linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] A10S-OLinuXino-Micro I2C support
@ 2013-07-07 21:31 Emilio López
  2013-07-07 21:31 ` [PATCH 1/4] ARM: sun5i: dt: Add I2C muxings for sun5i A10S Emilio López
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Emilio López @ 2013-07-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

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(+)

-- 
1.8.3.2

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

* [PATCH 1/4] ARM: sun5i: dt: Add I2C muxings for sun5i A10S
  2013-07-07 21:31 [PATCH 0/4] A10S-OLinuXino-Micro I2C support Emilio López
@ 2013-07-07 21:31 ` Emilio López
  2013-07-07 21:31 ` [PATCH 2/4] ARM: sun5i: dt: Add I2C controller nodes to the A10S dtsi Emilio López
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Emilio López @ 2013-07-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Emilio L?pez <emilio@elopez.com.ar>
---
 arch/arm/boot/dts/sun5i-a10s.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
index 2307ce8..7c9f88f 100644
--- a/arch/arm/boot/dts/sun5i-a10s.dtsi
+++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
@@ -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 {
-- 
1.8.3.2

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

* [PATCH 2/4] ARM: sun5i: dt: Add I2C controller nodes to the A10S dtsi
  2013-07-07 21:31 [PATCH 0/4] A10S-OLinuXino-Micro I2C support Emilio López
  2013-07-07 21:31 ` [PATCH 1/4] ARM: sun5i: dt: Add I2C muxings for sun5i A10S Emilio López
@ 2013-07-07 21:31 ` Emilio López
  2013-07-07 21:31 ` [PATCH 3/4] ARM: sun5i: dt: Enable I2C controllers on A10S-OLinuXino-Micro Emilio López
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Emilio López @ 2013-07-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Emilio L?pez <emilio@elopez.com.ar>
---
 arch/arm/boot/dts/sun5i-a10s.dtsi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
index 7c9f88f..0f0881a 100644
--- a/arch/arm/boot/dts/sun5i-a10s.dtsi
+++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
@@ -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";
+		};
 	};
 };
-- 
1.8.3.2

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

* [PATCH 3/4] ARM: sun5i: dt: Enable I2C controllers on A10S-OLinuXino-Micro
  2013-07-07 21:31 [PATCH 0/4] A10S-OLinuXino-Micro I2C support Emilio López
  2013-07-07 21:31 ` [PATCH 1/4] ARM: sun5i: dt: Add I2C muxings for sun5i A10S Emilio López
  2013-07-07 21:31 ` [PATCH 2/4] ARM: sun5i: dt: Add I2C controller nodes to the A10S dtsi Emilio López
@ 2013-07-07 21:31 ` Emilio López
  2013-07-07 21:31 ` [PATCH 4/4] ARM: sun5i: dt: Add AT24 device " Emilio López
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Emilio López @ 2013-07-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Emilio L?pez <emilio@elopez.com.ar>
---
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
index 64dc0c4..2a69ddf 100644
--- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
@@ -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 {
-- 
1.8.3.2

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

* [PATCH 4/4] ARM: sun5i: dt: Add AT24 device on A10S-OLinuXino-Micro
  2013-07-07 21:31 [PATCH 0/4] A10S-OLinuXino-Micro I2C support Emilio López
                   ` (2 preceding siblings ...)
  2013-07-07 21:31 ` [PATCH 3/4] ARM: sun5i: dt: Enable I2C controllers on A10S-OLinuXino-Micro Emilio López
@ 2013-07-07 21:31 ` Emilio López
  2013-07-11 16:38 ` [PATCH 0/4] A10S-OLinuXino-Micro I2C support Maxime Ripard
  2013-07-15  7:59 ` Maxime Ripard
  5 siblings, 0 replies; 7+ messages in thread
From: Emilio López @ 2013-07-07 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Emilio L?pez <emilio@elopez.com.ar>
---
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
index 2a69ddf..8ce7951 100644
--- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
@@ -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 {
-- 
1.8.3.2

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

* [PATCH 0/4] A10S-OLinuXino-Micro I2C support
  2013-07-07 21:31 [PATCH 0/4] A10S-OLinuXino-Micro I2C support Emilio López
                   ` (3 preceding siblings ...)
  2013-07-07 21:31 ` [PATCH 4/4] ARM: sun5i: dt: Add AT24 device " Emilio López
@ 2013-07-11 16:38 ` Maxime Ripard
  2013-07-15  7:59 ` Maxime Ripard
  5 siblings, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2013-07-11 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Emilio,

On Sun, Jul 07, 2013 at 06:31:55PM -0300, Emilio L?pez wrote:
> 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(+)

Thanks for doing this!

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

Maxime

-- 
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>

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

* [PATCH 0/4] A10S-OLinuXino-Micro I2C support
  2013-07-07 21:31 [PATCH 0/4] A10S-OLinuXino-Micro I2C support Emilio López
                   ` (4 preceding siblings ...)
  2013-07-11 16:38 ` [PATCH 0/4] A10S-OLinuXino-Micro I2C support Maxime Ripard
@ 2013-07-15  7:59 ` Maxime Ripard
  5 siblings, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2013-07-15  7:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Emilio,

On Sun, Jul 07, 2013 at 06:31:55PM -0300, Emilio L?pez wrote:
> 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 :)

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

Thanks!
Maxime

-- 
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>

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

end of thread, other threads:[~2013-07-15  7:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-07 21:31 [PATCH 0/4] A10S-OLinuXino-Micro I2C support Emilio López
2013-07-07 21:31 ` [PATCH 1/4] ARM: sun5i: dt: Add I2C muxings for sun5i A10S Emilio López
2013-07-07 21:31 ` [PATCH 2/4] ARM: sun5i: dt: Add I2C controller nodes to the A10S dtsi Emilio López
2013-07-07 21:31 ` [PATCH 3/4] ARM: sun5i: dt: Enable I2C controllers on A10S-OLinuXino-Micro Emilio López
2013-07-07 21:31 ` [PATCH 4/4] ARM: sun5i: dt: Add AT24 device " Emilio López
2013-07-11 16:38 ` [PATCH 0/4] A10S-OLinuXino-Micro I2C support Maxime Ripard
2013-07-15  7:59 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).