1# nRF9160 DK NRF9160 board configuration
2
3# Copyright (c) 2018-2020 Nordic Semiconductor ASA
4# SPDX-License-Identifier: Apache-2.0
5
6if BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160_NS
7
8config BOARD
9	default "nrf9160dk_nrf9160"
10
11# By default, if we build for a Non-Secure version of the board,
12# enable building with TF-M as the Secure Execution Environment.
13config BUILD_WITH_TFM
14	default y if BOARD_NRF9160DK_NRF9160_NS
15
16if BUILD_WITH_TFM
17
18# By default, if we build with TF-M, instruct build system to
19# flash the combined TF-M (Secure) & Zephyr (Non Secure) image
20config TFM_FLASH_MERGED_BINARY
21	bool
22	default y
23
24endif # BUILD_WITH_TFM
25
26# For the secure version of the board the firmware is linked at the beginning
27# of the flash, or into the code-partition defined in DT if it is intended to
28# be loaded by MCUboot. If the secure firmware is to be combined with a non-
29# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
30# be restricted to the size of its code partition.
31# For the non-secure version of the board, the firmware
32# must be linked into the code-partition (non-secure) defined in DT, regardless.
33# Apply this configuration below by setting the Kconfig symbols used by
34# the linker according to the information extracted from DT partitions.
35
36# Workaround for not being able to have commas in macro arguments
37DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
38
39config FLASH_LOAD_SIZE
40	default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
41	depends on BOARD_NRF9160DK_NRF9160 && TRUSTED_EXECUTION_SECURE
42
43if BOARD_NRF9160DK_NRF9160_NS
44
45config FLASH_LOAD_OFFSET
46	default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
47
48config FLASH_LOAD_SIZE
49	default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
50
51endif # BOARD_NRF9160DK_NRF9160_NS
52
53config BT_HCI_VS
54	default y if BT
55
56config BT_WAIT_NOP
57	default BT && $(dt_nodelabel_enabled,nrf52840_reset)
58
59config I2C
60	default $(dt_compat_on_bus,$(DT_COMPAT_NXP_PCAL6408A),i2c)
61
62endif # BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160_NS
63