Skip to contentSkip to conversation

IPC driver patches

PATCH Superseded Kuppuswamy Sathyanarayanan 2 participants 6 messages Jul 23, 2013 – Oct 15, 2013

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover IPC driver patches

Following patches adds IPC support for addional intel platforms and provides default interrupt mode support.

Please let me know your review comments.

Kuppuswamy Sathyanarayanan (3):
ipc: Added platform data structure
ipc: Enabled ipc support for additional intel platforms
ipc: Add support for default interrupt mode

 drivers/platform/x86/Kconfig         |   15 +++++
 drivers/platform/x86/intel_scu_ipc.c |  114 ++++++++++++++++++++++++++++++----
 2 files changed, 118 insertions(+), 11 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 ipc: Added platform data structure

Since the same ipc driver can be used by many platforms, using macros for defining ipc_base and i2c_base addresses is not a scalable approach. So added a platform data structure to pass this information.

---
 drivers/platform/x86/intel_scu_ipc.c |   37 ++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)
drivers/platform/x86/intel_scu_ipc.c +29 -8
index 9215ed7..93c1b57 100644
@@ -58,12 +58,29 @@
  *    message handler is called within firmware.
  */
 
-#define IPC_BASE_ADDR     0xFF11C000	/* IPC1 base register address */
-#define IPC_MAX_ADDR      0x100		/* Maximum IPC regisers */
 #define IPC_WWBUF_SIZE    20		/* IPC Write buffer Size */
 #define IPC_RWBUF_SIZE    20		/* IPC Read buffer Size */
-#define IPC_I2C_BASE      0xFF12B000	/* I2C control register base address */
-#define IPC_I2C_MAX_ADDR  0x10		/* Maximum I2C regisers */
+
+enum {
+	SCU_IPC_LINCROFT,
+};
+
+/* intel scu ipc driver data*/
+struct intel_scu_ipc_pdata_t {
+	u32 ipc_base;
+	u32 i2c_base;
+	u32 ipc_len;
+	u32 i2c_len;
+};
+
+static struct intel_scu_ipc_pdata_t intel_scu_ipc_pdata[] = {
+	[SCU_IPC_LINCROFT] = {
+		.ipc_base = 0xff11c000,
+		.i2c_base = 0xff12b000,
+		.ipc_len = 0x100,
+		.i2c_len = 0x10,
+	},
+};
 
 static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id);
 static void ipc_remove(struct pci_dev *pdev);
@@ -504,12 +521,16 @@ static irqreturn_t ioc(int irq, void *dev_id)
  */
 static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
-	int err;
+	int err, pid;
+	struct intel_scu_ipc_pdata_t *pdata;
 	resource_size_t pci_resource;
 
 	if (ipcdev.pdev)		/* We support only one SCU */
 		return -EBUSY;
 
+	pid = id->driver_data;
+	pdata = &intel_scu_ipc_pdata[pid];
+
 	ipcdev.pdev = pci_dev_get(dev);
 
 	err = pci_enable_device(dev);
@@ -527,11 +548,11 @@ static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (request_irq(dev->irq, ioc, 0, "intel_scu_ipc", &ipcdev))
 		return -EBUSY;
 
-	ipcdev.ipc_base = ioremap_nocache(IPC_BASE_ADDR, IPC_MAX_ADDR);
+	ipcdev.ipc_base = ioremap_nocache(pdata->ipc_base, pdata->ipc_len);
 	if (!ipcdev.ipc_base)
 		return -ENOMEM;
 
-	ipcdev.i2c_base = ioremap_nocache(IPC_I2C_BASE, IPC_I2C_MAX_ADDR);
+	ipcdev.i2c_base = ioremap_nocache(pdata->i2c_base, pdata->i2c_len);
 	if (!ipcdev.i2c_base) {
 		iounmap(ipcdev.ipc_base);
 		return -ENOMEM;
@@ -564,7 +585,7 @@ static void ipc_remove(struct pci_dev *pdev)
 }
 
 static DEFINE_PCI_DEVICE_TABLE(pci_ids) = {
-	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x082a)},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x082a), SCU_IPC_LINCROFT},
 	{ 0,}
 };
 MODULE_DEVICE_TABLE(pci, pci_ids);
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/3 ipc: Enabled ipc support for additional intel platforms

In reply to Kuppuswamy Sathyanarayanan

Enabled ipc support for penwell, clovertrail & tangier platforms.

---
 drivers/platform/x86/intel_scu_ipc.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
