2 * Copyright (C) 2016 Stefan Roese <sr@denx.de>
4 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/system.h>
13 #include <asm/arch/cpu.h>
14 #include <asm/arch/soc.h>
15 #include <asm/armv8/mmu.h>
17 DECLARE_GLOBAL_DATA_PTR;
20 #define MVEBU_RFU_BASE (MVEBU_REGISTER(0x6f0000))
21 #define RFU_GLOBAL_SW_RST (MVEBU_RFU_BASE + 0x84)
22 #define RFU_SW_RESET_OFFSET 0
25 * The following table includes all memory regions for Armada 7k and
26 * 8k SoCs. The Armada 7k is missing the CP110 slave regions here. Lets
27 * define these regions at the beginning of the struct so that they
28 * can be easier removed later dynamically if an Armada 7k device is detected.
29 * For a detailed memory map, please see doc/mvebu/armada-8k-memory.txt
31 #define ARMADA_7K8K_COMMON_REGIONS_START 2
32 static struct mm_region mvebu_mem_map[] = {
33 /* Armada 80x0 memory regions include the CP1 (slave) units */
35 /* SRAM, MMIO regions - CP110 slave region */
38 .size = 0x02000000UL, /* 32MiB internal registers */
39 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
46 .size = 0x04000000UL, /* 64MiB CP110 slave PCI space */
47 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
50 /* Armada 80x0 and 70x0 common memory regions start here */
56 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
60 /* SRAM, MMIO regions - AP806 region */
63 .size = 0x01000000UL, /* 16MiB internal registers */
64 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
68 /* SRAM, MMIO regions - CP110 master region */
71 .size = 0x02000000UL, /* 32MiB internal registers */
72 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
79 .size = 0x04000000UL, /* 64MiB CP110 master PCI space */
80 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
88 struct mm_region *mem_map = mvebu_mem_map;
90 void enable_caches(void)
93 * Armada 7k is not equipped with the CP110 slave CP. In case this
94 * code runs on an Armada 7k device, lets remove the CP110 slave
95 * entries from the memory mapping by moving the start to the
98 if (of_machine_is_compatible("marvell,armada7040"))
99 mem_map = &mvebu_mem_map[ARMADA_7K8K_COMMON_REGIONS_START];
105 void reset_cpu(ulong ignored)
109 reg = readl(RFU_GLOBAL_SW_RST);
110 reg &= ~(1 << RFU_SW_RESET_OFFSET);
111 writel(reg, RFU_GLOBAL_SW_RST);