Skip to content

boards: renesas: rx: Add support for RX261 boards #90708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion arch/rx/core/vects.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <zephyr/irq.h>
#include <kswap.h>
#include <zephyr/tracing/tracing.h>
#include <zephyr/drivers/clock_control/renesas_rx_cgc.h>

typedef void (*fp)(void);
extern void _start(void);
Expand All @@ -24,6 +25,14 @@ extern void z_rx_irq_exit(void);

#define __ISR__ __attribute__((interrupt, naked))

#define SET_OFS1_HOCO_BITS(reg, freq) \
((reg) & ~(0b11 << 12)) | ((((freq) == 24000000 ? 0b10 \
: (freq) == 32000000 ? 0b11 \
: (freq) == 48000000 ? 0b01 \
: (freq) == 64000000 ? 0b00 \
: 0b11) \
<< 12))

static ALWAYS_INLINE void REGISTER_SAVE(void)
{
__asm volatile(
Expand Down Expand Up @@ -421,7 +430,9 @@ const void *FixedVectors[] FVECT_SECT = {
/* Reserved for OFSM */
(fp)0xFFFFFFFF,
(fp)0xFFFFFFFF,
(fp)0xFFFFFFFF,
(fp)(SET_OFS1_HOCO_BITS(
0xFFFFFFFF,
(RX_CGC_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(hoco), clock_frequency, 32000000)))),
(fp)0xFFFFFFFF,
/* Reserved area */
(fp)0xFFFFFFFF,
Expand Down
5 changes: 5 additions & 0 deletions boards/renesas/ek_rx261/Kconfig.ek_rx261
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

config BOARD_EK_RX261
select SOC_R5F52618BGFP
9 changes: 9 additions & 0 deletions boards/renesas/ek_rx261/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

# options after "--tool-opt=" are directly passed to the tool. So instead of "--iface=JTAG" you could also write "--tool-opt=-if JTAG"
board_runner_args(jlink "--device=R5F52618" "--iface=FINE" "--speed=1000" "--tool-opt=-jtagconf -1,-1 -autoconnect 1" )
board_runner_args(rfp "--device=RX200" "--tool=e2l" "--interface=fine" "--erase")

include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/rfp.board.cmake)
6 changes: 6 additions & 0 deletions boards/renesas/ek_rx261/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: ek_rx261
full_name: RX261 Evaluation Kit
vendor: renesas
socs:
- name: r5f52618bgfp
14 changes: 14 additions & 0 deletions boards/renesas/ek_rx261/ek_rx261-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2025 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

&pinctrl {
sci6_default: sci6_default {
group1 {
psels = <RX_PSEL(RX_PSEL_SCI_6, 11, 1)>, /* TX */
<RX_PSEL(RX_PSEL_SCI_6, 11, 0)>; /* RX */
};
};
};
98 changes: 98 additions & 0 deletions boards/renesas/ek_rx261/ek_rx261.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Copyright (c) 2025 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <renesas/r5f52618bgfp.dtsi>
#include <dt-bindings/gpio/gpio.h>
#include "ek_rx261-pinctrl.dtsi"

/ {
model = "Renesas EK-RX261 KIT";
compatible = "renesas,ek_rx261","renesas,rxv3";

chosen {
zephyr,sram = &sram0;
zephyr,flash = &code_flash;
zephyr,console = &uart6;
zephyr,shell-uart = &uart6;
};

leds {
compatible = "gpio-leds";

led1: led1 {
gpios = <&ioportj 1 GPIO_ACTIVE_LOW>;
label = "LED1";
};

led2: led2 {
gpios = <&ioportc 5 GPIO_ACTIVE_LOW>;
label = "LED2";
};

led3: led3 {
gpios = <&ioporta 3 GPIO_ACTIVE_LOW>;
label = "LED3";
};

};

aliases {
led0 = &led1;
led1 = &led2;
led2 = &led3;
};
};

&xtal {
clock-frequency = <DT_FREQ_M(8)>;
mosel = <0>;
#clock-cells = <0>;
status = "okay";
};

&pll {
div = <1>;
mul = <RX_PLL_MUL_8>;
status = "okay";
};

&cmt {
clock-frequency = <4000000>;
status = "okay";
};

&ioport3 {
status = "okay";
};

&ioporta {
status = "okay";
};

&ioportc {
status = "okay";
};

&ioportd {
status = "okay";
};

&ioportj {
status = "okay";
};

&sci6 {
pinctrl-0 = <&sci6_default>;
pinctrl-names = "default";
status = "okay";

uart6: uart {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline on line 94

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added new line, thanks

current-speed = <115200>;
status = "okay";
};
};
17 changes: 17 additions & 0 deletions boards/renesas/ek_rx261/ek_rx261.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

identifier: ek_rx261
name: Renesas EK-RX261
type: mcu
arch: rx
toolchain:
- cross-compile
supported:
- gpio
- serial
- timer
ram: 128
flash: 512
testing:
timeout_multiplier: 5
13 changes: 13 additions & 0 deletions boards/renesas/ek_rx261/ek_rx261_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

# Enable GPIO
CONFIG_GPIO=y

# Enable UART driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
5 changes: 5 additions & 0 deletions boards/renesas/fpb_rx261/Kconfig.fpb_rx261
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

config BOARD_FPB_RX261
select SOC_R5F52618BGFP
9 changes: 9 additions & 0 deletions boards/renesas/fpb_rx261/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

# options after "--tool-opt=" are directly passed to the tool. So instead of "--iface=JTAG" you could also write "--tool-opt=-if JTAG"
board_runner_args(jlink "--device=R5F52618" "--iface=FINE" "--speed=1000" "--tool-opt=-jtagconf -1,-1 -autoconnect 1" )
board_runner_args(rfp "--device=RX200" "--tool=e2l" "--interface=fine" "--erase")

include(${ZEPHYR_BASE}/boards/common/rfp.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
6 changes: 6 additions & 0 deletions boards/renesas/fpb_rx261/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: fpb_rx261
full_name: RX261 Fast Prototyping Board
vendor: renesas
socs:
- name: r5f52618bgfp
14 changes: 14 additions & 0 deletions boards/renesas/fpb_rx261/fpb_rx261-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2025 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

&pinctrl {
sci5_default: sci5_default {
group1 {
psels = <RX_PSEL(RX_PSEL_SCI_5, 0xC, 0x3)>, /* TX */
<RX_PSEL(RX_PSEL_SCI_5, 0xC, 0x2)>; /* RX */
};
};
};
86 changes: 86 additions & 0 deletions boards/renesas/fpb_rx261/fpb_rx261.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Copyright (c) 2025 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <renesas/r5f52618bgfp.dtsi>
#include <dt-bindings/gpio/gpio.h>
#include "fpb_rx261-pinctrl.dtsi"

/ {
model = "Renesas FPB-RX261";
compatible = "renesas,fpb_rx261","renesas,rxv3";

chosen {
zephyr,sram = &sram0;
zephyr,flash = &code_flash;
zephyr,console = &uart5;
zephyr,shell-uart = &uart5;
};

leds {
compatible = "gpio-leds";

led1: led1 {
gpios = <&ioportj 1 GPIO_ACTIVE_LOW>;
label = "LED1";
};

led2: led2 {
gpios = <&ioportc 5 GPIO_ACTIVE_LOW>;
label = "LED2";
};
};

aliases {
led0 = &led1;
led1 = &led2;
};
};

&subclk {
status = "okay";
};

&cmt {
clock-frequency = <4000000>;
status = "okay";
};

&pclkblock {
clocks = <&hoco>;
};

&clkout {
clocks = <&hoco>;
};

&uclk {
clocks = <&hoco>;
};

&ioport3 {
status = "okay";
};

&ioportc {
status = "okay";
};

&ioportj {
status = "okay";
};

&sci5 {
pinctrl-0 = <&sci5_default>;
pinctrl-names = "default";
status = "okay";

uart5: uart {
current-speed = <115200>;
status = "okay";
};
};
17 changes: 17 additions & 0 deletions boards/renesas/fpb_rx261/fpb_rx261.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

identifier: fpb_rx261
name: Renesas RX261 Fast Prototyping Board
type: mcu
arch: rx
toolchain:
- cross-compile
supported:
- gpio
- serial
- timer
ram: 128
flash: 512
testing:
timeout_multiplier: 5
13 changes: 13 additions & 0 deletions boards/renesas/fpb_rx261/fpb_rx261_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2025 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

# Enable GPIO
CONFIG_GPIO=y

# Enable UART driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
Loading
Loading