[U-Boot] [PATCH 1/8] sunxi: board: Print error after power initialization fails

Olliver Schinagl oliver at schinagl.nl
Wed Mar 1 12:52:17 UTC 2017


Currently during init, we enable all power, then enable the dram and
after that check if there was an error during power-up.

This makes little sense, we should enable power and then check if power
was brought up properly initializing other things.

This patch moves the DRAM init after the power failure check.

Signed-off-by: Olliver Schinagl <oliver at schinagl.nl>
---
 board/sunxi/board.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 53656383d5..5467015860 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -540,11 +540,6 @@ void sunxi_board_init(void)
 	power_failed |= axp_set_sw(IS_ENABLED(CONFIG_AXP_SW_ON));
 #endif
 #endif
-	printf("DRAM:");
-	ramsize = sunxi_dram_init();
-	printf(" %d MiB\n", (int)(ramsize >> 20));
-	if (!ramsize)
-		hang();
 
 	/*
 	 * Only clock up the CPU to full speed if we are reasonably
@@ -553,7 +548,14 @@ void sunxi_board_init(void)
 	if (!power_failed)
 		clock_set_pll1(CONFIG_SYS_CLK_FREQ);
 	else
-		printf("Failed to set core voltage! Can't set CPU frequency\n");
+		printf("Error setting up the power controller.\n \
+			CPU frequency not set.\n");
+
+	printf("DRAM:");
+	ramsize = sunxi_dram_init();
+	printf(" %d MiB\n", (int)(ramsize >> 20));
+	if (!ramsize)
+		hang();
 }
 #endif
 
-- 
2.11.0



More information about the U-Boot mailing list