Marek Vasut | a523af6 | 2017-11-25 23:24:01 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Renesas RCar Gen3 memory map tables |
| 3 | * |
| 4 | * Copyright (C) 2017 Marek Vasut <marek.vasut@gmail.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <asm/armv8/mmu.h> |
| 11 | |
| 12 | static struct mm_region r8a7795_mem_map[] = { |
| 13 | { |
| 14 | .virt = 0x0UL, |
| 15 | .phys = 0x0UL, |
| 16 | .size = 0x80000000UL, |
| 17 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | |
| 18 | PTE_BLOCK_INNER_SHARE |
| 19 | }, { |
| 20 | .virt = 0x80000000UL, |
| 21 | .phys = 0x80000000UL, |
| 22 | .size = 0x80000000UL, |
| 23 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| 24 | PTE_BLOCK_NON_SHARE | |
| 25 | PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| 26 | }, { |
| 27 | /* List terminator */ |
| 28 | 0, |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | static struct mm_region r8a7796_mem_map[] = { |
| 33 | { |
| 34 | .virt = 0x0UL, |
| 35 | .phys = 0x0UL, |
| 36 | .size = 0xe0000000UL, |
| 37 | .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | |
| 38 | PTE_BLOCK_INNER_SHARE |
| 39 | }, { |
| 40 | .virt = 0xe0000000UL, |
| 41 | .phys = 0xe0000000UL, |
| 42 | .size = 0xe0000000UL, |
| 43 | .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| 44 | PTE_BLOCK_NON_SHARE | |
| 45 | PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| 46 | }, { |
| 47 | /* List terminator */ |
| 48 | 0, |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | struct mm_region *mem_map = r8a7795_mem_map; |
| 53 | |
| 54 | void rcar_gen3_memmap_fixup(void) |
| 55 | { |
| 56 | u32 cpu_type = rmobile_get_cpu_type(); |
| 57 | |
| 58 | switch (cpu_type) { |
| 59 | case RMOBILE_CPU_TYPE_R8A7795: |
| 60 | mem_map = r8a7795_mem_map; |
| 61 | break; |
| 62 | case RMOBILE_CPU_TYPE_R8A7796: |
| 63 | mem_map = r8a7796_mem_map; |
| 64 | break; |
| 65 | } |
| 66 | } |