Convert CONFIG_SYS_FSL_CORES_PER_CLUSTER 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 /* Generic Interrupt Controller Definitions */
44 #define GICD_BASE                       0x06000000
45 #define GICR_BASE                       0x06100000
46
47 /* SMMU Defintions */
48 #define SMMU_BASE                       0x05000000 /* GR0 Base */
49
50 /* Cache Coherent Interconnect */
51 #define CCI_MN_BASE                     0x04000000
52 #define CCI_MN_RNF_NODEID_LIST          0x180
53 #define CCI_MN_DVM_DOMAIN_CTL           0x200
54 #define CCI_MN_DVM_DOMAIN_CTL_SET       0x210
55
56 #define CCI_HN_F_0_BASE                 (CCI_MN_BASE + 0x200000)
57 #define CCI_HN_F_1_BASE                 (CCI_MN_BASE + 0x210000)
58 #define CCN_HN_F_SAM_CTL                0x8     /* offset on base HN_F base */
59 #define CCN_HN_F_SAM_NODEID_MASK        0x7f
60 #define CCN_HN_F_SAM_NODEID_DDR0        0x4
61 #define CCN_HN_F_SAM_NODEID_DDR1        0xe
62
63 #define CCI_RN_I_0_BASE                 (CCI_MN_BASE + 0x800000)
64 #define CCI_RN_I_2_BASE                 (CCI_MN_BASE + 0x820000)
65 #define CCI_RN_I_6_BASE                 (CCI_MN_BASE + 0x860000)
66 #define CCI_RN_I_12_BASE                (CCI_MN_BASE + 0x8C0000)
67 #define CCI_RN_I_16_BASE                (CCI_MN_BASE + 0x900000)
68 #define CCI_RN_I_20_BASE                (CCI_MN_BASE + 0x940000)
69
70 #define CCI_S0_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x10)
71 #define CCI_S1_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x110)
72 #define CCI_S2_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x210)
73
74 #define CCI_AUX_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x0500)
75
76 /* TZ Protection Controller Definitions */
77 #define TZPC_BASE                               0x02200000
78 #define TZPCR0SIZE_BASE                         (TZPC_BASE)
79 #define TZPCDECPROT_0_STAT_BASE                 (TZPC_BASE + 0x800)
80 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
81 #define TZPCDECPROT_0_CLR_BASE                  (TZPC_BASE + 0x808)
82 #define TZPCDECPROT_1_STAT_BASE                 (TZPC_BASE + 0x80C)
83 #define TZPCDECPROT_1_SET_BASE                  (TZPC_BASE + 0x810)
84 #define TZPCDECPROT_1_CLR_BASE                  (TZPC_BASE + 0x814)
85 #define TZPCDECPROT_2_STAT_BASE                 (TZPC_BASE + 0x818)
86 #define TZPCDECPROT_2_SET_BASE                  (TZPC_BASE + 0x81C)
87 #define TZPCDECPROT_2_CLR_BASE                  (TZPC_BASE + 0x820)
88
89 #define DCSR_CGACRE5            0x700070914ULL
90 #define EPU_EPCMPR5             0x700060914ULL
91 #define EPU_EPCCR5              0x700060814ULL
92 #define EPU_EPSMCR5             0x700060228ULL
93 #define EPU_EPECR5              0x700060314ULL
94 #define EPU_EPCTR5              0x700060a14ULL
95 #define EPU_EPGCR               0x700060000ULL
96
97 #define CONFIG_SYS_FSL_ERRATUM_A008751
98
99 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
100
101 #elif defined(CONFIG_ARCH_LS1088A)
102 #define CONFIG_SYS_FSL_NUM_CC_PLLS              3
103 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS           { 1, 1 }
104 #define CONFIG_SYS_PAGE_SIZE            0x10000
105
106 #define SRDS_MAX_LANES  4
107 #define SRDS_BITS_PER_LANE      4
108
109 /* TZ Protection Controller Definitions */
110 #define TZPC_BASE                               0x02200000
111 #define TZPCR0SIZE_BASE                         (TZPC_BASE)
112 #define TZPCDECPROT_0_STAT_BASE                 (TZPC_BASE + 0x800)
113 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
114 #define TZPCDECPROT_0_CLR_BASE                  (TZPC_BASE + 0x808)
115 #define TZPCDECPROT_1_STAT_BASE                 (TZPC_BASE + 0x80C)
116 #define TZPCDECPROT_1_SET_BASE                  (TZPC_BASE + 0x810)
117 #define TZPCDECPROT_1_CLR_BASE                  (TZPC_BASE + 0x814)
118 #define TZPCDECPROT_2_STAT_BASE                 (TZPC_BASE + 0x818)
119 #define TZPCDECPROT_2_SET_BASE                  (TZPC_BASE + 0x81C)
120 #define TZPCDECPROT_2_CLR_BASE                  (TZPC_BASE + 0x820)
121
122 /* Generic Interrupt Controller Definitions */
123 #define GICD_BASE                       0x06000000
124 #define GICR_BASE                       0x06100000
125
126 /* SMMU Defintions */
127 #define SMMU_BASE                       0x05000000 /* GR0 Base */
128
129 /* DDR */
130 #define CONFIG_SYS_DDR_BLOCK1_SIZE      ((phys_size_t)2 << 30)
131 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
132
133 /* DCFG - GUR */
134 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC   1
135 #define CONFIG_SYS_FSL_OCRAM_BASE       0x18000000 /* initial RAM */
136 #define SYS_FSL_OCRAM_SPACE_SIZE        0x00200000 /* 2M space */
137 #define CONFIG_SYS_FSL_OCRAM_SIZE       0x00020000 /* Real size 128K */
138
139 /* LX2160A/LX2162A Soc Support */
140 #elif defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A)
141 #define TZPC_BASE                               0x02200000
142 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
143 #define SRDS_MAX_LANES  8
144 #ifndef L1_CACHE_BYTES
145 #define L1_CACHE_SHIFT          6
146 #define L1_CACHE_BYTES          BIT(L1_CACHE_SHIFT)
147 #endif
148 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS           { 1, 1, 1, 1, 4, 4, 4, 4 }
149 #define CONFIG_SYS_FSL_NUM_CC_PLLS              4
150
151 #define CONFIG_SYS_PAGE_SIZE                    0x10000
152
153 #define CONFIG_SYS_FSL_OCRAM_BASE               0x18000000 /* initial RAM */
154 #define SYS_FSL_OCRAM_SPACE_SIZE                0x00200000 /* 2M space */
155 #define CONFIG_SYS_FSL_OCRAM_SIZE               0x00040000 /* Real size 256K */
156
157 /* DDR */
158 #define CONFIG_SYS_DDR_BLOCK1_SIZE              ((phys_size_t)2 << 30)
159 #define CONFIG_MAX_MEM_MAPPED                   CONFIG_SYS_DDR_BLOCK1_SIZE
160
161 /* Generic Interrupt Controller Definitions */
162 #define GICD_BASE                               0x06000000
163 #define GICR_BASE                               0x06200000
164
165 /* SMMU Definitions */
166 #define SMMU_BASE                               0x05000000 /* GR0 Base */
167
168 /* DCFG - GUR */
169
170 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
171
172 #elif defined(CONFIG_ARCH_LS1028A)
173 #define CONFIG_SYS_FSL_NUM_CC_PLLS              3
174 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS           { 1, 1 }
175 #define CONFIG_FSL_TZASC_400
176
177 /* TZ Protection Controller Definitions */
178 #define TZPC_BASE                               0x02200000
179 #define TZPCR0SIZE_BASE                         (TZPC_BASE)
180 #define TZPCDECPROT_0_STAT_BASE                 (TZPC_BASE + 0x800)
181 #define TZPCDECPROT_0_SET_BASE                  (TZPC_BASE + 0x804)
182 #define TZPCDECPROT_0_CLR_BASE                  (TZPC_BASE + 0x808)
183 #define TZPCDECPROT_1_STAT_BASE                 (TZPC_BASE + 0x80C)
184 #define TZPCDECPROT_1_SET_BASE                  (TZPC_BASE + 0x810)
185 #define TZPCDECPROT_1_CLR_BASE                  (TZPC_BASE + 0x814)
186 #define TZPCDECPROT_2_STAT_BASE                 (TZPC_BASE + 0x818)
187 #define TZPCDECPROT_2_SET_BASE                  (TZPC_BASE + 0x81C)
188 #define TZPCDECPROT_2_CLR_BASE                  (TZPC_BASE + 0x820)
189
190 #define SRDS_MAX_LANES  4
191 #define SRDS_BITS_PER_LANE      4
192
193 #define CONFIG_SYS_FSL_OCRAM_BASE               0x18000000 /* initial RAM */
194 #define SYS_FSL_OCRAM_SPACE_SIZE                0x00200000 /* 2M */
195 #define CONFIG_SYS_FSL_OCRAM_SIZE               0x00040000 /* Real size 256K */
196
197 /* Generic Interrupt Controller Definitions */
198 #define GICD_BASE                               0x06000000
199 #define GICR_BASE                               0x06040000
200
201 /* SMMU Definitions */
202 #define SMMU_BASE                               0x05000000 /* GR0 Base */
203
204 /* DDR */
205 #define CONFIG_SYS_DDR_BLOCK1_SIZE      ((phys_size_t)2 << 30)
206 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
207
208 /* SEC */
209 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
210
211 /* DCFG - GUR */
212
213 #elif defined(CONFIG_FSL_LSCH2)
214 #define CONFIG_SYS_FSL_OCRAM_BASE               0x10000000 /* initial RAM */
215 #define SYS_FSL_OCRAM_SPACE_SIZE                0x00200000 /* 2M space */
216 #define CONFIG_SYS_FSL_OCRAM_SIZE               0x00020000 /* Real size 128K */
217
218 #define DCSR_DCFG_SBEESR2                       0x20140534
219 #define DCSR_DCFG_MBEESR2                       0x20140544
220
221 #define CONFIG_SYS_FSL_WDOG_BE
222 #define CONFIG_SYS_FSL_DSPI_BE
223
224 /* SoC related */
225 #ifdef CONFIG_ARCH_LS1043A
226 #define CONFIG_SYS_FSL_QMAN_V3
227 #define CONFIG_SYS_NUM_FMAN                     1
228 #define CONFIG_SYS_NUM_FM1_DTSEC                7
229 #define CONFIG_SYS_NUM_FM1_10GEC                1
230 #define CONFIG_SYS_DDR_BLOCK1_SIZE              ((phys_size_t)2 << 30)
231 #define CONFIG_MAX_MEM_MAPPED                   CONFIG_SYS_DDR_BLOCK1_SIZE
232
233 #define QE_MURAM_SIZE           0x6000UL
234 #define MAX_QE_RISC             1
235 #define QE_NUM_OF_SNUM          28
236
237 /* SMMU Defintions */
238 #define SMMU_BASE               0x09000000
239
240 /* Generic Interrupt Controller Definitions */
241 #define GICD_BASE               0x01401000
242 #define GICC_BASE               0x01402000
243 #define GICH_BASE               0x01404000
244 #define GICV_BASE               0x01406000
245 #define GICD_SIZE               0x1000
246 #define GICC_SIZE               0x2000
247 #define GICH_SIZE               0x2000
248 #define GICV_SIZE               0x2000
249 #ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN
250 #define GICD_BASE_64K           0x01410000
251 #define GICC_BASE_64K           0x01420000
252 #define GICH_BASE_64K           0x01440000
253 #define GICV_BASE_64K           0x01460000
254 #define GICD_SIZE_64K           0x10000
255 #define GICC_SIZE_64K           0x20000
256 #define GICH_SIZE_64K           0x20000
257 #define GICV_SIZE_64K           0x20000
258 #endif
259
260 #define DCFG_CCSR_SVR           0x1ee00a4
261 #define REV1_0                  0x10
262 #define REV1_1                  0x11
263 #define GIC_ADDR_BIT            31
264 #define SCFG_GIC400_ALIGN       0x1570188
265
266 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
267
268 #elif defined(CONFIG_ARCH_LS1012A)
269 #define GICD_BASE               0x01401000
270 #define GICC_BASE               0x01402000
271 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
272 #define CONFIG_SYS_DDR_BLOCK1_SIZE      ((phys_size_t)2 << 30)
273 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
274
275 #elif defined(CONFIG_ARCH_LS1046A)
276 #define CONFIG_SYS_FSL_QMAN_V3
277 #define CONFIG_SYS_NUM_FMAN                     1
278 #define CONFIG_SYS_NUM_FM1_DTSEC                8
279 #define CONFIG_SYS_NUM_FM1_10GEC                2
280 #define CONFIG_SYS_DDR_BLOCK1_SIZE  ((phys_size_t)2 << 30)
281 #define CONFIG_MAX_MEM_MAPPED           CONFIG_SYS_DDR_BLOCK1_SIZE
282
283 /* SMMU Defintions */
284 #define SMMU_BASE               0x09000000
285
286 /* Generic Interrupt Controller Definitions */
287 #define GICD_BASE               0x01410000
288 #define GICC_BASE               0x01420000
289
290 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC           1
291 #else
292 #error SoC not defined
293 #endif
294 #endif
295
296 #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_ */