1# Circuit Dojo nRF9160 Feather configuration
2
3# Copyright (c) 2018-2020 Nordic Semiconductor ASA
4# Copyright (c) 2020 Circuit Dojo LLC
5# SPDX-License-Identifier: Apache-2.0
6
7if BOARD_SPARKFUN_THING_PLUS
8
9# For the secure version of the board the firmware is linked at the beginning
10# of the flash, or into the code-partition defined in DT if it is intended to
11# be loaded by MCUboot. If the secure firmware is to be combined with a non-
12# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
13# be restricted to the size of its code partition.
14# For the non-secure version of the board, the firmware
15# must be linked into the code-partition (non-secure) defined in DT, regardless.
16# Apply this configuration below by setting the Kconfig symbols used by
17# the linker according to the information extracted from DT partitions.
18
19# Workaround for not being able to have commas in macro arguments
20DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
21
22config FLASH_LOAD_SIZE
23	default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
24	depends on BOARD_SPARKFUN_THING_PLUS_NRF9160 && TRUSTED_EXECUTION_SECURE
25
26if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS
27
28config FLASH_LOAD_OFFSET
29	default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
30
31config FLASH_LOAD_SIZE
32	default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
33
34endif # BOARD_SPARKFUN_THING_PLUS_NRF9160
35
36endif # BOARD_SPARKFUN_THING_PLUS
37