From 502129c36d58a242194cc2a8be294932a0b208dc Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Sat, 1 Jun 2024 13:14:42 +0900 Subject: [PATCH] boards: arm: Add initial support for EKRA2A1 Add support for the EK-RA2A1 board. Signed-off-by: TOKITA Hiroshi --- boards/renesas/ek_ra2a1/Kconfig.ek_ra2a1 | 5 + boards/renesas/ek_ra2a1/board.cmake | 9 ++ boards/renesas/ek_ra2a1/board.yml | 5 + boards/renesas/ek_ra2a1/doc/index.rst | 105 ++++++++++++++++++ boards/renesas/ek_ra2a1/ek_ra2a1-pinctrl.dtsi | 19 ++++ boards/renesas/ek_ra2a1/ek_ra2a1.dts | 60 ++++++++++ boards/renesas/ek_ra2a1/ek_ra2a1.yaml | 12 ++ boards/renesas/ek_ra2a1/ek_ra2a1_defconfig | 17 +++ 8 files changed, 232 insertions(+) create mode 100644 boards/renesas/ek_ra2a1/Kconfig.ek_ra2a1 create mode 100644 boards/renesas/ek_ra2a1/board.cmake create mode 100644 boards/renesas/ek_ra2a1/board.yml create mode 100644 boards/renesas/ek_ra2a1/doc/index.rst create mode 100644 boards/renesas/ek_ra2a1/ek_ra2a1-pinctrl.dtsi create mode 100644 boards/renesas/ek_ra2a1/ek_ra2a1.dts create mode 100644 boards/renesas/ek_ra2a1/ek_ra2a1.yaml create mode 100644 boards/renesas/ek_ra2a1/ek_ra2a1_defconfig diff --git a/boards/renesas/ek_ra2a1/Kconfig.ek_ra2a1 b/boards/renesas/ek_ra2a1/Kconfig.ek_ra2a1 new file mode 100644 index 000000000000000..5eaad77c79c7f18 --- /dev/null +++ b/boards/renesas/ek_ra2a1/Kconfig.ek_ra2a1 @@ -0,0 +1,5 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_EK_RA2A1 + select SOC_R7FA2A1AB3CFM diff --git a/boards/renesas/ek_ra2a1/board.cmake b/boards/renesas/ek_ra2a1/board.cmake new file mode 100644 index 000000000000000..98ad18aa9bbd66a --- /dev/null +++ b/boards/renesas/ek_ra2a1/board.cmake @@ -0,0 +1,9 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=R7FA2A1AB") + +board_runner_args(pyocd "--target=r7fa2a1ab") + +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) +include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/renesas/ek_ra2a1/board.yml b/boards/renesas/ek_ra2a1/board.yml new file mode 100644 index 000000000000000..82c498850aa892c --- /dev/null +++ b/boards/renesas/ek_ra2a1/board.yml @@ -0,0 +1,5 @@ +board: + name: ek_ra2a1 + vendor: renesas + socs: + - name: r7fa2a1ab3cfm diff --git a/boards/renesas/ek_ra2a1/doc/index.rst b/boards/renesas/ek_ra2a1/doc/index.rst new file mode 100644 index 000000000000000..f971efc22a39dcc --- /dev/null +++ b/boards/renesas/ek_ra2a1/doc/index.rst @@ -0,0 +1,105 @@ +.. _ek_ra2a1: + +EK-RA2A1 +######## + +Overview +******** + +The EK-RA2A1 is a evaluation kit for Renesas RA2A1 SoC. + +Renesas RA2A1 SoC has following features. + +- 48MHz, Arm Cortex-M23 core +- 256kB Code Flash, 8kB Data Flash, 32kB SRAM +- USB 2.0 Full-Sppeed +- UART x 3 +- SPI x 2 +- I2C x 2 +- CAN x 1 +- 16-bit A/D Converter +- 24-bit Sigma-Delta A/D Converter +- 12-bit D/A Converter +- 8-bit D/A Converter x 2 +- High-Speed Analog Comparator +- Low-Power Analog Comparator +- OPAMP x 3 +- Temperature Sensor +- 32-bit Timer x 1 +- 16-bit Timer x 6 +- Asynchronous General-Purpose Timer x 2 +- Watchdog Timer +- 49 Input/Output pins + +Hardware +******** + +EK-RA2A1 has following features. + +- Native pin access through 4x 40-pin male headers +- MCU current measurement points +- SEGGER J-Link on-board programmer and debugger +- Two Digilent Pmod (SPI and UART) +- User LED +- Mechanical user button +- Capacitive user button + +Supported Features +================== + +The Renesas EK-RA2A1 board configuration supports the following +hardware features: + ++-----------+------------+-------------------------------+ +| Interface | Controller | Driver/components | ++===========+============+===============================+ +| PINCTRL | on-chip | pinctrl | ++-----------+------------+-------------------------------+ +| CLOCK | on-chip | clock_control | ++-----------+------------+-------------------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+-------------------------------+ +| UART | on-chip | uart | ++-----------+------------+-------------------------------+ + +The default configuration can be found in +:zephyr_file:`boards/renesas/ek_ra2a1/ek_ra2a17_defconfig` + + +Programming and debugging +************************* + +Building & Flashing +=================== + +You can build and flash an application with onboard J-Link debug adapter. +:ref:`build_an_application` and +:ref:`application_run` for more details). + +Here is an example for building and flashing the :zephyr:code-sample:`blinky` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: ek_ra2a1 + :goals: build flash + + +Debugging +========= + +Debugging also can be done with onboard J-Link debug adapter. +The following command is debugging the :zephyr:code-sample:`blinky` application. +Also, see the instructions specific to the debug server that you use. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: ek_ra2a1 + :maybe-skip-config: + :goals: debug + + +References +********** + +.. EK-RA2A1 Web site: + https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra2a1-evaluation-kit-ra2a1-mcu-group diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1-pinctrl.dtsi b/boards/renesas/ek_ra2a1/ek_ra2a1-pinctrl.dtsi new file mode 100644 index 000000000000000..f93e8118ddf7d0a --- /dev/null +++ b/boards/renesas/ek_ra2a1/ek_ra2a1-pinctrl.dtsi @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + sci0_default: sci0_default { + group1 { + /* tx */ + psels = ; + drive-strength = "medium"; + }; + group2 { + /* rx */ + psels = ; + }; + }; +}; diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1.dts b/boards/renesas/ek_ra2a1/ek_ra2a1.dts new file mode 100644 index 000000000000000..eb14660f8ac0501 --- /dev/null +++ b/boards/renesas/ek_ra2a1/ek_ra2a1.dts @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +#include "ek_ra2a1-pinctrl.dtsi" + +/ { + model = "Renesas EK-RA2A1"; + compatible = "renesas,ra2a1", "renesas,ra2"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + }; + + leds { + compatible = "gpio-leds"; + led1: led1 { + gpios = <&ioport2 5 GPIO_ACTIVE_HIGH>; + label = "LED1"; + }; + }; + + aliases { + led0 = &led1; + }; +}; + +&xtal { + clock-frequency = ; + mosel = <0>; + #clock-cells = <0>; + status = "okay"; +}; + +&subclk { + status = "okay"; +}; + +&ioport2 { + status = "okay"; +}; + +&sci0 { + pinctrl-0 = <&sci0_default>; + pinctrl-names = "default"; + status = "okay"; + uart0: uart { + current-speed = <115200>; + status = "okay"; + }; +}; diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1.yaml b/boards/renesas/ek_ra2a1/ek_ra2a1.yaml new file mode 100644 index 000000000000000..78000823a984d91 --- /dev/null +++ b/boards/renesas/ek_ra2a1/ek_ra2a1.yaml @@ -0,0 +1,12 @@ +identifier: ek_ra2a1 +name: Renesas EK-RA2A1 +type: mcu +arch: arm +ram: 32 +flash: 256 +toolchain: + - zephyr + - gnuarmemb +supported: + - gpio + - uart diff --git a/boards/renesas/ek_ra2a1/ek_ra2a1_defconfig b/boards/renesas/ek_ra2a1/ek_ra2a1_defconfig new file mode 100644 index 000000000000000..42f70d59a41c861 --- /dev/null +++ b/boards/renesas/ek_ra2a1/ek_ra2a1_defconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 + +# Enable GPIO +CONFIG_GPIO=y +CONFIG_PINCTRL=y + +# Enable Console +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_CONSOLE=y + +CONFIG_BUILD_OUTPUT_HEX=y +CONFIG_BUILD_NO_GAP_FILL=y