Skip to content

Commit 5a3e43c

Browse files
committed
dts: arm: Add Renesas r8a779f0 support
r8a779f0 is also know as S4, this SoC is part of the Gen4 SoC series, has 8 Cortex-A55 and a dual core lockstep Cortex-R52 processor. SCIF0 is dedicated to Zephyr and SCIF3 to Linux. **Control Domains** IMPORTANT: This SoC is divided into two "domains": - Application domain contains some peripherals as well as A55 & R52 cores. - Control domain that contain a G4MH/RH850 MCU and other peripherals. In order to access control domain peripherals such as gpio4-7 and CAN-FD from application domain, the G4MH MCU has to unlock a protection mechanism from control domain buses. "Protected" controllers will be flagged in gen4 device trees, warning users that they need to flash a custom G4MH firmware to unlock access to these controllers. **Clock controller** This SoC clock controller is offering "domains" for each world (Zephyr/Linux). These domains are several "entry points" to the clock controller which are arbitrated to avoid a world from turning off a clock needed by another one. We decided to use the same domain as Linux because the security mechanism as to be implemented before accessing another domain. Signed-off-by: Aymeric Aillet <[email protected]>
1 parent f5634a1 commit 5a3e43c

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2023 IoT.bzh
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <renesas/rcar/gen4/rcar_gen4_cr52.dtsi>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/clock/r8a779f0_cpg_mssr.h>
10+
11+
/ {
12+
soc {
13+
/* The last four registers of this controller are
14+
* located in the control domain
15+
* A custom G4MH/RH850 µC firmware has to be flashed to access them
16+
*/
17+
pfc: pin-controller@e6050000 {
18+
compatible = "renesas,rcar-pfc";
19+
reg = <0xe6050000 0x16c>, <0xe6050800 0x16c>,
20+
<0xe6051000 0x16c>, <0xe6051800 0x16c>,
21+
<0xdfd90000 0x16c>, <0xdfd90800 0x16c>,
22+
<0xdfd91000 0x16c>, <0xdfd91800 0x16c>;
23+
};
24+
25+
/* Clock controller
26+
* Using domain 0 as Linux
27+
*/
28+
cpg: clock-controller@e6150000 {
29+
compatible = "renesas,r8a779f0-cpg-mssr";
30+
reg = <0xe6150000 0x4000>;
31+
#clock-cells = <2>;
32+
};
33+
34+
gpio0: gpio@e6050180 {
35+
compatible = "renesas,rcar-gpio";
36+
reg = <0xe6050180 0x54>;
37+
#gpio-cells = <2>;
38+
gpio-controller;
39+
interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
40+
clocks = <&cpg CPG_MOD 915>;
41+
status = "disabled";
42+
};
43+
44+
/*
45+
* Control domain security has to be released to access gpio4 controller
46+
* A custom G4MH/RH850 µC firmware has to be flashed to do that
47+
*/
48+
gpio4: gpio@dfd90180 {
49+
compatible = "renesas,rcar-gpio";
50+
reg = <0xdfd90180 0x54>;
51+
#gpio-cells = <2>;
52+
gpio-controller;
53+
interrupts = <GIC_SPI 826 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
54+
clocks = <&cpg CPG_MOD 915>;
55+
status = "disabled";
56+
};
57+
58+
/* Zephyr console */
59+
scif0: serial@e6e60000 {
60+
interrupts = <GIC_SPI 249 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
61+
clocks = <&cpg CPG_MOD 702>, <&cpg CPG_CORE R8A779F0_CLK_S0D12_PER>;
62+
};
63+
64+
/* Linux console */
65+
scif3: serial@e6c50000 {
66+
interrupts = <GIC_SPI 252 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
67+
clocks = <&cpg CPG_MOD 704>, <&cpg CPG_CORE R8A779F0_CLK_S0D12_PER>;
68+
};
69+
};
70+
};
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (c) 2023 IoT.bzh
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <arm64/armv8-r.dtsi>
9+
#include <zephyr/dt-bindings/interrupt-controller/arm-gic.h>
10+
#include <zephyr/dt-bindings/clock/renesas_cpg_mssr.h>
11+
12+
/ {
13+
cpus {
14+
#address-cells = <1>;
15+
#size-cells = <0>;
16+
17+
cpu@0 {
18+
device_type = "cpu";
19+
compatible = "arm,cortex-r52";
20+
reg = <0>;
21+
};
22+
};
23+
24+
timer {
25+
compatible = "arm,armv8-timer";
26+
interrupt-parent = <&gic>;
27+
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL
28+
IRQ_DEFAULT_PRIORITY>,
29+
<GIC_PPI 14 IRQ_TYPE_LEVEL
30+
IRQ_DEFAULT_PRIORITY>,
31+
<GIC_PPI 11 IRQ_TYPE_LEVEL
32+
IRQ_DEFAULT_PRIORITY>,
33+
<GIC_PPI 10 IRQ_TYPE_LEVEL
34+
IRQ_DEFAULT_PRIORITY>;
35+
};
36+
37+
soc {
38+
interrupt-parent = <&gic>;
39+
40+
sram0: memory@40040000 {
41+
compatible = "mmio-sram";
42+
reg = <0x40040000 0x100000>;
43+
};
44+
45+
gic: interrupt-controller@f0000000 {
46+
compatible = "arm,gic-v3", "arm,gic";
47+
reg = <0xf0000000 0x1000>,
48+
<0xf0100000 0x20000>;
49+
interrupt-controller;
50+
#interrupt-cells = <4>;
51+
status = "okay";
52+
};
53+
54+
scif0: serial@e6e60000 {
55+
compatible = "renesas,rcar-scif";
56+
reg = <0xe6e60000 0x64>;
57+
current-speed = <115200>;
58+
status = "disabled";
59+
};
60+
61+
scif3: serial@e6c50000 {
62+
compatible = "renesas,rcar-scif";
63+
reg = <0xe6c50000 0x64>;
64+
current-speed = <115200>;
65+
status = "disabled";
66+
};
67+
};
68+
};

0 commit comments

Comments
 (0)