[U-Boot] [PATCHv2 17/20] arm: socfpga: spl: Add SDRAM check

dinguyen at opensource.altera.com dinguyen at opensource.altera.com
Mon Mar 2 17:28:05 CET 2015


From: Dinh Nguyen <dinguyen at opensource.altera.com>

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

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index ea4a1fb..31ac789 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -191,4 +191,12 @@ void spl_board_init(void)
 
 	sdram_size = sdram_calculate_size();
 	debug("SDRAM: %ld MiB\n", (sdram_size >> 20));
+
+	/* Sanity check ensure correct SDRAM size specified */
+	puts("SDRAM: Ensuring specified SDRAM size is correct ...");
+	if (get_ram_size(0, sdram_size) != sdram_size) {
+		puts("failed\n");
+		hang();
+	}
+	puts("passed\n");
 }
-- 
2.2.1



More information about the U-Boot mailing list