drivers/platform/x86/intel_scu_ipc.c +24 -0
index 93c1b57..aaaf1c1 100644
@@ -63,6 +63,9 @@
 
 enum {
 	SCU_IPC_LINCROFT,
+	SCU_IPC_PENWELL,
+	SCU_IPC_CLOVERVIEW,
+	SCU_IPC_TANGIER,
 };
 
 /* intel scu ipc driver data*/
@@ -80,6 +83,24 @@ static struct intel_scu_ipc_pdata_t intel_scu_ipc_pdata[] = {
 		.ipc_len = 0x100,
 		.i2c_len = 0x10,
 	},
+	[SCU_IPC_PENWELL] = {
+		.ipc_base = 0xff11c000,
+		.i2c_base = 0xff12b000,
+		.ipc_len = 0x100,
+		.i2c_len = 0x10,
+	},
+	[SCU_IPC_CLOVERVIEW] = {
+		.ipc_base = 0xff11c000,
+		.i2c_base = 0xff12b000,
+		.ipc_len = 0x100,
+		.i2c_len = 0x10,
+	},
+	[SCU_IPC_TANGIER] = {
+		.ipc_base = 0xff009000,
+		.i2c_base  = 0xff00d000,
+		.ipc_len  = 0x100,
+		.i2c_len = 0x10,
+	},
 };
 
 static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id);
@@ -586,6 +607,9 @@ static void ipc_remove(struct pci_dev *pdev)
 
 static DEFINE_PCI_DEVICE_TABLE(pci_ids) = {
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x082a), SCU_IPC_LINCROFT},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x080e), SCU_IPC_PENWELL},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x08ea), SCU_IPC_CLOVERVIEW},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x11a0), SCU_IPC_TANGIER},
 	{ 0,}
 };
 MODULE_DEVICE_TABLE(pci, pci_ids);
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/3 ipc: Add support for default interrupt mode

In reply to Kuppuswamy Sathyanarayanan

Added intel scu ipc access mode config option.

Also, This patch adds support to enable ipc command interrupt mode by default. This functionality is enabled by following config option.

CONFIG_INTEL_SCU_IPC_INTR_MODE=y

---
 drivers/platform/x86/Kconfig         |   15 ++++++++++
 drivers/platform/x86/intel_scu_ipc.c |   53 ++++++++++++++++++++++++++++++++--
 2 files changed, 65 insertions(+), 3 deletions(-)
drivers/platform/x86/Kconfig +15 -0
index 36a9e60..26921ce 100644
@@ -654,6 +654,21 @@ config INTEL_SCU_IPC
 	  some embedded Intel x86 platforms. This is not needed for PC-type
 	  machines.
 
+choice
+	prompt "IPC access mode"
+	depends on INTEL_SCU_IPC
+	default INTEL_SCU_IPC_INTR_MODE
+	---help---
+	Select the desired access mode for IPC call.
+
+config INTEL_SCU_IPC_INTR_MODE
+	bool "Intel SCU IPC interrupt mode"
+
+config INTEL_SCU_IPC_POLL_MODE
+	bool "Intel SCU IPC polling mode"
+
+endchoice
+
 config INTEL_SCU_IPC_UTIL
 	tristate "Intel SCU IPC utility driver"
 	depends on INTEL_SCU_IPC
drivers/platform/x86/intel_scu_ipc.c +50 -3

108 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#4 lore raw

Re: [PATCH v1 3/3] ipc: Add support for default interrupt mode

Quoted 7 lines · Kuppuswamy Sathyanarayanan

Added intel scu ipc access mode config option.

Also, This patch adds support to enable ipc command interrupt mode by default. This functionality is enabled by following config option.

CONFIG_INTEL_SCU_IPC_INTR_MODE=y

Can you document this in the help text? It's unclear whether people should enable this option or not.

Signature · 1 line
Matthew Garrett <[email protected]>
#5 lore raw

Re: [PATCH v1 3/3] ipc: Add support for default interrupt mode

Quoted 11 lines · Kuppuswamy Sathyanarayanan
Quoted 7 lines

Added intel scu ipc access mode config option.

Also, This patch adds support to enable ipc command interrupt mode by default. This functionality is enabled by following config option.

CONFIG_INTEL_SCU_IPC_INTR_MODE=y

Can you document this in the help text? It's unclear whether people should enable this option or not.

Thanks for the review. I will update the help content in my next patchset.

Quoted 3 lines

--
Matthew Garrett <[email protected]>

--
Sathyanarayanan Kuppuswamy