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