1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef SCP_SOFTWARE_MMAP_H
9 #define SCP_SOFTWARE_MMAP_H
10 
11 #include "scp_soc_mmap.h"
12 
13 #include <fwk_macros.h>
14 
15 /* SCP RAM firmware base and size on the flash */
16 #define SCP_RAMFW_IMAGE_FLASH_BASE (SCP_NOR0_FLASH_BASE + 0x03D80000)
17 #define SCP_RAMFW_IMAGE_FLASH_SIZE (256 * FWK_KIB)
18 
19 /* SCP trusted and non-trusted RAM base address */
20 #define SCP_TRUSTED_RAM_BASE    (SCP_SYSTEM_ACCESS_PORT1_BASE + 0x04000000)
21 #define SCP_NONTRUSTED_RAM_BASE (SCP_SYSTEM_ACCESS_PORT1_BASE + 0x06000000)
22 
23 /* Secure Shared memory between AP and SCP */
24 #define SCP_AP_SHARED_SECURE_BASE (SCP_TRUSTED_RAM_BASE)
25 #define SCP_AP_SHARED_SECURE_SIZE (4 * FWK_KIB)
26 
27 /*
28  * Non-trusted shared SRAM region
29  */
30 #define SCP_AP_SHARED_NONSECURE_BASE (SCP_NONTRUSTED_RAM_BASE)
31 #define SCP_AP_SHARED_NONSECURE_SIZE (4 * FWK_KIB)
32 /* AP Context Area */
33 #define SCP_AP_CONTEXT_BASE \
34     (SCP_AP_SHARED_SECURE_BASE + SCP_AP_SHARED_SECURE_SIZE - \
35      SCP_AP_CONTEXT_SIZE)
36 #define SCP_AP_CONTEXT_SIZE (64)
37 
38 /* SDS Memory Region */
39 #define SCP_SDS_SECURE_BASE (SCP_AP_SHARED_SECURE_BASE)
40 #define SCP_SDS_SECURE_SIZE (3520)
41 
42 /* SCMI Secure Payload Areas */
43 #define SCP_SCMI_PAYLOAD_SIZE       (128)
44 #define SCP_SCMI_PAYLOAD_S_A2P_BASE (SCP_SDS_SECURE_BASE + SCP_SDS_SECURE_SIZE)
45 #define SCP_SCMI_PAYLOAD_S_P2A_BASE \
46     (SCP_SCMI_PAYLOAD_S_A2P_BASE + SCP_SCMI_PAYLOAD_SIZE)
47 
48 /* SCMI Non-Secure Payload Areas */
49 #define SCP_SCMI_PAYLOAD_NS_A2P_BASE (SCP_AP_SHARED_NONSECURE_BASE)
50 #define SCP_SCMI_PAYLOAD_NS_P2A_BASE \
51     (SCP_SCMI_PAYLOAD_NS_A2P_BASE + SCP_SCMI_PAYLOAD_SIZE)
52 
53 /* SDS non secure region */
54 #define SCP_SDS_NONSECURE_BASE \
55     (SCP_SCMI_PAYLOAD_NS_P2A_BASE + SCP_SCMI_PAYLOAD_SIZE)
56 #define SCP_SDS_NONSECURE_SIZE (1024)
57 
58 /*
59  * SCMI Fastchannel memory region. Fastchannel Size as per SCMI v2
60  * specification
61  */
62 #define SCP_SCMI_FAST_CHANNEL_BASE \
63     (SCP_SDS_NONSECURE_BASE + SCP_SDS_NONSECURE_SIZE)
64 
65 #endif /* SCP_SOFTWARE_MMAP_H */
66