mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
rockchip: rk3188: add board_debug_uart_init()
Use board_debug_uart_init() for UART iomux init instead of do it in board_init_f, and 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. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
This commit is contained in:
parent
7f3eec03d5
commit
86d0eca451
@ -93,38 +93,12 @@ static int setup_arm_clock(void)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void board_debug_uart_init(void)
|
|
||||||
{
|
|
||||||
/* 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_GPIO = 0,
|
|
||||||
GPIO1B1_UART2_SOUT,
|
|
||||||
|
|
||||||
GPIO1B0_SHIFT = 0,
|
|
||||||
GPIO1B0_MASK = 3,
|
|
||||||
GPIO1B0_GPIO = 0,
|
|
||||||
GPIO1B0_UART2_SIN,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Enable early UART on the RK3188 */
|
|
||||||
rk_clrsetreg(&grf->gpio1b_iomux,
|
|
||||||
GPIO1B1_MASK << GPIO1B1_SHIFT |
|
|
||||||
GPIO1B0_MASK << GPIO1B0_SHIFT,
|
|
||||||
GPIO1B1_UART2_SOUT << GPIO1B1_SHIFT |
|
|
||||||
GPIO1B0_UART2_SIN << GPIO1B0_SHIFT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void board_init_f(ulong dummy)
|
void board_init_f(ulong dummy)
|
||||||
{
|
{
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#define EARLY_UART
|
#ifdef CONFIG_DEBUG_UART
|
||||||
#ifdef EARLY_UART
|
|
||||||
/*
|
/*
|
||||||
* Debug UART can be used from here if required:
|
* Debug UART can be used from here if required:
|
||||||
*
|
*
|
||||||
|
@ -6,5 +6,6 @@
|
|||||||
|
|
||||||
ifndef CONFIG_TPL_BUILD
|
ifndef CONFIG_TPL_BUILD
|
||||||
obj-y += clk_rk3188.o
|
obj-y += clk_rk3188.o
|
||||||
|
obj-y += rk3188.o
|
||||||
obj-y += syscon_rk3188.o
|
obj-y += syscon_rk3188.o
|
||||||
endif
|
endif
|
||||||
|
36
arch/arm/mach-rockchip/rk3188/rk3188.c
Normal file
36
arch/arm/mach-rockchip/rk3188/rk3188.c
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
|
/*
|
||||||
|
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
|
||||||
|
*/
|
||||||
|
#include <common.h>
|
||||||
|
#include <asm/io.h>
|
||||||
|
#include <asm/arch-rockchip/grf_rk3188.h>
|
||||||
|
#include <asm/arch-rockchip/hardware.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
||||||
|
void board_debug_uart_init(void)
|
||||||
|
{
|
||||||
|
/* 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_GPIO = 0,
|
||||||
|
GPIO1B1_UART2_SOUT,
|
||||||
|
GPIO1B1_JTAG_TDO,
|
||||||
|
|
||||||
|
GPIO1B0_SHIFT = 0,
|
||||||
|
GPIO1B0_MASK = 3,
|
||||||
|
GPIO1B0_GPIO = 0,
|
||||||
|
GPIO1B0_UART2_SIN,
|
||||||
|
GPIO1B0_JTAG_TDI,
|
||||||
|
};
|
||||||
|
|
||||||
|
rk_clrsetreg(&grf->gpio1b_iomux,
|
||||||
|
GPIO1B1_MASK << GPIO1B1_SHIFT |
|
||||||
|
GPIO1B0_MASK << GPIO1B0_SHIFT,
|
||||||
|
GPIO1B1_UART2_SOUT << GPIO1B1_SHIFT |
|
||||||
|
GPIO1B0_UART2_SIN << GPIO1B0_SHIFT);
|
||||||
|
}
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user