Skip to content

Commit 9f243af

Browse files
committed
soc: arm: reneas: Add r8a779f0 support
r8a779f0 SoC is part of the Renesas R-Car Gen4 SoC series. This SoC has a dual core lockstep Cortex-R52 CPU. L1 cache and branch prediction are enabled for Renesas RCar Gen4 SoCs. Signed-off-by: Aymeric Aillet <[email protected]>
1 parent 7f254e9 commit 9f243af

File tree

8 files changed

+127
-1
lines changed

8 files changed

+127
-1
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Copyright (c) 2023 IoT.bzh
22
# SPDX-License-Identifier: Apache-2.0
33

4-
zephyr_library_sources_ifdef(CONFIG_SOC_R8A779F0 pfc_r8a779f0.c)
4+
zephyr_sources(
5+
soc.c
6+
)
7+
zephyr_library_sources_ifdef(CONFIG_SOC_R8A779F0 pfc_r8a779f0.c)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2023 IoT.bzh
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_R8A779F0
5+
6+
config SOC
7+
default "r8a779f0"
8+
9+
config NUM_IRQS
10+
default 1216 #960 SPI + 256 LPI
11+
12+
config PINCTRL
13+
default y
14+
15+
endif # SOC_R8A779F0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Renesas R-Car Gen4 SoC line
2+
3+
# Copyright (c) 2023 IoT.bzh
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if SOC_SERIES_RCAR_GEN4
7+
8+
source "soc/arm/renesas_rcar/gen4/Kconfig.defconfig.r8a779*"
9+
10+
config SOC_SERIES
11+
default "gen4"
12+
13+
endif # SOC_SERIES_RCAR_GEN4
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2023 IoT.bzh
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_RCAR_GEN4
5+
bool "Renesas R-Car Gen4 Cortex R52"
6+
select ARM
7+
select CPU_CORTEX_R52
8+
select PLATFORM_SPECIFIC_INIT
9+
select GIC_V3
10+
select GIC_SINGLE_SECURITY_STATE
11+
select SOC_FAMILY_RCAR
12+
select CLOCK_CONTROL_RCAR_CPG_MSSR if CLOCK_CONTROL
13+
select ARM_ARCH_TIMER
14+
help
15+
Enable support for Renesas R-Car Gen4 SoC series
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2023 IoT.bzh
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
choice
5+
prompt "Renesas RCar SoC Selection"
6+
depends on SOC_SERIES_RCAR_GEN4
7+
8+
config SOC_R8A779F0
9+
bool "r8a779f0"
10+
11+
endchoice
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright (c) 2023 IoT.bzh
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/arch/arm/aarch32/cortex_a_r/scripts/linker.ld>

soc/arm/renesas_rcar/gen4/soc.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2023 IoT.bzh
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#include <zephyr/kernel.h>
9+
#include <zephyr/device.h>
10+
#include <zephyr/init.h>
11+
12+
/**
13+
*
14+
* @brief Perform basic hardware initialization
15+
*
16+
* @return 0
17+
*/
18+
19+
static int soc_init(const struct device *arg)
20+
{
21+
ARG_UNUSED(arg);
22+
23+
/* Install default handler that simply resets the CPU
24+
* if configured in the kernel, NOP otherwise
25+
*/
26+
NMI_INIT();
27+
return 0;
28+
}
29+
30+
void z_arm_platform_init(void)
31+
{
32+
L1C_DisableCaches();
33+
L1C_DisableBTAC();
34+
35+
/* Invalidate instruction cache and flush branch target cache */
36+
__set_ICIALLU(0);
37+
__DSB();
38+
__ISB();
39+
40+
L1C_EnableCaches();
41+
L1C_EnableBTAC();
42+
}
43+
44+
SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

soc/arm/renesas_rcar/gen4/soc.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2023 IoT.bzh
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#ifndef _SOC__H_
9+
#define _SOC__H_
10+
11+
/* Define CMSIS configurations */
12+
#define __CR_REV 1U
13+
14+
/* Do not let CMSIS to handle GIC and Timer */
15+
#define __GIC_PRESENT 0
16+
#define __TIM_PRESENT 0
17+
18+
#endif /* _SOC__H_ */

0 commit comments

Comments
 (0)