-
Notifications
You must be signed in to change notification settings - Fork 51
/
config.mk
executable file
·454 lines (360 loc) · 10.8 KB
/
config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
#
# global config options
#
# ----------------------------------------------------------------------------
# config options
# ----------------------------------------------------------------------------
include $(ROOT_PATH)/chip.mk
# redefine int32_t to signed int, but not signed long
__CONFIG_LIBC_REDEFINE_GCC_INT32_TYPE ?= y
# support printf float variables
__CONFIG_LIBC_PRINTF_FLOAT ?= y
# support scanf float variables
__CONFIG_LIBC_SCANF_FLOAT ?= y
# wrap standard input/output/error functions
__CONFIG_LIBC_WRAP_STDIO ?= y
# heap managed by stdlib
__CONFIG_MALLOC_USE_STDLIB ?= y
# trace heap memory usage and error when using malloc, free, etc.
__CONFIG_MALLOC_TRACE ?= n
# trace psram heap memory usage and error when using psram_malloc, psram_free, etc.
__CONFIG_PSRAM_MALLOC_TRACE ?= n
# os
__CONFIG_OS_FREERTOS ?= y
ifeq ($(__CONFIG_OS_FREERTOS), y)
# - 80203: FreeRTOS 8.2.3
# - 100201: FreeRTOS 10.2.1
__CONFIG_OS_FREERTOS_VER ?= 80203
endif
# lwIP
# - y: lwIP 1.4.1, support IPv4 stack only
# - n: lwIP 2.x.x, support dual IPv4/IPv6 stack
__CONFIG_LWIP_V1 ?= y
# mbed TLS
# - 0x02020000: mbed TLS 2.2.0
# - 0x02100000: mbed TLS 2.16.0
__CONFIG_MBEDTLS_VER ?= 0x02100000
# mbuf implementation mode
# - mode 0: continuous memory allocated from heap
# - mode 1: continuous memory allocated from lwip pbuf
__CONFIG_MBUF_IMPL_MODE ?= 0
# wlan
__CONFIG_WLAN ?= y
# wlan station mode
__CONFIG_WLAN_STA ?= y
# wlan hostap mode
__CONFIG_WLAN_AP ?= y
# wlan monitor mode
__CONFIG_WLAN_MONITOR ?= y
# wps of wlan station mode
__CONFIG_WLAN_STA_WPS ?= n
# wlan ETF test
__CONFIG_ETF ?= n
# wlan ETF test using ETF command line interface
# - y: using ETF command line interface
# - n: using ETF GUI exec on PC
__CONFIG_ETF_CLI ?= n
# Wi-Fi Certification of WFA
__CONFIG_WIFI_CERTIFIED ?= y
# XIP
__CONFIG_XIP ?= y
# psram
__CONFIG_PSRAM ?= n
ifeq ($(__CONFIG_PSRAM), y)
__CONFIG_PSRAM_CHIP_OPI32 ?= y
else
__CONFIG_PSRAM_CHIP_OPI32 ?= n
endif
__CONFIG_PSRAM_CHIP_OPI64 ?= n
__CONFIG_PSRAM_CHIP_SQPI ?= n
# enable section attribute macros "__xip_xxx", eg. __xip_text
ifeq ($(__CONFIG_XIP), y)
__CONFIG_SECTION_ATTRIBUTE_XIP ?= y
else
__CONFIG_SECTION_ATTRIBUTE_XIP ?= n
endif
# enable section attribute macros "__nonxip_xxx", eg. __nonxip_text
ifeq ($(__CONFIG_XIP), y)
__CONFIG_SECTION_ATTRIBUTE_NONXIP ?= y
else
__CONFIG_SECTION_ATTRIBUTE_NONXIP ?= n
endif
# enable section attribute macros "__sram_xxx", eg. __sram_text
__CONFIG_SECTION_ATTRIBUTE_SRAM ?= y
# enable section attribute macros "__psram_xxx", eg. __psram_text
ifeq ($(__CONFIG_PSRAM), y)
__CONFIG_SECTION_ATTRIBUTE_PSRAM ?= y
else
__CONFIG_SECTION_ATTRIBUTE_PSRAM ?= n
endif
# rom
ifeq ($(__CONFIG_CHIP_ARCH_VER), 1)
__CONFIG_ROM ?= n
else
__CONFIG_ROM ?= y
endif
# rom of FreeRTOS
ifeq ($(__CONFIG_ROM), y)
ifeq ($(__CONFIG_OS_FREERTOS_VER), 80203)
__CONFIG_ROM_FREERTOS ?= y
else
__CONFIG_ROM_FREERTOS ?= n
endif
else
__CONFIG_ROM_FREERTOS ?= n
endif
# rom of xz
ifeq ($(__CONFIG_ROM), y)
__CONFIG_ROM_XZ ?= y
else
__CONFIG_ROM_XZ ?= n
endif
# enable/disable bootloader, y to enable bootloader and disable some features
__CONFIG_BOOTLOADER ?= n
# secure boot
__CONFIG_SECURE_BOOT ?= n
# power manager
__CONFIG_PM ?= y
# OTA
__CONFIG_OTA ?= n
# ota policy, choose ota mode
# - 0x00: ping-pong mode
# - 0x01: image compression mode
__CONFIG_OTA_POLICY ?= 0x00
# bin compression
__CONFIG_BIN_COMPRESS ?= n
__CONFIG_BIN_COMPRESS_APP ?= y
__CONFIG_BIN_COMPRESS_APP_PSRAM ?= y
# xplayer
__CONFIG_XPLAYER ?= n
# JPEG
__CONFIG_JPEG ?= n
__CONFIG_JPEG_SHARE_64K ?= n
# mix sram/psram heap manager
ifeq ($(__CONFIG_MALLOC_USE_STDLIB), y)
ifeq ($(__CONFIG_PSRAM), y)
ifneq ($(__CONFIG_MALLOC_TRACE), y)
__CONFIG_MIX_HEAP_MANAGE ?= n
endif
endif
endif
__CONFIG_MIX_HEAP_MANAGE ?= n
# config dma_malloc using psram
# unit KB, 0 is disable
ifeq ($(__CONFIG_PSRAM), y)
ifeq ($(__CONFIG_JPEG), y)
__CONFIG_DMAHEAP_PSRAM_SIZE ?= 768
else
__CONFIG_DMAHEAP_PSRAM_SIZE ?= 256
endif
else
__CONFIG_DMAHEAP_PSRAM_SIZE := 0
endif
# icache and dcache configure, sort by size sum of icache+dcache
# - 0x00: icache 0 KB, dcache 0 KB
# - 0x01: icache 0 KB, dcache 8 KB
# - 0x10: icache 8 KB, dcache 0 KB
# - 0x02: icache 0 KB, dcache 16 KB
# - 0x11: icache 8 KB, dcache 8 KB
# - 0x20: icache 16 KB, dcache 0 KB
# - 0x12: icache 8 KB, dcache 16 KB
# - 0x21: icache 16 KB, dcache 8 KB
# - 0x04: icache 0 KB, dcache 32 KB
# - 0x22: icache 16 KB, dcache 16 KB
# - 0x40: icache 32 KB, dcache 0 KB
# - 0x14: icache 8 KB, dcache 32 KB
# - 0x41: icache 32 KB, dcache 8 KB
ifeq ($(__CONFIG_CHIP_TYPE), xr872)
ifeq ($(__CONFIG_PSRAM), y)
__CONFIG_CACHE_POLICY ?= 0x41
else
__CONFIG_CACHE_POLICY ?= 0x02
endif
else ifeq ($(__CONFIG_CHIP_TYPE), xr808)
__CONFIG_CACHE_POLICY ?= 0x04
endif
# heap usage mode for different module
# - mode 0: heap from sram
# - mode 1: heap from psram
ifeq ($(__CONFIG_PSRAM), y)
__CONFIG_MBUF_HEAP_MODE ?= 0
__CONFIG_MBEDTLS_HEAP_MODE ?= 1
__CONFIG_HTTPC_HEAP_MODE ?= 1
__CONFIG_MQTT_HEAP_MODE ?= 1
__CONFIG_NOPOLL_HEAP_MODE ?= 1
__CONFIG_WPA_HEAP_MODE ?= 1
__CONFIG_UMAC_HEAP_MODE ?= 0
__CONFIG_LMAC_HEAP_MODE ?= 0
__CONFIG_CEDARX_HEAP_MODE ?= 1
__CONFIG_AUDIO_HEAP_MODE ?= 1
__CONFIG_CODEC_HEAP_MODE ?= 1
else
__CONFIG_MBUF_HEAP_MODE := 0
__CONFIG_MBEDTLS_HEAP_MODE := 0
__CONFIG_HTTPC_HEAP_MODE := 0
__CONFIG_MQTT_HEAP_MODE := 0
__CONFIG_NOPOLL_HEAP_MODE := 0
__CONFIG_WPA_HEAP_MODE := 0
__CONFIG_UMAC_HEAP_MODE := 0
__CONFIG_LMAC_HEAP_MODE := 0
__CONFIG_CEDARX_HEAP_MODE := 0
__CONFIG_AUDIO_HEAP_MODE := 0
__CONFIG_CODEC_HEAP_MODE := 0
endif
ifeq ($(__CONFIG_PSRAM), y)
__CONFIG_PSRAM_ALL_CACHEABLE ?= y
endif
# support setting cpu clock to 349MHz
__CONFIG_CPU_SUPPORT_349MHZ ?= n
# ----------------------------------------------------------------------------
# config symbols
# ----------------------------------------------------------------------------
CONFIG_SYMBOLS += -D__CONFIG_HOSC_TYPE=$(__CONFIG_HOSC_TYPE)
ifeq ($(__CONFIG_LIBC_REDEFINE_GCC_INT32_TYPE), y)
CONFIG_SYMBOLS += -D__CONFIG_LIBC_REDEFINE_GCC_INT32_TYPE
endif
ifeq ($(__CONFIG_LIBC_PRINTF_FLOAT), y)
CONFIG_SYMBOLS += -D__CONFIG_LIBC_PRINTF_FLOAT
endif
ifeq ($(__CONFIG_LIBC_SCANF_FLOAT), y)
CONFIG_SYMBOLS += -D__CONFIG_LIBC_SCANF_FLOAT
endif
ifeq ($(__CONFIG_LIBC_WRAP_STDIO), y)
CONFIG_SYMBOLS += -D__CONFIG_LIBC_WRAP_STDIO
endif
ifeq ($(__CONFIG_MALLOC_USE_STDLIB), y)
CONFIG_SYMBOLS += -D__CONFIG_MALLOC_USE_STDLIB
endif
ifeq ($(__CONFIG_MALLOC_TRACE), y)
CONFIG_SYMBOLS += -D__CONFIG_MALLOC_TRACE
endif
ifeq ($(__CONFIG_PSRAM_MALLOC_TRACE), y)
CONFIG_SYMBOLS += -D__CONFIG_PSRAM_MALLOC_TRACE
endif
ifeq ($(__CONFIG_OS_FREERTOS), y)
CONFIG_SYMBOLS += -D__CONFIG_OS_FREERTOS
CONFIG_SYMBOLS += -D__CONFIG_OS_FREERTOS_VER=$(__CONFIG_OS_FREERTOS_VER)
endif
ifeq ($(__CONFIG_LWIP_V1), y)
CONFIG_SYMBOLS += -D__CONFIG_LWIP_V1
endif
CONFIG_SYMBOLS += -D__CONFIG_MBEDTLS_VER=$(__CONFIG_MBEDTLS_VER)
CONFIG_SYMBOLS += -D__CONFIG_MBUF_IMPL_MODE=$(__CONFIG_MBUF_IMPL_MODE)
ifeq ($(__CONFIG_WLAN), y)
CONFIG_SYMBOLS += -D__CONFIG_WLAN
else
__CONFIG_WLAN_STA := n
__CONFIG_WLAN_AP := n
__CONFIG_WLAN_MONITOR := n
__CONFIG_WLAN_STA_WPS := n
endif
ifeq ($(__CONFIG_WLAN_STA), y)
CONFIG_SYMBOLS += -D__CONFIG_WLAN_STA
endif
ifeq ($(__CONFIG_WLAN_AP), y)
CONFIG_SYMBOLS += -D__CONFIG_WLAN_AP
endif
ifeq ($(__CONFIG_WLAN_MONITOR), y)
CONFIG_SYMBOLS += -D__CONFIG_WLAN_MONITOR
endif
ifeq ($(__CONFIG_WLAN_STA_WPS), y)
CONFIG_SYMBOLS += -D__CONFIG_WLAN_STA_WPS
endif
ifeq ($(__CONFIG_ETF), y)
CONFIG_SYMBOLS += -D__CONFIG_ETF
endif
ifeq ($(__CONFIG_ETF_CLI), y)
CONFIG_SYMBOLS += -D__CONFIG_ETF_CLI
endif
ifeq ($(__CONFIG_WIFI_CERTIFIED), y)
CONFIG_SYMBOLS += -D__CONFIG_WIFI_CERTIFIED
endif
ifeq ($(__CONFIG_XIP), y)
CONFIG_SYMBOLS += -D__CONFIG_XIP
endif
ifeq ($(__CONFIG_PSRAM), y)
CONFIG_SYMBOLS += -D__CONFIG_PSRAM
endif
ifeq ($(__CONFIG_PSRAM_CHIP_SQPI), y)
CONFIG_SYMBOLS += -D__CONFIG_PSRAM_CHIP_SQPI
endif
ifeq ($(__CONFIG_PSRAM_CHIP_OPI32), y)
CONFIG_SYMBOLS += -D__CONFIG_PSRAM_CHIP_OPI32
endif
ifeq ($(__CONFIG_PSRAM_CHIP_OPI64), y)
CONFIG_SYMBOLS += -D__CONFIG_PSRAM_CHIP_OPI64
endif
ifeq ($(__CONFIG_SECTION_ATTRIBUTE_XIP), y)
CONFIG_SYMBOLS += -D__CONFIG_SECTION_ATTRIBUTE_XIP
endif
ifeq ($(__CONFIG_SECTION_ATTRIBUTE_NONXIP), y)
CONFIG_SYMBOLS += -D__CONFIG_SECTION_ATTRIBUTE_NONXIP
endif
ifeq ($(__CONFIG_SECTION_ATTRIBUTE_SRAM), y)
CONFIG_SYMBOLS += -D__CONFIG_SECTION_ATTRIBUTE_SRAM
endif
ifeq ($(__CONFIG_SECTION_ATTRIBUTE_PSRAM), y)
CONFIG_SYMBOLS += -D__CONFIG_SECTION_ATTRIBUTE_PSRAM
endif
ifeq ($(__CONFIG_ROM), y)
CONFIG_SYMBOLS += -D__CONFIG_ROM
endif
ifeq ($(__CONFIG_ROM_FREERTOS), y)
CONFIG_SYMBOLS += -D__CONFIG_ROM_FREERTOS
endif
ifeq ($(__CONFIG_ROM_XZ), y)
CONFIG_SYMBOLS += -D__CONFIG_ROM_XZ
endif
ifeq ($(__CONFIG_BOOTLOADER), y)
CONFIG_SYMBOLS += -D__CONFIG_BOOTLOADER
endif
ifeq ($(__CONFIG_SECURE_BOOT), y)
CONFIG_SYMBOLS += -D__CONFIG_SECURE_BOOT
endif
ifeq ($(__CONFIG_PM), y)
CONFIG_SYMBOLS += -D__CONFIG_PM
endif
ifeq ($(__CONFIG_OTA), y)
CONFIG_SYMBOLS += -D__CONFIG_OTA
endif
CONFIG_SYMBOLS += -D__CONFIG_OTA_POLICY=$(__CONFIG_OTA_POLICY)
ifeq ($(__CONFIG_BIN_COMPRESS), y)
CONFIG_SYMBOLS += -D__CONFIG_BIN_COMPRESS
ifeq ($(__CONFIG_BIN_COMPRESS_APP), y)
CONFIG_SYMBOLS += -D__CONFIG_BIN_COMPRESS_APP
endif
ifeq ($(__CONFIG_BIN_COMPRESS_APP_PSRAM), y)
CONFIG_SYMBOLS += -D__CONFIG_BIN_COMPRESS_APP_PSRAM
endif
endif # __CONFIG_BIN_COMPRESS
ifeq ($(__CONFIG_XPLAYER), y)
CONFIG_SYMBOLS += -D__CONFIG_XPLAYER
endif
ifeq ($(__CONFIG_JPEG), y)
CONFIG_SYMBOLS += -D__CONFIG_JPEG
endif
ifeq ($(__CONFIG_JPEG_SHARE_64K), y)
CONFIG_SYMBOLS += -D__CONFIG_JPEG_SHARE_64K
endif
ifeq ($(__CONFIG_MIX_HEAP_MANAGE), y)
CONFIG_SYMBOLS += -D__CONFIG_MIX_HEAP_MANAGE
endif
CONFIG_SYMBOLS += -D__CONFIG_CACHE_POLICY=$(__CONFIG_CACHE_POLICY)
CONFIG_SYMBOLS += -D__CONFIG_DMAHEAP_PSRAM_SIZE=$(__CONFIG_DMAHEAP_PSRAM_SIZE)
CONFIG_SYMBOLS += -D__CONFIG_MBUF_HEAP_MODE=$(__CONFIG_MBUF_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_MBEDTLS_HEAP_MODE=$(__CONFIG_MBEDTLS_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_HTTPC_HEAP_MODE=$(__CONFIG_HTTPC_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_MQTT_HEAP_MODE=$(__CONFIG_MQTT_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_NOPOLL_HEAP_MODE=$(__CONFIG_NOPOLL_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_WPA_HEAP_MODE=$(__CONFIG_WPA_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_UMAC_HEAP_MODE=$(__CONFIG_UMAC_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_LMAC_HEAP_MODE=$(__CONFIG_LMAC_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_CEDARX_HEAP_MODE=$(__CONFIG_CEDARX_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_AUDIO_HEAP_MODE=$(__CONFIG_AUDIO_HEAP_MODE)
CONFIG_SYMBOLS += -D__CONFIG_CODEC_HEAP_MODE=$(__CONFIG_CODEC_HEAP_MODE)
ifeq ($(__CONFIG_PSRAM_ALL_CACHEABLE), y)
CONFIG_SYMBOLS += -D__CONFIG_PSRAM_ALL_CACHEABLE
endif
ifeq ($(__CONFIG_CPU_SUPPORT_349MHZ), y)
CONFIG_SYMBOLS += -D__CONFIG_CPU_SUPPORT_349MHZ
endif