mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
rockchip: rk3188: Move SoC one time setting into arch_cpu_init()
The setting for noc remap should goto arch_cpu_init(). Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
parent
cca3b09147
commit
c14fe2a8e1
2 changed files with 18 additions and 17 deletions
|
@ -7,13 +7,9 @@
|
||||||
#include <clk.h>
|
#include <clk.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <ram.h>
|
#include <ram.h>
|
||||||
#include <syscon.h>
|
|
||||||
#include <asm/gpio.h>
|
#include <asm/gpio.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/arch-rockchip/clock.h>
|
|
||||||
#include <asm/arch-rockchip/grf_rk3188.h>
|
|
||||||
#include <asm/arch-rockchip/periph.h>
|
#include <asm/arch-rockchip/periph.h>
|
||||||
#include <asm/arch-rockchip/pmu_rk3288.h>
|
|
||||||
#include <asm/arch-rockchip/boot_mode.h>
|
#include <asm/arch-rockchip/boot_mode.h>
|
||||||
|
|
||||||
__weak int rk_board_late_init(void)
|
__weak int rk_board_late_init(void)
|
||||||
|
@ -23,18 +19,7 @@ __weak int rk_board_late_init(void)
|
||||||
|
|
||||||
int board_late_init(void)
|
int board_late_init(void)
|
||||||
{
|
{
|
||||||
struct rk3188_grf *grf;
|
|
||||||
|
|
||||||
setup_boot_mode();
|
setup_boot_mode();
|
||||||
grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
|
|
||||||
if (IS_ERR(grf)) {
|
|
||||||
pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
|
|
||||||
} else {
|
|
||||||
/* enable noc remap to mimic legacy loaders */
|
|
||||||
rk_clrsetreg(&grf->soc_con0,
|
|
||||||
NOC_REMAP_MASK << NOC_REMAP_SHIFT,
|
|
||||||
NOC_REMAP_MASK << NOC_REMAP_SHIFT);
|
|
||||||
}
|
|
||||||
|
|
||||||
return rk_board_late_init();
|
return rk_board_late_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
|
* (C) Copyright 2019 Rockchip Electronics Co., Ltd
|
||||||
*/
|
*/
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <dm.h>
|
||||||
|
#include <syscon.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/arch-rockchip/bootrom.h>
|
#include <asm/arch-rockchip/bootrom.h>
|
||||||
|
#include <asm/arch-rockchip/clock.h>
|
||||||
#include <asm/arch-rockchip/grf_rk3188.h>
|
#include <asm/arch-rockchip/grf_rk3188.h>
|
||||||
#include <asm/arch-rockchip/hardware.h>
|
#include <asm/arch-rockchip/hardware.h>
|
||||||
|
|
||||||
|
@ -42,11 +45,17 @@ void board_debug_uart_init(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_SPL_BUILD
|
||||||
int arch_cpu_init(void)
|
int arch_cpu_init(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ROCKCHIP_USB_UART
|
struct rk3188_grf *grf;
|
||||||
struct rk3188_grf * const grf = (void *)GRF_BASE;
|
|
||||||
|
|
||||||
|
grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
|
||||||
|
if (IS_ERR(grf)) {
|
||||||
|
pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#ifdef CONFIG_ROCKCHIP_USB_UART
|
||||||
rk_clrsetreg(&grf->uoc0_con[0],
|
rk_clrsetreg(&grf->uoc0_con[0],
|
||||||
SIDDQ_MASK | UOC_DISABLE_MASK | COMMON_ON_N_MASK,
|
SIDDQ_MASK | UOC_DISABLE_MASK | COMMON_ON_N_MASK,
|
||||||
1 << SIDDQ_SHIFT | 1 << UOC_DISABLE_SHIFT |
|
1 << SIDDQ_SHIFT | 1 << UOC_DISABLE_SHIFT |
|
||||||
|
@ -64,8 +73,15 @@ int arch_cpu_init(void)
|
||||||
BYPASSSEL_MASK | BYPASSDMEN_MASK,
|
BYPASSSEL_MASK | BYPASSDMEN_MASK,
|
||||||
1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT);
|
1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* enable noc remap to mimic legacy loaders */
|
||||||
|
rk_clrsetreg(&grf->soc_con0,
|
||||||
|
NOC_REMAP_MASK << NOC_REMAP_SHIFT,
|
||||||
|
NOC_REMAP_MASK << NOC_REMAP_SHIFT);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_BUILD
|
#ifdef CONFIG_SPL_BUILD
|
||||||
static int setup_led(void)
|
static int setup_led(void)
|
||||||
|
|
Loading…
Add table
Reference in a new issue