[coreboot-gerrit] New patch to review for coreboot: bab1cb0 rk3288: Move UART initialization to bootblock_mainboard_early_init()

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Mon Apr 13 15:22:50 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9604

-gerrit

commit bab1cb0accb1f54d7f954a193abad104be73c88f
Author: Julius Werner <jwerner at chromium.org>
Date:   Tue Nov 25 13:36:17 2014 -0800

    rk3288: Move UART initialization to bootblock_mainboard_early_init()
    
    This patch uses the new bootblock_mainboard_early_init() hook to run the
    UART pinmuxing on rk3288-based boards before initializing the console.
    This allows us to get rid of the hacky second console_init() call in
    bootblock_soc_init(). We can also simplify the pinmux selection a bit
    since we know that a given board always uses the same UART (still keep
    an assert around to be sure, though).
    
    BRANCH=None
    BUG=chrome-os-partner:32123
    TEST=Booted on Pinky.
    
    Change-Id: I3da8b0e4bd609f33cedd934ce51cb20b1190024b
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: caabda8fc1ddb4805d86fd9a0d5d2f3cf738bfaf
    Original-Change-Id: Ia56c0599a15f966d087ca39181bfe23abd262e72
    Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/231942
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
 src/mainboard/google/veyron_jerry/bootblock.c  | 10 ++++++++++
 src/mainboard/google/veyron_mighty/bootblock.c | 10 ++++++++++
 src/mainboard/google/veyron_pinky/bootblock.c  | 10 ++++++++++
 src/soc/rockchip/rk3288/bootblock.c            | 11 -----------
 4 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/src/mainboard/google/veyron_jerry/bootblock.c b/src/mainboard/google/veyron_jerry/bootblock.c
index 30b00e1..1e46ed0 100644
--- a/src/mainboard/google/veyron_jerry/bootblock.c
+++ b/src/mainboard/google/veyron_jerry/bootblock.c
@@ -19,6 +19,7 @@
  */
 
 #include <arch/io.h>
+#include <assert.h>
 #include <bootblock_common.h>
 #include <delay.h>
 #include <soc/clock.h>
@@ -31,6 +32,15 @@
 
 #include "board.h"
 
+void bootblock_mainboard_early_init()
+{
+	if (IS_ENABLED(CONFIG_CONSOLE_SERIAL_UART)) {
+		assert(CONFIG_CONSOLE_SERIAL_UART_ADDRESS == UART2_BASE);
+		writel(IOMUX_UART2, &rk3288_grf->iomux_uart2);
+	}
+
+}
+
 void bootblock_mainboard_init(void)
 {
 	/* Up VDD_CPU (BUCK1) to 1.4V to support max CPU frequency (1.8GHz). */
diff --git a/src/mainboard/google/veyron_mighty/bootblock.c b/src/mainboard/google/veyron_mighty/bootblock.c
index 30b00e1..1e46ed0 100644
--- a/src/mainboard/google/veyron_mighty/bootblock.c
+++ b/src/mainboard/google/veyron_mighty/bootblock.c
@@ -19,6 +19,7 @@
  */
 
 #include <arch/io.h>
+#include <assert.h>
 #include <bootblock_common.h>
 #include <delay.h>
 #include <soc/clock.h>
@@ -31,6 +32,15 @@
 
 #include "board.h"
 
+void bootblock_mainboard_early_init()
+{
+	if (IS_ENABLED(CONFIG_CONSOLE_SERIAL_UART)) {
+		assert(CONFIG_CONSOLE_SERIAL_UART_ADDRESS == UART2_BASE);
+		writel(IOMUX_UART2, &rk3288_grf->iomux_uart2);
+	}
+
+}
+
 void bootblock_mainboard_init(void)
 {
 	/* Up VDD_CPU (BUCK1) to 1.4V to support max CPU frequency (1.8GHz). */
diff --git a/src/mainboard/google/veyron_pinky/bootblock.c b/src/mainboard/google/veyron_pinky/bootblock.c
index 30b00e1..1e46ed0 100644
--- a/src/mainboard/google/veyron_pinky/bootblock.c
+++ b/src/mainboard/google/veyron_pinky/bootblock.c
@@ -19,6 +19,7 @@
  */
 
 #include <arch/io.h>
+#include <assert.h>
 #include <bootblock_common.h>
 #include <delay.h>
 #include <soc/clock.h>
@@ -31,6 +32,15 @@
 
 #include "board.h"
 
+void bootblock_mainboard_early_init()
+{
+	if (IS_ENABLED(CONFIG_CONSOLE_SERIAL_UART)) {
+		assert(CONFIG_CONSOLE_SERIAL_UART_ADDRESS == UART2_BASE);
+		writel(IOMUX_UART2, &rk3288_grf->iomux_uart2);
+	}
+
+}
+
 void bootblock_mainboard_init(void)
 {
 	/* Up VDD_CPU (BUCK1) to 1.4V to support max CPU frequency (1.8GHz). */
diff --git a/src/soc/rockchip/rk3288/bootblock.c b/src/soc/rockchip/rk3288/bootblock.c
index 84a17c2..4a5b0d2 100644
--- a/src/soc/rockchip/rk3288/bootblock.c
+++ b/src/soc/rockchip/rk3288/bootblock.c
@@ -31,17 +31,6 @@ static void bootblock_soc_init(void)
 {
 	rk3288_init_timer();
 
-	if (IS_ENABLED(CONFIG_DRIVERS_UART)) {
-		switch (CONFIG_CONSOLE_SERIAL_UART_ADDRESS) {
-		case UART2_BASE:
-			writel(IOMUX_UART2, &rk3288_grf->iomux_uart2);
-			break;
-		default:
-			die("TODO: Handle setup for console UART if needed");
-		}
-		console_init();
-	}
-
 	rkclk_init();
 
 	mmu_init();



More information about the coreboot-gerrit mailing list