From 18259d95a8d7ff364617efb19a88bc877387e0c3 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Wed, 7 Feb 2024 15:33:30 +0100 Subject: [PATCH] boards: Convert stm32l562e_dk to HWM v2 Port the board to HWMv2. Signed-off-by: Erwan Gouriou --- .../arm/stm32l562e_dk/Kconfig.board | 8 ------- .../arm => st}/stm32l562e_dk/CMakeLists.txt | 0 .../stm32l562e_dk/Kconfig.defconfig | 9 ++++---- boards/st/stm32l562e_dk/Kconfig.stm32l562e_dk | 9 ++++++++ .../stm32l562e_dk/arduino_r3_connector.dtsi | 0 .../arm => st}/stm32l562e_dk/board.cmake | 0 boards/st/stm32l562e_dk/board.yml | 7 ++++++ .../stm32l562e_dk/doc/img/stm32l562e_dk.jpg | Bin .../arm => st}/stm32l562e_dk/doc/index.rst | 20 +++++++++--------- .../stm32l562e_dk/stm32l562e_dk.dts | 0 .../stm32l562e_dk/stm32l562e_dk.yaml | 0 .../stm32l562e_dk/stm32l562e_dk_common.dtsi | 0 .../stm32l562e_dk/stm32l562e_dk_defconfig | 3 --- .../stm32l562e_dk_stm32l562xx_ns.dts} | 0 .../stm32l562e_dk_stm32l562xx_ns.yaml} | 2 +- .../stm32l562e_dk_stm32l562xx_ns_defconfig} | 3 --- .../stm32l562e_dk/support/openocd.cfg | 0 17 files changed, 32 insertions(+), 29 deletions(-) delete mode 100644 boards/boards_legacy/arm/stm32l562e_dk/Kconfig.board rename boards/{boards_legacy/arm => st}/stm32l562e_dk/CMakeLists.txt (100%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/Kconfig.defconfig (87%) create mode 100644 boards/st/stm32l562e_dk/Kconfig.stm32l562e_dk rename boards/{boards_legacy/arm => st}/stm32l562e_dk/arduino_r3_connector.dtsi (100%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/board.cmake (100%) create mode 100644 boards/st/stm32l562e_dk/board.yml rename boards/{boards_legacy/arm => st}/stm32l562e_dk/doc/img/stm32l562e_dk.jpg (100%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/doc/index.rst (94%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/stm32l562e_dk.dts (100%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/stm32l562e_dk.yaml (100%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/stm32l562e_dk_common.dtsi (100%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/stm32l562e_dk_defconfig (85%) rename boards/{boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns.dts => st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns.dts} (100%) rename boards/{boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns.yaml => st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns.yaml} (85%) rename boards/{boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns_defconfig => st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns_defconfig} (86%) rename boards/{boards_legacy/arm => st}/stm32l562e_dk/support/openocd.cfg (100%) diff --git a/boards/boards_legacy/arm/stm32l562e_dk/Kconfig.board b/boards/boards_legacy/arm/stm32l562e_dk/Kconfig.board deleted file mode 100644 index 44cabce93d3d5ed..000000000000000 --- a/boards/boards_legacy/arm/stm32l562e_dk/Kconfig.board +++ /dev/null @@ -1,8 +0,0 @@ -# STM32L562E-DK Discovery board configuration - -# Copyright (c) 2020 Yestin Sun -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_STM32L562E_DK - bool "STM32L562E-DK Discovery Development Board" - depends on SOC_STM32L562XX diff --git a/boards/boards_legacy/arm/stm32l562e_dk/CMakeLists.txt b/boards/st/stm32l562e_dk/CMakeLists.txt similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/CMakeLists.txt rename to boards/st/stm32l562e_dk/CMakeLists.txt diff --git a/boards/boards_legacy/arm/stm32l562e_dk/Kconfig.defconfig b/boards/st/stm32l562e_dk/Kconfig.defconfig similarity index 87% rename from boards/boards_legacy/arm/stm32l562e_dk/Kconfig.defconfig rename to boards/st/stm32l562e_dk/Kconfig.defconfig index 3a81889dc71c673..ac74129b6d31a08 100644 --- a/boards/boards_legacy/arm/stm32l562e_dk/Kconfig.defconfig +++ b/boards/st/stm32l562e_dk/Kconfig.defconfig @@ -5,9 +5,6 @@ if BOARD_STM32L562E_DK -config BOARD - default "stm32l562e_dk" - if BT config SPI @@ -29,6 +26,10 @@ config BT_HCI_VS_EXT endif # BT +endif # BOARD_STM32L562E_DK + +if BOARD_STM32L562E_DK_STM32L562XX_NS + if TRUSTED_EXECUTION_NONSECURE # Get flash configuration for NS image from dts flash partition @@ -37,4 +38,4 @@ config USE_DT_CODE_PARTITION endif # TRUSTED_EXECUTION_NONSECURE -endif # BOARD_STM32L562E_DK +endif # BOARD_STM32L562E_DK_STM32L562XX_NS diff --git a/boards/st/stm32l562e_dk/Kconfig.stm32l562e_dk b/boards/st/stm32l562e_dk/Kconfig.stm32l562e_dk new file mode 100644 index 000000000000000..48b426203dfe969 --- /dev/null +++ b/boards/st/stm32l562e_dk/Kconfig.stm32l562e_dk @@ -0,0 +1,9 @@ +# Copyright (c) 2020 Yestin Sun +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_STM32L562E_DK + select SOC_STM32L562XX + +config BOARD_STM32L562E_DK_STM32L562XX_NS + bool + select SOC_STM32L562XX diff --git a/boards/boards_legacy/arm/stm32l562e_dk/arduino_r3_connector.dtsi b/boards/st/stm32l562e_dk/arduino_r3_connector.dtsi similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/arduino_r3_connector.dtsi rename to boards/st/stm32l562e_dk/arduino_r3_connector.dtsi diff --git a/boards/boards_legacy/arm/stm32l562e_dk/board.cmake b/boards/st/stm32l562e_dk/board.cmake similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/board.cmake rename to boards/st/stm32l562e_dk/board.cmake diff --git a/boards/st/stm32l562e_dk/board.yml b/boards/st/stm32l562e_dk/board.yml new file mode 100644 index 000000000000000..4ba7230524d2a15 --- /dev/null +++ b/boards/st/stm32l562e_dk/board.yml @@ -0,0 +1,7 @@ +board: + name: stm32l562e_dk + vendor: st + socs: + - name: stm32l562xx + variants: + - name: ns diff --git a/boards/boards_legacy/arm/stm32l562e_dk/doc/img/stm32l562e_dk.jpg b/boards/st/stm32l562e_dk/doc/img/stm32l562e_dk.jpg similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/doc/img/stm32l562e_dk.jpg rename to boards/st/stm32l562e_dk/doc/img/stm32l562e_dk.jpg diff --git a/boards/boards_legacy/arm/stm32l562e_dk/doc/index.rst b/boards/st/stm32l562e_dk/doc/index.rst similarity index 94% rename from boards/boards_legacy/arm/stm32l562e_dk/doc/index.rst rename to boards/st/stm32l562e_dk/doc/index.rst index 16af6cb242b6fe7..4b2dbfbff023bc5 100644 --- a/boards/boards_legacy/arm/stm32l562e_dk/doc/index.rst +++ b/boards/st/stm32l562e_dk/doc/index.rst @@ -214,20 +214,20 @@ for building for both Secure and Non-Secure firmware. The BOARD options are summarized below: -+----------------------+-----------------------------------------------+ -| BOARD | Description | -+======================+===============================================+ -| stm32l562e_dk | For building Secure (or Secure-only) firmware | -+----------------------+-----------------------------------------------+ -| stm32l562e_dk_ns | For building Non-Secure firmware | -+----------------------+-----------------------------------------------+ ++------------------------------+-------------------------------------------+ +| BOARD | Description | ++==============================+===========================================+ +| stm32l562e_dk | For building Trust Zone Disabled firmware | ++------------------------------+-------------------------------------------+ +| stm32l562e_dk/stm32l562xx/ns | For building Non-Secure firmware | ++------------------------------+-------------------------------------------+ Here are the instructions to build Zephyr with a non-secure configuration, using `tfm_ipc_` sample: .. code-block:: bash - $ west build -b stm32l562e_dk_ns samples/tfm_integration/tfm_ipc/ + $ west build -b stm32l562e_dk/stm32l562xx/ns samples/tfm_integration/tfm_ipc/ Once done, before flashing, you need to first run a generated script that will set platform option bytes config and erase platform (among others, @@ -334,11 +334,11 @@ Building Secure/Non-Secure Zephyr applications with Arm |reg| TrustZone |reg| The TF-M integration sample :ref:`tfm_ipc` can be run on a ST STM32L562E-DK Discovery. In TF-M configuration, Zephyr is run on the non-secure domain. A non-secure image -can be generated using ``stm32l562e_dk_ns`` as build target. +can be generated using ``stm32l562e_dk/stm32l562xx/ns`` as build target. .. code-block:: bash - $ west build -b stm32l562e_dk_ns path/to/source/directory + $ west build -b stm32l562e_dk/stm32l562xx/ns path/to/source/directory Note: When building the ``*_ns`` image with TF-M, ``build/tfm/api_ns/postbuild.sh`` bash script is run automatically in a post-build step to make some required flash layout changes. diff --git a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk.dts b/boards/st/stm32l562e_dk/stm32l562e_dk.dts similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk.dts rename to boards/st/stm32l562e_dk/stm32l562e_dk.dts diff --git a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk.yaml b/boards/st/stm32l562e_dk/stm32l562e_dk.yaml similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk.yaml rename to boards/st/stm32l562e_dk/stm32l562e_dk.yaml diff --git a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi b/boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_common.dtsi rename to boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi diff --git a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_defconfig b/boards/st/stm32l562e_dk/stm32l562e_dk_defconfig similarity index 85% rename from boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_defconfig rename to boards/st/stm32l562e_dk/stm32l562e_dk_defconfig index 6646832e7ef7e89..cf7483088e502a5 100644 --- a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_defconfig +++ b/boards/st/stm32l562e_dk/stm32l562e_dk_defconfig @@ -1,8 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_STM32L5X=y -CONFIG_SOC_STM32L562XX=y - # enable uart driver CONFIG_SERIAL=y diff --git a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns.dts b/boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns.dts similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns.dts rename to boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns.dts diff --git a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns.yaml b/boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns.yaml similarity index 85% rename from boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns.yaml rename to boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns.yaml index 8d743536e74d860..c092f8da95d82e1 100644 --- a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns.yaml +++ b/boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns.yaml @@ -1,4 +1,4 @@ -identifier: stm32l562e_dk_ns +identifier: stm32l562e_dk/stm32l562xx/ns name: ST STM32L562E-DK Discovery non secure type: mcu arch: arm diff --git a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns_defconfig b/boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns_defconfig similarity index 86% rename from boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns_defconfig rename to boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns_defconfig index c28424d306a05a0..d2035929200df45 100644 --- a/boards/boards_legacy/arm/stm32l562e_dk/stm32l562e_dk_ns_defconfig +++ b/boards/st/stm32l562e_dk/stm32l562e_dk_stm32l562xx_ns_defconfig @@ -1,8 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_STM32L5X=y -CONFIG_SOC_STM32L562XX=y - # enable uart driver CONFIG_SERIAL=y diff --git a/boards/boards_legacy/arm/stm32l562e_dk/support/openocd.cfg b/boards/st/stm32l562e_dk/support/openocd.cfg similarity index 100% rename from boards/boards_legacy/arm/stm32l562e_dk/support/openocd.cfg rename to boards/st/stm32l562e_dk/support/openocd.cfg