Skip to contentSkip to conversation

ARM: sun7i: Enable the I2C support for the A20

PATCH New Maxime Ripard 1 participant 6 messages Sep 11, 2013 – Sep 18, 2013

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

cover ARM: sun7i: Enable the I2C support for the A20

Hi everyone,

This patchset enables the support for the I2C IP found in the Allwinner A20. Since it's basically the same IP than the one found in the other Allwinner SoCs, it's just a matter of enabling it in the device tree.

Thanks,
Maxime

Maxime Ripard (4):
ARM: sun7i: Enable the I2C controllers
ARM: sun7i: Add the pin muxing options for the I2C controllers
ARM: sun7i: cubieboard2: Enable the I2C controllers
ARM: sun7i: olinuxino-micro: Enable the I2C controllers

 arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 12 +++++
 arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 18 +++++++
 arch/arm/boot/dts/sun7i-a20.dtsi                | 66 +++++++++++++++++++++++++
 3 files changed, 96 insertions(+)
Signature · 1 line
1.8.4
#1 lore raw

PATCH 1/4 ARM: sun7i: Enable the I2C controllers

The Allwinner A20 shares the same I2C controller than the one that could be found on earlier SoCs from Allwinner. There is only a few more of these controllers. Add all of them in the DTSI.

---
 arch/arm/boot/dts/sun7i-a20.dtsi | 45 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
arch/arm/boot/dts/sun7i-a20.dtsi +45 -0
index 80559cb..82b1af3 100644
@@ -324,6 +324,51 @@
 			status = "disabled";
 		};
 
+		i2c0: i2c at 01c2ac00 {
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2ac00 0x400>;
+			interrupts = <0 7 1>;
+			clocks = <&apb1_gates 0>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		i2c1: i2c at 01c2b000 {
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2b000 0x400>;
+			interrupts = <0 8 1>;
+			clocks = <&apb1_gates 1>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		i2c2: i2c at 01c2b400 {
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2b400 0x400>;
+			interrupts = <0 9 1>;
+			clocks = <&apb1_gates 2>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		i2c3: i2c at 01c2b800 {
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2b800 0x400>;
+			interrupts = <0 88 1>;
+			clocks = <&apb1_gates 3>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		i2c4: i2c at 01c2bc00 {
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2bc00 0x400>;
+			interrupts = <0 89 1>;
+			clocks = <&apb1_gates 15>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
 		gic: interrupt-controller at 01c81000 {
 			compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
 			reg = <0x01c81000 0x1000>,
Signature · 1 line
1.8.4
#2 lore raw

PATCH 2/4 ARM: sun7i: Add the pin muxing options for the I2C controllers

In reply to Maxime Ripard

The A20 boards we currently have share the same pins for the i2c controllers they share. Add them to the DTSI.

---
 arch/arm/boot/dts/sun7i-a20.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/sun7i-a20.dtsi +21 -0
index 82b1af3..b939d30 100644
@@ -215,6 +215,27 @@
 				allwinner,pull = <0>;
 			};
 
+			i2c0_pins_a: i2c0 at 0 {
+				allwinner,pins = "PB0", "PB1";
+				allwinner,function = "i2c0";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
+
+			i2c1_pins_a: i2c1 at 0 {
+				allwinner,pins = "PB18", "PB19";
+				allwinner,function = "i2c1";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
+
+			i2c2_pins_a: i2c2 at 0 {
+				allwinner,pins = "PB20", "PB21";
+				allwinner,function = "i2c2";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
+
 			emac_pins_a: emac0 at 0 {
 				allwinner,pins = "PA0", "PA1", "PA2",
 						"PA3", "PA4", "PA5", "PA6",
Signature · 1 line
1.8.4
#3 lore raw

PATCH 3/4 ARM: sun7i: cubieboard2: Enable the I2C controllers

In reply to Maxime Ripard

The Cubieboard2 uses both the i2c0 and i2c1 controllers. Enable them in the DT.

---
 arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +12 -0
index 15e625e..5c51cb8 100644
@@ -48,6 +48,18 @@
 			pinctrl-0 = <&uart0_pins_a>;
 			status = "okay";
 		};
+
+		i2c0: i2c at 01c2ac00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins_a>;
+			status = "okay";
+		};
+
+		i2c1: i2c at 01c2b000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c1_pins_a>;
+			status = "okay";
+		};
 	};
 
 	leds {
Signature · 1 line
1.8.4
#4 lore raw

PATCH 4/4 ARM: sun7i: olinuxino-micro: Enable the I2C controllers

In reply to Maxime Ripard

The A20-olinuxino-micro uses the first three I2C controllers found on the A20. Enable them in the DT.

---
 arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts +18 -0
index 9e77855..ead3013 100644
@@ -60,6 +60,24 @@
 			pinctrl-0 = <&uart7_pins_a>;
 			status = "okay";
 		};
+
+		i2c0: i2c at 01c2ac00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins_a>;
+			status = "okay";
+		};
+
+		i2c1: i2c at 01c2b000 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c1_pins_a>;
+			status = "okay";
+		};
+
+		i2c2: i2c at 01c2b400 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c2_pins_a>;
+			status = "okay";
+		};
 	};
 
 	leds {
Signature · 1 line
1.8.4
author Applied
#5 lore raw

cover ARM: sun7i: Enable the I2C support for the A20

In reply to Maxime Ripard
Quoted 5 lines · Maxime Ripard

Hi everyone,

This patchset enables the support for the I2C IP found in the Allwinner A20. Since it's basically the same IP than the one found in the other Allwinner SoCs, it's just a matter of enabling it in the device tree.

Merged into sunxi/dt-for-3.13

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- 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/20130918/81326b50/attachment.sig>