Skip to content

Commit 262fc25

Browse files
Hau Hojhedberg
authored andcommitted
soc: renesas: rx: Initial support for RX261 SOC
This commit to initial support for RX261 SOC. Signed-off-by: Hau Ho <[email protected]> Signed-off-by: Phi Tran <[email protected]>
1 parent 3bd10d9 commit 262fc25

File tree

8 files changed

+149
-0
lines changed

8 files changed

+149
-0
lines changed

soc/renesas/rx/rx261/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_include_directories(.)
5+
6+
zephyr_sources(
7+
soc.c
8+
)
9+
10+
zephyr_linker_sources(SECTIONS ofsm.ld)
11+
12+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/rx/linker.ld CACHE INTERNAL "")

soc/renesas/rx/rx261/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RX261
5+
select RX
6+
select CPU_RXV3
7+
select XIP
8+
select CLOCK_CONTROL_RENESAS_RX_CGC if CLOCK_CONTROL
9+
select HAS_RENESAS_RX_RDP
10+
select CLOCK_CONTROL
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_RX261
5+
6+
DT_CMT_PATH := $(dt_nodelabel_path,cmt)
7+
8+
config SYS_CLOCK_HW_CYCLES_PER_SEC
9+
default $(dt_node_int_prop_int,$(DT_CMT_PATH),clock-frequency)
10+
11+
# SYS_CLOCK_TICKS_PER_SEC is set to 100 if PCLKB is 48MHz or less.
12+
# (PCLKB = SYS_CLOCK_HW_CYCLES_PER_SEC * 8)
13+
config SYS_CLOCK_TICKS_PER_SEC
14+
default 100 if SYS_CLOCK_HW_CYCLES_PER_SEC <= 6000000
15+
default 1000
16+
17+
config INITIALIZATION_STACK_SIZE
18+
default 512
19+
20+
config BUILD_OUTPUT_HEX
21+
default y
22+
23+
endif # SOC_SERIES_RX261

soc/renesas/rx/rx261/Kconfig.soc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RX261
5+
bool
6+
select SOC_FAMILY_RENESAS_RX
7+
help
8+
Renesas RX261 series
9+
10+
config SOC_R5F52618BGFP
11+
bool
12+
select SOC_SERIES_RX261
13+
help
14+
R5F52618BGFP microcontroller SoC
15+
16+
config SOC_SERIES
17+
default "rx261" if SOC_SERIES_RX261
18+
19+
config SOC
20+
default "r5f52618bgfp" if SOC_R5F52618BGFP

soc/renesas/rx/rx261/ofsm.ld

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
SECTION_PROLOGUE(.ofsm,,)
8+
{
9+
__OFSM_START = .;
10+
KEEP(*(.ofs_mde))
11+
. = __OFSM_START + 0x8;
12+
KEEP(*(.ofs1))
13+
. = __OFSM_START + 0xC;
14+
KEEP(*(.ofs0))
15+
__OFSM_END = .;
16+
} GROUP_LINK_IN(OFSM) = 0xFF

soc/renesas/rx/rx261/soc.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @brief System/hardware module for RX SOC family
9+
*/
10+
11+
#include <zephyr/device.h>
12+
#include <zephyr/init.h>
13+
#include <zephyr/kernel.h>
14+
#include <zephyr/arch/cpu.h>
15+
#include <soc.h>
16+
17+
#include "platform.h"
18+
#include "r_bsp_cpu.h"
19+
20+
/**
21+
* @brief Perform basic hardware initialization at boot.
22+
*
23+
* This needs to be run from the very beginning.
24+
* So the init priority has to be 0 (zero).
25+
*
26+
* @return 0
27+
*/
28+
void soc_early_init_hook(void)
29+
{
30+
#ifdef CONFIG_HAS_RENESAS_RX_RDP
31+
bsp_ram_initialize();
32+
bsp_interrupt_open();
33+
bsp_register_protect_open();
34+
#ifdef CONFIG_RENESAS_NONE_USED_PORT_INIT
35+
/*
36+
* This is the function that initializes the unused port.
37+
* Please see datails on this in the "Handling of Unused Pins" section of PORT chapter
38+
* of RX MCU of User's manual.
39+
* And please MUST set "BSP_PACKAGE_PINS" definition to your device of pin type in
40+
* r_bsp_config.h Otherwise, the port may output without intention.
41+
*/
42+
bsp_non_existent_port_init();
43+
44+
#endif /* CONFIG_RENESAS_NONE_USED_PORT_INIT */
45+
#else
46+
renesas_rx_register_protect_open();
47+
#endif /* CONFIG_HAS_RENESAS_RX_RDP */
48+
}

soc/renesas/rx/rx261/soc.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @brief SOC header file for Renesas RX SOC series
9+
*/
10+
11+
#ifndef _SOC_H_
12+
#define _SOC_H_
13+
14+
#include "reg_protection.h"
15+
#include <mcu_clocks.h>
16+
17+
#endif /* _SOC_H_ */

soc/renesas/rx/soc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ family:
77
- name: rx62n
88
socs:
99
- name: r5f562n8
10+
- name: rx261
11+
socs:
12+
- name: r5f52618bgfp

0 commit comments

Comments
 (0)