From f11cf73df13bd8a4c77bba93cd3fbef1fef503f3 Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 10 Feb 2024 15:36:41 +0100 Subject: [PATCH] boards: saml21_xpro: Convert to HWMv2 Port the board to HWMv2. Signed-off-by: Gerson Fernando Budke --- .../sam0/saml21_xpro/Kconfig.saml21_xpro | 6 ++++++ .../sam0/saml21_xpro}/board.cmake | 0 boards/atmel/sam0/saml21_xpro/board.yml | 5 +++++ .../doc/img/atsaml21-xpro-pinout.jpg | Bin .../saml21_xpro}/doc/img/atsaml21-xpro.jpg | Bin .../sam0/saml21_xpro}/doc/index.rst | 18 +++++++++--------- .../saml21_xpro/saml21_xpro-pinctrl.dtsi} | 0 .../sam0/saml21_xpro/saml21_xpro.dts} | 4 ++-- .../sam0/saml21_xpro/saml21_xpro.yaml} | 7 ++++--- .../sam0/saml21_xpro/saml21_xpro_defconfig} | 6 ++---- .../sam0/saml21_xpro}/support/openocd.cfg | 0 .../arm/atsaml21_xpro/Kconfig.board | 8 -------- .../arm/atsaml21_xpro/Kconfig.defconfig | 8 -------- 13 files changed, 28 insertions(+), 34 deletions(-) create mode 100644 boards/atmel/sam0/saml21_xpro/Kconfig.saml21_xpro rename boards/{boards_legacy/arm/atsaml21_xpro => atmel/sam0/saml21_xpro}/board.cmake (100%) create mode 100644 boards/atmel/sam0/saml21_xpro/board.yml rename boards/{boards_legacy/arm/atsaml21_xpro => atmel/sam0/saml21_xpro}/doc/img/atsaml21-xpro-pinout.jpg (100%) rename boards/{boards_legacy/arm/atsaml21_xpro => atmel/sam0/saml21_xpro}/doc/img/atsaml21-xpro.jpg (100%) rename boards/{boards_legacy/arm/atsaml21_xpro => atmel/sam0/saml21_xpro}/doc/index.rst (92%) rename boards/{boards_legacy/arm/atsaml21_xpro/atsaml21_xpro-pinctrl.dtsi => atmel/sam0/saml21_xpro/saml21_xpro-pinctrl.dtsi} (100%) rename boards/{boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.dts => atmel/sam0/saml21_xpro/saml21_xpro.dts} (95%) rename boards/{boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.yaml => atmel/sam0/saml21_xpro/saml21_xpro.yaml} (78%) rename boards/{boards_legacy/arm/atsaml21_xpro/atsaml21_xpro_defconfig => atmel/sam0/saml21_xpro/saml21_xpro_defconfig} (71%) rename boards/{boards_legacy/arm/atsaml21_xpro => atmel/sam0/saml21_xpro}/support/openocd.cfg (100%) delete mode 100644 boards/boards_legacy/arm/atsaml21_xpro/Kconfig.board delete mode 100644 boards/boards_legacy/arm/atsaml21_xpro/Kconfig.defconfig diff --git a/boards/atmel/sam0/saml21_xpro/Kconfig.saml21_xpro b/boards/atmel/sam0/saml21_xpro/Kconfig.saml21_xpro new file mode 100644 index 00000000000..465269f2d8d --- /dev/null +++ b/boards/atmel/sam0/saml21_xpro/Kconfig.saml21_xpro @@ -0,0 +1,6 @@ +# Copyright (c) 2021 Argentum Systems Ltd. +# Copyright (c) 2024 Gerson Fernando Budke +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_SAML21_XPRO + select SOC_SAML21J18B diff --git a/boards/boards_legacy/arm/atsaml21_xpro/board.cmake b/boards/atmel/sam0/saml21_xpro/board.cmake similarity index 100% rename from boards/boards_legacy/arm/atsaml21_xpro/board.cmake rename to boards/atmel/sam0/saml21_xpro/board.cmake diff --git a/boards/atmel/sam0/saml21_xpro/board.yml b/boards/atmel/sam0/saml21_xpro/board.yml new file mode 100644 index 00000000000..10e2284d58b --- /dev/null +++ b/boards/atmel/sam0/saml21_xpro/board.yml @@ -0,0 +1,5 @@ +board: + name: saml21_xpro + vendor: atmel + socs: + - name: saml21j18b diff --git a/boards/boards_legacy/arm/atsaml21_xpro/doc/img/atsaml21-xpro-pinout.jpg b/boards/atmel/sam0/saml21_xpro/doc/img/atsaml21-xpro-pinout.jpg similarity index 100% rename from boards/boards_legacy/arm/atsaml21_xpro/doc/img/atsaml21-xpro-pinout.jpg rename to boards/atmel/sam0/saml21_xpro/doc/img/atsaml21-xpro-pinout.jpg diff --git a/boards/boards_legacy/arm/atsaml21_xpro/doc/img/atsaml21-xpro.jpg b/boards/atmel/sam0/saml21_xpro/doc/img/atsaml21-xpro.jpg similarity index 100% rename from boards/boards_legacy/arm/atsaml21_xpro/doc/img/atsaml21-xpro.jpg rename to boards/atmel/sam0/saml21_xpro/doc/img/atsaml21-xpro.jpg diff --git a/boards/boards_legacy/arm/atsaml21_xpro/doc/index.rst b/boards/atmel/sam0/saml21_xpro/doc/index.rst similarity index 92% rename from boards/boards_legacy/arm/atsaml21_xpro/doc/index.rst rename to boards/atmel/sam0/saml21_xpro/doc/index.rst index 5c55f23d587..c31fbaf737a 100644 --- a/boards/boards_legacy/arm/atsaml21_xpro/doc/index.rst +++ b/boards/atmel/sam0/saml21_xpro/doc/index.rst @@ -1,4 +1,4 @@ - .. _atsaml21_xpro: + .. _saml21_xpro: SAM L21 Xplained Pro Evaluation Kit ################################### @@ -14,12 +14,12 @@ hardware. .. image:: img/atsaml21-xpro.jpg :align: center - :alt: ATSAML21-XPRO + :alt: SAML21-XPRO Hardware ******** -- ATSAML21J18 ARM Cortex-M0+ processor at 48 MHz +- SAML21J18 ARM Cortex-M0+ processor at 48 MHz - 32.768 kHz crystal oscillator - 256 KiB flash memory, 32 KiB of SRAM, 8KB Low Power SRAM - One yellow user LED @@ -30,7 +30,7 @@ Hardware Supported Features ================== -The atsaml21_xpro board configuration supports the following hardware +The saml21_xpro board configuration supports the following hardware features: .. list-table:: @@ -73,7 +73,7 @@ features: Other hardware features are not currently supported by Zephyr. The default configuration can be found in the Kconfig -``boards/arm/atsaml21_xpro/atsaml21_xpro_defconfig``. +``boards/atmel/sam0/saml21_xpro/saml21_xpro_defconfig``. Pin Mapping =========== @@ -86,7 +86,7 @@ Xplained Pro Schematic`_. .. image:: img/atsaml21-xpro-pinout.jpg :align: center - :alt: ATSAML21-XPRO-pinout + :alt: SAML21-XPRO-pinout Default Zephyr Peripheral Mapping: ---------------------------------- @@ -154,7 +154,7 @@ Flashing .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: atsaml21_xpro + :board: saml21_xpro :goals: build :compact: @@ -177,11 +177,11 @@ Flashing .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: atsaml21_xpro + :board: saml21_xpro :goals: flash :compact: - You should see "Hello World! atsaml21_xpro" in your terminal. + You should see "Hello World! saml21_xpro" in your terminal. References ********** diff --git a/boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro-pinctrl.dtsi b/boards/atmel/sam0/saml21_xpro/saml21_xpro-pinctrl.dtsi similarity index 100% rename from boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro-pinctrl.dtsi rename to boards/atmel/sam0/saml21_xpro/saml21_xpro-pinctrl.dtsi diff --git a/boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.dts b/boards/atmel/sam0/saml21_xpro/saml21_xpro.dts similarity index 95% rename from boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.dts rename to boards/atmel/sam0/saml21_xpro/saml21_xpro.dts index ee800d7ae95..c0e0e43d666 100644 --- a/boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.dts +++ b/boards/atmel/sam0/saml21_xpro/saml21_xpro.dts @@ -6,12 +6,12 @@ /dts-v1/; #include -#include "atsaml21_xpro-pinctrl.dtsi" +#include "saml21_xpro-pinctrl.dtsi" #include / { model = "SAM L21 Xplained Pro"; - compatible = "atsaml21,xpro", "atmel,saml21j18b", "atmel,saml21"; + compatible = "saml21,xpro", "atmel,saml21j18b", "atmel,saml21"; chosen { zephyr,console = &sercom3; diff --git a/boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.yaml b/boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml similarity index 78% rename from boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.yaml rename to boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml index 03c5c226209..3d531f66287 100644 --- a/boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro.yaml +++ b/boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml @@ -1,15 +1,16 @@ # Copyright (c) 2021 Argentum Systems Ltd. +# Copyright (c) 2024 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 -identifier: atsaml21_xpro +identifier: saml21_xpro name: SAM L21 Xplained Pro type: mcu arch: arm -ram: 32 -flash: 256 toolchain: - zephyr - gnuarmemb - xtools +flash: 256 +ram: 32 supported: - adc - counter diff --git a/boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro_defconfig b/boards/atmel/sam0/saml21_xpro/saml21_xpro_defconfig similarity index 71% rename from boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro_defconfig rename to boards/atmel/sam0/saml21_xpro/saml21_xpro_defconfig index 13ee4a48190..50125e5510d 100644 --- a/boards/boards_legacy/arm/atsaml21_xpro/atsaml21_xpro_defconfig +++ b/boards/atmel/sam0/saml21_xpro/saml21_xpro_defconfig @@ -1,15 +1,13 @@ # Copyright (c) 2021 Argentum Systems Ltd. +# Copyright (c) 2024 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_SAML21=y -CONFIG_SOC_PART_NUMBER_SAML21J18B=y CONFIG_SOC_ATMEL_SAML_XOSC32K=y CONFIG_SOC_ATMEL_SAML_XOSC32K_AS_MAIN=y -CONFIG_BOARD_ATSAML21_XPRO=y + CONFIG_BUILD_OUTPUT_HEX=y CONFIG_CONSOLE=y -CONFIG_GPIO=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/boards/boards_legacy/arm/atsaml21_xpro/support/openocd.cfg b/boards/atmel/sam0/saml21_xpro/support/openocd.cfg similarity index 100% rename from boards/boards_legacy/arm/atsaml21_xpro/support/openocd.cfg rename to boards/atmel/sam0/saml21_xpro/support/openocd.cfg diff --git a/boards/boards_legacy/arm/atsaml21_xpro/Kconfig.board b/boards/boards_legacy/arm/atsaml21_xpro/Kconfig.board deleted file mode 100644 index a06c9e3d20a..00000000000 --- a/boards/boards_legacy/arm/atsaml21_xpro/Kconfig.board +++ /dev/null @@ -1,8 +0,0 @@ -# SAM L21 Xplained Pro board configuration - -# Copyright (c) 2021 Argentum Systems Ltd. -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_ATSAML21_XPRO - bool "SAM L21 Xplained Pro" - depends on SOC_PART_NUMBER_SAML21J18B diff --git a/boards/boards_legacy/arm/atsaml21_xpro/Kconfig.defconfig b/boards/boards_legacy/arm/atsaml21_xpro/Kconfig.defconfig deleted file mode 100644 index 3c35f327bb2..00000000000 --- a/boards/boards_legacy/arm/atsaml21_xpro/Kconfig.defconfig +++ /dev/null @@ -1,8 +0,0 @@ -# SAM L21 Xplained Pro board configuration - -# Copyright (c) 2021 Argentum Systems Ltd. -# SPDX-License-Identifier: Apache-2.0 - -config BOARD - default "atsaml21_xpro" - depends on BOARD_ATSAML21_XPRO