aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>2024-04-05 17:37:15 +0900
committerTom Rini <trini@konsulko.com>2024-04-12 08:53:31 -0600
commit4341fb73326907faecfc9e3b711bbfcd3937b525 (patch)
tree52fdcdbbf87dfa777fa87e8ac9e27577003f5d0a
parent51b2f4f085593d36a82c1a2b5916751584490544 (diff)
downloadu-boot-WIP/2024-04-12-assorted-updates.zip
u-boot-WIP/2024-04-12-assorted-updates.tar.gz
u-boot-WIP/2024-04-12-assorted-updates.tar.bz2
ARM: uniphier: Move uniphier_mem_map_init() call into dram_init()WIP/2024-04-12-assorted-updates
The function uniphier_mem_map_init() is to change global variable 'mem_map', which is referenced to get_page_table_size() to calculate the size of page table. However, uniphier_mem_map_init() is called after get_page_table_size(), so the size of page table and 'mem_map' become inconsist each other. After all, U-Boot fails to boot on chip with memory map different from default map, uniphier_mem_map_init() should be moved to dram_init(), which is called before get_page_table_size(). Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
-rw-r--r--arch/arm/mach-uniphier/dram_init.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c
index 7f27531..e6f1286 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -265,14 +265,15 @@ int dram_init(void)
if (uniphier_get_soc_id() == UNIPHIER_LD20_ID)
gd->ram_size -= 64;
+ /* map all the DRAM regions */
+ uniphier_mem_map_init(gd->ram_base, prev_top - gd->ram_base);
+
return 0;
}
int dram_init_banksize(void)
{
struct uniphier_dram_map dram_map[3] = {};
- unsigned long base, top;
- bool valid_bank_found = false;
int ret, i;
ret = uniphier_dram_map_get(dram_map);
@@ -287,18 +288,7 @@ int dram_init_banksize(void)
if (!dram_map[i].size)
continue;
-
- if (!valid_bank_found)
- base = dram_map[i].base;
- top = dram_map[i].base + dram_map[i].size;
- valid_bank_found = true;
}
- if (!valid_bank_found)
- return -EINVAL;
-
- /* map all the DRAM regions */
- uniphier_mem_map_init(base, top - base);
-
return 0;
}