Skip to content

Commit 4a2f180

Browse files
committed
soc: renesas: Add support for Renesas RZ/A3M
Add support for Renesas RZ/A3M Signed-off-by: Nhut Nguyen <[email protected]>
1 parent 7a663fb commit 4a2f180

File tree

10 files changed

+162
-0
lines changed

10 files changed

+162
-0
lines changed

soc/renesas/rz/rza3m/CMakeLists.txt

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+
zephyr_sources(soc.c)
5+
zephyr_library_sources_ifdef(CONFIG_ARM_MMU mmu_regions.c)
6+
7+
zephyr_include_directories(.)
8+
9+
zephyr_linker_sources(SECTIONS sections.ld)
10+
11+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm64/scripts/linker.ld CACHE INTERNAL "")

soc/renesas/rz/rza3m/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RZA3M
5+
select ARM64
6+
select CPU_CORTEX_A55
7+
select ARM_ARCH_TIMER
8+
select HAS_RENESAS_RZ_FSP
9+
select SOC_EARLY_INIT_HOOK
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_RZA3M
5+
6+
config SYS_CLOCK_EXISTS
7+
default y
8+
9+
config NUM_IRQS
10+
default 512
11+
12+
config SYS_CLOCK_HW_CYCLES_PER_SEC
13+
default $(dt_node_int_prop_int,/osc,clock-frequency)
14+
15+
config FLASH_SIZE
16+
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K)
17+
18+
config FLASH_BASE_ADDRESS
19+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
20+
21+
DT_CHOSEN_IMAGE_ZEPHYR = zephyr,code-partition
22+
DT_CHOSEN_SRAM_ZEPHYR = zephyr,sram
23+
24+
config BUILD_OUTPUT_ADJUST_LMA
25+
default "$(dt_chosen_partition_addr_hex,$(DT_CHOSEN_IMAGE_ZEPHYR)) - \
26+
$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_SRAM_ZEPHYR))"
27+
28+
config BUILD_OUTPUT_ADJUST_LMA_SECTIONS
29+
default "*;!.header"
30+
31+
endif # SOC_SERIES_RZA3M

soc/renesas/rz/rza3m/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_RZA3M
5+
bool
6+
select SOC_FAMILY_RENESAS_RZ
7+
help
8+
Renesas RZ/A3M series
9+
10+
config SOC_SERIES
11+
default "rza3m" if SOC_SERIES_RZA3M
12+
13+
config SOC_R9A07G066M04GBG
14+
bool
15+
select SOC_SERIES_RZA3M
16+
help
17+
R9A07G066M04GBG
18+
19+
config SOC
20+
default "r9a07g066m04gbg" if SOC_R9A07G066M04GBG

soc/renesas/rz/rza3m/mmu_regions.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/arch/arm64/arm_mmu.h>
8+
#include <zephyr/devicetree.h>
9+
10+
static const struct arm_mmu_region mmu_regions[] = {
11+
MMU_REGION_FLAT_ENTRY("IO_REG", 0x10000000, 0x10000000,
12+
MT_DEVICE_nGnRnE | MT_RW | MT_DEFAULT_SECURE_STATE),
13+
};
14+
15+
const struct arm_mmu_config mmu_config = {
16+
.num_regions = ARRAY_SIZE(mmu_regions),
17+
.mmu_regions = mmu_regions,
18+
};

soc/renesas/rz/rza3m/pinctrl_soc.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#ifndef ZEPHYR_SOC_RENESAS_RZ_RZA3M_PINCTRL_SOC_H_
7+
#define ZEPHYR_SOC_RENESAS_RZ_RZA3M_PINCTRL_SOC_H_
8+
9+
#include <pinctrl_rza.h>
10+
11+
#endif /* ZEPHYR_SOC_RENESAS_RZ_RZA3M_PINCTRL_SOC_H_ */

soc/renesas/rz/rza3m/sections.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_PROLOGUE(.header, CONFIG_FLASH_BASE_ADDRESS,)
8+
{
9+
QUAD(__start)
10+
QUAD(0xFFFFFFFFFFFFFFFF-__start)
11+
QUAD(CONFIG_SRAM_BASE_ADDRESS)
12+
QUAD(0xFFFFFFFFFFFFFFFF-CONFIG_SRAM_BASE_ADDRESS)
13+
QUAD(z_mapped_size)
14+
QUAD(0xFFFFFFFFFFFFFFFF-z_mapped_size)
15+
FILL(0x00)
16+
. += 0x1B0;
17+
QUAD(0x4120505346205a52)
18+
QUAD(0x69746163696c7070)
19+
QUAD(0x0000000000006e6f)
20+
QUAD(0x0000000000000000)
21+
} > FLASH
22+
23+
z_mapped_size = z_mapped_end - z_mapped_start;

soc/renesas/rz/rza3m/soc.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief System/hardware module for Renesas RZ/A3UL Group
10+
*/
11+
12+
#include <zephyr/init.h>
13+
#include "soc.h"
14+
15+
uint32_t SystemCoreClock;
16+
17+
void soc_early_init_hook(void)
18+
{
19+
/* Configure system clocks. */
20+
bsp_clock_init();
21+
22+
/* Initialize SystemCoreClock variable. */
23+
SystemCoreClockUpdate();
24+
}

soc/renesas/rz/rza3m/soc.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef ZEPHYR_SOC_RENESAS_RZA3M_SOC_H_
8+
#define ZEPHYR_SOC_RENESAS_RZA3M_SOC_H_
9+
10+
#include <bsp_api.h>
11+
12+
#endif /* ZEPHYR_SOC_RENESAS_RZA3M_SOC_H_ */

soc/renesas/rz/soc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ family:
44
- name: rza2m
55
socs:
66
- name: r7s921053vcbg
7+
- name: rza3m
8+
socs:
9+
- name: r9a07g066m04gbg
710
- name: rza3ul
811
socs:
912
- name: r9a07g063u02gbg

0 commit comments

Comments
 (0)