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: Ia56c0599a15f966d087ca39181bfe23abd262e72 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/231942 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
f58e84a2fc
commit
caabda8fc1
4 changed files with 30 additions and 11 deletions
|
|
@ -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). */
|
||||
|
|
|
|||
|
|
@ -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). */
|
||||
|
|
|
|||
|
|
@ -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). */
|
||||
|
|
|
|||
|
|
@ -34,17 +34,6 @@ void bootblock_soc_init(void)
|
|||
|
||||
timestamp_early_init(timestamp_get());
|
||||
|
||||
if (IS_ENABLED(CONFIG_CONSOLE_SERIAL_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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue