Skip to contentSkip to conversation

i2c: busses: xgene: I2C proxy driver for X-Gene

PATCH RESEND Applied Feng Kan 2 participants 10 messages Apr 24, 2015 – May 12, 2015

Subsystems (4)
lore
Share & tools
lore

Feng Kan

author
#0 lore raw

v4 cover i2c: busses: xgene: I2C proxy driver for X-Gene

This is a proxy I2C driver for APM X-Gene SoC. It uses the mailbox driver to tunnel i2c transactions via the SLIMpro processor.

V4 Change:
- Remove PRP0001 and use a real ACPI id
V3 Change:
- Add ACPI support
- Fix previous comments.

Feng Kan (4):
i2c: busses: add SLIMpro I2C device driver on APM X-Gene platform
i2c: busses: xgene: add acpi support for i2c xgene SLIMpro driver
Documentation: i2c: Add APM X-Gene platform SLIMpro I2C driver
documentation
arm64: dts: add proxy I2C device driver on APM X-Gene platform

 .../devicetree/bindings/i2c/i2c-xgene-slimpro.txt  |  15 +
 arch/arm64/boot/dts/apm/apm-storm.dtsi             |   5 +
 drivers/i2c/busses/Kconfig                         |   9 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-xgene-slimpro.c             | 469 +++++++++++++++++++++
 5 files changed, 499 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-xgene-slimpro.txt
 create mode 100644 drivers/i2c/busses/i2c-xgene-slimpro.c
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH RESEND v4 1/4 i2c: busses: add SLIMpro I2C device driver on APM X-Gene platform

Add SLIMpro I2C device driver on APM X-Gene platform. This I2C device driver use the SLIMpro Mailbox driver to tunnel message to the SLIMpro coprocessor to do the work of accessing I2C components.

---
 drivers/i2c/busses/Kconfig             |   9 +
 drivers/i2c/busses/Makefile            |   1 +
 drivers/i2c/busses/i2c-xgene-slimpro.c | 459 +++++++++++++++++++++++++++++++++
 3 files changed, 469 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-xgene-slimpro.c
drivers/i2c/busses/Kconfig +9 -0
index 22da9c2..1ac07d0 100644
@@ -1082,6 +1082,15 @@ config I2C_CROS_EC_TUNNEL
 	  connected there. This will work whatever the interface used to
 	  talk to the EC (SPI, I2C or LPC).
 
+config I2C_XGENE_SLIMPRO
+	tristate "APM X-Gene SoC I2C SLIMpro devices support"
+	depends on ARCH_XGENE && MAILBOX
+	help
+	  Enable I2C bus access using the APM X-Gene SoC SLIMpro
+	  co-processor. The I2C device access the I2C bus via the X-Gene
+	  to SLIMpro (On chip coprocessor) mailbox mechanism.
+	  If unsure, say N.
+
 config SCx200_ACB
 	tristate "Geode ACCESS.bus support"
 	depends on X86_32 && PCI
drivers/i2c/busses/Makefile +1 -0
index 3638feb..9cf9c4b 100644
@@ -107,6 +107,7 @@ obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
 obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
 obj-$(CONFIG_I2C_PCA_ISA)	+= i2c-pca-isa.o
 obj-$(CONFIG_I2C_SIBYTE)	+= i2c-sibyte.o
+obj-$(CONFIG_I2C_XGENE_SLIMPRO) += i2c-xgene-slimpro.o
 obj-$(CONFIG_SCx200_ACB)	+= scx200_acb.o
 
 ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
drivers/i2c/busses/i2c-xgene-slimpro.c new file +459 -0

459 lines not on this page · raw message

Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw

Re: [PATCH RESEND V4 1/4] i2c: busses: add SLIMpro I2C device driver on APM X-Gene platform

Quoted 6 lines · Feng Kan

Add SLIMpro I2C device driver on APM X-Gene platform. This I2C device driver use the SLIMpro Mailbox driver to tunnel message to the SLIMpro coprocessor to do the work of accessing I2C components.

Applied to for-next, thanks!

One comment though:

drivers/i2c/busses/i2c-xgene-slimpro.c line 415

