Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 1 | /* |
Roberto Vargas | 550eb08 | 2018-01-05 16:00:05 +0000 | [diff] [blame] | 2 | * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 5 | */ |
Antonio Nino Diaz | a320ecd | 2019-01-15 14:19:50 +0000 | [diff] [blame] | 6 | |
| 7 | #include <platform_def.h> |
Antonio Nino Diaz | bd7b740 | 2019-01-25 14:30:04 +0000 | [diff] [blame] | 8 | #include <plat/arm/common/plat_arm.h> |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 9 | |
| 10 | /* |
Sandrine Bailleux | 4a1267a | 2016-05-18 16:11:47 +0100 | [diff] [blame] | 11 | * Table of memory regions for different BL stages to map using the MMU. |
Roberto Vargas | 344ff02 | 2018-10-19 16:44:18 +0100 | [diff] [blame] | 12 | * This doesn't include Trusted SRAM as setup_page_tables() already takes care |
| 13 | * of mapping it. |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 14 | */ |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 15 | #ifdef IMAGE_BL1 |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 16 | const mmap_region_t plat_arm_mmap[] = { |
| 17 | ARM_MAP_SHARED_RAM, |
Soby Mathew | 9427357 | 2018-03-07 11:32:04 +0000 | [diff] [blame] | 18 | V2M_MAP_FLASH0_RW, |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 19 | V2M_MAP_IOFPGA, |
| 20 | CSS_MAP_DEVICE, |
| 21 | SOC_CSS_MAP_DEVICE, |
Yatharth Kochar | 736a3bf | 2015-10-11 14:14:55 +0100 | [diff] [blame] | 22 | #if TRUSTED_BOARD_BOOT |
Sandrine Bailleux | d9160a5 | 2017-05-26 15:48:10 +0100 | [diff] [blame] | 23 | /* Map DRAM to authenticate NS_BL2U image. */ |
Yatharth Kochar | 736a3bf | 2015-10-11 14:14:55 +0100 | [diff] [blame] | 24 | ARM_MAP_NS_DRAM1, |
| 25 | #endif |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 26 | {0} |
| 27 | }; |
| 28 | #endif |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 29 | #ifdef IMAGE_BL2 |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 30 | const mmap_region_t plat_arm_mmap[] = { |
| 31 | ARM_MAP_SHARED_RAM, |
Soby Mathew | 9427357 | 2018-03-07 11:32:04 +0000 | [diff] [blame] | 32 | V2M_MAP_FLASH0_RW, |
Roberto Vargas | a1c16b6 | 2017-08-03 09:16:43 +0100 | [diff] [blame] | 33 | #ifdef PLAT_ARM_MEM_PROT_ADDR |
| 34 | ARM_V2M_MAP_MEM_PROTECT, |
| 35 | #endif |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 36 | V2M_MAP_IOFPGA, |
| 37 | CSS_MAP_DEVICE, |
| 38 | SOC_CSS_MAP_DEVICE, |
| 39 | ARM_MAP_NS_DRAM1, |
Roberto Vargas | f8fda10 | 2017-08-08 11:27:20 +0100 | [diff] [blame] | 40 | #ifdef AARCH64 |
| 41 | ARM_MAP_DRAM2, |
| 42 | #endif |
Sandrine Bailleux | b260c3a | 2017-08-30 10:59:22 +0100 | [diff] [blame] | 43 | #ifdef SPD_tspd |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 44 | ARM_MAP_TSP_SEC_MEM, |
Sandrine Bailleux | b260c3a | 2017-08-30 10:59:22 +0100 | [diff] [blame] | 45 | #endif |
Summer Qin | 9db8f2e | 2017-04-24 16:49:28 +0100 | [diff] [blame] | 46 | #ifdef SPD_opteed |
Soby Mathew | 874fc9e | 2017-09-01 13:43:50 +0100 | [diff] [blame] | 47 | ARM_MAP_OPTEE_CORE_MEM, |
Summer Qin | 9db8f2e | 2017-04-24 16:49:28 +0100 | [diff] [blame] | 48 | ARM_OPTEE_PAGEABLE_LOAD_MEM, |
| 49 | #endif |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 50 | {0} |
| 51 | }; |
| 52 | #endif |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 53 | #ifdef IMAGE_BL2U |
Yatharth Kochar | 3a11eda | 2015-10-14 15:28:11 +0100 | [diff] [blame] | 54 | const mmap_region_t plat_arm_mmap[] = { |
| 55 | ARM_MAP_SHARED_RAM, |
| 56 | CSS_MAP_DEVICE, |
Daniel Boulby | 45a2c9e | 2018-07-06 16:54:44 +0100 | [diff] [blame] | 57 | CSS_MAP_SCP_BL2U, |
| 58 | V2M_MAP_IOFPGA, |
Yatharth Kochar | 3a11eda | 2015-10-14 15:28:11 +0100 | [diff] [blame] | 59 | SOC_CSS_MAP_DEVICE, |
| 60 | {0} |
| 61 | }; |
| 62 | #endif |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 63 | #ifdef IMAGE_BL31 |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 64 | const mmap_region_t plat_arm_mmap[] = { |
| 65 | ARM_MAP_SHARED_RAM, |
| 66 | V2M_MAP_IOFPGA, |
| 67 | CSS_MAP_DEVICE, |
Roberto Vargas | a1c16b6 | 2017-08-03 09:16:43 +0100 | [diff] [blame] | 68 | #ifdef PLAT_ARM_MEM_PROT_ADDR |
| 69 | ARM_V2M_MAP_MEM_PROTECT, |
| 70 | #endif |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 71 | SOC_CSS_MAP_DEVICE, |
| 72 | {0} |
| 73 | }; |
| 74 | #endif |
Masahiro Yamada | 441bfdd | 2016-12-25 23:36:24 +0900 | [diff] [blame] | 75 | #ifdef IMAGE_BL32 |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 76 | const mmap_region_t plat_arm_mmap[] = { |
Yatharth Kochar | 2694cba | 2016-11-14 12:00:41 +0000 | [diff] [blame] | 77 | #ifdef AARCH32 |
| 78 | ARM_MAP_SHARED_RAM, |
Roberto Vargas | 550eb08 | 2018-01-05 16:00:05 +0000 | [diff] [blame] | 79 | #ifdef PLAT_ARM_MEM_PROT_ADDR |
| 80 | ARM_V2M_MAP_MEM_PROTECT, |
| 81 | #endif |
Yatharth Kochar | 2694cba | 2016-11-14 12:00:41 +0000 | [diff] [blame] | 82 | #endif |
Dan Handley | 9df4804 | 2015-03-19 18:58:55 +0000 | [diff] [blame] | 83 | V2M_MAP_IOFPGA, |
| 84 | CSS_MAP_DEVICE, |
| 85 | SOC_CSS_MAP_DEVICE, |
| 86 | {0} |
| 87 | }; |
| 88 | #endif |
| 89 | |
| 90 | ARM_CASSERT_MMAP |