Skip to contentSkip to conversation

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

PATCH Superseded Feng Kan 2 participants 6 messages Apr 23, 2015 – Apr 24, 2015

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Feng Kan

author
#0 lore raw

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

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 v3 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 · 1 line
1.9.1
author
#2 lore raw

PATCH v3 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 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-xgene-slimpro.c +11 -1
index afe4cf2..0035760 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_id[] = {
 };
 MODULE_DEVICE_TABLE(of, xgene_slimpro_i2c_dt_ids);
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_slimpro_i2c_acpi_ids[] = {
+	{"PRP0001", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(acpi, slimpro_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_id)
+		.of_match_table = of_match_ptr(xgene_slimpro_i2c_id),
+		.acpi_match_table = ACPI_PTR(xgene_slimpro_i2c_acpi_ids)
 	},
 };
 
Signature · 1 line
1.9.1
#3 lore raw

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

drivers/i2c/busses/i2c-xgene-slimpro.c static const struct of_device_id xgene_slimpro_i2c_id[] = { · line 452

Quoted 9 lines · On Thursday 23 April 2015 11:07:08 Feng Kan wrote:
drivers/i2c/busses/i2c-xgene-slimpro.c +7 -0
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_slimpro_i2c_acpi_ids[] = {
+       {"PRP0001", 0},
+       {}
+};
+MODULE_DEVICE_TABLE(acpi, slimpro_acpi_ids);
+#endif

Sorry, but this is wrong: The PRP0001 name is meant for embedded devices that just use the generic properties API for loading, and does not require specifying an ACPI device ID.

Arnd

author
#4 lore raw

PATCH v3 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 · 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
author
#5 lore raw

PATCH v3 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 a2b9657..d405dd0 100644
@@ -522,6 +522,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