From: Dinh Nguyen <dingu...@opensource.altera.com>

Remap SDRAM to 0x0 in board_init_f().

Signed-off-by: Dinh Nguyen <dingu...@opensource.altera.com>
---
 arch/arm/cpu/armv7/socfpga/spl.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index 31ac789..21023c2 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/pl310.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <version.h>
@@ -20,6 +21,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static struct pl310_regs *const pl310 =
+       (struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
 #define MAIN_VCO_BASE (                                        \
        (CONFIG_HPS_MAINPLLGRP_VCO_DENOM <<             \
                CLKMGR_MAINPLLGRP_VCO_DENOM_OFFSET) |   \
@@ -45,6 +49,16 @@ DECLARE_GLOBAL_DATA_PTR;
                CLKMGR_SDRPLLGRP_VCO_NUMER_OFFSET)      \
        )
 
+void board_init_f(ulong dummy)
+{
+       memset(__bss_start, 0, __bss_end - __bss_start);
+       gd = &gdata;
+
+       writel(0x1, &pl310->pl310_addr_filter_start);
+
+       board_init_r(NULL, 0);
+}
+
 u32 spl_boot_device(void)
 {
        return BOOT_DEVICE_RAM;
-- 
2.2.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to