Convert CONFIG_SYS_FSL_SEC_MON et al to Kconfig
[platform/kernel/u-boot.git] / arch / arm / include / asm / arch-fsl-layerscape / config.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2016-2018, 2020 NXP
4  * Copyright 2015, Freescale Semiconductor
5  */
6
7 #ifndef _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_
8 #define _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_
9
10 #include <linux/kconfig.h>
11 #include <fsl_ddrc_version.h>
12
13 #ifndef __ASSEMBLY__
14 #include <linux/bitops.h>
15 #endif
16
17 #define CONFIG_STANDALONE_LOAD_ADDR     0x80300000
18
19 /*
20  * Reserve secure memory
21  * To be aligned with MMU block size
22  */
23 #define CONFIG_SYS_MEM_RESERVE_SECURE   (66 * 1024 * 1024)      /* 66MB */
24 #define SPL_TLB_SETBACK 0x1000000       /* 16MB under effective memory top */
25
26 #ifdef CONFIG_ARCH_LS2080A
27 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS           { 1, 1, 4, 4 }
28 #define SRDS_MAX_LANES  8
29 #define CONFIG_SYS_PAGE_SIZE            0x10000
30 #ifndef L1_CACHE_BYTES
31 #define L1_CACHE_SHIFT          6
32 #define L1_CACHE_BYTES          BIT(L1_CACHE_SHIFT)
33 #endif
34
35 #define CONFIG_SYS_FSL_OCRAM_BASE       0x18000000 /* initial RAM */
36 #define SYS_FSL_OCRAM_SPACE_SIZE        0x00200000 /* 2M space */
37 #define CONFIG_SYS_FSL_OCRAM_SIZE       0x00020000 /* Real size 128K */
38
39 /* DDR */
40 #define CONFIG_SYS_DDR_BLOCK1_SIZE      ((phys_size_t)2 << 30)
41 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
42
43 #define CONFIG_SYS_FSL_CCSR_GUR_LE
44 #define CONFIG_SYS_FSL_CCSR_SCFG_LE
45 #define CONFIG_SYS_FSL_ESDHC_LE
46 #define CONFIG_SYS_FSL_IFC_LE
47 #define CONFIG_SYS_FSL_PEX_LUT_LE
48
49 #define CONFIG_SYS_MEMAC_LITTLE_ENDIAN
50
51 /* Generic Interrupt Controller Definitions */
52 #define GICD_BASE                       0x06000000
53 #define GICR_BASE                       0x06100000
54
55 /* SMMU Defintions */
56 #define SMMU_BASE                       0x05000000 /* GR0 Base */
57
58 /* SFP */
59 #define CONFIG_SYS_FSL_SFP_VER_3_4
60 #define CONFIG_SYS_FSL_SFP_LE
61 #define CONFIG_SYS_FSL_SRK_LE
62
63 /* DCFG - GUR */
64 #define CONFIG_SYS_FSL_CCSR_GUR_LE
65
66 /* Cache Coherent Interconnect */
67 #define CCI_MN_BASE                     0x04000000
68 #define CCI_MN_RNF_NODEID_LIST          0x180
69 #define CCI_MN_DVM_DOMAIN_CTL           0x200
70 #define CCI_MN_DVM_DOMAIN_CTL_SET       0x210
71
72 #define CCI_HN_F_0_BASE                 (CCI_MN_BASE + 0x200000)
73 #define CCI_HN_F_1_BASE                 (CCI_MN_BASE + 0x210000)
74 #define CCN_HN_F_SAM_CTL                0x8     /* offset on base HN_F base */
75 #define CCN_HN_F_SAM_NODEID_MASK        0x7f
76 #define CCN_HN_F_SAM_NODEID_DDR0        0x4
77 #define CCN_HN_F_SAM_NODEID_DDR1        0xe
78
79 #define CCI_RN_I_0_BASE                 (CCI_MN_BASE + 0x800000)
80 #define CCI_RN_I_2_BASE                 (CCI_MN_BASE + 0x820000)
81 #define CCI_RN_I_6_BASE                 (CCI_MN_BASE + 0x860000)
82 #define CCI_RN_I_12_BASE                (CCI_MN_BASE + 0x8C0000)
83 #define CCI_RN_I_16_BASE                (CCI_MN_BASE + 0x900000)
84 #define CCI_RN_I_20_BASE                (CCI_MN_BASE + 0x940000)
85
86 #define CCI_S0_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x10)
87 #define CCI_S1_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x110)
88 #define CCI_S2_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x210)
89
90 #define CCI_AUX_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x0500)
91
92 /* TZ Protection Controller Definitions */
93 #define TZPC_BASE                               0x02200000
94 #define TZPCR0SIZE_BASE                         (TZPC_BASE)
95 #define TZPCDECPROT_0_STAT_BASE                 (TZPC_BASE + 0x800)
96 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
97 #define TZPCDECPROT_0_CLR_BASE                  (TZPC_BASE + 0x808)
98 #define TZPCDECPROT_1_STAT_BASE                 (TZPC_BASE + 0x80C)
99 #define TZPCDECPROT_1_SET_BASE                  (TZPC_BASE + 0x810)
100 #define TZPCDECPROT_1_CLR_BASE                  (TZPC_BASE + 0x814)
101 #define TZPCDECPROT_2_STAT_BASE                 (TZPC_BASE + 0x818)
102 #define TZPCDECPROT_2_SET_BASE                  (TZPC_BASE + 0x81C)
103 #define TZPCDECPROT_2_CLR_BASE                  (TZPC_BASE + 0x820)
104
105 #define DCSR_CGACRE5            0x700070914ULL
106 #define EPU_EPCMPR5             0x700060914ULL
107 #define EPU_EPCCR5              0x700060814ULL
108 #define EPU_EPSMCR5             0x700060228ULL
109 #define EPU_EPECR5              0x700060314ULL
110 #define EPU_EPCTR5              0x700060a14ULL
111 #define EPU_EPGCR               0x700060000ULL
112
113 #define CONFIG_SYS_FSL_ERRATUM_A008751
114
115 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
116
117 #elif defined(CONFIG_ARCH_LS1088A)
118 #define CONFIG_SYS_FSL_NUM_CC_PLLS              3
119 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS           { 1, 1 }
120 #define CONFIG_SYS_PAGE_SIZE            0x10000
121
122 #define SRDS_MAX_LANES  4
123 #define SRDS_BITS_PER_LANE      4
124
125 /* TZ Protection Controller Definitions */
126 #define TZPC_BASE                               0x02200000
127 #define TZPCR0SIZE_BASE                         (TZPC_BASE)
128 #define TZPCDECPROT_0_STAT_BASE                 (TZPC_BASE + 0x800)
129 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
130 #define TZPCDECPROT_0_CLR_BASE                  (TZPC_BASE + 0x808)
131 #define TZPCDECPROT_1_STAT_BASE                 (TZPC_BASE + 0x80C)
132 #define TZPCDECPROT_1_SET_BASE                  (TZPC_BASE + 0x810)
133 #define TZPCDECPROT_1_CLR_BASE                  (TZPC_BASE + 0x814)
134 #define TZPCDECPROT_2_STAT_BASE                 (TZPC_BASE + 0x818)
135 #define TZPCDECPROT_2_SET_BASE                  (TZPC_BASE + 0x81C)
136 #define TZPCDECPROT_2_CLR_BASE                  (TZPC_BASE + 0x820)
137
138 /* Generic Interrupt Controller Definitions */
139 #define GICD_BASE                       0x06000000
140 #define GICR_BASE                       0x06100000
141
142 /* SMMU Defintions */
143 #define SMMU_BASE                       0x05000000 /* GR0 Base */
144
145 /* DDR */
146 #define CONFIG_SYS_DDR_BLOCK1_SIZE      ((phys_size_t)2 << 30)
147 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
148
149 #define CONFIG_SYS_FSL_CCSR_GUR_LE
150 #define CONFIG_SYS_FSL_CCSR_SCFG_LE
151 #define CONFIG_SYS_FSL_ESDHC_LE
152 #define CONFIG_SYS_FSL_IFC_LE
153 #define CONFIG_SYS_FSL_PEX_LUT_LE
154
155 #define CONFIG_SYS_MEMAC_LITTLE_ENDIAN
156
157 /* SFP */
158 #define CONFIG_SYS_FSL_SFP_VER_3_4
159 #define CONFIG_SYS_FSL_SFP_LE
160 #define CONFIG_SYS_FSL_SRK_LE
161
162 /* DCFG - GUR */
163 #define CONFIG_SYS_FSL_CCSR_GUR_LE
164 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC   1
165 #define CONFIG_SYS_FSL_OCRAM_BASE       0x18000000 /* initial RAM */
166 #define SYS_FSL_OCRAM_SPACE_SIZE        0x00200000 /* 2M space */
167 #define CONFIG_SYS_FSL_OCRAM_SIZE       0x00020000 /* Real size 128K */
168
169 /* LX2160A/LX2162A Soc Support */
170 #elif defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A)
171 #define TZPC_BASE                               0x02200000
172 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
173 #define SRDS_MAX_LANES  8
174 #ifndef L1_CACHE_BYTES
175 #define L1_CACHE_SHIFT          6
176 #define L1_CACHE_BYTES          BIT(L1_CACHE_SHIFT)
177 #endif
178 #define CONFIG_SYS_FSL_CORES_PER_CLUSTER        2
179 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS           { 1, 1, 1, 1, 4, 4, 4, 4 }
180 #define CONFIG_SYS_FSL_NUM_CC_PLLS              4
181
182 #define CONFIG_SYS_PAGE_SIZE                    0x10000
183
184 #define CONFIG_SYS_FSL_OCRAM_BASE               0x18000000 /* initial RAM */
185 #define SYS_FSL_OCRAM_SPACE_SIZE                0x00200000 /* 2M space */
186 #define CONFIG_SYS_FSL_OCRAM_SIZE               0x00040000 /* Real size 256K */
187
188 /* DDR */
189 #define CONFIG_SYS_DDR_BLOCK1_SIZE              ((phys_size_t)2 << 30)
190 #define CONFIG_MAX_MEM_MAPPED                   CONFIG_SYS_DDR_BLOCK1_SIZE
191
192 #define CONFIG_SYS_FSL_CCSR_GUR_LE
193 #define CONFIG_SYS_FSL_CCSR_SCFG_LE
194 #define CONFIG_SYS_FSL_ESDHC_LE
195 #define CONFIG_SYS_FSL_PEX_LUT_LE
196
197 #define CONFIG_SYS_MEMAC_LITTLE_ENDIAN
198
199 /* Generic Interrupt Controller Definitions */
200 #define GICD_BASE                               0x06000000
201 #define GICR_BASE                               0x06200000
202
203 /* SMMU Definitions */
204 #define SMMU_BASE                               0x05000000 /* GR0 Base */
205
206 /* SFP */
207 #define CONFIG_SYS_FSL_SFP_VER_3_4
208 #define CONFIG_SYS_FSL_SFP_LE
209 #define CONFIG_SYS_FSL_SRK_LE
210
211 /* DCFG - GUR */
212 #define CONFIG_SYS_FSL_CCSR_GUR_LE
213
214 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
215
216 #elif defined(CONFIG_ARCH_LS1028A)
217 #define CONFIG_SYS_FSL_NUM_CC_PLLS              3
218 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS           { 1, 1 }
219 #define CONFIG_FSL_TZASC_400
220
221 /* TZ Protection Controller Definitions */
222 #define TZPC_BASE                               0x02200000
223 #define TZPCR0SIZE_BASE                         (TZPC_BASE)
224 #define TZPCDECPROT_0_STAT_BASE                 (TZPC_BASE + 0x800)
225 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
226 #define TZPCDECPROT_0_CLR_BASE                  (TZPC_BASE + 0x808)
227 #define TZPCDECPROT_1_STAT_BASE                 (TZPC_BASE + 0x80C)
228 #define TZPCDECPROT_1_SET_BASE                  (TZPC_BASE + 0x810)
229 #define TZPCDECPROT_1_CLR_BASE                  (TZPC_BASE + 0x814)
230 #define TZPCDECPROT_2_STAT_BASE                 (TZPC_BASE + 0x818)
231 #define TZPCDECPROT_2_SET_BASE                  (TZPC_BASE + 0x81C)
232 #define TZPCDECPROT_2_CLR_BASE                  (TZPC_BASE + 0x820)
233
234 #define SRDS_MAX_LANES  4
235 #define SRDS_BITS_PER_LANE      4
236
237 #define CONFIG_SYS_FSL_OCRAM_BASE               0x18000000 /* initial RAM */
238 #define SYS_FSL_OCRAM_SPACE_SIZE                0x00200000 /* 2M */
239 #define CONFIG_SYS_FSL_OCRAM_SIZE               0x00040000 /* Real size 256K */
240
241 /* Generic Interrupt Controller Definitions */
242 #define GICD_BASE                               0x06000000
243 #define GICR_BASE                               0x06040000
244
245 /* SMMU Definitions */
246 #define SMMU_BASE                               0x05000000 /* GR0 Base */
247
248 /* DDR */
249 #define CONFIG_SYS_DDR_BLOCK1_SIZE      ((phys_size_t)2 << 30)
250 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
251
252 #define CONFIG_SYS_FSL_CCSR_GUR_LE
253 #define CONFIG_SYS_FSL_CCSR_SCFG_LE
254 #define CONFIG_SYS_FSL_ESDHC_LE
255 #define CONFIG_SYS_FSL_PEX_LUT_LE
256
257 #define CONFIG_SYS_MEMAC_LITTLE_ENDIAN
258
259 /* SFP */
260 #define CONFIG_SYS_FSL_SFP_VER_3_4
261 #define CONFIG_SYS_FSL_SFP_LE
262 #define CONFIG_SYS_FSL_SRK_LE
263
264 /* SEC */
265 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
266
267 /* DCFG - GUR */
268 #define CONFIG_SYS_FSL_CCSR_GUR_LE
269
270 #elif defined(CONFIG_FSL_LSCH2)
271 #define CONFIG_SYS_FSL_OCRAM_BASE               0x10000000 /* initial RAM */
272 #define SYS_FSL_OCRAM_SPACE_SIZE                0x00200000 /* 2M space */
273 #define CONFIG_SYS_FSL_OCRAM_SIZE               0x00020000 /* Real size 128K */
274
275 #define DCSR_DCFG_SBEESR2                       0x20140534
276 #define DCSR_DCFG_MBEESR2                       0x20140544
277
278 #define CONFIG_SYS_FSL_CCSR_SCFG_BE
279 #define CONFIG_SYS_FSL_ESDHC_BE
280 #define CONFIG_SYS_FSL_WDOG_BE
281 #define CONFIG_SYS_FSL_DSPI_BE
282 #define CONFIG_SYS_FSL_CCSR_GUR_BE
283 #define CONFIG_SYS_FSL_PEX_LUT_BE
284
285 /* SoC related */
286 #ifdef CONFIG_ARCH_LS1043A
287 #define CONFIG_SYS_FMAN_V3
288 #define CONFIG_SYS_FSL_QMAN_V3
289 #define CONFIG_SYS_NUM_FMAN                     1
290 #define CONFIG_SYS_NUM_FM1_DTSEC                7
291 #define CONFIG_SYS_NUM_FM1_10GEC                1
292 #define CONFIG_SYS_DDR_BLOCK1_SIZE              ((phys_size_t)2 << 30)
293 #define CONFIG_MAX_MEM_MAPPED                   CONFIG_SYS_DDR_BLOCK1_SIZE
294
295 #define QE_MURAM_SIZE           0x6000UL
296 #define MAX_QE_RISC             1
297 #define QE_NUM_OF_SNUM          28
298
299 #define CONFIG_SYS_FSL_IFC_BE
300 #define CONFIG_SYS_FSL_SFP_VER_3_2
301 #define CONFIG_SYS_FSL_SFP_BE
302 #define CONFIG_SYS_FSL_SRK_LE
303 #define CONFIG_KEY_REVOCATION
304
305 /* SMMU Defintions */
306 #define SMMU_BASE               0x09000000
307
308 /* Generic Interrupt Controller Definitions */
309 #define GICD_BASE               0x01401000
310 #define GICC_BASE               0x01402000
311 #define GICH_BASE               0x01404000
312 #define GICV_BASE               0x01406000
313 #define GICD_SIZE               0x1000
314 #define GICC_SIZE               0x2000
315 #define GICH_SIZE               0x2000
316 #define GICV_SIZE               0x2000
317 #ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN
318 #define GICD_BASE_64K           0x01410000
319 #define GICC_BASE_64K           0x01420000
320 #define GICH_BASE_64K           0x01440000
321 #define GICV_BASE_64K           0x01460000
322 #define GICD_SIZE_64K           0x10000
323 #define GICC_SIZE_64K           0x20000
324 #define GICH_SIZE_64K           0x20000
325 #define GICV_SIZE_64K           0x20000
326 #endif
327
328 #define DCFG_CCSR_SVR           0x1ee00a4
329 #define REV1_0                  0x10
330 #define REV1_1                  0x11
331 #define GIC_ADDR_BIT            31
332 #define SCFG_GIC400_ALIGN       0x1570188
333
334 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
335
336 #elif defined(CONFIG_ARCH_LS1012A)
337 #define GICD_BASE               0x01401000
338 #define GICC_BASE               0x01402000
339 #define CONFIG_SYS_FSL_SFP_VER_3_2
340 #define CONFIG_SYS_FSL_SFP_BE
341 #define CONFIG_SYS_FSL_SRK_LE
342 #define CONFIG_KEY_REVOCATION
343 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
344 #define CONFIG_SYS_DDR_BLOCK1_SIZE      ((phys_size_t)2 << 30)
345 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
346
347 #elif defined(CONFIG_ARCH_LS1046A)
348 #define CONFIG_SYS_FMAN_V3
349 #define CONFIG_SYS_FSL_QMAN_V3
350 #define CONFIG_SYS_NUM_FMAN                     1
351 #define CONFIG_SYS_NUM_FM1_DTSEC                8
352 #define CONFIG_SYS_NUM_FM1_10GEC                2
353 #define CONFIG_SYS_DDR_BLOCK1_SIZE  ((phys_size_t)2 << 30)
354 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
355
356 #define CONFIG_SYS_FSL_IFC_BE
357 #define CONFIG_SYS_FSL_SFP_VER_3_2
358 #define CONFIG_SYS_FSL_SFP_BE
359 #define CONFIG_SYS_FSL_SRK_LE
360 #define CONFIG_KEY_REVOCATION
361
362 /* SMMU Defintions */
363 #define SMMU_BASE               0x09000000
364
365 /* Generic Interrupt Controller Definitions */
366 #define GICD_BASE               0x01410000
367 #define GICC_BASE               0x01420000
368
369 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
370 #else
371 #error SoC not defined
372 #endif
373 #endif
374
375 #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_ */