[U-Boot] [PATCHv3 14/17] arm: socfpga: spl: Add SDRAM check

dinguyen at opensource.altera.com dinguyen at opensource.altera.com
Tue Mar 31 00:01:15 CEST 2015


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

Signed-off-by: Dinh Nguyen <dinguyen at opensource.altera.com>
---
v3: Only report the failure
v2: Be a bit more verbose about the fail message
---
 arch/arm/cpu/armv7/socfpga/spl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index f2d3f79..dd4d882 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -221,4 +221,10 @@ 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 */
+	if (get_ram_size(0, sdram_size) != sdram_size) {
+		puts("SDRAM size check failed!\n");
+		hang();
+	}
 }
-- 
2.2.1



More information about the U-Boot mailing list