1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2014-2016, Freescale Semiconductor, Inc.
11 #include <asm/system.h>
12 #include <asm/armv8/mmu.h>
14 #include <asm/arch/mc_me_regs.h>
15 #include <linux/bitops.h>
20 return readl(MC_ME_CS);
23 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
25 #define S32V234_IRAM_BASE 0x3e800000UL
26 #define S32V234_IRAM_SIZE 0x800000UL
27 #define S32V234_DRAM_BASE1 0x80000000UL
28 #define S32V234_DRAM_SIZE1 0x40000000UL
29 #define S32V234_DRAM_BASE2 0xC0000000UL
30 #define S32V234_DRAM_SIZE2 0x20000000UL
31 #define S32V234_PERIPH_BASE 0x40000000UL
32 #define S32V234_PERIPH_SIZE 0x40000000UL
34 static struct mm_region s32v234_mem_map[] = {
36 .virt = S32V234_IRAM_BASE,
37 .phys = S32V234_IRAM_BASE,
38 .size = S32V234_IRAM_SIZE,
39 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
42 .virt = S32V234_DRAM_BASE1,
43 .phys = S32V234_DRAM_BASE1,
44 .size = S32V234_DRAM_SIZE1,
45 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
48 .virt = S32V234_PERIPH_BASE,
49 .phys = S32V234_PERIPH_BASE,
50 .size = S32V234_PERIPH_SIZE,
51 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
53 /* TODO: Do we need these? */
54 /* | PTE_BLOCK_PXN | PTE_BLOCK_UXN */
56 .virt = S32V234_DRAM_BASE2,
57 .phys = S32V234_DRAM_BASE2,
58 .size = S32V234_DRAM_SIZE2,
59 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL_NC) |
67 struct mm_region *mem_map = s32v234_mem_map;
72 * Return the number of cores on this SOC.
74 int cpu_numcores(void)
80 numcores = hweight32(cpu_mask());
82 /* Verify if M4 is deactivated */
89 #if defined(CONFIG_ARCH_EARLY_INIT_R)
90 int arch_early_init_r(void)
93 asm volatile ("dsb sy");
94 rv = fsl_s32v234_wake_seconday_cores();
97 printf("Did not wake secondary cores\n");
102 #endif /* CONFIG_ARCH_EARLY_INIT_R */