Skip to contentSkip to conversation

RM9200 DT i2c bindings and MPA 1600 support

PATCH New Joachim Eastwood 3 participants 8 messages Feb 8, 2013 – Mar 15, 2013

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

cover RM9200 DT i2c bindings and MPA 1600 support

Hi,

1st patch adds bindings for hardware i2c on RM9200. This also includes pinctrl setup.

2nd patch adds pinctrl nodes to i2c-gpio which is need since the gpio pins must be set to open drain. I suspect that this should be done in other AT91 dtsi files as well, unless we want to rely on the bootloader doing it.

3rd patch adds a new RM9200 DT board. This is minimal DT file with a lot of stuff missing. The plan is to add the ASoC stuff next.

Joachim Eastwood (3):
ARM: at91: add TWI bindings to RM9200 DT
ARM: at91: add pinctrl nodes to i2c-gpio on RM92000 DT
ARM: at91: add MPA 1600 DT board

 arch/arm/boot/dts/Makefile        |  1 +
 arch/arm/boot/dts/at91rm9200.dtsi | 28 +++++++++++++++
 arch/arm/boot/dts/mpa1600.dts     | 71 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-at91/at91rm9200.c   |  1 +
 4 files changed, 101 insertions(+)
 create mode 100644 arch/arm/boot/dts/mpa1600.dts
Signature · 1 line
1.8.0
#1 lore raw

PATCH 1/3 ARM: at91: add TWI bindings to RM9200 DT

---
 arch/arm/boot/dts/at91rm9200.dtsi | 20 ++++++++++++++++++++
 arch/arm/mach-at91/at91rm9200.c   |  1 +
 2 files changed, 21 insertions(+)
arch/arm/boot/dts/at91rm9200.dtsi +20 -0
index b0268a5..a7031c6 100644
@@ -29,6 +29,7 @@
 		gpio3 = &pioD;
 		tcb0 = &tcb0;
 		tcb1 = &tcb1;
+		i2c0 = &i2c0;
 		ssc0 = &ssc0;
 		ssc1 = &ssc1;
 		ssc2 = &ssc2;
@@ -91,6 +92,17 @@
 				interrupts = <20 4 0 21 4 0 22 4 0>;
 			};
 
+			i2c0: i2c at fffb8000 {
+				compatible = "atmel,at91rm9200-i2c";
+				reg = <0xfffb8000 0x4000>;
+				interrupts = <12 4 6>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_twi>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
 			mmc0: mmc at fffb4000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfffb4000 0x4000>;
@@ -365,6 +377,14 @@
 					};
 				};
 
+				twi {
+					pinctrl_twi: twi-0 {
+						atmel,pins =
+							<0 25 0x1 0x2	/* PA25 periph A with multi drive */
+							 0 26 0x1 0x2>;	/* PA26 periph A with multi drive */
+					};
+				};
+
 				pioA: gpio at fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
arch/arm/mach-at91/at91rm9200.c +1 -0
index 9706c00..36b05fc 100644
@@ -212,6 +212,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk),
 	CLKDEV_CON_DEV_ID("mci_clk", "fffb4000.mmc", &mmc_clk),
 	CLKDEV_CON_DEV_ID("emac_clk", "fffbc000.ethernet", &ether_clk),
+	CLKDEV_CON_DEV_ID(NULL, "fffb8000.i2c", &twi_clk),
 	CLKDEV_CON_DEV_ID("hclk", "300000.ohci", &ohci_clk),
 	CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
 	CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
Signature · 1 line
1.8.0
#2 lore raw

PATCH 2/3 ARM: at91: add pinctrl nodes to i2c-gpio on RM92000 DT

In reply to Joachim Eastwood

GPIO pins used by i2c-gpio must be set to multi drive (open drain) to work properly.

---
 arch/arm/boot/dts/at91rm9200.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/at91rm9200.dtsi +8 -0
index a7031c6..5d3ed5a 100644
@@ -383,6 +383,12 @@
 							<0 25 0x1 0x2	/* PA25 periph A with multi drive */
 							 0 26 0x1 0x2>;	/* PA26 periph A with multi drive */
 					};
