1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2015-2021, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 * 7 * Description: 8 * Software defined memory map shared between SCP and AP cores. 9 */ 10 11 #ifndef SOFTWARE_MMAP_H 12 #define SOFTWARE_MMAP_H 13 14 #include "system_mmap.h" 15 16 #include <fwk_macros.h> 17 18 /* 19 * The 4KiB AP/SCP Shared memory at the base of Trusted SRAM is used for several 20 * purposes. These are: the Shared Data Storage (SDS) Memory Region, the SCMI 21 * secure payload areas, and the context area for Application Processor 22 * firmware. 23 * 24 * Shared Data Storage (SDS) Memory Region: Used for structured storage of data 25 * that is shared between SCP Firmware and Application Processor firmware. The 26 * SDS Memory Region occupies the area between the context region base and 27 * the SCMI Secure Payload base. 28 * 29 * SCMI Secure Payload Areas: Storage for SCMI message contents in both the 30 * Agent->Platform and Platform->Agent directions. 31 * 32 * Application Processor Context Area: The usage of this area is defined by the 33 * firmware running on the Application Processors. The SCP Firmware must zero 34 * this memory before releasing any Application Processors. This area must 35 * always be located in the top 64 bytes of the 4KiB reserved region. 36 * 37 * +-----------------------+ 4096 38 * | | 39 * 64B | AP Context Area | 40 * | | 41 * +-----------------------+ 42 * | | 43 * 256B | Unused | 44 * | | 45 * +-----------------------+ 46 * | | 47 * | SCMI Sec. Payload | 48 * 128B | Platform to Agent | 49 * | | 50 * +-----------------------+ 51 * | | 52 * 128B | SCMI Sec. Payload | 53 * | Agent to Platform | 54 * | | 55 * +-----------------------+ 56 * | | 57 * 3520B | SDS Memory Region | 58 * | | 59 * +-----------------------+ 0 60 */ 61 62 /* Secure shared memory at the base of Trusted SRAM */ 63 #define SHARED_SECURE_BASE (TRUSTED_RAM_BASE) 64 #define SHARED_SECURE_SIZE (4 * FWK_KIB) 65 66 /* SDS Memory Region */ 67 #define SDS_SECURE_BASE (SHARED_SECURE_BASE) 68 #define SDS_SECURE_SIZE (3520) 69 70 /* AP Context Area */ 71 #define AP_CONTEXT_BASE (SHARED_SECURE_BASE + SHARED_SECURE_SIZE - \ 72 AP_CONTEXT_SIZE) 73 #define AP_CONTEXT_SIZE (64) 74 75 /* SCMI Secure Payload Areas */ 76 #define SCMI_PAYLOAD_SIZE (128) 77 #define SCMI_PAYLOAD_S_A2P_BASE (SDS_SECURE_BASE + SDS_SECURE_SIZE) 78 #define SCMI_PAYLOAD_S_P2A_BASE (SCMI_PAYLOAD_S_A2P_BASE + SCMI_PAYLOAD_SIZE) 79 80 /* 81 * The 4KiB AP/SCP Shared memory at the base of Non-trusted SRAM is used for the 82 * SCMI non-secure payload areas. 83 * 84 * Shared Data Storage (SDS) Memory Region: Used for structured storage of data 85 * that is shared between SCP Firmware and Application Processor firmware. It 86 * exists along the SDS region in secure RAM so that AP code unable to access 87 * the secure RAM is still able to use SDS, if required. 88 * 89 * Two SCMI non-Secure Payload Areas: Storage for SCMI message contents in both 90 * the Agent->Platform and Platform->Agent directions. 91 * 92 * +-----------------------+ 4096 93 * 2560B | Unused | 94 * +-----------------------+ 95 * | | 96 * 1024B | Non-Sec. SDS memory | 97 * | region | 98 * | | 99 * +-----------------------+ 100 * | | 101 * | Non-Sec. Channel 1 | 102 * | SCMI non-Sec. Payload | 103 * 128B | Platform to Agent | 104 * | | 105 * +-----------------------+ 106 * | | 107 * | Non-Sec. Channel 1 | 108 * 128B | SCMI non-Sec. Payload | 109 * | Agent to Platform | 110 * | | 111 * +-----------------------+ 112 * | | 113 * | Non-Sec. Channel 0 | 114 * | SCMI non-Sec. Payload | 115 * 128B | Platform to Agent | 116 * | | 117 * +-----------------------+ 118 * | | 119 * | Non-Sec. Channel 0 | 120 * 128B | SCMI non-Sec. Payload | 121 * | Agent to Platform | 122 * | | 123 * +-----------------------+ 0 124 */ 125 126 /* Non-secure shared memory at the base of Non-trusted SRAM */ 127 #define SHARED_NONSECURE_BASE (NONTRUSTED_RAM_BASE) 128 #define SHARED_NONSECURE_SIZE (4 * FWK_KIB) 129 130 /* SCMI Non-Secure Payload Areas */ 131 #define SCMI_PAYLOAD0_NS_A2P_BASE (SHARED_NONSECURE_BASE) 132 #define SCMI_PAYLOAD0_NS_P2A_BASE (SCMI_PAYLOAD0_NS_A2P_BASE + \ 133 SCMI_PAYLOAD_SIZE) 134 #define SCMI_PAYLOAD1_NS_A2P_BASE (SCMI_PAYLOAD0_NS_P2A_BASE + \ 135 SCMI_PAYLOAD_SIZE) 136 #define SCMI_PAYLOAD1_NS_P2A_BASE (SCMI_PAYLOAD1_NS_A2P_BASE + \ 137 SCMI_PAYLOAD_SIZE) 138 139 /* SDS Memory Region */ 140 #define SDS_NONSECURE_BASE (SCMI_PAYLOAD1_NS_P2A_BASE + \ 141 SCMI_PAYLOAD_SIZE) 142 #define SDS_NONSECURE_SIZE (1024) 143 144 #endif /* SOFTWARE_MMAP_H */ 145