1# nRF5340 Audio DK board configuration
2
3# Copyright (c) 2019 Nordic Semiconductor ASA
4# SPDX-License-Identifier: Apache-2.0
5
6if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
7
8config BOARD
9	default "nrf5340_audio_dk_nrf5340_cpuapp" if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
10
11# Code Partition:
12#
13# For the secure version of the board the firmware is linked at the beginning
14# of the flash, or into the code-partition defined in DT if it is intended to
15# be loaded by MCUboot. If the secure firmware is to be combined with a non-
16# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
17# be restricted to the size of its code partition.
18#
19# For the non-secure version of the board, the firmware
20# must be linked into the code-partition (non-secure) defined in DT, regardless.
21# Apply this configuration below by setting the Kconfig symbols used by
22# the linker according to the information extracted from DT partitions.
23
24# SRAM Partition:
25#
26# If the secure firmware is to be combined with a non-secure image
27# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always
28# be restricted to the secure image SRAM partition (sram-secure-partition).
29# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram
30# may be used by the image.
31#
32# For the non-secure version of the board, the firmware image SRAM is
33# always restricted to the allocated non-secure SRAM partition.
34#
35# Workaround for not being able to have commas in macro arguments
36DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
37DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition
38
39if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE
40
41config FLASH_LOAD_SIZE
42	default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
43
44config SRAM_SIZE
45	default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K)
46
47endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE
48
49if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
50
51config FLASH_LOAD_OFFSET
52	default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
53
54config FLASH_LOAD_SIZE
55	default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
56
57endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
58
59endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
60
61config BOARD
62	default "nrf5340_audio_dk_nrf5340_cpunet" if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUNET
63
64config IPM_NRFX
65	default IPM
66
67config MBOX_NRFX_IPC
68	default MBOX
69
70if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
71
72choice BT_HCI_BUS_TYPE
73	default BT_RPMSG if BT
74endchoice
75
76config HEAP_MEM_POOL_SIZE
77	default 4096 if BT_RPMSG
78
79endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
80
81if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUNET
82
83config BT_CTLR
84	default y if BT
85
86endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUNET
87