Skip to contentSkip to conversation

arm64: dts: renesas: spider: Add I2C and EEPROM support

PATCH Superseded Geert Uytterhoeven 3 participants 7 messages Feb 3, 2022 – Apr 4, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover arm64: dts: renesas: spider: Add I2C and EEPROM support

Hi all,

This patch series adds I2C and EEPROM support for the Renesas R-Car S4-8 SoC and the Spider development board.

It has been tested by reading /sys/bus/nvmem/devices/*/nvmem. All three EEPROMs are empty, except for a (different for each (sub)board) 32-bit value at offset 0x70.
As the AT24 EEPROM driver does not set the I2C_M_DMA_SAFE flag (it uses regmap), DMA operation was tested by modifying the i2c-rcar driver to ignore the lack of this flag.

For testing, this series and its dependencies (i2c driver updates, pinctrl, clk, ...) can be found at[1].

Thanks for your comments!

[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/r8a779f0-i2c-v1

Geert Uytterhoeven (3):
arm64: dts: renesas: r8a779f0: Add I2C nodes
arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs
arm64: dts: renesas: spider: Add Ethernet sub-board

 .../boot/dts/renesas/r8a779f0-spider-cpu.dtsi |  20 ++++
 .../dts/renesas/r8a779f0-spider-ethernet.dtsi |  15 +++
 .../boot/dts/renesas/r8a779f0-spider.dts      |  10 ++
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi     | 102 ++++++++++++++++++
 4 files changed, 147 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
Signature · 12 lines
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH 1/3 arm64: dts: renesas: r8a779f0: Add I2C nodes

Add device nodes for the I2C Bus Interfaces on the Renesas R-Car S4-8 (R8A779F0) SoC.

Based on a larger patch in the BSP by LUU HOAI.

---
R-Car S4 Series Hardware User's Manual Rev. 0.51 states I2C2 TX DMARS is 0x05, which is probably a typo?

Changed compared to the BSP:
- Replace GIC_SPI in reg property by 0,
- Add DMA-related properties.

---
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 102 ++++++++++++++++++++++
 1 file changed, 102 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0.dtsi +102 -0
index 182861251d22551c..a8d0f930cbb35164 100644
@@ -222,6 +222,108 @@ sysc: system-controller@e6180000 {
 			#power-domain-cells = <1>;
 		};
 
+		i2c0: i2c@e6500000 {
+			compatible = "renesas,i2c-r8a779f0",
+				     "renesas,rcar-gen4-i2c";
+			reg = <0 0xe6500000 0 0x40>;
+			interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 518>;
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 518>;
+			dmas = <&dmac0 0x91>, <&dmac0 0x90>,
+			       <&dmac1 0x91>, <&dmac1 0x90>;
+			dma-names = "tx", "rx", "tx", "rx";
+			i2c-scl-internal-delay-ns = <110>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c1: i2c@e6508000 {
+			compatible = "renesas,i2c-r8a779f0",
+				     "renesas,rcar-gen4-i2c";
+			reg = <0 0xe6508000 0 0x40>;
+			interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 519>;
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 519>;
+			dmas = <&dmac0 0x93>, <&dmac0 0x92>,
+			       <&dmac1 0x93>, <&dmac1 0x92>;
+			dma-names = "tx", "rx", "tx", "rx";
+			i2c-scl-internal-delay-ns = <110>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c2: i2c@e6510000 {
+			compatible = "renesas,i2c-r8a779f0",
+				     "renesas,rcar-gen4-i2c";
+			reg = <0 0xe6510000 0 0x40>;
+			interrupts = <0 240 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 520>;
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 520>;
+			dmas = <&dmac0 0x95>, <&dmac0 0x94>,
+			       <&dmac1 0x95>, <&dmac1 0x94>;
+			dma-names = "tx", "rx", "tx", "rx";
+			i2c-scl-internal-delay-ns = <110>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c3: i2c@e66d0000 {
+			compatible = "renesas,i2c-r8a779f0",
+				     "renesas,rcar-gen4-i2c";
+			reg = <0 0xe66d0000 0 0x40>;
+			interrupts = <GIC_SPI 241 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 521>;
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 521>;
+			dmas = <&dmac0 0x97>, <&dmac0 0x96>,
+			       <&dmac1 0x97>, <&dmac1 0x96>;
+			dma-names = "tx", "rx", "tx", "rx";
+			i2c-scl-internal-delay-ns = <110>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c4: i2c@e66d8000 {
+			compatible = "renesas,i2c-r8a779f0",
+				     "renesas,rcar-gen4-i2c";
+			reg = <0 0xe66d8000 0 0x40>;
+			interrupts = <GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 522>;
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 522>;
+			dmas = <&dmac0 0x99>, <&dmac0 0x98>,
+			       <&dmac1 0x99>, <&dmac1 0x98>;
+			dma-names = "tx", "rx", "tx", "rx";
+			i2c-scl-internal-delay-ns = <110>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c5: i2c@e66e0000 {
+			compatible = "renesas,i2c-r8a779f0",
+				     "renesas,rcar-gen4-i2c";
+			reg = <0 0xe66e0000 0 0x40>;
+			interrupts = <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 523>;
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 523>;
+			dmas = <&dmac0 0x9b>, <&dmac0 0x9a>,
+			       <&dmac1 0x9b>, <&dmac1 0x9a>;
+			dma-names = "tx", "rx", "tx", "rx";
+			i2c-scl-internal-delay-ns = <110>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		scif3: serial@e6c50000 {
 			compatible = "renesas,scif-r8a779f0",
 				     "renesas,rcar-gen4-scif", "renesas,scif";
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes

Quoted 9 lines · Geert Uytterhoeven

Add device nodes for the I2C Bus Interfaces on the Renesas R-Car S4-8 (R8A779F0) SoC.

Based on a larger patch in the BSP by LUU HOAI.

---
R-Car S4 Series Hardware User's Manual Rev. 0.51 states I2C2 TX DMARS is 0x05, which is probably a typo?

This is confirmed to be a typo.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#3 lore raw

PATCH 2/3 arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs

In reply to Geert Uytterhoeven

Enable the I2C4 bus on the Falcon CPU board, and describe the I2C EEPROMs present on the Spider CPU and BreakOut boards.

Extracted from a larger patch in the BSP by LUU HOAI.

---
 .../boot/dts/renesas/r8a779f0-spider-cpu.dtsi | 20 +++++++++++++++++++
 .../boot/dts/renesas/r8a779f0-spider.dts      |  9 +++++++++
 2 files changed, 29 insertions(+)
arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi +20 -0
index 6e07c54148e716d7..41aa8591b3b1b548 100644
@@ -31,10 +31,30 @@ &extalr_clk {
 	clock-frequency = <32768>;
 };
 
+&i2c4 {
+	pinctrl-0 = <&i2c4_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <400000>;
+
+	eeprom@50 {
+		compatible = "rohm,br24g01", "atmel,24c01";
+		label = "cpu-board";
+		reg = <0x50>;
+		pagesize = <8>;
+	};
+};
+
 &pfc {
 	pinctrl-0 = <&scif_clk_pins>;
 	pinctrl-names = "default";
 
+	i2c4_pins: i2c4 {
+		groups = "i2c4";
+		function = "i2c4";
+	};
+
 	scif3_pins: scif3 {
 		groups = "scif3_data", "scif3_ctrl";
 		function = "scif3";
arch/arm64/boot/dts/renesas/r8a779f0-spider.dts +9 -0
index f286254b41d885d9..78c4730538fdc9d3 100644
@@ -20,3 +20,12 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 };
+
+&i2c4 {
+	eeprom@51 {
+		compatible = "rohm,br24g01", "atmel,24c01";
+		label = "breakout-board";
+		reg = <0x51>;
+		pagesize = <8>;
+	};
+};
Signature · 1 line
2.25.1
author maintainer
#5 lore raw

PATCH 3/3 arm64: dts: renesas: spider: Add Ethernet sub-board

In reply to Geert Uytterhoeven

Add a DTS file for the Spider Ether TSN sub-board (RTP8A779F0ASKB0ST0S), and include it from the main r8a779f0-spider.dts.

For now its contents are limited to the Board ID EEPROM.

Extracted from a larger patch in the BSP by LUU HOAI.

---
 .../dts/renesas/r8a779f0-spider-ethernet.dtsi     | 15 +++++++++++++++
 arch/arm64/boot/dts/renesas/r8a779f0-spider.dts   |  1 +
 2 files changed, 16 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi new file +15 -0
new file mode 100644
index 0000000000000000..15e8d1ebf575f09a
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the Spider Ethernet sub-board
+ *
+ * Copyright (C) 2021 Renesas Electronics Corp.
+ */
+
+&i2c4 {
+	eeprom@52 {
+		compatible = "rohm,br24g01", "atmel,24c01";
+		label = "ethernet-sub-board";
+		reg = <0x52>;
+		pagesize = <8>;
+	};
+};
arch/arm64/boot/dts/renesas/r8a779f0-spider.dts +1 -0
index 78c4730538fdc9d3..2e3b719cc749492d 100644
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 #include "r8a779f0-spider-cpu.dtsi"
+#include "r8a779f0-spider-ethernet.dtsi"
 
 / {
 	model = "Renesas Spider CPU and Breakout boards based on r8a779f0";
Signature · 1 line
2.25.1
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] arm64: dts: renesas: spider: Add Ethernet sub-board

Quoted 8 lines · Geert Uytterhoeven

Add a DTS file for the Spider Ether TSN sub-board (RTP8A779F0ASKB0ST0S), and include it from the main r8a779f0-spider.dts.

For now its contents are limited to the Board ID EEPROM.

Extracted from a larger patch in the BSP by LUU HOAI.