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 ROM and RAM firmware size loaded on main memory */
16 #define SCP_BOOT_ROM_SIZE (512 * 1024)
17 #define SCP_RAM_SIZE (512 * 1024)
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 /* Non-secure Shared memory between AP and SCP */
28 #define SCP_AP_SHARED_NONSECURE_BASE (SCP_NONTRUSTED_RAM_BASE)
29 #define SCP_AP_SHARED_NONSECURE_SIZE (4 * FWK_KIB)
30 
31 /* AP Context Area */
32 #define SCP_AP_CONTEXT_BASE \
33     (SCP_AP_SHARED_SECURE_BASE + SCP_AP_SHARED_SECURE_SIZE - \
34      SCP_AP_CONTEXT_SIZE)
35 #define SCP_AP_CONTEXT_SIZE (64)
36 
37 /* SDS Memory Region */
38 #define SCP_SDS_MEM_BASE (SCP_AP_SHARED_SECURE_BASE)
39 #define SCP_SDS_MEM_SIZE (3520)
40 
41 /* SCMI Secure Payload Areas */
42 #define SCP_SCMI_PAYLOAD_SIZE (128)
43 #define SCP_SCMI_PAYLOAD_S_A2P_BASE (SCP_SDS_MEM_BASE + SCP_SDS_MEM_SIZE)
44 #define SCP_SCMI_PAYLOAD_S_P2A_BASE \
45     (SCP_SCMI_PAYLOAD_S_A2P_BASE + SCP_SCMI_PAYLOAD_SIZE)
46 
47 /* SCMI Non-Secure Payload Areas */
48 
49 #define SCP_SCMI_PAYLOAD0_NS_A2P_BASE (SCP_AP_SHARED_NONSECURE_BASE)
50 #define SCP_SCMI_PAYLOAD0_NS_P2A_BASE \
51     (SCP_SCMI_PAYLOAD0_NS_A2P_BASE + SCP_SCMI_PAYLOAD_SIZE)
52 #define SCP_SCMI_PAYLOAD1_NS_A2P_BASE \
53     (SCP_SCMI_PAYLOAD0_NS_P2A_BASE + SCP_SCMI_PAYLOAD_SIZE)
54 #define SCP_SCMI_PAYLOAD1_NS_P2A_BASE \
55     (SCP_SCMI_PAYLOAD1_NS_A2P_BASE + SCP_SCMI_PAYLOAD_SIZE)
56 
57 /* SCMIv2 Fast Channels */
58 #define SCMI_FAST_CHANNEL_BASE \
59     (SCP_SCMI_PAYLOAD1_NS_P2A_BASE + SCP_SCMI_PAYLOAD_SIZE)
60 
61 #endif /* SCP_SOFTWARE_MMAP_H */
62