Quoted 1 line
drivers/i2c/busses/i2c-xgene-slimpro.c new file +1 -0
+	adapter->class = I2C_CLASS_HWMON;

Since you have DT and ACPI, you most likely won't need that, or? It speeds up boot time if you don't use classes. Send me an incremental patch if you want to change this.

author
#3 lore raw

PATCH RESEND v4 2/4 i2c: busses: xgene: add acpi support for i2c xgene SLIMpro driver

In reply to Feng Kan

This adds support for ACPI for the APM X-Gene I2C SLIMpro proxy driver.

---
 drivers/i2c/busses/i2c-xgene-slimpro.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/i2c/busses/i2c-xgene-slimpro.c +10 -0
index f994b8a0..0b33aa2e 100644
@@ -22,6 +22,7 @@
  * using the APM X-Gene SLIMpro mailbox driver.
  *
  */
+#include <linux/acpi.h>
 #include <linux/dma-mapping.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
@@ -442,12 +443,21 @@ static const struct of_device_id xgene_slimpro_i2c_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, xgene_slimpro_i2c_dt_ids);
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_slimpro_i2c_acpi_ids[] = {
+	{"APMC0D40", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(acpi, xgene_slimpro_i2c_acpi_ids);
+#endif
+
 static struct platform_driver xgene_slimpro_i2c_driver = {
 	.probe	= xgene_slimpro_i2c_probe,
 	.remove	= xgene_slimpro_i2c_remove,
 	.driver	= {
 		.name	= "xgene-slimpro-i2c",
 		.of_match_table = of_match_ptr(xgene_slimpro_i2c_dt_ids),
+		.acpi_match_table = ACPI_PTR(xgene_slimpro_i2c_acpi_ids)
 	},
 };
 
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH RESEND V4 2/4] i2c: busses: xgene: add acpi support for i2c xgene SLIMpro driver

Quoted 4 lines · Feng Kan

This adds support for ACPI for the APM X-Gene I2C SLIMpro proxy driver.

I squashed this into the previous patch, thanks.

author
#5 lore raw

PATCH RESEND v4 3/4 Documentation: i2c: Add APM X-Gene platform SLIMpro I2C driver documentation

In reply to Feng Kan

Add APM X-Gene platform SLIMpro I2C driver documentation.

---
 .../devicetree/bindings/i2c/i2c-xgene-slimpro.txt         | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-xgene-slimpro.txt
Documentation/devicetree/bindings/i2c/i2c-xgene-slimpro.txt new file +15 -0
new file mode 100644
index 0000000..f6b2c20
@@ -0,0 +1,15 @@
+APM X-Gene SLIMpro Mailbox I2C Driver
+
+An I2C controller accessed over the "SLIMpro" mailbox.
+
+Required properties :
+
+ - compatible : should be "apm,xgene-slimpro-i2c"
+ - mboxes : use the label reference for the mailbox as the first parameter.
+	    The second parameter is the channel number.
+
+Example :
+	i2cslimpro {
+		compatible = "apm,xgene-slimpro-i2c";
+		mboxes = <&mailbox 0>;
+	};
Signature · 1 line
1.9.1
author
#7 lore raw

PATCH RESEND v4 4/4 arm64: dts: add proxy I2C device driver on APM X-Gene platform

In reply to Feng Kan

Add proxy I2C device driver on APM X-Gene platform.

---
 arch/arm64/boot/dts/apm/apm-storm.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/apm/apm-storm.dtsi +5 -0
index 70c14fa..00ae4d8 100644
@@ -483,6 +483,11 @@
 					<0x0 0x7 0x4>;
 		};
 
+		i2cslimpro {
+			compatible = "apm,xgene-slimpro-i2c";
+			mboxes = <&mailbox 0>;
+		};
+
 		serial0: serial@1c020000 {
 			status = "disabled";
 			device_type = "serial";
Signature · 1 line
1.9.1
#9 lore raw
In reply to Feng Kan
Quoted 2 lines

- Fix previous comments.

Next time, please specify what exactly you changed. This speeds up reviewing *a lot*, because otherwise I have to do this myself.