From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Date: Wed, 26 Apr 2017 01:32:43 +0100 Subject: [U-Boot] [PATCH v4 11/20] sunxi: SPL: store RAM size in gd In-Reply-To: <1493166772-24598-1-git-send-email-andre.przywara@arm.com> References: <1493166772-24598-1-git-send-email-andre.przywara@arm.com> Message-ID: <1493166772-24598-12-git-send-email-andre.przywara@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Reviewed-by: Simon Glass Acked-by: Maxime Ripard --- board/sunxi/board.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 04a6291..c6fcb4c 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -504,7 +504,6 @@ void i2c_init_board(void) 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); @@ -565,9 +564,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(); /* -- 2.8.2