+
+					pinctrl_twi_gpio: twi_gpio-0 {
+						atmel,pins =
+							<0 25 0x0 0x2	/* PA25 GPIO with multi drive */
+							 0 26 0x0 0x2>;	/* PA26 GPIO with multi drive */
+					};
 				};
 
 				pioA: gpio at fffff400 {
@@ -520,6 +526,8 @@
 		i2c-gpio,sda-open-drain;
 		i2c-gpio,scl-open-drain;
 		i2c-gpio,delay-us = <2>;	/* ~100 kHz */
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_twi_gpio>;
 		#address-cells = <1>;
 		#size-cells = <0>;
 		status = "disabled";
Signature · 1 line
1.8.0
#3 lore raw

PATCH 3/3 ARM: at91: add MPA 1600 DT board

In reply to Joachim Eastwood
---
 arch/arm/boot/dts/Makefile    |  1 +
 arch/arm/boot/dts/mpa1600.dts | 71 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 arch/arm/boot/dts/mpa1600.dts
arch/arm/boot/dts/Makefile +1 -0
index 5ebb44f..8bfb5f3 100644
@@ -3,6 +3,7 @@ ifeq ($(CONFIG_OF),y)
 # Keep at91 dtb files sorted alphabetically for each SoC
 # rm9200
 dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb
+dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb
 # sam9260
 dtb-$(CONFIG_ARCH_AT91) += animeo_ip.dtb
 dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb
arch/arm/boot/dts/mpa1600.dts new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
1.8.0
#4 lore raw

PATCH 3/3 ARM: at91: add MPA 1600 DT board

Quoted 78 lines · Joachim Eastwood
---
 arch/arm/boot/dts/Makefile    |  1 +
 arch/arm/boot/dts/mpa1600.dts | 71 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 arch/arm/boot/dts/mpa1600.dts
arch/arm/boot/dts/Makefile +1 -0
index 5ebb44f..8bfb5f3 100644
@@ -3,6 +3,7 @@ ifeq ($(CONFIG_OF),y)
 # Keep at91 dtb files sorted alphabetically for each SoC
 # rm9200
 dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb
+dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb
 # sam9260
 dtb-$(CONFIG_ARCH_AT91) += animeo_ip.dtb
 dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb
arch/arm/boot/dts/mpa1600.dts new file +53 -0
new file mode 100644
index 0000000..927972a
@@ -0,0 +1,71 @@
+/*
+ * mpa1600.dts - Device Tree file for Phontech MPA 1600
+ *
+ *  Copyright (C) 2013 Joachim Eastwood <[email protected]>
+ *
+ * Licensed under GPLv2 only
+ */
+/dts-v1/;
+/include/ "at91rm9200.dtsi"
+
+/ {
+	model = "Phontech MPA 1600";
+	compatible = "phontech,mpa1600", "atmel,at91rm9200";
+
+	memory {
+		reg = <0x20000000 0x4000000>;
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		main_clock: clock at 0 {
+			compatible = "atmel,osc", "fixed-clock";
+			clock-frequency = <18432000>;
+		};
+	};
+
+	ahb {
+		apb {
+			dbgu: serial at fffff200 {
+				status = "okay";
+			};
+
+			macb0: ethernet at fffbc000 {
+				phy-mode = "rmii";
+				status = "okay";
+			};
+
+			ssc0: ssc at fffd0000 {
+				status = "okay";
+			};
+
+			ssc1: ssc at fffd4000 {
+				status = "okay";
+			};
+		};
+
+		usb0: ohci at 00300000 {
+			num-ports = <1>;
+			status = "okay";
+		};

arch/arm/boot/dts/mpa1600.dts line 63

Quoted 10 lines
arch/arm/boot/dts/mpa1600.dts new file +10 -0
+	};
+
+	i2c at 0 {
+		status = "okay";
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;

No need to use these address-cells and size-cells properties as child DT node is not Using. Please see the discussion on link

http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15590.html

Quoted 17 lines
arch/arm/boot/dts/mpa1600.dts new file +8 -0
+
+		monitor_mute {
+			label = "Monitor mute";
+			gpios = <&pioC 1 1>;
+			linux,code = <113>;
+		};
+	};
+};
Signature · 7 lines
1.8.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#5 lore raw

PATCH 3/3 ARM: at91: add MPA 1600 DT board

Quoted 93 lines · Anil
Quoted 78 lines · Joachim Eastwood
---
 arch/arm/boot/dts/Makefile    |  1 +
 arch/arm/boot/dts/mpa1600.dts | 71 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 arch/arm/boot/dts/mpa1600.dts
arch/arm/boot/dts/Makefile +1 -0
index 5ebb44f..8bfb5f3 100644
@@ -3,6 +3,7 @@ ifeq ($(CONFIG_OF),y)
 # Keep at91 dtb files sorted alphabetically for each SoC
 # rm9200
 dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb
+dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb
 # sam9260
 dtb-$(CONFIG_ARCH_AT91) += animeo_ip.dtb
 dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb
arch/arm/boot/dts/mpa1600.dts new file +53 -0
new file mode 100644
index 0000000..927972a
@@ -0,0 +1,71 @@
+/*
+ * mpa1600.dts - Device Tree file for Phontech MPA 1600
+ *
+ *  Copyright (C) 2013 Joachim Eastwood <[email protected]>
+ *
+ * Licensed under GPLv2 only
+ */
+/dts-v1/;
+/include/ "at91rm9200.dtsi"
+
+/ {
+     model = "Phontech MPA 1600";
+     compatible = "phontech,mpa1600", "atmel,at91rm9200";
+
+     memory {
+             reg = <0x20000000 0x4000000>;
+     };
+
+     clocks {
+             #address-cells = <1>;
+             #size-cells = <1>;
+             ranges;
+
+             main_clock: clock at 0 {
+                     compatible = "atmel,osc", "fixed-clock";
+                     clock-frequency = <18432000>;
+             };
+     };
+
+     ahb {
+             apb {
+                     dbgu: serial at fffff200 {
+                             status = "okay";
+                     };
+
+                     macb0: ethernet at fffbc000 {
+                             phy-mode = "rmii";
+                             status = "okay";
+                     };
+
+                     ssc0: ssc at fffd0000 {
+                             status = "okay";
+                     };
+
+                     ssc1: ssc at fffd4000 {
+                             status = "okay";
+                     };
+             };
+
+             usb0: ohci at 00300000 {
+                     num-ports = <1>;
+                     status = "okay";
+             };

arch/arm/boot/dts/mpa1600.dts line 63

Quoted 10 lines
arch/arm/boot/dts/mpa1600.dts new file +10 -0
+     };
+
+     i2c at 0 {
+             status = "okay";
+     };
+
+     gpio_keys {
+             compatible = "gpio-keys";
+             #address-cells = <1>;
+             #size-cells = <0>;

No need to use these address-cells and size-cells properties as child DT node is not Using. Please see the discussion on link

Quoted 1 line

http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15590.html

I see.

Thanks for the feedback. I'll update this patch in the series.

I assume someone will clean up all the other dts files or we'll never get rid of these properties as people will copy-paste stuff.

regards
Joachim Eastwood

#6 lore raw

PATCH 1/1 ARM: at91/dt: gpio-keys: remove address-cells and size-cells properties

Gpio-keys nodes are not using the "reg" property in their sub nodes. So, there is no need to define #address-cells and #size-cells properties in gpio-keys nodes: we remove them.

---
 arch/arm/boot/dts/at91sam9263ek.dts         | 2 --
 arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 2 --
 arch/arm/boot/dts/at91sam9m10g45ek.dts      | 2 --
 arch/arm/boot/dts/at91sam9n12ek.dts         | 2 --
 4 files changed, 8 deletions(-)
arch/arm/boot/dts/at91sam9263ek.dts +0 -2
index 1eb0872..aa0e184 100644
@@ -155,8 +155,6 @@
 
 	gpio_keys {
 		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
 
 		left_click {
 			label = "left_click";
arch/arm/boot/dts/at91sam9g20ek_common.dtsi +0 -2
index da15e83..e041b72 100644
@@ -167,8 +167,6 @@
 
 	gpio_keys {
 		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
 
 		btn3 {
 			label = "Button 3";
arch/arm/boot/dts/at91sam9m10g45ek.dts +0 -2
index 20c3191..c795bfb 100644
@@ -162,8 +162,6 @@
 
 	gpio_keys {
 		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
 
 		left_click {
 			label = "left_click";
arch/arm/boot/dts/at91sam9n12ek.dts +0 -2
index d400f8d..7117c05 100644
@@ -104,8 +104,6 @@
 
 	gpio_keys {
 		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
 
 		enter {
 			label = "Enter";
Signature · 1 line
1.8.0
#7 lore raw

PATCH 3/3 ARM: at91: add MPA 1600 DT board

In reply to Joachim Eastwood

On 02/08/2013 04:56 PM, Joachim Eastwood :

Quoted 94 lines · Anil
Quoted 93 lines · Joachim Eastwood
Quoted 78 lines
---
 arch/arm/boot/dts/Makefile    |  1 +
 arch/arm/boot/dts/mpa1600.dts | 71 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 arch/arm/boot/dts/mpa1600.dts
arch/arm/boot/dts/Makefile +1 -0
index 5ebb44f..8bfb5f3 100644
@@ -3,6 +3,7 @@ ifeq ($(CONFIG_OF),y)
 # Keep at91 dtb files sorted alphabetically for each SoC
 # rm9200
 dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb
+dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb
 # sam9260
 dtb-$(CONFIG_ARCH_AT91) += animeo_ip.dtb
 dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb
arch/arm/boot/dts/mpa1600.dts new file +53 -0
new file mode 100644
index 0000000..927972a
@@ -0,0 +1,71 @@
+/*
+ * mpa1600.dts - Device Tree file for Phontech MPA 1600
+ *
+ *  Copyright (C) 2013 Joachim Eastwood <[email protected]>
+ *
+ * Licensed under GPLv2 only
+ */
+/dts-v1/;
+/include/ "at91rm9200.dtsi"
+
+/ {
+     model = "Phontech MPA 1600";
+     compatible = "phontech,mpa1600", "atmel,at91rm9200";
+
+     memory {
+             reg = <0x20000000 0x4000000>;
+     };
+
+     clocks {
+             #address-cells = <1>;
+             #size-cells = <1>;
+             ranges;
+
+             main_clock: clock at 0 {
+                     compatible = "atmel,osc", "fixed-clock";
+                     clock-frequency = <18432000>;
+             };
+     };
+
+     ahb {
+             apb {
+                     dbgu: serial at fffff200 {
+                             status = "okay";
+                     };
+
+                     macb0: ethernet at fffbc000 {
+                             phy-mode = "rmii";
+                             status = "okay";
+                     };
+
+                     ssc0: ssc at fffd0000 {
+                             status = "okay";
+                     };
+
+                     ssc1: ssc at fffd4000 {
+                             status = "okay";
+                     };
+             };
+
+             usb0: ohci at 00300000 {
+                     num-ports = <1>;
+                     status = "okay";
+             };

arch/arm/boot/dts/mpa1600.dts line 63

Quoted 10 lines
arch/arm/boot/dts/mpa1600.dts new file +10 -0
+     };
+
+     i2c at 0 {
+             status = "okay";
+     };
+
+     gpio_keys {
+             compatible = "gpio-keys";
+             #address-cells = <1>;
+             #size-cells = <0>;

No need to use these address-cells and size-cells properties as child DT node is not Using. Please see the discussion on link

Quoted 5 lines
Quoted 1 line

http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg15590.html

I see.

Thanks for the feedback. I'll update this patch in the series.

I have modified it and queued the whole series in the:
at91-3.10-dt branch.

Quoted 2 lines

I assume someone will clean up all the other dts files or we'll never get rid of these properties as people will copy-paste stuff.

Just done in a new patch:
[PATCH] ARM: at91/dt: gpio-keys: remove address-cells and size-cells properties

Best regards,

Signature · 1 line
Nicolas Ferre