summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-stm32mp/stm32mp2/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/stm32mp2/cpu.c b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
index a8a6bcf8ab4..178c6356b2b 100644
--- a/arch/arm/mach-stm32mp/stm32mp2/cpu.c
+++ b/arch/arm/mach-stm32mp/stm32mp2/cpu.c
@@ -15,6 +15,7 @@
#include <asm/io.h>
#include <asm/arch/stm32.h>
#include <asm/arch/sys_proto.h>
+#include <asm/armv8/mmu.h>
#include <asm/system.h>
#include <dm/device.h>
#include <dm/lists.h>
@@ -70,8 +71,21 @@ int mach_cpu_init(void)
void enable_caches(void)
{
+ struct mm_region *mem = mem_map;
+
/* deactivate the data cache, early enabled in arch_cpu_init() */
dcache_disable();
+
+ /* Parse mem_map and find DDR entry */
+ while (mem->size) {
+ if (mem->phys == CONFIG_TEXT_BASE) {
+ /* update DDR entry with real DDR size */
+ mem->size = gd->ram_size;
+ break;
+ }
+ mem++;
+ }
+
/*
* Force the call of setup_all_pgtables() in mmu_setup() by clearing tlb_fillptr
* to update the TLB location udpated in board_f.c::reserve_mmu