summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-rockchip
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2018-11-29 10:07:38 +0800
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2018-11-30 22:00:11 +0100
commit17e5f3a4265cf372c4e09d7d3fd09fa54ef413cb (patch)
tree294863fdd8d6ab7354476e2c8debcde7625dea9b /arch/arm/mach-rockchip
parentaf765a49baac1191da1cf272a19d650d313c3314 (diff)
downloadu-boot-17e5f3a4265cf372c4e09d7d3fd09fa54ef413cb.tar.gz
u-boot-17e5f3a4265cf372c4e09d7d3fd09fa54ef413cb.tar.xz
u-boot-17e5f3a4265cf372c4e09d7d3fd09fa54ef413cb.zip
rockchip: rk3188: use board_debug_uart_init() for UART io init
Sync with other rockchip SoCs, use board_debug_uart_init() to init default UART iomux. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'arch/arm/mach-rockchip')
-rw-r--r--arch/arm/mach-rockchip/Kconfig1
-rw-r--r--arch/arm/mach-rockchip/rk3188-board-spl.c28
2 files changed, 18 insertions, 11 deletions
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 0e15f7b859..6dc8e3a017 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -35,6 +35,7 @@ config ROCKCHIP_RK3188
select SPL_RAM
select SPL_DRIVERS_MISC_SUPPORT
select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
+ select DEBUG_UART_BOARD_INIT
select BOARD_LATE_INIT
select ROCKCHIP_BROM_HELPER
help
diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c
index 1877855db8..3c6c3d3c09 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -93,24 +93,21 @@ static int setup_arm_clock(void)
return ret;
}
-#define GRF_BASE 0x20008000
-
-void board_init_f(ulong dummy)
+void board_debug_uart_init(void)
{
- __maybe_unused struct rk3188_grf * const grf = (void *)GRF_BASE;
- struct udevice *pinctrl, *dev;
- int ret;
-
- /* Example code showing how to enable the debug UART on RK3188 */
-#ifdef EARLY_UART
+ /* Enable early UART on the RK3188 */
+#define GRF_BASE 0x20008000
+ struct rk3188_grf * const grf = (void *)GRF_BASE;
enum {
GPIO1B1_SHIFT = 2,
GPIO1B1_MASK = 3,
- GPIO1B1_UART2_SOUT = 1,
+ GPIO1B1_GPIO = 0,
+ GPIO1B1_UART2_SOUT,
GPIO1B0_SHIFT = 0,
GPIO1B0_MASK = 3,
- GPIO1B0_UART2_SIN = 1,
+ GPIO1B0_GPIO = 0,
+ GPIO1B0_UART2_SIN,
};
/* Enable early UART on the RK3188 */
@@ -119,6 +116,15 @@ void board_init_f(ulong dummy)
GPIO1B0_MASK << GPIO1B0_SHIFT,
GPIO1B1_UART2_SOUT << GPIO1B1_SHIFT |
GPIO1B0_UART2_SIN << GPIO1B0_SHIFT);
+}
+
+void board_init_f(ulong dummy)
+{
+ struct udevice *pinctrl, *dev;
+ int ret;
+
+#define EARLY_UART
+#ifdef EARLY_UART
/*
* Debug UART can be used from here if required:
*