]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: socfpga: spl: add sdram init and calibration
authorDinh Nguyen <dinguyen@opensource.altera.com>
Mon, 30 Mar 2015 22:01:08 +0000 (17:01 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:29:20 +0000 (22:29 +0200)
Add a call to checkboard along with sdram intilialization and calibration.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
arch/arm/cpu/armv7/socfpga/spl.c

index 787ad7fb0d964eb886ea5d42cd03dd1ccc31096c..756c55af91e62c47fe040a2a8b2edb1f7a9e4991 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/arch/freeze_controller.h>
 #include <asm/arch/clock_manager.h>
 #include <asm/arch/scan_manager.h>
+#include <asm/arch/sdram.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -174,4 +175,16 @@ void spl_board_init(void)
 
        /* enable console uart printing */
        preloader_console_init();
+
+       if (sdram_mmr_init_full(0xffffffff) != 0) {
+               puts("SDRAM init failed.\n");
+               hang();
+       }
+
+       debug("SDRAM: Calibrating PHY\n");
+       /* SDRAM calibration */
+       if (sdram_calibration_full() == 0) {
+               puts("SDRAM calibration failed.\n");
+               hang();
+       }
 }