Skip to content

Commit 1426019

Browse files
duynguyenxaquytranpzz
authored andcommitted
soc: renesas: Add initial support for RA6M1 SOC
- Initial commit to support RA6M1 SOC Signed-off-by: Duy Phuong Hoang. Nguyen <[email protected]>
1 parent 08170d3 commit 1426019

File tree

10 files changed

+189
-0
lines changed

10 files changed

+189
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2024 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(ROM_START opt_set_mem.ld)
11+
12+
zephyr_linker_sources(SECTIONS sections.ld)
13+
14+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

soc/renesas/ra/ra6m1/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RA6M1
5+
select ARM
6+
select CPU_CORTEX_M4
7+
select CPU_HAS_ARM_MPU
8+
select HAS_RENESAS_RA_FSP
9+
select CPU_CORTEX_M_HAS_DWT
10+
select CPU_HAS_FPU
11+
select FPU
12+
select HAS_SWO
13+
select XIP
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_RA6M1
5+
6+
config NUM_IRQS
7+
default 96
8+
9+
config PINCTRL
10+
default y
11+
12+
endif # SOC_SERIES_RA6M1

soc/renesas/ra/ra6m1/Kconfig.soc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RA6M1
5+
bool
6+
select SOC_FAMILY_RENESAS_RA
7+
help
8+
Renesas RA6M1 series
9+
10+
config SOC_R7FA6M1AD3CFP
11+
bool
12+
select SOC_SERIES_RA6M1
13+
help
14+
R7FA6M1AD3CFP
15+
16+
config SOC_SERIES
17+
default "ra6m1" if SOC_SERIES_RA6M1
18+
19+
config SOC
20+
default "r7fa6m1ad3cfp" if SOC_R7FA6M1AD3CFP
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* ROM Registers start at address 0x00000400 */
8+
. = 0x400;
9+
KEEP(*(.rom_registers*))
10+
/* Reserving 0x100 bytes of space for ROM registers. */
11+
. = 0x500;

soc/renesas/ra/ra6m1/sections.ld

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
.code_in_ram :
8+
{
9+
. = ALIGN(4);
10+
__Code_In_RAM_Start = .;
11+
KEEP(*(.code_in_ram*))
12+
__Code_In_RAM_End = .;
13+
} > RAMABLE_REGION
14+
15+
SECTION_DATA_PROLOGUE(.fsp_dtc_vector_table,(NOLOAD),)
16+
{
17+
/* If DTC is used, put the DTC vector table at the start of SRAM.
18+
This avoids memory holes due to 1K alignment required by it. */
19+
*(.fsp_dtc_vector_table)
20+
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
21+
22+
SECTION_PROLOGUE(.id_code,,)
23+
{
24+
KEEP(*(.id_code*))
25+
} GROUP_LINK_IN(ID_CODE)

soc/renesas/ra/ra6m1/soc.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief System/hardware module for Renesas RA6M1 family processor
10+
*/
11+
12+
#include <zephyr/device.h>
13+
#include <zephyr/init.h>
14+
#include <zephyr/kernel.h>
15+
#include <zephyr/arch/cpu.h>
16+
#include <cmsis_core.h>
17+
#include <zephyr/irq.h>
18+
#include <zephyr/logging/log.h>
19+
LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
20+
21+
#include "bsp_cfg.h"
22+
#include <bsp_api.h>
23+
24+
uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
25+
26+
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
27+
28+
/**
29+
* @brief Perform basic hardware initialization at boot.
30+
*
31+
* This needs to be run from the very beginning.
32+
* So the init priority has to be 0 (zero).
33+
*
34+
* @return 0
35+
*/
36+
static int renesas_ra6m1_init(void)
37+
{
38+
uint32_t key;
39+
40+
key = irq_lock();
41+
42+
SystemCoreClock = BSP_MOCO_HZ;
43+
g_protect_pfswe_counter = 0;
44+
bsp_clock_init();
45+
46+
irq_unlock(key);
47+
48+
return 0;
49+
}
50+
51+
SYS_INIT(renesas_ra6m1_init, PRE_KERNEL_1, 0);

soc/renesas/ra/ra6m1/soc.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file SoC configuration macros for the Renesas RA6M1 family MCU
9+
*/
10+
11+
#ifndef ZEPHYR_SOC_RENESAS_RA6M1_SOC_H_
12+
#define ZEPHYR_SOC_RENESAS_RA6M1_SOC_H_
13+
14+
#include <bsp_api.h>
15+
16+
#endif /* ZEPHYR_SOC_RENESAS_RA6M1_SOC_H_ */

soc/renesas/ra/soc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ family:
2525
- name: ra6e2
2626
socs:
2727
- name: r7fa6e2bb3cfm
28+
- name: ra6m1
29+
socs:
30+
- name: r7fa6m1ad3cfp
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
&pinctrl {
7+
sci9_default: sci9_default {
8+
group1 {
9+
/* tx */
10+
psels = <RA_PSEL(RA_PSEL_SCI_9, 6, 2)>,
11+
<RA_PSEL(RA_PSEL_SCI_9, 6, 1)>;
12+
};
13+
};
14+
};
15+
16+
&sci9 {
17+
pinctrl-0 = <&sci9_default>;
18+
pinctrl-names = "default";
19+
status = "okay";
20+
dut: uart {
21+
current-speed = <115200>;
22+
status = "okay";
23+
};
24+
};

0 commit comments

Comments
 (0)