summaryrefslogtreecommitdiff
path: root/arch/arm/mach-rockchip/rk3368/rk3368.c
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2019-03-29 04:09:05 +0300
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2019-05-01 10:40:58 +0300
commit6a033357148b67da9e2e5d0a0a06d5ec1ed8e0d3 (patch)
treea6956699e48f6e996275f9014fc0196f6f7e1db3 /arch/arm/mach-rockchip/rk3368/rk3368.c
parente83e885e53dd43df64ba54d59c18f98f1d98ef4e (diff)
downloadu-boot-6a033357148b67da9e2e5d0a0a06d5ec1ed8e0d3.tar.xz
rockchip: rk3368: move board_debug_uart_init() to rk3368.c
Move the function to soc file so that we can find all the soc/board setting in soc file and use a common board file later for all rockchip SoCs. 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/rk3368/rk3368.c')
-rw-r--r--arch/arm/mach-rockchip/rk3368/rk3368.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rk3368/rk3368.c b/arch/arm/mach-rockchip/rk3368/rk3368.c
index 197f0c485a..1ed06c5352 100644
--- a/arch/arm/mach-rockchip/rk3368/rk3368.c
+++ b/arch/arm/mach-rockchip/rk3368/rk3368.c
@@ -96,3 +96,34 @@ int arch_early_init_r(void)
return mcu_init();
}
#endif
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+ /*
+ * N.B.: This is called before the device-model has been
+ * initialised. For this reason, we can not access
+ * the GRF address range using the syscon API.
+ */
+#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
+ struct rk3368_grf * const grf =
+ (struct rk3368_grf * const)0xff770000;
+
+ enum {
+ GPIO2D1_MASK = GENMASK(3, 2),
+ GPIO2D1_GPIO = 0,
+ GPIO2D1_UART0_SOUT = (1 << 2),
+
+ GPIO2D0_MASK = GENMASK(1, 0),
+ GPIO2D0_GPIO = 0,
+ GPIO2D0_UART0_SIN = (1 << 0),
+ };
+
+ /* Enable early UART0 on the RK3368 */
+ rk_clrsetreg(&grf->gpio2d_iomux,
+ GPIO2D0_MASK, GPIO2D0_UART0_SIN);
+ rk_clrsetreg(&grf->gpio2d_iomux,
+ GPIO2D1_MASK, GPIO2D1_UART0_SOUT);
+#endif
+}
+#endif