#include <asm/global_data.h>
#include <linux/bitops.h>
#include <linux/libfdt.h>
+#include <linux/sizes.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/arch/cpu.h>
#define MVEBU_CPU_DEC_WIN_REMAP(w) (MVEBU_CPU_DEC_WIN_CTRL(w) + 0xc)
#define MVEBU_CPU_DEC_WIN_GRANULARITY 16
#define MVEBU_CPU_DEC_WINS 5
+#define MVEBU_CPU_DEC_CCI_BASE (MVEBU_CPU_DEC_WIN_REG_BASE + 0xe0)
+#define MVEBU_CPU_DEC_ROM_BASE (MVEBU_CPU_DEC_WIN_REG_BASE + 0xf4)
-#define MAX_MEM_MAP_REGIONS (MVEBU_CPU_DEC_WINS + 2)
+#define MAX_MEM_MAP_REGIONS (MVEBU_CPU_DEC_WINS + 4)
#define A3700_PTE_BLOCK_NORMAL \
(PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_INNER_SHARE)
static void build_mem_map(void)
{
int win, region;
+ u32 reg;
region = 1;
+
+ /* CCI-400 */
+ reg = readl(MVEBU_CPU_DEC_CCI_BASE);
+ mvebu_mem_map[region].phys = reg << 20;
+ mvebu_mem_map[region].virt = reg << 20;
+ mvebu_mem_map[region].size = SZ_64K;
+ mvebu_mem_map[region].attrs = A3700_PTE_BLOCK_DEVICE;
+ ++region;
+
+ /* AP BootROM */
+ reg = readl(MVEBU_CPU_DEC_ROM_BASE);
+ mvebu_mem_map[region].phys = reg << 20;
+ mvebu_mem_map[region].virt = reg << 20;
+ mvebu_mem_map[region].size = SZ_1M;
+ mvebu_mem_map[region].attrs = A3700_PTE_BLOCK_NORMAL;
+ ++region;
+
for (win = 0; win < MVEBU_CPU_DEC_WINS; ++win) {
u32 base, tgt, size;
u64 attrs;