Skip to contentSkip to conversation

ARM: shmobile: r8a7791: add i2c master nodes to dtsi

PATCH New Wolfram Sang 5 participants 13 messages Feb 17, 2014 – May 13, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 ARM: shmobile: r8a7791: add i2c master nodes to dtsi

From: Wolfram Sang <[email protected]>

---
 arch/arm/boot/dts/r8a7791.dtsi | 69 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
arch/arm/boot/dts/r8a7791.dtsi +69 -0
index 41194fe..1ab4f3d 100644
@@ -19,6 +19,15 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+		i2c4 = &i2c4;
+		i2c5 = &i2c5;
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -170,6 +179,66 @@
 			     <0 17 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
+	i2c0: i2c at e6508000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7791";
+		reg = <0 0xe6508000 0 0x40>;
+		interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
+		status = "disabled";
+	};
+
+	i2c1: i2c at e6518000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7791";
+		reg = <0 0xe6518000 0 0x40>;
+		interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7791_CLK_I2C1>;
+		status = "disabled";
+	};
+
+	i2c2: i2c at e6530000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7791";
+		reg = <0 0xe6530000 0 0x40>;
+		interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7791_CLK_I2C2>;
+		status = "disabled";
+	};
+
+	i2c3: i2c at e6540000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7791";
+		reg = <0 0xe6540000 0 0x40>;
+		interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7791_CLK_I2C3>;
+		status = "disabled";
+	};
+
+	i2c4: i2c at e6520000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7791";
+		reg = <0 0xe6520000 0 0x40>;
+		interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7791_CLK_I2C4>;
+		status = "disabled";
+	};
+
+	i2c5: i2c at e6528000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "renesas,i2c-r8a7791";
+		reg = <0 0xe6528000 0 0x40>;
+		interrupts = <0 20 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp9_clks R8A7791_CLK_I2C5>;
+		status = "disabled";
+	};
+
 	pfc: pfc at e6060000 {
 		compatible = "renesas,pfc-r8a7791";
 		reg = <0 0xe6060000 0 0x250>;
Signature · 1 line
1.8.5.1
#1 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

From: Wolfram Sang <[email protected]>

---
 arch/arm/boot/dts/r8a7791-koelsch.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/r8a7791-koelsch.dts +19 -0
index d4b9bba..b3f75d7 100644
@@ -108,10 +108,29 @@
 	clock-frequency = <20000000>;
 };
 
