diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2019-07-22 20:02:08 +0800 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2019-07-29 10:26:41 +0800 |
commit | c14fe2a8e192d1b1974a425dff7552df71962fa4 (patch) | |
tree | f1f8e52a6029fefa7f892ab8e63ed547f8adc60b /arch/arm/mach-rockchip/rk3188/rk3188.c | |
parent | cca3b09147ea572ba1491186328588f6aa9c9aef (diff) |
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>
Diffstat (limited to 'arch/arm/mach-rockchip/rk3188/rk3188.c')
-rw-r--r-- | arch/arm/mach-rockchip/rk3188/rk3188.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c index 08792f1674..95f0e3ccbe 100644 --- a/arch/arm/mach-rockchip/rk3188/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188/rk3188.c @@ -3,8 +3,11 @@ * (C) Copyright 2019 Rockchip Electronics Co., Ltd */ #include <common.h> +#include <dm.h> +#include <syscon.h> #include <asm/io.h> #include <asm/arch-rockchip/bootrom.h> +#include <asm/arch-rockchip/clock.h> #include <asm/arch-rockchip/grf_rk3188.h> #include <asm/arch-rockchip/hardware.h> @@ -42,11 +45,17 @@ void board_debug_uart_init(void) } #endif +#ifdef CONFIG_SPL_BUILD int arch_cpu_init(void) { -#ifdef CONFIG_ROCKCHIP_USB_UART - struct rk3188_grf * const grf = (void *)GRF_BASE; + struct rk3188_grf *grf; + 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], SIDDQ_MASK | UOC_DISABLE_MASK | COMMON_ON_N_MASK, 1 << SIDDQ_SHIFT | 1 << UOC_DISABLE_SHIFT | @@ -64,8 +73,15 @@ int arch_cpu_init(void) BYPASSSEL_MASK | BYPASSDMEN_MASK, 1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT); #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; } +#endif #ifdef CONFIG_SPL_BUILD static int setup_led(void) |