1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2014-2016, Freescale Semiconductor, Inc.
8 #include <asm/system.h>
9 #include <asm/armv8/mmu.h>
11 #include <asm/arch/mc_me_regs.h>
16 return readl(MC_ME_CS);
19 #ifndef CONFIG_SYS_DCACHE_OFF
21 #define S32V234_IRAM_BASE 0x3e800000UL
22 #define S32V234_IRAM_SIZE 0x800000UL
23 #define S32V234_DRAM_BASE1 0x80000000UL
24 #define S32V234_DRAM_SIZE1 0x40000000UL
25 #define S32V234_DRAM_BASE2 0xC0000000UL
26 #define S32V234_DRAM_SIZE2 0x20000000UL
27 #define S32V234_PERIPH_BASE 0x40000000UL
28 #define S32V234_PERIPH_SIZE 0x40000000UL
30 static struct mm_region s32v234_mem_map[] = {
32 .virt = S32V234_IRAM_BASE,
33 .phys = S32V234_IRAM_BASE,
34 .size = S32V234_IRAM_SIZE,
35 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
38 .virt = S32V234_DRAM_BASE1,
39 .phys = S32V234_DRAM_BASE1,
40 .size = S32V234_DRAM_SIZE1,
41 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
44 .virt = S32V234_PERIPH_BASE,
45 .phys = S32V234_PERIPH_BASE,
46 .size = S32V234_PERIPH_SIZE,
47 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
49 /* TODO: Do we need these? */
50 /* | PTE_BLOCK_PXN | PTE_BLOCK_UXN */
52 .virt = S32V234_DRAM_BASE2,
53 .phys = S32V234_DRAM_BASE2,
54 .size = S32V234_DRAM_SIZE2,
55 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL_NC) |
63 struct mm_region *mem_map = s32v234_mem_map;
68 * Return the number of cores on this SOC.
70 int cpu_numcores(void)
76 numcores = hweight32(cpu_mask());
78 /* Verify if M4 is deactivated */
85 #if defined(CONFIG_ARCH_EARLY_INIT_R)
86 int arch_early_init_r(void)
89 asm volatile ("dsb sy");
90 rv = fsl_s32v234_wake_seconday_cores();
93 printf("Did not wake secondary cores\n");
98 #endif /* CONFIG_ARCH_EARLY_INIT_R */