All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Revert "sunxi: board: Print error after power initialization fails"
@ 2018-12-19 13:00 Andre Przywara
  2018-12-29 18:53 ` [U-Boot] [linux-sunxi] " Jagan Teki
  0 siblings, 1 reply; 13+ messages in thread
From: Andre Przywara @ 2018-12-19 13:00 UTC (permalink / raw)
  To: u-boot

From: "From: Karl Palsson" <karlp@tweak.net.au>

Commit a8011eb84dfa("sunxi: board: Print error after power initialization
fails") moved the DRAM init after the increase of the CPU clock
frequency. This lead to various DRAM initialisation failures on some
boards (hangs or wrong size reported, on a NanoPi Duo2 and OrangePi
Zero, for instance). Lowering the CPU frequency significantly (for instance
to 408 MHz) seems to work around the problem, so this points to some timing
issues in the DRAM code.

Debugging this sounds like a larger job, so let's just revert this patch
to bring back those boards.
Beside this probably unintended change the patch just moved the error
message around, so reverting this is not a real loss.

This reverts commit a8011eb84dfac5187cebf00ed8bc981bdb5c1fa1.

Tested-By: Priit Laes <plaes@plaes.org>
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 board/sunxi/board.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 917f5b18f6..f022f365e9 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -637,6 +637,13 @@ void sunxi_board_init(void)
 	power_failed |= axp_set_sw(IS_ENABLED(CONFIG_AXP_SW_ON));
 #endif
 #endif
+	printf("DRAM:");
+	gd->ram_size = sunxi_dram_init();
+	printf(" %d MiB\n", (int)(gd->ram_size >> 20));
+	if (!gd->ram_size)
+		hang();
+
+	sunxi_spl_store_dram_size(gd->ram_size);
 
 	/*
 	 * Only clock up the CPU to full speed if we are reasonably
@@ -645,16 +652,7 @@ void sunxi_board_init(void)
 	if (!power_failed)
 		clock_set_pll1(CONFIG_SYS_CLK_FREQ);
 	else
-		printf("Error setting up the power controller.\n"
-		       "CPU frequency not set.\n");
-
-	printf("DRAM:");
-	gd->ram_size = sunxi_dram_init();
-	printf(" %d MiB\n", (int)(gd->ram_size >> 20));
-	if (!gd->ram_size)
-		hang();
-
-	sunxi_spl_store_dram_size(gd->ram_size);
+		printf("Failed to set core voltage! Can't set CPU frequency\n");
 }
 #endif
 
-- 
2.14.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [U-Boot] [PATCH] Revert "sunxi: board: Print error after power initialization fails"
@ 2018-12-18 11:11 karlp at tweak.net.au
  2018-12-18 11:20 ` Priit Laes
  0 siblings, 1 reply; 13+ messages in thread
From: karlp at tweak.net.au @ 2018-12-18 11:11 UTC (permalink / raw)
  To: u-boot

From: Karl Palsson <karlp@tweak.net.au>

This reverts commit a8011eb84dfac5187cebf00ed8bc981bdb5c1fa1

This causes DRAM init failures on (at least)
* allwinner h3 nanopi-duo2
* allwinner h2+ orangepi zero v1.1

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
---

Ideally, this should get into 2019.01, so that this release is not
broken on those targets.

 board/sunxi/board.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 917f5b18f6..f022f365e9 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -637,6 +637,13 @@ void sunxi_board_init(void)
 	power_failed |= axp_set_sw(IS_ENABLED(CONFIG_AXP_SW_ON));
 #endif
 #endif
+	printf("DRAM:");
+	gd->ram_size = sunxi_dram_init();
+	printf(" %d MiB\n", (int)(gd->ram_size >> 20));
+	if (!gd->ram_size)
+		hang();
+
+	sunxi_spl_store_dram_size(gd->ram_size);
 
 	/*
 	 * Only clock up the CPU to full speed if we are reasonably
@@ -645,16 +652,7 @@ void sunxi_board_init(void)
 	if (!power_failed)
 		clock_set_pll1(CONFIG_SYS_CLK_FREQ);
 	else
-		printf("Error setting up the power controller.\n"
-		       "CPU frequency not set.\n");
-
-	printf("DRAM:");
-	gd->ram_size = sunxi_dram_init();
-	printf(" %d MiB\n", (int)(gd->ram_size >> 20));
-	if (!gd->ram_size)
-		hang();
-
-	sunxi_spl_store_dram_size(gd->ram_size);
+		printf("Failed to set core voltage! Can't set CPU frequency\n");
 }
 #endif
 
-- 
2.14.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [U-Boot] [PATCH] Revert "sunxi: board: Print error after power initialization fails"
@ 2018-12-18 10:38 karlp at tweak.net.au
  0 siblings, 0 replies; 13+ messages in thread
From: karlp at tweak.net.au @ 2018-12-18 10:38 UTC (permalink / raw)
  To: u-boot

From: Karl Palsson <karlp@tweak.net.au>

This reverts commit a8011eb84dfac5187cebf00ed8bc981bdb5c1fa1

This causes DRAM init failures on (at least)
* allwinner h3 nanopi-duo2
* allwinner h2+ orangepi zero v1.1

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
---

Ideally, this should get into 2019.01, so that this release is not
broken on those targets.

 board/sunxi/board.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 917f5b18f6..f022f365e9 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -637,6 +637,13 @@ void sunxi_board_init(void)
 	power_failed |= axp_set_sw(IS_ENABLED(CONFIG_AXP_SW_ON));
 #endif
 #endif
+	printf("DRAM:");
+	gd->ram_size = sunxi_dram_init();
+	printf(" %d MiB\n", (int)(gd->ram_size >> 20));
+	if (!gd->ram_size)
+		hang();
+
+	sunxi_spl_store_dram_size(gd->ram_size);
 
 	/*
 	 * Only clock up the CPU to full speed if we are reasonably
@@ -645,16 +652,7 @@ void sunxi_board_init(void)
 	if (!power_failed)
 		clock_set_pll1(CONFIG_SYS_CLK_FREQ);
 	else
-		printf("Error setting up the power controller.\n"
-		       "CPU frequency not set.\n");
-
-	printf("DRAM:");
-	gd->ram_size = sunxi_dram_init();
-	printf(" %d MiB\n", (int)(gd->ram_size >> 20));
-	if (!gd->ram_size)
-		hang();
-
-	sunxi_spl_store_dram_size(gd->ram_size);
+		printf("Failed to set core voltage! Can't set CPU frequency\n");
 }
 #endif
 
-- 
2.14.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-12-31 19:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 13:00 [U-Boot] [PATCH] Revert "sunxi: board: Print error after power initialization fails" Andre Przywara
2018-12-29 18:53 ` [U-Boot] [linux-sunxi] " Jagan Teki
2018-12-29 22:10   ` Olliver Schinagl
2018-12-30  4:28     ` Priit Laes
2018-12-30 23:23     ` André Przywara
2018-12-31 10:34       ` Olliver Schinagl
2018-12-31 11:27         ` Michael Trimarchi
2018-12-31 13:10           ` André Przywara
2018-12-31 13:38             ` Michael Trimarchi
2018-12-31 19:31             ` Olliver Schinagl
  -- strict thread matches above, loose matches on Subject: below --
2018-12-18 11:11 [U-Boot] " karlp at tweak.net.au
2018-12-18 11:20 ` Priit Laes
2018-12-18 10:38 karlp at tweak.net.au

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.