Debian Codegraph @

plat/arm/board/morello/include/platform_def.h

raw
1 /*
2 * Copyright (c) 2020-2024, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #ifndef PLATFORM_DEF_H
8 #define PLATFORM_DEF_H
9
10 #include <plat/arm/board/common/v2m_def.h>
11 #include <plat/arm/common/arm_def.h>
12 #include <plat/arm/css/common/css_def.h>
13
14 /* UART related constants */
15 #define PLAT_ARM_BOOT_UART_BASE ULL(0x2A400000)
16 #define PLAT_ARM_BOOT_UART_CLK_IN_HZ U(50000000)
17
18 /* IOFPGA UART0 */
19 #define PLAT_ARM_RUN_UART_BASE ULL(0x1C090000)
20 #define PLAT_ARM_RUN_UART_CLK_IN_HZ U(24000000)
21
22 #define PLAT_ARM_CRASH_UART_BASE PLAT_ARM_RUN_UART_BASE
23 #define PLAT_ARM_CRASH_UART_CLK_IN_HZ PLAT_ARM_RUN_UART_CLK_IN_HZ
24
25 #define PLAT_ARM_DRAM2_BASE ULL(0x8080000000)
26 #define PLAT_ARM_DRAM2_SIZE ULL(0xF80000000)
27
28 #define MAX_IO_DEVICES U(3)
29 #define MAX_IO_HANDLES U(4)
30
31 #define PLAT_ARM_FLASH_IMAGE_BASE ULL(0x1A000000)
32 #define PLAT_ARM_FLASH_IMAGE_MAX_SIZE ULL(0x01000000)
33
34 #define PLAT_ARM_NVM_BASE ULL(0x1A000000)
35 #define PLAT_ARM_NVM_SIZE ULL(0x01000000)
36
37 #if defined NS_BL1U_BASE
38 #undef NS_BL1U_BASE
39 #define NS_BL1U_BASE (PLAT_ARM_NVM_BASE + UL(0x00800000))
40 #endif
41
42 /*
43 * There are no non-volatile counters in morello, these macros points
44 * to unused addresses.
45 */
46 #define SOC_TRUSTED_NVCTR_BASE ULL(0x7FE70000)
47 #define TFW_NVCTR_BASE (SOC_TRUSTED_NVCTR_BASE + U(0x0000))
48 #define TFW_NVCTR_SIZE U(4)
49 #define NTFW_CTR_BASE (SOC_TRUSTED_NVCTR_BASE + U(0x0004))
50 #define NTFW_CTR_SIZE U(4)
51
52 /*
53 * To access the complete DDR memory along with remote chip's DDR memory,
54 * which is at 4 TB offset, physical and virtual address space limits are
55 * extended to 43-bits.
56 */
57 #define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 43)
58 #define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 43)
59
60 #if CSS_USE_SCMI_SDS_DRIVER
61 #define MORELLO_SCMI_PAYLOAD_BASE ULL(0x45400000)
62 /*
63 * Index of SDS region used in the communication with SCP
64 */
65 #define SDS_SCP_AP_REGION_ID U(0)
66 #else
67 #define PLAT_CSS_SCP_COM_SHARED_MEM_BASE ULL(0x45400000)
68 #endif
69
70 #define PLAT_ARM_TRUSTED_SRAM_SIZE UL(0x00080000)
71
72 /*
73 * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size
74 * plus a little space for growth.
75 */
76 #define PLAT_ARM_MAX_BL1_RW_SIZE UL(0xC000)
77
78 /* Define memory configuration for device tree files. */
79 #define PLAT_ARM_HW_CONFIG_SIZE U(0x8000)
80
81 /*
82 * PLAT_ARM_MAX_ROMLIB_RW_SIZE is define to use a full page
83 */
84
85 #if USE_ROMLIB
86 #define PLAT_ARM_MAX_ROMLIB_RW_SIZE UL(0x1000)
87 #define PLAT_ARM_MAX_ROMLIB_RO_SIZE UL(0xE000)
88 #else
89 #define PLAT_ARM_MAX_ROMLIB_RW_SIZE U(0)
90 #define PLAT_ARM_MAX_ROMLIB_RO_SIZE U(0)
91 #endif
92
93 /*
94 * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a
95 * little space for growth.
96 */
97 #if TRUSTED_BOARD_BOOT
98 # define PLAT_ARM_MAX_BL2_SIZE UL(0x1D000)
99 #else
100 # define PLAT_ARM_MAX_BL2_SIZE UL(0x14000)
101 #endif
102
103 #define PLAT_ARM_MAX_BL31_SIZE UL(0x3B000)
104
105 /*******************************************************************************
106 * MORELLO topology related constants
107 ******************************************************************************/
108 #define MORELLO_MAX_CPUS_PER_CLUSTER U(2)
109 #define PLAT_ARM_CLUSTER_COUNT U(2)
110 #define PLAT_MORELLO_CHIP_COUNT U(1)
111 #define MORELLO_MAX_CLUSTERS_PER_CHIP U(2)
112 #define MORELLO_MAX_PE_PER_CPU U(1)
113
114 #define PLATFORM_CORE_COUNT (PLAT_MORELLO_CHIP_COUNT * \
115 PLAT_ARM_CLUSTER_COUNT * \
116 MORELLO_MAX_CPUS_PER_CLUSTER * \
117 MORELLO_MAX_PE_PER_CPU)
118
119 /* System power domain level */
120 #define CSS_SYSTEM_PWR_DMN_LVL ARM_PWR_LVL3
121
122 /*
123 * PLAT_ARM_MMAP_ENTRIES depends on the number of entries in the
124 * plat_arm_mmap array defined for each BL stage.
125 */
126 #if IMAGE_BL1 || IMAGE_BL31
127 # define PLAT_ARM_MMAP_ENTRIES U(6)
128 # define MAX_XLAT_TABLES U(7)
129 #else
130 # define PLAT_ARM_MMAP_ENTRIES U(5)
131 # define MAX_XLAT_TABLES U(6)
132 #endif
133
134 /*
135 * Size of cacheable stacks
136 */
137 #if defined(IMAGE_BL1)
138 # if TRUSTED_BOARD_BOOT
139 # define PLATFORM_STACK_SIZE UL(0x1000)
140 # else
141 # define PLATFORM_STACK_SIZE UL(0x440)
142 # endif
143 #elif defined(IMAGE_BL2)
144 # if TRUSTED_BOARD_BOOT
145 # define PLATFORM_STACK_SIZE UL(0x1000)
146 # else
147 # define PLATFORM_STACK_SIZE UL(0x400)
148 # endif
149 #elif defined(IMAGE_BL2U)
150 # define PLATFORM_STACK_SIZE UL(0x400)
151 #elif defined(IMAGE_BL31)
152 # if SPM_MM
153 # define PLATFORM_STACK_SIZE UL(0x500)
154 # else
155 # define PLATFORM_STACK_SIZE UL(0x400)
156 # endif
157 #elif defined(IMAGE_BL32)
158 # define PLATFORM_STACK_SIZE UL(0x440)
159 #endif
160
161 #define PLAT_ARM_NSTIMER_FRAME_ID U(0)
162
163 #define PLAT_ARM_TRUSTED_ROM_BASE U(0x0)
164 #define PLAT_ARM_TRUSTED_ROM_SIZE UL(0x00020000) /* 128KB */
165
166 #define PLAT_ARM_NSRAM_BASE ULL(0x06000000)
167 #define PLAT_ARM_NSRAM_SIZE UL(0x00010000) /* 64KB */
168
169 #define PLAT_CSS_MHU_BASE UL(0x45000000)
170 #define PLAT_MHUV2_BASE PLAT_CSS_MHU_BASE
171 #define PLAT_MAX_PWR_LVL U(2)
172
173 /* Interrupt handling constants */
174 #define MORELLO_IRQ_SEC_UART U(87)
175 #define MORELLO_IRQ_DISPLAY_TCU_EVENT_Q U(107)
176 #define MORELLO_IRQ_DISPLAY_TCU_CMD_SYNC U(111)
177 #define MORELLO_IRQ_DISPLAY_TCU_GLOBAL U(113)
178 #define MORELLO_IRQ_MMU_TCU1_EVENT_Q U(257)
179 #define MORELLO_IRQ_MMU_TCU1_CMD_SYNC U(258)
180 #define MORELLO_IRQ_MMU_TCU1_GLOBAL U(259)
181 #define MORELLO_IRQ_MMU_TCU2_EVENT_Q U(264)
182 #define MORELLO_IRQ_MMU_TCU2_CMD_SYNC U(265)
183 #define MORELLO_IRQ_MMU_TCU2_GLOBAL U(266)
184 #define MORELLO_IRQ_CLUSTER0_MHU U(349)
185 #define MORELLO_IRQ_CLUSTER1_MHU U(351)
186 #define MORELLO_IRQ_P0_REFCLK U(412)
187 #define MORELLO_IRQ_P1_REFCLK U(413)
188
189 #define PLAT_ARM_G1S_IRQ_PROPS(grp) \
190 ARM_G1S_IRQ_PROPS(grp), \
191 INTR_PROP_DESC(CSS_IRQ_MHU, \
192 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
193 INTR_PROP_DESC(CSS_IRQ_TZ_WDOG, \
194 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
195 INTR_PROP_DESC(CSS_IRQ_SEC_SYS_TIMER, \
196 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
197 INTR_PROP_DESC(MORELLO_IRQ_SEC_UART, \
198 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
199 INTR_PROP_DESC(MORELLO_IRQ_DISPLAY_TCU_EVENT_Q, \
200 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
201 INTR_PROP_DESC(MORELLO_IRQ_DISPLAY_TCU_CMD_SYNC, \
202 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
203 INTR_PROP_DESC(MORELLO_IRQ_DISPLAY_TCU_GLOBAL, \
204 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
205 INTR_PROP_DESC(MORELLO_IRQ_MMU_TCU1_EVENT_Q, \
206 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
207 INTR_PROP_DESC(MORELLO_IRQ_MMU_TCU1_CMD_SYNC, \
208 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
209 INTR_PROP_DESC(MORELLO_IRQ_MMU_TCU1_GLOBAL, \
210 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
211 INTR_PROP_DESC(MORELLO_IRQ_MMU_TCU2_EVENT_Q, \
212 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
213 INTR_PROP_DESC(MORELLO_IRQ_MMU_TCU2_CMD_SYNC, \
214 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
215 INTR_PROP_DESC(MORELLO_IRQ_MMU_TCU2_GLOBAL, \
216 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
217 INTR_PROP_DESC(MORELLO_IRQ_CLUSTER0_MHU, \
218 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
219 INTR_PROP_DESC(MORELLO_IRQ_CLUSTER1_MHU, \
220 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
221 INTR_PROP_DESC(MORELLO_IRQ_P0_REFCLK, \
222 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL), \
223 INTR_PROP_DESC(MORELLO_IRQ_P1_REFCLK, \
224 GIC_HIGHEST_SEC_PRIORITY, grp, GIC_INTR_CFG_LEVEL)
225
226 #define PLAT_ARM_G0_IRQ_PROPS(grp) ARM_G0_IRQ_PROPS(grp)
227
228 #define MORELLO_DEVICE_BASE ULL(0x08000000)
229 #define MORELLO_DEVICE_SIZE ULL(0x48000000)
230
231 /*Secure Watchdog Constants */
232 #define SBSA_SECURE_WDOG_BASE UL(0x2A480000)
233 #define SBSA_SECURE_WDOG_TIMEOUT UL(1000)
234
235 #define MORELLO_MAP_DEVICE MAP_REGION_FLAT( \
236 MORELLO_DEVICE_BASE, \
237 MORELLO_DEVICE_SIZE, \
238 MT_DEVICE | MT_RW | MT_SECURE)
239
240 #define ARM_MAP_DRAM1 MAP_REGION_FLAT( \
241 ARM_DRAM1_BASE, \
242 ARM_DRAM1_SIZE, \
243 MT_MEMORY | MT_RW | MT_NS)
244
245 /* GIC related constants */
246 #define PLAT_ARM_GICD_BASE UL(0x30000000)
247 #define PLAT_ARM_GICC_BASE UL(0x2C000000)
248 #define PLAT_ARM_GICR_BASE UL(0x300C0000)
249
250 /* Number of SCMI channels on the platform */
251 #define PLAT_ARM_SCMI_CHANNEL_COUNT U(1)
252
253 /* Platform ID address */
254 #define SSC_VERSION (SSC_REG_BASE + SSC_VERSION_OFFSET)
255
256 #endif /* PLATFORM_DEF_H */