From 1b2560167f586159fe4751f5b00ae9f7be8e8c83 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Wed, 3 Apr 2024 18:18:19 +0900 Subject: [PATCH] boards: arduino: uno_r4: Add Arduino UNO R4 WiFi Add configuration for Arduino UNO R4 WiFi Signed-off-by: TOKITA Hiroshi --- .../uno_r4/Kconfig.arduino_uno_r4_wifi | 5 ++ .../arduino/uno_r4/arduino_uno_r4_common.dtsi | 62 ++++++++++++++++++ .../arduino/uno_r4/arduino_uno_r4_minima.dts | 64 ------------------- .../uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi | 15 +++++ boards/arduino/uno_r4/arduino_uno_r4_wifi.dts | 24 +++++++ .../arduino/uno_r4/arduino_uno_r4_wifi.yaml | 12 ++++ .../uno_r4/arduino_uno_r4_wifi_defconfig | 23 +++++++ boards/arduino/uno_r4/board.yml | 14 ++-- 8 files changed, 150 insertions(+), 69 deletions(-) create mode 100644 boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi create mode 100644 boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi create mode 100644 boards/arduino/uno_r4/arduino_uno_r4_wifi.dts create mode 100644 boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml create mode 100644 boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig diff --git a/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi b/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi new file mode 100644 index 0000000000..840ead804a --- /dev/null +++ b/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi @@ -0,0 +1,5 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ARDUINO_UNO_R4_WIFI + select SOC_R7FA4M1AB3CFM diff --git a/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi b/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi index 472e1092f5..13ec82502c 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi +++ b/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi @@ -6,8 +6,70 @@ /dts-v1/; #include +#include / { model = "Arduino Uno R4 Board"; compatible = "renesas,r7fa4m1aB3cfm"; + + chosen { + zephyr,console = &uart2; + zephyr,shell-uart = &uart2; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,code-partition = &code_partition; + }; +}; + +&sci2 { + status = "okay"; + pinctrl-0 = <&sci2_default>; + pinctrl-names = "default"; + uart2: uart { + current-speed = <115200>; + status = "okay"; + }; +}; + +&ioport1 { + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "bootloader"; + reg = <0x00000000 0x4000>; + read-only; + }; + + code_partition: partition@4000 { + label = "code"; + reg = <0x4000 0x3C000>; + read-only; + }; + }; +}; + +&fcu { + status = "okay"; +}; + +&hoco { + status = "okay"; + clock-frequency = <48000000>; +}; + +&cgc { + clock-source = <&hoco>; + iclk-div = <1>; + pclka-div = <1>; + pclkb-div = <2>; + pclkc-div = <1>; + pclkd-div = <1>; + fclk-div = <2>; }; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_minima.dts b/boards/arduino/uno_r4/arduino_uno_r4_minima.dts index 18b1aea120..6984b6c535 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_minima.dts +++ b/boards/arduino/uno_r4/arduino_uno_r4_minima.dts @@ -5,23 +5,12 @@ */ /dts-v1/; - -#include - #include "arduino_uno_r4_common.dtsi" #include "arduino_uno_r4_minima-pinctrl.dtsi" / { model = "Arduino Uno R4 Minima"; - chosen { - zephyr,console = &uart2; - zephyr,shell-uart = &uart2; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - zephyr,code-partition = &code_partition; - }; - leds { compatible = "gpio-leds"; led: led { @@ -33,56 +22,3 @@ led0 = &led; }; }; - -&sci2 { - status = "okay"; - pinctrl-0 = <&sci2_default>; - pinctrl-names = "default"; - uart2: uart { - current-speed = <115200>; - status = "okay"; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&flash0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "bootloader"; - reg = <0x00000000 0x4000>; - read-only; - }; - - code_partition: partition@4000 { - label = "code"; - reg = <0x4000 0x3C000>; - read-only; - }; - }; -}; - -&fcu { - status = "okay"; -}; - -&hoco { - status = "okay"; - clock-frequency = <48000000>; -}; - -&cgc { - clock-source = <&hoco>; - iclk-div = <1>; - pclka-div = <1>; - pclkb-div = <2>; - pclkc-div = <1>; - pclkd-div = <1>; - fclk-div = <2>; -}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi b/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi new file mode 100644 index 0000000000..093d4e4cdf --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + sci2_default: sci2_default { + group1 { + pinmux = , ; + }; + }; +}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi.dts b/boards/arduino/uno_r4/arduino_uno_r4_wifi.dts new file mode 100644 index 0000000000..2cba24cdf1 --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi.dts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include "arduino_uno_r4_common.dtsi" +#include "arduino_uno_r4_wifi-pinctrl.dtsi" + +/ { + model = "Arduino Uno R4 WiFi"; + + leds { + compatible = "gpio-leds"; + led: led { + gpios = <&ioport1 2 GPIO_ACTIVE_HIGH>; + }; + }; + + aliases { + led0 = &led; + }; +}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml b/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml new file mode 100644 index 0000000000..bfe5bc8cdc --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml @@ -0,0 +1,12 @@ +identifier: arduino_uno_r4_wifi +name: Arduino Uno R4 WiFi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +ram: 32 +supported: + - gpio + - uart diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig b/boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig new file mode 100644 index 0000000000..76f5a5fb85 --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig @@ -0,0 +1,23 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 + +CONFIG_BUILD_OUTPUT_HEX=y + +# Enable UART driver +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +CONFIG_PINCTRL=y + +CONFIG_CLOCK_CONTROL=y + +CONFIG_USE_DT_CODE_PARTITION=y diff --git a/boards/arduino/uno_r4/board.yml b/boards/arduino/uno_r4/board.yml index f4dc7b8467..8286850b76 100644 --- a/boards/arduino/uno_r4/board.yml +++ b/boards/arduino/uno_r4/board.yml @@ -1,5 +1,9 @@ -board: - name: arduino_uno_r4_minima - vendor: arduino - socs: - - name: r7fa4m1ab3cfm +boards: + - name: arduino_uno_r4_minima + vendor: arduino + socs: + - name: r7fa4m1ab3cfm + - name: arduino_uno_r4_wifi + vendor: arduino + socs: + - name: r7fa4m1ab3cfm