Skip to content

Commit 3b55181

Browse files
Hau Hoquytranpzz
authored andcommitted
soc: renesas: rx: Initial support for RX140 SoC
This commit to initial support for RX140 SoC. Signed-off-by: Hau Ho <[email protected]>
1 parent 25fd96d commit 3b55181

File tree

8 files changed

+149
-0
lines changed

8 files changed

+149
-0
lines changed
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/rx140/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RX140
5+
select RX
6+
select CPU_RXV2
7+
select XIP
8+
select CLOCK_CONTROL_RENESAS_RX_CGC if CLOCK_CONTROL
9+
select HAS_RENESAS_RX_RDP
10+
select CLOCK_CONTROL
11+
select SOC_EARLY_INIT_HOOK
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_RX140
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_RX140

soc/renesas/rx/rx140/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_RX140
5+
bool
6+
select SOC_FAMILY_RENESAS_RX
7+
help
8+
Renesas RX140 series
9+
10+
config SOC_R5F51406
11+
bool
12+
select SOC_SERIES_RX140
13+
help
14+
R5F51406
15+
16+
config SOC_SERIES
17+
default "rx140" if SOC_SERIES_RX140
18+
19+
config SOC
20+
default "r5f51406" if SOC_R5F51406

soc/renesas/rx/rx140/ofsm.ld

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
SECTION_DATA_PROLOGUE(.dtc_vector_table,(NOLOAD),)
8+
{
9+
/* If DTC is used, put the DTC vector table at the start of SRAM.
10+
This avoids memory holes due to 1K alignment required by it. */
11+
*(.dtc_vector_table)
12+
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
13+
14+
SECTION_PROLOGUE(.ofsm,,)
15+
{
16+
__OFSM_START = .;
17+
KEEP(*(.ofs_mde))
18+
. = __OFSM_START + 0x8;
19+
KEEP(*(.ofs1))
20+
. = __OFSM_START + 0xC;
21+
KEEP(*(.ofs0))
22+
__OFSM_END = .;
23+
} GROUP_LINK_IN(OFSM) = 0xFF

soc/renesas/rx/rx140/soc.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
void soc_early_init_hook(void)
21+
{
22+
#ifdef CONFIG_HAS_RENESAS_RX_RDP
23+
bsp_ram_initialize();
24+
bsp_interrupt_open();
25+
bsp_register_protect_open();
26+
#if CONFIG_RENESAS_NONE_USED_PORT_INIT == 1
27+
/*
28+
* This is the function that initializes the unused port.
29+
* Please see datails on this in the "Handling of Unused Pins" section of PORT chapter
30+
* of RX MCU of User's manual.
31+
* And please MUST set "BSP_PACKAGE_PINS" definition to your device of pin type in
32+
* r_bsp_config.h Otherwise, the port may output without intention.
33+
*/
34+
bsp_non_existent_port_init();
35+
36+
#endif /* CONFIG_RENESAS_NONE_USED_PORT_INIT */
37+
#else
38+
renesas_rx_register_protect_open();
39+
#endif /* CONFIG_HAS_RENESAS_RX_RDP */
40+
}

soc/renesas/rx/rx140/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
@@ -4,6 +4,9 @@ family:
44
- name: rx130
55
socs:
66
- name: r5f51308axfp
7+
- name: rx140
8+
socs:
9+
- name: r5f51406
710
- name: rx62n
811
socs:
912
- name: r5f562n8

0 commit comments

Comments
 (0)