diff mbox series

[U-Boot,03/10] microblaze: Fix lmb memory initialization

Message ID 60a0ae5fcc973e6285414bc38be0d331dbdc151f.1569411718.git.michal.simek@xilinx.com
State Accepted
Commit a750ded4667496b367bc1275246752a3092b2ca2
Delegated to: Michal Simek
Headers show
Series microblaze: External initrd support | expand

Commit Message

Michal Simek Sept. 25, 2019, 11:41 a.m. UTC
Microblaze as Arm is using multiple memory banks which are read from DT
that's why there is a need to initialized LMB based on bd->bi_dram[].
Without this fix memory base/size is all the time 0 and image relocation is
not possible.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 common/image.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/common/image.c b/common/image.c
index 179eef0bd2dc..fc0ebe338bd8 100644
--- a/common/image.c
+++ b/common/image.c
@@ -582,7 +582,7 @@  ulong env_get_bootm_low(void)
 
 #if defined(CONFIG_SYS_SDRAM_BASE)
 	return CONFIG_SYS_SDRAM_BASE;
-#elif defined(CONFIG_ARM)
+#elif defined(CONFIG_ARM) || defined(CONFIG_MICROBLAZE)
 	return gd->bd->bi_dram[0].start;
 #else
 	return 0;
@@ -599,7 +599,8 @@  phys_size_t env_get_bootm_size(void)
 		return tmp;
 	}
 
-#if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS)
+#if (defined(CONFIG_ARM) || defined(CONFIG_MICROBLAZE)) && \
+     defined(CONFIG_NR_DRAM_BANKS)
 	start = gd->bd->bi_dram[0].start;
 	size = gd->bd->bi_dram[0].size;
 #else