}
}
-void mmu_disable(void)
-{
- asm volatile(
- "mrc p15, 0, r0, c1, c0, 0\n"
- "bic r0, #1\n"
- "mcr p15, 0, r0, c1, c0, 0\n");
-}
-
#ifdef CONFIG_ARCH_CPU_INIT
-static void set_cbar(u32 addr)
-{
- asm("mcr p15, 4, %0, c15, c0" : : "r" (addr));
-}
-
#define MV_USB_PHY_BASE (MVEBU_AXP_USB_BASE + 0x800)
#define MV_USB_PHY_PLL_REG(reg) (MV_USB_PHY_BASE | (((reg) & 0xF) << 2))
#define MV_USB_X3_BASE(addr) (MVEBU_AXP_USB_BASE | BIT(11) | \
struct pl310_regs *const pl310 =
(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
- /*
- * Only with disabled MMU its possible to switch the base
- * register address on Armada 38x. Without this the SDRAM
- * located at >= 0x4000.0000 is also not accessible, as its
- * still locked to cache.
- */
- mmu_disable();
-
- /* Linux expects the internal registers to be at 0xf1000000 */
- writel(SOC_REGS_PHY_BASE, INTREG_BASE_ADDR_REG);
- set_cbar(SOC_REGS_PHY_BASE + 0xC000);
-
- /*
- * From this stage on, the SoC detection is working. As we have
- * configured the internal register base to the value used
- * in the macros / defines in the U-Boot header (soc.h).
- */
-
if (mvebu_soc_family() == MVEBU_SOC_A38X) {
/*
* To fully release / unlock this area from cache, we need
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+
+ENTRY(arch_very_early_init)
+#ifdef CONFIG_ARMADA_38X
+ /*
+ * Only with disabled MMU its possible to switch the base
+ * register address on Armada 38x. Without this the SDRAM
+ * located at >= 0x4000.0000 is also not accessible, as its
+ * still locked to cache.
+ */
+ mrc p15, 0, r0, c1, c0, 0
+ bic r0, #1
+ mcr p15, 0, r0, c1, c0, 0
+#endif
+
+ /* Move internal registers from INTREG_BASE_ADDR_REG to SOC_REGS_PHY_BASE */
+ ldr r0, =SOC_REGS_PHY_BASE
+ ldr r1, =INTREG_BASE_ADDR_REG
+ str r0, [r1]
+ add r0, r0, #0xC000
+ mcr p15, 4, r0, c15, c0
+
+ bx lr
+ENDPROC(arch_very_early_init)