Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 4 | */ |
| 5 | |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 6 | #include <linux/types.h> |
| 7 | #include <asm/armv8/mmu.h> |
| 8 | |
Masahiro Yamada | f0f6a80 | 2019-07-10 20:07:45 +0900 | [diff] [blame] | 9 | #include "../init.h" |
| 10 | |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 11 | static struct mm_region uniphier_mem_map[] = { |
| 12 | { |
York Sun | c7104e5 | 2016-06-24 16:46:22 -0700 | [diff] [blame] | 13 | .virt = 0x00000000, |
| 14 | .phys = 0x00000000, |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 15 | .size = 0x80000000, |
| 16 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| 17 | PTE_BLOCK_NON_SHARE | |
| 18 | PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| 19 | }, |
| 20 | { |
York Sun | c7104e5 | 2016-06-24 16:46:22 -0700 | [diff] [blame] | 21 | .virt = 0x80000000, |
| 22 | .phys = 0x80000000, |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 23 | .size = 0xc0000000, |
| 24 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | |
| 25 | PTE_BLOCK_INNER_SHARE |
| 26 | }, |
| 27 | { /* sentinel */ } |
| 28 | }; |
| 29 | |
| 30 | struct mm_region *mem_map = uniphier_mem_map; |
Masahiro Yamada | f0f6a80 | 2019-07-10 20:07:45 +0900 | [diff] [blame] | 31 | |
| 32 | void uniphier_mem_map_init(unsigned long dram_base, unsigned long dram_size) |
| 33 | { |
| 34 | uniphier_mem_map[0].size = dram_base; |
| 35 | uniphier_mem_map[1].virt = dram_base; |
| 36 | uniphier_mem_map[1].phys = dram_base; |
| 37 | uniphier_mem_map[1].size = dram_size; |
| 38 | } |