]> git.sur5r.net Git - u-boot/commitdiff
sunxi: SPL: store RAM size in gd
authorAndre Przywara <andre.przywara@arm.com>
Wed, 26 Apr 2017 00:32:43 +0000 (01:32 +0100)
committerJagan Teki <jagan@openedev.com>
Wed, 17 May 2017 17:51:21 +0000 (23:21 +0530)
The sunxi SPL was holding the detected RAM size in some local variable
only, so it wasn't accessible for other functions.
Store the value in gd->ram_size instead, so it can be used later on.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
board/sunxi/board.c

index 4404edb59e0e1423ad0947ce95cab9d3b7d47b16..4248b47cc7fdbf887ad26458d8bcac6fe6fdb115 100644 (file)
@@ -512,7 +512,6 @@ int board_mmc_init(bd_t *bis)
 void sunxi_board_init(void)
 {
        int power_failed = 0;
-       unsigned long ramsize;
 
 #ifdef CONFIG_SY8106A_POWER
        power_failed = sy8106a_set_vout1(CONFIG_SY8106A_VOUT1_VOLT);
@@ -573,9 +572,9 @@ void sunxi_board_init(void)
 #endif
 #endif
        printf("DRAM:");
-       ramsize = sunxi_dram_init();
-       printf(" %d MiB\n", (int)(ramsize >> 20));
-       if (!ramsize)
+       gd->ram_size = sunxi_dram_init();
+       printf(" %d MiB\n", (int)(gd->ram_size >> 20));
+       if (!gd->ram_size)
                hang();
 
        /*