mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-11 22:03:15 +00:00
e83e885e53
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 for all rockchip SoCs later. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
33 lines
801 B
C
33 lines
801 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (c) 2016 Rockchip Electronics Co., Ltd
|
|
*/
|
|
#include <asm/io.h>
|
|
#include <asm/arch-rockchip/hardware.h>
|
|
#include <asm/arch-rockchip/grf_rk3288.h>
|
|
|
|
#define GRF_BASE 0xff770000
|
|
|
|
int arch_cpu_init(void)
|
|
{
|
|
/* We do some SoC one time setting here. */
|
|
struct rk3288_grf * const grf = (void *)GRF_BASE;
|
|
|
|
/* Use rkpwm by default */
|
|
rk_setreg(&grf->soc_con2, 1 << 0);
|
|
|
|
return 0;
|
|
}
|
|
|
|
#ifdef CONFIG_DEBUG_UART_BOARD_INIT
|
|
void board_debug_uart_init(void)
|
|
{
|
|
/* Enable early UART on the RK3288 */
|
|
struct rk3288_grf * const grf = (void *)GRF_BASE;
|
|
|
|
rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
|
|
GPIO7C6_MASK << GPIO7C6_SHIFT,
|
|
GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
|
|
GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
|
|
}
|
|
#endif
|