Skip to contentSkip to conversation

A10S-OLinuXino-Micro I2C support

PATCH New Emilio López 2 participants 7 messages Jul 7, 2013 – Jul 15, 2013

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

cover A10S-OLinuXino-Micro I2C support

Hi,

This patchset adds the required DT nodes to get I2C supported and working on the OLIMEX A10S-OLinuXino-Micro board.

Patch 1 adds the muxings as seen on the board's schematics. Patch 2 adds the DT nodes, based on other sunxi dts, as we don't have an A10S user manual so far. Patch 3 enables the controllers, and patch 4 adds a node for the AT24 EEPROM found on the board.

I have tested and can see the PMU on I2C-0 using i2cdetect, and can read the EEPROM contents on I2C-1. I have not tested I2C-2, but i2cdetect reports no devices so I suppose it's working okay too.

Any testing or review will be appreciated :)

Thanks,

Emilio

Emilio L?pez (4):
ARM: sun5i: dt: Add I2C muxings for sun5i A10S
ARM: sun5i: dt: Add I2C controller nodes to the A10S dtsi
ARM: sun5i: dt: Enable I2C controllers on A10S-OLinuXino-Micro
ARM: sun5i: dt: Add AT24 device on A10S-OLinuXino-Micro

 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 25 +++++++++++
 arch/arm/boot/dts/sun5i-a10s.dtsi                | 54 ++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/4 ARM: sun5i: dt: Add I2C muxings for sun5i A10S

The information has been extracted from the A10S-OLinuXino-Micro schematics, as we do not have a user manual for A10S yet.

---
 arch/arm/boot/dts/sun5i-a10s.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/sun5i-a10s.dtsi +21 -0
index 2307ce8..7c9f88f 100644
@@ -229,6 +229,27 @@
 				allwinner,drive = <0>;
 				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 = "PB15", "PB16";
+				allwinner,function = "i2c1";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
+
+			i2c2_pins_a: i2c2 at 0 {
+				allwinner,pins = "PB17", "PB18";
+				allwinner,function = "i2c2";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
 		};
 
 		timer at 01c20c00 {
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/4 ARM: sun5i: dt: Add I2C controller nodes to the A10S dtsi

In reply to Emilio López

Allwinner A10S has 3 I2C controllers embedded on it. Add them to the corresponding dtsi.

---
 arch/arm/boot/dts/sun5i-a10s.dtsi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm/boot/dts/sun5i-a10s.dtsi +33 -0
index 7c9f88f..0f0881a 100644
@@ -303,5 +303,38 @@
 			clocks = <&apb1_gates 19>;
 			status = "disabled";
 		};
+
+		i2c0: i2c at 01c2ac00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2ac00 0x400>;
+			interrupts = <7>;
+			clocks = <&apb1_gates 0>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		i2c1: i2c at 01c2b000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2b000 0x400>;
+			interrupts = <8>;
+			clocks = <&apb1_gates 1>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		i2c2: i2c at 01c2b400 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "allwinner,sun4i-i2c";
+			reg = <0x01c2b400 0x400>;
+			interrupts = <9>;
+			clocks = <&apb1_gates 2>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
 	};
 };
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH 3/4 ARM: sun5i: dt: Enable I2C controllers on A10S-OLinuXino-Micro

In reply to Emilio López

This board from OLIMEX is using the three I2C controllers present on A10S:
* I2C-0 connects to the AXP152 PMU
* I2C-1 holds an AT24C16BN-SH EEPROM with the MAC address for ethernet
* I2C-2 is used for UEXT modules.

---
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts +18 -0
index 64dc0c4..2a69ddf 100644
@@ -60,6 +60,24 @@
 			pinctrl-0 = <&uart3_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.3.2
#4 lore raw

PATCH 4/4 ARM: sun5i: dt: Add AT24 device on A10S-OLinuXino-Micro

In reply to Emilio López

This OLIMEX board has a AT24C16BN-SH EEPROM holding the MAC address. This patch adds the corresponding device tree node to reflect this.

---
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts +7 -0
index 2a69ddf..8ce7951 100644
@@ -71,6 +71,13 @@
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c1_pins_a>;
 			status = "okay";
+
+			at24 at 50 {
+				compatible = "at,24c16";
+				pagesize = <16>;
+				reg = <0x50>;
+				read-only;
+			};
 		};
 
 		i2c2: i2c at 01c2b400 {
Signature · 1 line
1.8.3.2
#5 lore raw

cover A10S-OLinuXino-Micro I2C support

In reply to Emilio López

Hi Emilio,

Quoted 26 lines · Emilio L?pez

Hi,

This patchset adds the required DT nodes to get I2C supported and working on the OLIMEX A10S-OLinuXino-Micro board.

Patch 1 adds the muxings as seen on the board's schematics. Patch 2 adds the DT nodes, based on other sunxi dts, as we don't have an A10S user manual so far. Patch 3 enables the controllers, and patch 4 adds a node for the AT24 EEPROM found on the board.

I have tested and can see the PMU on I2C-0 using i2cdetect, and can read the EEPROM contents on I2C-1. I have not tested I2C-2, but i2cdetect reports no devices so I suppose it's working okay too.

Any testing or review will be appreciated :)

Thanks,

Emilio

Emilio L?pez (4):
ARM: sun5i: dt: Add I2C muxings for sun5i A10S
ARM: sun5i: dt: Add I2C controller nodes to the A10S dtsi
ARM: sun5i: dt: Enable I2C controllers on A10S-OLinuXino-Micro
ARM: sun5i: dt: Add AT24 device on A10S-OLinuXino-Micro

Quoted 3 lines
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 25 +++++++++++
 arch/arm/boot/dts/sun5i-a10s.dtsi                | 54 ++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

Thanks for doing this!

Overall, this patchset looks fine. I'll apply it as soon as 3.11-rc1 is out.

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/20130711/93271d83/attachment.sig>
#6 lore raw

cover A10S-OLinuXino-Micro I2C support

In reply to Emilio López

Hi Emilio,

Quoted 10 lines · Emilio L?pez

Hi,

This patchset adds the required DT nodes to get I2C supported and working on the OLIMEX A10S-OLinuXino-Micro board.

Patch 1 adds the muxings as seen on the board's schematics. Patch 2 adds the DT nodes, based on other sunxi dts, as we don't have an A10S user manual so far. Patch 3 enables the controllers, and patch 4 adds a node for the AT24 EEPROM found on the board.

Quoted 5 lines

I have tested and can see the PMU on I2C-0 using i2cdetect, and can read the EEPROM contents on I2C-1. I have not tested I2C-2, but i2cdetect reports no devices so I suppose it's working okay too.

Any testing or review will be appreciated :)

I just applied them to my sunxi/dt-for-3.12 branch.

Thanks!
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/20130715/9a977471/attachment.sig>