blob: 7653bd2d3c65874208376dfb127b65f839b69dec [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Masahiro Yamada063eb1e2016-04-21 14:43:18 +09002/*
3 * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada063eb1e2016-04-21 14:43:18 +09004 */
5
6#include <common.h>
7#include <linux/types.h>
8#include <asm/armv8/mmu.h>
9
Masahiro Yamadaf0f6a802019-07-10 20:07:45 +090010#include "../init.h"
11
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090012static struct mm_region uniphier_mem_map[] = {
13 {
York Sunc7104e52016-06-24 16:46:22 -070014 .virt = 0x00000000,
15 .phys = 0x00000000,
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090016 .size = 0x80000000,
17 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
18 PTE_BLOCK_NON_SHARE |
19 PTE_BLOCK_PXN | PTE_BLOCK_UXN
20 },
21 {
York Sunc7104e52016-06-24 16:46:22 -070022 .virt = 0x80000000,
23 .phys = 0x80000000,
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090024 .size = 0xc0000000,
25 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
26 PTE_BLOCK_INNER_SHARE
27 },
28 { /* sentinel */ }
29};
30
31struct mm_region *mem_map = uniphier_mem_map;
Masahiro Yamadaf0f6a802019-07-10 20:07:45 +090032
33void uniphier_mem_map_init(unsigned long dram_base, unsigned long dram_size)
34{
35 uniphier_mem_map[0].size = dram_base;
36 uniphier_mem_map[1].virt = dram_base;
37 uniphier_mem_map[1].phys = dram_base;
38 uniphier_mem_map[1].size = dram_size;
39}