summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/system.h
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-03-04 03:09:47 +0300
committerTom Rini <trini@konsulko.com>2016-03-15 22:13:01 +0300
commit5e2ec773bb6c5acf22d8652112856e87cff86ea4 (patch)
treeae75a1cab47d1d59c91ccc5a5d2579c64dab47a1 /arch/arm/include/asm/system.h
parent9bb367a590feac21d674e4d2cee77702d4774819 (diff)
downloadu-boot-5e2ec773bb6c5acf22d8652112856e87cff86ea4.tar.xz
arm64: Make full va map code more dynamic
The idea to generate our pages tables from an array of memory ranges is very sound. However, instead of hard coding the code to create up to 2 levels of 64k granule page tables, we really should just create normal 4k page tables that allow us to set caching attributes on 2M or 4k level later on. So this patch moves the full_va mapping code to 4k page size and makes it fully flexible to dynamically create as many levels as necessary for a map (including dynamic 1G/2M pages). It also adds support to dynamically split a large map into smaller ones when some code wants to set dcache attributes. With all this in place, there is very little reason to create your own page tables in board specific files. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/arm/include/asm/system.h')
-rw-r--r--arch/arm/include/asm/system.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 026e7ef83b..9b1cbf2c43 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -17,18 +17,19 @@
#define CR_WXN (1 << 19) /* Write Permision Imply XN */
#define CR_EE (1 << 25) /* Exception (Big) Endian */
-#ifndef CONFIG_SYS_FULL_VA
-#define PGTABLE_SIZE (0x10000)
-#else
-#define PGTABLE_SIZE CONFIG_SYS_PGTABLE_SIZE
-#endif
-
/* 2MB granularity */
#define MMU_SECTION_SHIFT 21
#define MMU_SECTION_SIZE (1 << MMU_SECTION_SHIFT)
#ifndef __ASSEMBLY__
+#ifndef CONFIG_SYS_FULL_VA
+#define PGTABLE_SIZE (0x10000)
+#else
+u64 get_page_table_size(void);
+#define PGTABLE_SIZE get_page_table_size()
+#endif
+
enum dcache_option {
DCACHE_OFF = 0x3,
};
@@ -97,6 +98,7 @@ void __asm_flush_dcache_range(u64 start, u64 end);
void __asm_invalidate_tlb_all(void);
void __asm_invalidate_icache_all(void);
int __asm_flush_l3_cache(void);
+void __asm_switch_ttbr(u64 new_ttbr);
void armv8_switch_to_el2(void);
void armv8_switch_to_el1(void);