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