1PLATFORM_FLAVOR ?= mx6ulevk
2
3# Get SoC associated with the PLATFORM_FLAVOR
4mx6ul-flavorlist = \
5	mx6ulevk \
6	mx6ul9x9evk \
7	mx6ulccimx6ulsbcpro \
8	mx6ulccbv2 \
9
10mx6ull-flavorlist = \
11	mx6ullevk \
12	mx6ulzevk \
13
14mx6q-flavorlist = \
15	mx6qsabrelite \
16	mx6qsabreauto \
17	mx6qsabresd \
18	mx6qhmbedge \
19	mx6qapalis \
20
21mx6qp-flavorlist = \
22	mx6qpsabreauto \
23	mx6qpsabresd \
24
25mx6sl-flavorlist = \
26	mx6slevk
27
28mx6sll-flavorlist = \
29	mx6sllevk
30
31mx6sx-flavorlist = \
32	mx6sxsabreauto \
33	mx6sxsabresd \
34	mx6sxudooneofull \
35
36mx6d-flavorlist = \
37	mx6dhmbedge \
38	mx6dapalis \
39
40mx6dl-flavorlist = \
41	mx6dlsabreauto \
42	mx6dlsabresd \
43	mx6dlhmbedge \
44
45mx6s-flavorlist = \
46	mx6shmbedge \
47	mx6solosabresd \
48	mx6solosabreauto \
49
50mx7d-flavorlist = \
51	mx7dsabresd \
52	mx7dpico_mbl \
53	mx7dclsom \
54
55mx7s-flavorlist = \
56	mx7swarp7 \
57	mx7swarp7_mbl \
58
59mx7ulp-flavorlist = \
60	mx7ulpevk
61
62mx8mq-flavorlist = \
63	mx8mqevk
64
65mx8mm-flavorlist = \
66	mx8mmevk \
67	mx8mm_cl_iot_gate
68
69mx8mn-flavorlist = \
70	mx8mnevk
71
72mx8mp-flavorlist = \
73	mx8mpevk \
74	mx8mp_rsb3720_6g
75
76mx8qm-flavorlist = \
77	mx8qmmek \
78
79mx8qx-flavorlist = \
80	mx8qxpmek \
81
82mx8dxl-flavorlist = \
83	mx8dxlevk \
84
85mx8ulp-flavorlist = \
86	mx8ulpevk \
87
88ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6ul-flavorlist)))
89$(call force,CFG_MX6,y)
90$(call force,CFG_MX6UL,y)
91$(call force,CFG_TEE_CORE_NB_CORE,1)
92$(call force,CFG_TZC380,y)
93include core/arch/arm/cpu/cortex-a7.mk
94else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6ull-flavorlist)))
95$(call force,CFG_MX6,y)
96$(call force,CFG_MX6ULL,y)
97$(call force,CFG_TEE_CORE_NB_CORE,1)
98$(call force,CFG_TZC380,y)
99$(call force,CFG_IMX_CAAM,n)
100$(call force,CFG_NXP_CAAM,n)
101$(call force,CFG_IMX_DCP,y)
102include core/arch/arm/cpu/cortex-a7.mk
103else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6q-flavorlist)))
104$(call force,CFG_MX6,y)
105$(call force,CFG_MX6Q,y)
106$(call force,CFG_TEE_CORE_NB_CORE,4)
107$(call force,CFG_TZC380,y)
108else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6qp-flavorlist)))
109$(call force,CFG_MX6,y)
110$(call force,CFG_MX6QP,y)
111$(call force,CFG_TEE_CORE_NB_CORE,4)
112else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6d-flavorlist)))
113$(call force,CFG_MX6,y)
114$(call force,CFG_MX6D,y)
115$(call force,CFG_TEE_CORE_NB_CORE,2)
116$(call force,CFG_TZC380,y)
117else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6dl-flavorlist)))
118$(call force,CFG_MX6,y)
119$(call force,CFG_MX6DL,y)
120$(call force,CFG_TEE_CORE_NB_CORE,2)
121$(call force,CFG_TZC380,y)
122else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6s-flavorlist)))
123$(call force,CFG_MX6,y)
124$(call force,CFG_MX6S,y)
125$(call force,CFG_TEE_CORE_NB_CORE,1)
126else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6sl-flavorlist)))
127$(call force,CFG_MX6,y)
128$(call force,CFG_MX6SL,y)
129$(call force,CFG_TEE_CORE_NB_CORE,1)
130$(call force,CFG_IMX_CAAM,n)
131$(call force,CFG_NXP_CAAM,n)
132$(call force,CFG_IMX_DCP,y)
133else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6sll-flavorlist)))
134$(call force,CFG_MX6,y)
135$(call force,CFG_MX6SLL,y)
136$(call force,CFG_TEE_CORE_NB_CORE,1)
137$(call force,CFG_IMX_CAAM,n)
138$(call force,CFG_NXP_CAAM,n)
139$(call force,CFG_IMX_DCP,y)
140$(call force,CFG_NO_SMP,y)
141else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6sx-flavorlist)))
142$(call force,CFG_MX6,y)
143$(call force,CFG_MX6SX,y)
144$(call force,CFG_TEE_CORE_NB_CORE,1)
145else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx7s-flavorlist)))
146$(call force,CFG_MX7,y)
147$(call force,CFG_TEE_CORE_NB_CORE,1)
148include core/arch/arm/cpu/cortex-a7.mk
149else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx7d-flavorlist)))
150$(call force,CFG_MX7,y)
151$(call force,CFG_TEE_CORE_NB_CORE,2)
152include core/arch/arm/cpu/cortex-a7.mk
153else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx7ulp-flavorlist)))
154$(call force,CFG_MX7ULP,y)
155$(call force,CFG_TEE_CORE_NB_CORE,1)
156$(call force,CFG_TZC380,n)
157$(call force,CFG_CSU,n)
158$(call force,CFG_NXP_CAAM,n)
159include core/arch/arm/cpu/cortex-a7.mk
160else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8mq-flavorlist)))
161$(call force,CFG_MX8MQ,y)
162$(call force,CFG_MX8M,y)
163$(call force,CFG_ARM64_core,y)
164CFG_IMX_UART ?= y
165CFG_DRAM_BASE ?= 0x40000000
166CFG_TEE_CORE_NB_CORE ?= 4
167else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8mm-flavorlist)))
168$(call force,CFG_MX8MM,y)
169$(call force,CFG_MX8M,y)
170$(call force,CFG_ARM64_core,y)
171CFG_IMX_UART ?= y
172CFG_DRAM_BASE ?= 0x40000000
173CFG_TEE_CORE_NB_CORE ?= 4
174else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8mn-flavorlist)))
175$(call force,CFG_MX8MN,y)
176$(call force,CFG_MX8M,y)
177$(call force,CFG_ARM64_core,y)
178CFG_IMX_UART ?= y
179CFG_DRAM_BASE ?= 0x40000000
180CFG_TEE_CORE_NB_CORE ?= 4
181else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8mp-flavorlist)))
182$(call force,CFG_MX8MP,y)
183$(call force,CFG_MX8M,y)
184$(call force,CFG_ARM64_core,y)
185CFG_IMX_UART ?= y
186CFG_DRAM_BASE ?= 0x40000000
187CFG_TEE_CORE_NB_CORE ?= 4
188else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8qm-flavorlist)))
189$(call force,CFG_MX8QM,y)
190$(call force,CFG_ARM64_core,y)
191$(call force,CFG_IMX_SNVS,n)
192CFG_IMX_LPUART ?= y
193CFG_DRAM_BASE ?= 0x80000000
194CFG_TEE_CORE_NB_CORE ?= 6
195$(call force,CFG_IMX_OCOTP,n)
196else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8qx-flavorlist)))
197$(call force,CFG_MX8QX,y)
198$(call force,CFG_ARM64_core,y)
199$(call force,CFG_IMX_SNVS,n)
200CFG_IMX_LPUART ?= y
201CFG_DRAM_BASE ?= 0x80000000
202CFG_TEE_CORE_NB_CORE ?= 4
203$(call force,CFG_IMX_OCOTP,n)
204else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8dxl-flavorlist)))
205$(call force,CFG_MX8DXL,y)
206$(call force,CFG_ARM64_core,y)
207$(call force,CFG_IMX_SNVS,n)
208CFG_IMX_LPUART ?= y
209CFG_DRAM_BASE ?= 0x80000000
210$(call force,CFG_TEE_CORE_NB_CORE,2)
211$(call force,CFG_IMX_OCOTP,n)
212$(call force,CFG_NXP_CAAM,n)
213else ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx8ulp-flavorlist)))
214$(call force,CFG_MX8ULP,y)
215$(call force,CFG_ARM64_core,y)
216CFG_IMX_LPUART ?= y
217CFG_DRAM_BASE ?= 0x80000000
218CFG_TEE_CORE_NB_CORE ?= 2
219$(call force,CFG_NXP_SNVS,n)
220$(call force,CFG_IMX_OCOTP,n)
221else
222$(error Unsupported PLATFORM_FLAVOR "$(PLATFORM_FLAVOR)")
223endif
224
225ifneq (,$(filter $(PLATFORM_FLAVOR),mx7dsabresd))
226CFG_DDR_SIZE ?= 0x40000000
227CFG_NS_ENTRY_ADDR ?= 0x80800000
228CFG_IMX_WDOG_EXT_RESET ?= y
229endif
230
231ifneq (,$(filter $(PLATFORM_FLAVOR),mx7dclsom))
232CFG_DDR_SIZE ?= 0x40000000
233CFG_UART_BASE ?= UART1_BASE
234CFG_IMX_WDOG_EXT_RESET ?= y
235endif
236
237ifneq (,$(filter $(PLATFORM_FLAVOR),mx7dpico_mbl))
238CFG_DDR_SIZE ?= 0x20000000
239CFG_NS_ENTRY_ADDR ?= 0x87800000
240CFG_DT_ADDR ?= 0x83100000
241CFG_UART_BASE ?= UART5_BASE
242CFG_BOOT_SECONDARY_REQUEST ?= n
243CFG_EXTERNAL_DTB_OVERLAY ?= y
244CFG_IMX_WDOG_EXT_RESET ?= y
245endif
246
247ifneq (,$(filter $(PLATFORM_FLAVOR),mx7swarp7))
248CFG_DDR_SIZE ?= 0x20000000
249CFG_NS_ENTRY_ADDR ?= 0x80800000
250CFG_BOOT_SECONDARY_REQUEST ?= n
251endif
252
253ifneq (,$(filter $(PLATFORM_FLAVOR),mx7swarp7_mbl))
254CFG_DDR_SIZE ?= 0x20000000
255CFG_NS_ENTRY_ADDR ?= 0x87800000
256CFG_DT_ADDR ?= 0x83100000
257CFG_BOOT_SECONDARY_REQUEST ?= n
258CFG_EXTERNAL_DTB_OVERLAY = y
259CFG_IMX_WDOG_EXT_RESET = y
260endif
261
262ifneq (,$(filter $(PLATFORM_FLAVOR),mx7ulpevk))
263CFG_DDR_SIZE ?= 0x40000000
264CFG_NS_ENTRY_ADDR ?= 0x60800000
265CFG_UART_BASE ?= UART4_BASE
266endif
267
268ifneq (,$(filter $(PLATFORM_FLAVOR),mx6qpsabresd mx6qsabresd mx6dlsabresd \
269	mx6dlsabrelite mx6dhmbedge mx6dlhmbedge mx6solosabresd \
270	mx6dapalis mx6qapalis))
271CFG_DDR_SIZE ?= 0x40000000
272CFG_NS_ENTRY_ADDR ?= 0x12000000
273endif
274
275ifneq (,$(filter $(PLATFORM_FLAVOR),mx6qpsabreauto mx6qsabreauto \
276	mx6dlsabreauto mx6solosabreauto))
277CFG_DDR_SIZE ?= 0x80000000
278CFG_NS_ENTRY_ADDR ?= 0x12000000
279CFG_UART_BASE ?= UART4_BASE
280endif
281
282ifneq (,$(filter $(PLATFORM_FLAVOR),mx6qhmbedge))
283CFG_DDR_SIZE ?= 0x80000000
284CFG_UART_BASE ?= UART1_BASE
285endif
286
287ifneq (,$(filter $(PLATFORM_FLAVOR),mx6shmbedge))
288CFG_DDR_SIZE ?= 0x40000000
289CFG_NS_ENTRY_ADDR ?= 0x12000000
290endif
291
292ifneq (,$(filter $(PLATFORM_FLAVOR),mx6qsabrelite mx6dlsabrelite))
293CFG_DDR_SIZE ?= 0x40000000
294CFG_NS_ENTRY_ADDR ?= 0x12000000
295CFG_UART_BASE ?= UART2_BASE
296endif
297
298ifneq (,$(filter $(PLATFORM_FLAVOR),mx6slevk))
299CFG_NS_ENTRY_ADDR ?= 0x80800000
300CFG_DDR_SIZE ?= 0x40000000
301endif
302
303ifneq (,$(filter $(PLATFORM_FLAVOR),mx6sllevk))
304CFG_NS_ENTRY_ADDR ?= 0x80800000
305CFG_DDR_SIZE ?= 0x80000000
306endif
307
308ifneq (,$(filter $(PLATFORM_FLAVOR),mx6sxsabreauto))
309CFG_DDR_SIZE ?= 0x80000000
310CFG_NS_ENTRY_ADDR ?= 0x80800000
311endif
312
313ifneq (,$(filter $(PLATFORM_FLAVOR),mx6sxsabresd))
314CFG_DDR_SIZE ?= 0x40000000
315CFG_NS_ENTRY_ADDR ?= 0x80800000
316endif
317
318ifeq ($(PLATFORM_FLAVOR), mx6sxudooneofull)
319CFG_DDR_SIZE ?= 0x40000000
320CFG_UART_BASE ?= UART1_BASE
321endif
322
323ifneq (,$(filter $(PLATFORM_FLAVOR),mx6ulevk mx6ullevk mx6ulzevk))
324CFG_DDR_SIZE ?= 0x20000000
325CFG_NS_ENTRY_ADDR ?= 0x80800000
326endif
327
328ifneq (,$(filter $(PLATFORM_FLAVOR),mx6ulccimx6ulsbcpro))
329CFG_DDR_SIZE ?= 0x10000000
330CFG_NS_ENTRY_ADDR ?= 0x80800000
331CFG_UART_BASE ?= UART5_BASE
332endif
333
334ifneq (,$(filter $(PLATFORM_FLAVOR),mx6ul9x9evk))
335CFG_DDR_SIZE ?= 0x10000000
336CFG_NS_ENTRY_ADDR ?= 0x80800000
337endif
338
339ifneq (,$(filter $(PLATFORM_FLAVOR),mx6ulccbv2))
340CFG_DDR_SIZE ?= 0x10000000
341CFG_UART_BASE ?= UART7_BASE
342endif
343
344ifneq (,$(filter $(PLATFORM_FLAVOR),mx8mqevk))
345CFG_DDR_SIZE ?= 0xc0000000
346CFG_UART_BASE ?= UART1_BASE
347endif
348
349ifneq (,$(filter $(PLATFORM_FLAVOR),mx8mmevk))
350CFG_DDR_SIZE ?= 0x80000000
351CFG_UART_BASE ?= UART2_BASE
352endif
353
354ifneq (,$(filter $(PLATFORM_FLAVOR),mx8mm_cl_iot_gate))
355CFG_DDR_SIZE ?= 0x40000000
356CFG_UART_BASE ?= UART3_BASE
357CFG_NSEC_DDR_1_BASE ?= 0x80000000UL
358CFG_NSEC_DDR_1_SIZE ?= 0x40000000UL
359endif
360
361ifneq (,$(filter $(PLATFORM_FLAVOR),mx8mnevk))
362CFG_DDR_SIZE ?= 0x80000000
363CFG_UART_BASE ?= UART2_BASE
364endif
365
366ifneq (,$(filter $(PLATFORM_FLAVOR),mx8mpevk))
367CFG_DDR_SIZE ?= UL(0x180000000)
368CFG_UART_BASE ?= UART2_BASE
369$(call force,CFG_CORE_LARGE_PHYS_ADDR,y)
370$(call force,CFG_CORE_ARM64_PA_BITS,36)
371endif
372
373ifneq (,$(filter $(PLATFORM_FLAVOR),mx8mp_rsb3720_6g))
374CFG_DDR_SIZE ?= UL(0x180000000)
375CFG_UART_BASE ?= UART3_BASE
376CFG_TZDRAM_START ?= 0x56000000
377$(call force,CFG_CORE_LARGE_PHYS_ADDR,y)
378$(call force,CFG_CORE_ARM64_PA_BITS,36)
379endif
380
381ifneq (,$(filter $(PLATFORM_FLAVOR),mx8qxpmek mx8qmmek))
382CFG_DDR_SIZE ?= 0x80000000
383CFG_UART_BASE ?= UART0_BASE
384CFG_NSEC_DDR_1_BASE ?= 0x880000000UL
385CFG_NSEC_DDR_1_SIZE  ?= 0x380000000UL
386CFG_CORE_ARM64_PA_BITS ?= 40
387endif
388
389ifneq (,$(filter $(PLATFORM_FLAVOR),mx8dxlevk))
390CFG_DDR_SIZE ?= 0x40000000
391CFG_UART_BASE ?= UART0_BASE
392endif
393
394ifneq (,$(filter $(PLATFORM_FLAVOR),mx8ulpevk))
395CFG_DDR_SIZE ?= 0x80000000
396CFG_UART_BASE ?= UART5_BASE
397endif
398
399# i.MX6 Solo/SL/SoloX/DualLite/Dual/Quad specific config
400ifeq ($(filter y, $(CFG_MX6QP) $(CFG_MX6Q) $(CFG_MX6D) $(CFG_MX6DL) $(CFG_MX6S) \
401	$(CFG_MX6SL) $(CFG_MX6SLL) $(CFG_MX6SX)), y)
402include core/arch/arm/cpu/cortex-a9.mk
403
404$(call force,CFG_PL310,y)
405
406CFG_PL310_LOCKED ?= y
407CFG_ENABLE_SCTLR_RR ?= y
408CFG_SCU ?= y
409endif
410
411ifeq ($(filter y, $(CFG_MX6QP) $(CFG_MX6Q) $(CFG_MX6D) $(CFG_MX6DL) $(CFG_MX6S)), y)
412CFG_DRAM_BASE ?= 0x10000000
413endif
414
415ifneq (,$(filter y, $(CFG_MX6UL) $(CFG_MX6ULL) $(CFG_MX6SL) $(CFG_MX6SLL) \
416	$(CFG_MX6SX)))
417CFG_DRAM_BASE ?= 0x80000000
418endif
419
420ifeq ($(filter y, $(CFG_MX7)), y)
421CFG_INIT_CNTVOFF ?= y
422CFG_DRAM_BASE ?= 0x80000000
423endif
424
425ifeq ($(filter y, $(CFG_MX7ULP)), y)
426CFG_INIT_CNTVOFF ?= y
427CFG_DRAM_BASE ?= UL(0x60000000)
428$(call force,CFG_IMX_LPUART,y)
429$(call force,CFG_BOOT_SECONDARY_REQUEST,n)
430endif
431
432ifneq (,$(filter y, $(CFG_MX6) $(CFG_MX7) $(CFG_MX7ULP)))
433$(call force,CFG_GIC,y)
434
435CFG_BOOT_SECONDARY_REQUEST ?= y
436CFG_DT ?= y
437CFG_DTB_MAX_SIZE ?= 0x20000
438CFG_PAGEABLE_ADDR ?= 0
439CFG_PSCI_ARM32 ?= y
440CFG_SECURE_TIME_SOURCE_REE ?= y
441CFG_UART_BASE ?= UART1_BASE
442endif
443
444ifneq (,$(filter y, $(CFG_MX6) $(CFG_MX7) $(CFG_MX8MM)))
445$(call force,CFG_IMX_UART,y)
446ifeq ($(CFG_RPMB_FS),y)
447CFG_IMX_SNVS ?= y
448endif
449endif
450
451ifneq (,$(filter y, $(CFG_MX6) $(CFG_MX7)))
452CFG_CSU ?= y
453endif
454
455ifeq ($(filter y, $(CFG_PSCI_ARM32)), y)
456CFG_HWSUPP_MEM_PERM_WXN = n
457CFG_IMX_WDOG ?= y
458endif
459
460ifeq ($(CFG_ARM64_core),y)
461# arm-v8 platforms
462include core/arch/arm/cpu/cortex-armv8-0.mk
463$(call force,CFG_ARM_GICV3,y)
464$(call force,CFG_GIC,y)
465$(call force,CFG_WITH_LPAE,y)
466$(call force,CFG_WITH_ARM_TRUSTED_FW,y)
467$(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,y)
468
469CFG_CRYPTO_WITH_CE ?= y
470
471supported-ta-targets = ta_arm64
472endif
473
474CFG_TZDRAM_START ?= ($(CFG_DRAM_BASE) - 0x02000000 + $(CFG_DDR_SIZE))
475CFG_TZDRAM_SIZE ?= 0x01e00000
476CFG_SHMEM_START ?= ($(CFG_TZDRAM_START) + $(CFG_TZDRAM_SIZE))
477CFG_SHMEM_SIZE ?= 0x00200000
478
479CFG_NSEC_DDR_0_BASE ?= $(CFG_DRAM_BASE)
480CFG_NSEC_DDR_0_SIZE ?= ($(CFG_DDR_SIZE) - 0x02000000)
481
482CFG_CRYPTO_SIZE_OPTIMIZATION ?= n
483CFG_MMAP_REGIONS ?= 24
484
485# SE05X and OCOTP both implement tee_otp_get_die_id()
486ifeq ($(CFG_NXP_SE05X),y)
487$(call force,CFG_IMX_OCOTP,n)
488endif
489CFG_IMX_OCOTP ?= y
490
491# Almost all platforms include CAAM HW Modules, except the
492# ones forced to be disabled
493CFG_NXP_CAAM ?= n
494
495ifeq ($(CFG_NXP_CAAM),y)
496ifeq ($(filter y, $(CFG_MX8QM) $(CFG_MX8QX) $(CFG_MX8DXL)), y)
497CFG_IMX_SC ?= y
498endif
499
500# As NXP CAAM Driver is enabled, disable the small local CAAM driver
501# used just to release Job Rings to Non-Secure world
502$(call force,CFG_IMX_CAAM,n)
503else
504
505ifneq (,$(filter y, $(CFG_MX6) $(CFG_MX7) $(CFG_MX7ULP)))
506CFG_IMX_CAAM ?= y
507endif
508endif
509
510# Cryptographic configuration
511include core/arch/arm/plat-imx/crypto_conf.mk
512