All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64: dts: renesas: spider: Add I2C and EEPROM support
@ 2022-02-03 15:26 Geert Uytterhoeven
  2022-02-03 15:26 ` [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-02-03 15:26 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Wolfram Sang, LUU HOAI, linux-renesas-soc, Geert Uytterhoeven

	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

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes
  2022-02-03 15:26 [PATCH 0/3] arm64: dts: renesas: spider: Add I2C and EEPROM support Geert Uytterhoeven
@ 2022-02-03 15:26 ` Geert Uytterhoeven
  2022-02-04  7:37   ` Geert Uytterhoeven
  2022-02-03 15:26 ` [PATCH 2/3] arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs Geert Uytterhoeven
  2022-02-03 15:26 ` [PATCH 3/3] arm64: dts: renesas: spider: Add Ethernet sub-board Geert Uytterhoeven
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-02-03 15:26 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Wolfram Sang, LUU HOAI, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
index 182861251d22551c..a8d0f930cbb35164 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
@@ -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";
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs
  2022-02-03 15:26 [PATCH 0/3] arm64: dts: renesas: spider: Add I2C and EEPROM support Geert Uytterhoeven
  2022-02-03 15:26 ` [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes Geert Uytterhoeven
@ 2022-02-03 15:26 ` Geert Uytterhoeven
  2022-04-04 15:57   ` Wolfram Sang
  2022-02-03 15:26 ` [PATCH 3/3] arm64: dts: renesas: spider: Add Ethernet sub-board Geert Uytterhoeven
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-02-03 15:26 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Wolfram Sang, LUU HOAI, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 .../boot/dts/renesas/r8a779f0-spider-cpu.dtsi | 20 +++++++++++++++++++
 .../boot/dts/renesas/r8a779f0-spider.dts      |  9 +++++++++
 2 files changed, 29 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
index 6e07c54148e716d7..41aa8591b3b1b548 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
@@ -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";
diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
index f286254b41d885d9..78c4730538fdc9d3 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
@@ -20,3 +20,12 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 };
+
+&i2c4 {
+	eeprom@51 {
+		compatible = "rohm,br24g01", "atmel,24c01";
+		label = "breakout-board";
+		reg = <0x51>;
+		pagesize = <8>;
+	};
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] arm64: dts: renesas: spider: Add Ethernet sub-board
  2022-02-03 15:26 [PATCH 0/3] arm64: dts: renesas: spider: Add I2C and EEPROM support Geert Uytterhoeven
  2022-02-03 15:26 ` [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes Geert Uytterhoeven
  2022-02-03 15:26 ` [PATCH 2/3] arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs Geert Uytterhoeven
@ 2022-02-03 15:26 ` Geert Uytterhoeven
  2022-04-04 15:57   ` Wolfram Sang
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-02-03 15:26 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Wolfram Sang, LUU HOAI, linux-renesas-soc, 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.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 .../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

diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
new file mode 100644
index 0000000000000000..15e8d1ebf575f09a
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
@@ -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>;
+	};
+};
diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
index 78c4730538fdc9d3..2e3b719cc749492d 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
@@ -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";
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes
  2022-02-03 15:26 ` [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes Geert Uytterhoeven
@ 2022-02-04  7:37   ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-02-04  7:37 UTC (permalink / raw)
  To: Linux-Renesas; +Cc: Magnus Damm, Wolfram Sang, LUU HOAI

On Thu, Feb 3, 2022 at 4:26 PM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> 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.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> 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 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs
  2022-02-03 15:26 ` [PATCH 2/3] arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs Geert Uytterhoeven
@ 2022-04-04 15:57   ` Wolfram Sang
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2022-04-04 15:57 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Magnus Damm, LUU HOAI, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

On Thu, Feb 03, 2022 at 04:26:48PM +0100, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] arm64: dts: renesas: spider: Add Ethernet sub-board
  2022-02-03 15:26 ` [PATCH 3/3] arm64: dts: renesas: spider: Add Ethernet sub-board Geert Uytterhoeven
@ 2022-04-04 15:57   ` Wolfram Sang
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2022-04-04 15:57 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Magnus Damm, LUU HOAI, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

On Thu, Feb 03, 2022 at 04:26:49PM +0100, Geert Uytterhoeven wrote:
> 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.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-04 15:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 15:26 [PATCH 0/3] arm64: dts: renesas: spider: Add I2C and EEPROM support Geert Uytterhoeven
2022-02-03 15:26 ` [PATCH 1/3] arm64: dts: renesas: r8a779f0: Add I2C nodes Geert Uytterhoeven
2022-02-04  7:37   ` Geert Uytterhoeven
2022-02-03 15:26 ` [PATCH 2/3] arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs Geert Uytterhoeven
2022-04-04 15:57   ` Wolfram Sang
2022-02-03 15:26 ` [PATCH 3/3] arm64: dts: renesas: spider: Add Ethernet sub-board Geert Uytterhoeven
2022-04-04 15:57   ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.