Commit 252cdb46 authored by York Sun's avatar York Sun

armv8: mmu: house cleaning

Make setup_pgtages() and get_tcr() available for platform code to
customize MMU tables.
Remove unintentional call of create_table().
Signed-off-by: default avatarYork Sun <>
parent 50e93b95
......@@ -35,7 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;
* off: FFF
static u64 get_tcr(int el, u64 *pips, u64 *pva_bits)
u64 get_tcr(int el, u64 *pips, u64 *pva_bits)
u64 max_addr = 0;
u64 ips, va_bits;
......@@ -349,10 +349,13 @@ __weak u64 get_page_table_size(void)
return size;
static void setup_pgtables(void)
void setup_pgtables(void)
int i;
if (!gd->arch.tlb_fillptr || !gd->arch.tlb_addr)
panic("Page table pointer not setup.");
* Allocate the first level we're on with invalidate entries.
* If the starting level is 0 (va_bits >= 39), then this is our
......@@ -363,9 +366,6 @@ static void setup_pgtables(void)
/* Now add all MMU table entries one after another to the table */
for (i = 0; mem_map[i].size || mem_map[i].attrs; i++)
/* Create the same thing once more for our emergency page table */
static void setup_all_pgtables(void)
......@@ -527,6 +527,9 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
debug("start=%lx size=%lx\n", (ulong)start, (ulong)size);
if (!gd->arch.tlb_emerg)
panic("Emergency page table not setup.");
* We can not modify page tables that we're currently running on,
* so we first need to switch to the "emergency" page tables where
......@@ -141,6 +141,8 @@ struct mm_region {
extern struct mm_region *mem_map;
void setup_pgtables(void);
u64 get_tcr(int el, u64 *pips, u64 *pva_bits);
#endif /* _ASM_ARMV8_MMU_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment