From 4d536647e1cc5a9ba20e759cd799fa43310d7f09 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Thu, 12 Nov 2020 11:25:42 +0100 Subject: [PATCH] samples: tfm_integration: support TF-M samples on nRF5340 DK Add support for nRF5340 DK in the TF-M integration samples (nrf5340dk_nrf5340_cpuappns build target). Add the required DTS overlays needed for the samples to build and run successfully. Signed-off-by: Ioannis Glaropoulos --- .../boards/nrf5340dk_nrf5340_cpuappns.overlay | 32 +++++++++++++++++++ .../tfm_integration/psa_level_1/sample.yaml | 2 +- .../boards/nrf5340dk_nrf5340_cpuappns.overlay | 32 +++++++++++++++++++ samples/tfm_integration/tfm_ipc/sample.yaml | 2 +- 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 samples/tfm_integration/psa_level_1/boards/nrf5340dk_nrf5340_cpuappns.overlay create mode 100644 samples/tfm_integration/tfm_ipc/boards/nrf5340dk_nrf5340_cpuappns.overlay diff --git a/samples/tfm_integration/psa_level_1/boards/nrf5340dk_nrf5340_cpuappns.overlay b/samples/tfm_integration/psa_level_1/boards/nrf5340dk_nrf5340_cpuappns.overlay new file mode 100644 index 00000000000..9211016797e --- /dev/null +++ b/samples/tfm_integration/psa_level_1/boards/nrf5340dk_nrf5340_cpuappns.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Modify the SRAM partitioning to accommodate the requirements + * for the Secure (TF-M) firmware for the configuration that is + * used in this sample. + */ + +/* Increase the size of the Secure Firmware (TF-M). + * This modification is not required at the moment, + * since TF-M region definitions are configured + * statically in the TF-M project. + */ +&sram0_s { + reg = <0x20000000 DT_SIZE_K(256)>; +}; + +/* Decrease the size of the Non-Secure Firmware (Zephyr), + * and move its starting address to the offset expected by + * TF-M. + */ +/delete-node/ &sram0_ns; +/ { + reserved-memory { + sram0_ns: image_ns@20040000 { + reg = <0x20040000 DT_SIZE_K(192)>; + }; + }; +}; diff --git a/samples/tfm_integration/psa_level_1/sample.yaml b/samples/tfm_integration/psa_level_1/sample.yaml index 05ccb29dd36..000f8d9d22a 100644 --- a/samples/tfm_integration/psa_level_1/sample.yaml +++ b/samples/tfm_integration/psa_level_1/sample.yaml @@ -6,7 +6,7 @@ tests: sample.psa_level_1: tags: introduction platform_allow: mps2_an521_nonsecure lpcxpresso55s69_ns nrf5340pdk_nrf5340_cpuappns - nrf9160dk_nrf9160ns + nrf5340dk_nrf5340_cpuappns nrf9160dk_nrf9160ns harness: console harness_config: type: multi_line diff --git a/samples/tfm_integration/tfm_ipc/boards/nrf5340dk_nrf5340_cpuappns.overlay b/samples/tfm_integration/tfm_ipc/boards/nrf5340dk_nrf5340_cpuappns.overlay new file mode 100644 index 00000000000..9211016797e --- /dev/null +++ b/samples/tfm_integration/tfm_ipc/boards/nrf5340dk_nrf5340_cpuappns.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Modify the SRAM partitioning to accommodate the requirements + * for the Secure (TF-M) firmware for the configuration that is + * used in this sample. + */ + +/* Increase the size of the Secure Firmware (TF-M). + * This modification is not required at the moment, + * since TF-M region definitions are configured + * statically in the TF-M project. + */ +&sram0_s { + reg = <0x20000000 DT_SIZE_K(256)>; +}; + +/* Decrease the size of the Non-Secure Firmware (Zephyr), + * and move its starting address to the offset expected by + * TF-M. + */ +/delete-node/ &sram0_ns; +/ { + reserved-memory { + sram0_ns: image_ns@20040000 { + reg = <0x20040000 DT_SIZE_K(192)>; + }; + }; +}; diff --git a/samples/tfm_integration/tfm_ipc/sample.yaml b/samples/tfm_integration/tfm_ipc/sample.yaml index a6629845a21..290fe898bc0 100644 --- a/samples/tfm_integration/tfm_ipc/sample.yaml +++ b/samples/tfm_integration/tfm_ipc/sample.yaml @@ -6,7 +6,7 @@ tests: sample.tfm_ipc: tags: introduction platform_allow: mps2_an521_nonsecure lpcxpresso55s69_ns nrf5340pdk_nrf5340_cpuappns - nrf9160dk_nrf9160ns nucleo_l552ze_q_ns + nrf5340dk_nrf5340_cpuappns nrf9160dk_nrf9160ns nucleo_l552ze_q_ns harness: console harness_config: type: multi_line