]> git.sur5r.net Git - u-boot/commitdiff
arm: socfpga: spl: Add SDRAM check
authorDinh Nguyen <dinguyen@opensource.altera.com>
Mon, 30 Mar 2015 22:01:15 +0000 (17:01 -0500)
committerMarek Vasut <marex@denx.de>
Tue, 21 Apr 2015 10:23:17 +0000 (12:23 +0200)
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
arch/arm/cpu/armv7/socfpga/spl.c

index e7b4d299b9259f87680d26ec16b13ac1775da485..d7cedadfc6f3be19a303808c743fbcf4957de788 100644 (file)
@@ -191,4 +191,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();
+       }
 }