+&i2c2 {
+	pinctrl-0 = <&i2c2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <400000>;
+
+	eeprom at 50 {
+		compatible = "renesas,24c02";
+		reg = <0x50>;
+		pagesize = <16>;
+	};
+};
+
 &pfc {
 	pinctrl-0 = <&scif0_pins &scif1_pins>;
 	pinctrl-names = "default";
 
+	i2c2_pins: i2c {
+		renesas,groups = "i2c2";
+		renesas,function = "i2c2";
+	};
+
 	scif0_pins: serial0 {
 		renesas,groups = "scif0_data_d";
 		renesas,function = "scif0";
Signature · 1 line
1.8.5.1
#3 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

In reply to Wolfram Sang
Quoted 3 lines · Wolfram Sang

From: Wolfram Sang <[email protected]>

Thanks, I have queued up the following after resolving a minor conflict.

From: Wolfram Sang <[email protected]>

ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

[horms+renesas at verge.net.au: resolved conflict]
---
 arch/arm/boot/dts/r8a7791-koelsch.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/r8a7791-koelsch.dts +19 -0
index f67d2d0..bf6ba0c 100644
@@ -108,10 +108,29 @@
 	clock-frequency = <20000000>;
 };
 
+&i2c2 {
+	pinctrl-0 = <&i2c2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <400000>;
+
+	eeprom at 50 {
+		compatible = "renesas,24c02";
+		reg = <0x50>;
+		pagesize = <16>;
+	};
+};
+
 &pfc {
 	pinctrl-0 = <&du_pins &scif0_pins &scif1_pins>;
 	pinctrl-names = "default";
 
+	i2c2_pins: i2c {
+		renesas,groups = "i2c2";
+		renesas,function = "i2c2";
+	};
+
 	du_pins: du {
 		renesas,groups = "du_rgb666", "du_sync", "du_clk_out_0";
 		renesas,function = "du";
Signature · 1 line
1.8.5.2
#4 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

In reply to Wolfram Sang

Hello.

Quoted 14 lines · Wolfram Sang

From: Wolfram Sang <[email protected]>

---
  arch/arm/boot/dts/r8a7791-koelsch.dts | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
arch/arm/boot/dts/r8a7791-koelsch.dts +0 -0
index d4b9bba..b3f75d7 100644
@@ -108,10 +108,29 @@
  	clock-frequency = <20000000>;
  };

arch/arm/boot/dts/r8a7791-koelsch.dts line 119

Quoted 10 lines
arch/arm/boot/dts/r8a7791-koelsch.dts +9 -0
 
+&i2c2 {
+	pinctrl-0 = <&i2c2_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <400000>;
+
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not quite right: Renesas' part is called differently, and you're
carrying the other vendor's naming onto Renesas parts. I'd just say "24c02" (which I'll do in the Henninger board patch).

WBR, Sergei

#5 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

Quoted 7 lines

arch/arm/boot/dts/r8a7791-koelsch.dts line 119

Quoted 3 lines
arch/arm/boot/dts/r8a7791-koelsch.dts +2 -0
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not quite right: Renesas' part is called differently, and
you're carrying the other vendor's naming onto Renesas parts. I'd just say "24c02" (which I'll do in the Henninger board patch).

What about "generic"?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140509/ed4c0d4f/attachment.sig>

#6 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

Hello.

Quoted 8 lines · Wolfram Sang
Quoted 6 lines

arch/arm/boot/dts/r8a7791-koelsch.dts line 119

Quoted 2 lines
arch/arm/boot/dts/r8a7791-koelsch.dts +2 -0
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not quite right: Renesas' part is called differently, and
you're carrying the other vendor's naming onto Renesas parts. I'd just say "24c02" (which I'll do in the Henninger board patch).

What about "generic"?

I don't know, really. However, you're right in that there should be some
vendor prefix -- I've just seen Documentation/devicetree/bindings/eeprom.txt.

WBR, Sergei

#7 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

Quoted 11 lines · Sergei Shtylyov

Hello.

Quoted 6 lines · Wolfram Sang
Quoted 6 lines

arch/arm/boot/dts/r8a7791-koelsch.dts line 119

Quoted 2 lines
arch/arm/boot/dts/r8a7791-koelsch.dts +2 -0
+	eeprom at 50 {
+		compatible = "renesas,24c02";

This is not quite right: Renesas' part is called differently, and
you're carrying the other vendor's naming onto Renesas parts. I'd just say "24c02" (which I'll do in the Henninger board patch).

Quoted 5 lines
Quoted 1 line

What about "generic"?

I don't know, really. However, you're right in that there should
be some vendor prefix -- I've just seen Documentation/devicetree/bindings/eeprom.txt.

A quick survey of arch/arm/boot/dts/ yields:

"atmel,24c02" (22 times)
"microchip,24c02" (once)
"mcp,24c02" (once)

So it seems to me that precedence is in favour of using "renesas,24c02".

#8 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

Quoted 18 lines · Simon Horman
Quoted 11 lines · Sergei Shtylyov

Hello.

Quoted 6 lines · Wolfram Sang
Quoted 6 lines

arch/arm/boot/dts/r8a7791-koelsch.dts line 119

Quoted 2 lines
arch/arm/boot/dts/r8a7791-koelsch.dts +2 -0
+  eeprom at 50 {
+          compatible = "renesas,24c02";

This is not quite right: Renesas' part is called differently, and
you're carrying the other vendor's naming onto Renesas parts. I'd just say "24c02" (which I'll do in the Henninger board patch).

Quoted 5 lines
Quoted 1 line

What about "generic"?

I don't know, really. However, you're right in that there should
be some vendor prefix -- I've just seen Documentation/devicetree/bindings/eeprom.txt.

Quoted 7 lines

A quick survey of arch/arm/boot/dts/ yields:

"atmel,24c02" (22 times)
"microchip,24c02" (once)
"mcp,24c02" (once)

So it seems to me that precedence is in favour of using "renesas,24c02".

Except that the Renesas part is called differently (as Sergei already pointed out), unlike the Atmel and Microchip parts.

So it should be:

        compatible = "renesas,r1ex24002", "<something>,24c02";

Unfortunately the datasheet doesn't mention compatibility with parts from other manufacturers.

So let's <something> be "atmel"?

BTW, we have a similar issue with Genmai, which has an R1EX24128.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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

#9 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

Hello.

Quoted 19 lines · Geert Uytterhoeven
Quoted 18 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

arch/arm/boot/dts/r8a7791-koelsch.dts line 119

Quoted 2 lines
arch/arm/boot/dts/r8a7791-koelsch.dts +2 -0
+  eeprom at 50 {
+          compatible = "renesas,24c02";

This is not quite right: Renesas' part is called differently, and
you're carrying the other vendor's naming onto Renesas parts. I'd just say "24c02" (which I'll do in the Henninger board patch).

Quoted 5 lines
Quoted 1 line

What about "generic"?

I don't know, really. However, you're right in that there should
be some vendor prefix -- I've just seen Documentation/devicetree/bindings/eeprom.txt.

A quick survey of arch/arm/boot/dts/ yields:

"atmel,24c02" (22 times)
"microchip,24c02" (once)
"mcp,24c02" (once)

Quoted 8 lines
Quoted 1 line

So it seems to me that precedence is in favour of using "renesas,24c02".

Except that the Renesas part is called differently (as Sergei already pointed out), unlike the Atmel and Microchip parts.

So it should be:

         compatible = "renesas,r1ex24002", "<something>,24c02";

Unfortunately, that way the legacy I2C driver matching used now won't work
anymore. :-(

Quoted 4 lines

Unfortunately the datasheet doesn't mention compatibility with parts from other manufacturers.

So let's <something> be "atmel"?

Yes, probably. But the "renesas,r1ex24002" part have to be dropped.

Quoted 2 lines

Gr{oetje,eeting}s,
Geert

WBR, Sergei

#10 lore raw

PATCH v2 2/2 ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt

In reply to Geert Uytterhoeven
Quoted 30 lines · Geert Uytterhoeven
Quoted 18 lines · Simon Horman
Quoted 11 lines · Sergei Shtylyov

Hello.

Quoted 6 lines · Wolfram Sang
Quoted 6 lines

arch/arm/boot/dts/r8a7791-koelsch.dts line 119

Quoted 2 lines
arch/arm/boot/dts/r8a7791-koelsch.dts +2 -0
+  eeprom at 50 {
+          compatible = "renesas,24c02";

This is not quite right: Renesas' part is called differently, and
you're carrying the other vendor's naming onto Renesas parts. I'd just say "24c02" (which I'll do in the Henninger board patch).

Quoted 5 lines
Quoted 1 line

What about "generic"?

I don't know, really. However, you're right in that there should
be some vendor prefix -- I've just seen Documentation/devicetree/bindings/eeprom.txt.

Quoted 7 lines

A quick survey of arch/arm/boot/dts/ yields:

"atmel,24c02" (22 times)
"microchip,24c02" (once)
"mcp,24c02" (once)

So it seems to me that precedence is in favour of using "renesas,24c02".

Except that the Renesas part is called differently (as Sergei already pointed out), unlike the Atmel and Microchip parts.

Quoted 8 lines

So it should be:

        compatible = "renesas,r1ex24002", "<something>,24c02";

Unfortunately the datasheet doesn't mention compatibility with parts from other manufacturers.

So let's <something> be "atmel"?

If <something> isn't documented as being compatible then I feel that we should not add it to the list.

Quoted 17 lines

BTW, we have a similar issue with Genmai, which has an R1EX24128.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

PATCH v2 1/2 ARM: shmobile: r8a7791: add i2c master nodes to dtsi

In reply to Wolfram Sang
Quoted 28 lines · Wolfram Sang

From: Wolfram Sang <[email protected]>

---
 arch/arm/boot/dts/r8a7791.dtsi | 69 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
arch/arm/boot/dts/r8a7791.dtsi +9 -0
index 41194fe..1ab4f3d 100644
@@ -19,6 +19,15 @@
        #address-cells = <2>;
        #size-cells = <2>;
 
+       aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+               i2c3 = &i2c3;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;

arch/arm/boot/dts/r8a7791.dtsi line 185

Quoted 7 lines
arch/arm/boot/dts/r8a7791.dtsi +4 -0
@@ -170,6 +179,66 @@
                             <0 17 IRQ_TYPE_LEVEL_HIGH>;
        };
 
+       i2c0: i2c at e6508000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,i2c-r8a7791";

V2 of this patch looks good to me, thanks!

When you have time, please send an incremental patch to add support for the three IIC channels as well.

Cheers,

/ magnus