aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2023-03-11 11:57:01 +0100
committerStefan Roese <sr@denx.de>2023-03-24 13:11:47 +0100
commitae60fc6902c262de8f4168b1dada0e1fe0ec5692 (patch)
tree4fb6a2efa25f8ba669078ac7d2bc665282a49ca7 /arch/arm/mach-kirkwood
parent2a3bbced71301399490d37684050dffb364519e1 (diff)
downloadu-boot-ae60fc6902c262de8f4168b1dada0e1fe0ec5692.zip
u-boot-ae60fc6902c262de8f4168b1dada0e1fe0ec5692.tar.gz
u-boot-ae60fc6902c262de8f4168b1dada0e1fe0ec5692.tar.bz2
arm: kirkwood: Move internal registers in arch_very_early_init() function
Same change as was done for mvebu in commit 5bb2c550b11e ("arm: mvebu: Move internal registers in arch_very_early_init() function") but for kirkwood. Signed-off-by: Pali Rohár <pali@kernel.org> Tested-by: Tony Dinh <mibodhi@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/Kconfig2
-rw-r--r--arch/arm/mach-kirkwood/Makefile1
-rw-r--r--arch/arm/mach-kirkwood/cpu.c3
-rw-r--r--arch/arm/mach-kirkwood/lowlevel.S12
4 files changed, 15 insertions, 3 deletions
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index b19ed2c..54027cc 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -5,9 +5,11 @@ config FEROCEON_88FR131
config KW88F6192
bool
+ select ARCH_VERY_EARLY_INIT
config KW88F6281
bool
+ select ARCH_VERY_EARLY_INIT
config SHEEVA_88SV131
bool
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 3b2eef8..0fb5a23 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -6,6 +6,7 @@
obj-y = cpu.o
obj-y += cache.o
+obj-y += lowlevel.o
obj-y += mpp.o
# cpu.o and cache.o contain CP15 instructions which cannot be run in
diff --git a/arch/arm/mach-kirkwood/cpu.c b/arch/arm/mach-kirkwood/cpu.c
index df3e8f1..2b493b3 100644
--- a/arch/arm/mach-kirkwood/cpu.c
+++ b/arch/arm/mach-kirkwood/cpu.c
@@ -189,9 +189,6 @@ int arch_cpu_init(void)
struct kwcpu_registers *cpureg =
(struct kwcpu_registers *)KW_CPU_REG_BASE;
- /* Linux expects the internal registers to be at 0xf1000000 */
- writel(KW_REGS_PHY_BASE, KW_OFFSET_REG);
-
/* Enable and invalidate L2 cache in write through mode */
writel(readl(&cpureg->l2_cfg) | 0x18, &cpureg->l2_cfg);
invalidate_l2_cache();
diff --git a/arch/arm/mach-kirkwood/lowlevel.S b/arch/arm/mach-kirkwood/lowlevel.S
new file mode 100644
index 0000000..6810384
--- /dev/null
+++ b/arch/arm/mach-kirkwood/lowlevel.S
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+
+ENTRY(arch_very_early_init)
+ /* Move internal registers from KW_OFFSET_REG to KW_REGS_PHY_BASE */
+ ldr r0, =KW_REGS_PHY_BASE
+ ldr r1, =KW_OFFSET_REG
+ str r0, [r1]
+ bx lr
+ENDPROC(arch_very_early_init)