All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] Series short description
@ 2009-04-07 15:40 Alan Cox
  0 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2009-04-07 15:40 UTC (permalink / raw)
  To: torvalds, linux-kernel

More small updates and a driver for the MAX3100. The MAX3100 driver needs kref
bits eventually but its otherwise fine and good enough to merge
---

Adrian Bunk (1):
      tty: Correct inline types for tty_driver_kref_get()

Alan Cox (2):
      lanana: assign a device name and numbering for MAX3100
      serqt: initial clean up pass for tty side

Breno Leitao (1):
      Here are some cleanups, mainly removing unused variables and silly

Christian Pellegrin (1):
      Add support for the MAX3100 SPI UART.

Claudio Scordino (1):
      tty: Use the generic RS485 ioctl on CRIS

Mike Frysinger (3):
      Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
      Depend on KGDB_SERIAL_CONSOLE being set to N rather than !Y, since it can
      Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>

Sonic Zhang (2):
      Both software emulated and hardware based CTS and RTS are enabled in
      Only CTS bit is affected.


 Documentation/devices.txt                          |    4 
 .../mach-bf518/include/mach/bfin_serial_5xx.h      |   10 
 .../mach-bf527/include/mach/bfin_serial_5xx.h      |   36 --
 .../mach-bf533/include/mach/bfin_serial_5xx.h      |   29 -
 .../mach-bf537/include/mach/bfin_serial_5xx.h      |   37 --
 .../mach-bf538/include/mach/bfin_serial_5xx.h      |   10 
 .../mach-bf548/include/mach/bfin_serial_5xx.h      |  117 +----
 .../mach-bf561/include/mach/bfin_serial_5xx.h      |   29 -
 arch/cris/include/asm/ioctls.h                     |    5 
 arch/cris/include/asm/rs485.h                      |    8 
 arch/cris/include/asm/termios.h                    |    1 
 drivers/serial/Kconfig                             |   47 ++
 drivers/serial/Makefile                            |    1 
 drivers/serial/bfin_5xx.c                          |  282 ++++++++-----
 drivers/serial/crisv10.c                           |   79 +++-
 drivers/serial/crisv10.h                           |    2 
 drivers/serial/jsm/jsm_neo.c                       |   14 -
 drivers/serial/jsm/jsm_tty.c                       |   19 -
 drivers/staging/serqt_usb/serqt_usb.c              |  449 +++++++-------------
 include/linux/serial_core.h                        |    3 
 include/linux/tty_driver.h                         |    3 
 21 files changed, 547 insertions(+), 638 deletions(-)

-- 

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

* [PATCH 00/11] Series short description
@ 2009-11-18 14:18 Alan Cox
  0 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2009-11-18 14:18 UTC (permalink / raw)
  To: greg, linux-kernel

Resend: This patch series reworks the sdio_uart driver into a modern format
and also replaces the circ buffer stuff it uses with a kfifo which makes the
code a good deal easier to follow.
---

Alan Cox (10):
      sdio_uart: add modem functionality
      sdio_uart: Fix the locking on "func" for new code
      sdio_uart: Style fixes
      sdio_uart: Use kfifo instead of the messy circ stuff
      sdio_uart: Fix termios handling
      sdio_uart: Switch to the open/close helpers
      sdio_uart: Move the open lock
      sdio_uart: refcount the tty objects
      sdio_uart: use tty_port
      tty_port: Move hupcl handling

Nicolas Pitre (1):
      sdio_uart: Fix oops caused by the previous changeset


 drivers/char/tty_port.c      |   13 +
 drivers/mmc/card/sdio_uart.c |  393 ++++++++++++++++++++++++------------------
 2 files changed, 235 insertions(+), 171 deletions(-)


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

* [PATCH 00/11] Series short description
@ 2010-07-26  9:02 Alan Cox
  2010-07-26  9:02 ` [PATCH 01/11] intel_scu_ipc: detect CPU type automatically Alan Cox
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:02 UTC (permalink / raw)
  To: platform-driver-x86, mjg

This patch set updates the intel SCU IPC to our internal version and fixes
various bugs/cleanliness issues as well as making the CPU detection occur
automatically and removing the module parameter.
---

Alan Cox (1):
      intel_scu_ipc: Use the new cpu identification function

Andy Ross (1):
      Clean up command packing on MRST.

Arjan van de Ven (2):
      zero the stack buffer before giving random garbage to the SCU
      Fix stack buffer size for IPC writev messages

Hong Liu (3):
      intel_scu_ipc: fix size field for intel_scu_ipc_command
      intel_scu_ipc: return -EIO for error condition in busy_loop

Sreedhara DS (4):
      intel_scu_ipc: tidy up unused bits
      Remove indirect read write api support.
      intel_scu_ipc: Support Medfield processors
      intel_scu_ipc: detect CPU type automatically


 arch/x86/include/asm/intel_scu_ipc.h |   14 ---
 drivers/platform/x86/intel_scu_ipc.c |  180 ++++++++++------------------------
 2 files changed, 52 insertions(+), 142 deletions(-)

-- 
	"It's 106 miles to Chicago, we've got a full tank of gas, the
	 sat-nav has crashed, it's dark and we're completely lost"

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

* [PATCH 01/11] intel_scu_ipc: detect CPU type automatically
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
@ 2010-07-26  9:02 ` Alan Cox
  2010-07-26  9:02 ` [PATCH 02/11] intel_scu_ipc: Support Medfield processors Alan Cox
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:02 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Sreedhara DS <sreedhara.ds@intel.com>

Intel SCU message formats depend upon the processor type. Replace the
module option with automatic detection of the processor type.

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index bb2f1fb..b6a0344 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -23,7 +23,7 @@
 #include <linux/pm.h>
 #include <linux/pci.h>
 #include <linux/interrupt.h>
-#include <asm/setup.h>
+#include <asm/mrst.h>
 #include <asm/intel_scu_ipc.h>
 
 /* IPC defines the following message types */
@@ -78,12 +78,9 @@ struct intel_scu_ipc_dev {
 
 static struct intel_scu_ipc_dev  ipcdev; /* Only one for now */
 
-static int platform = 1;
-module_param(platform, int, 0);
-MODULE_PARM_DESC(platform, "1 for moorestown platform");
-
-
-
+#define PLATFORM_LANGWELL 1
+#define PLATFORM_PENWELL 2
+static int platform;		/* Platform type */
 
 /*
  * IPC Read Buffer (Read Only):
@@ -817,6 +814,14 @@ static struct pci_driver ipc_driver = {
 
 static int __init intel_scu_ipc_init(void)
 {
+	if (boot_cpu_data.x86 == 6 &&
+		boot_cpu_data.x86_model == 0x27 &&
+		boot_cpu_data.x86_mask == 1)
+			platform = PLATFORM_PENWELL;
+	else if (boot_cpu_data.x86 == 6 &&
+		boot_cpu_data.x86_model == 0x26)
+			platform = PLATFORM_LANGWELL;
+
 	return  pci_register_driver(&ipc_driver);
 }
 

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

* [PATCH 02/11] intel_scu_ipc: Support Medfield processors
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
  2010-07-26  9:02 ` [PATCH 01/11] intel_scu_ipc: detect CPU type automatically Alan Cox
@ 2010-07-26  9:02 ` Alan Cox
  2010-07-26  9:03 ` [PATCH 03/11] Remove indirect read write api support Alan Cox
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:02 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Sreedhara DS <sreedhara.ds@intel.com>

Changes to work on bothMmoorestown and Medfield
New pci id added for Medfield
Return type of ipc_data_readl chnaged from u8 to u32

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |   53 +++++++++++++++++++++-------------
 1 files changed, 33 insertions(+), 20 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index b6a0344..a0dc41e 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -151,7 +151,7 @@ static inline u8 ipc_data_readb(u32 offset) /* Read ipc byte data */
 	return readb(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
 }
 
-static inline u8 ipc_data_readl(u32 offset) /* Read ipc u32 data */
+static inline u32 ipc_data_readl(u32 offset) /* Read ipc u32 data */
 {
 	return readl(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
 }
@@ -181,18 +181,19 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 	int nc;
 	u32 offset = 0;
 	u32 err = 0;
-	u8 cbuf[IPC_WWBUF_SIZE] = { '\0' };
+	u8 cbuf[IPC_WWBUF_SIZE] = { };
 	u32 *wbuf = (u32 *)&cbuf;
 
 	mutex_lock(&ipclock);
+
 	if (ipcdev.pdev == NULL) {
 		mutex_unlock(&ipclock);
 		return -ENODEV;
 	}
 
-	if (platform == 1) {
+	if (platform == PLATFORM_LANGWELL) {
 		/* Entry is 4 bytes for read/write, 5 bytes for read modify */
-		for (nc = 0; nc < count; nc++) {
+		for (nc = 0; nc < count; nc++, offset += 3) {
 			cbuf[offset] = addr[nc];
 			cbuf[offset + 1] = addr[nc] >> 8;
 			if (id != IPC_CMD_PCNTRL_R)
@@ -201,33 +202,44 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 				cbuf[offset + 3] = data[nc + 1];
 				offset += 1;
 			}
-			offset += 3;
 		}
 		for (nc = 0, offset = 0; nc < count; nc++, offset += 4)
 			ipc_data_writel(wbuf[nc], offset); /* Write wbuff */
 
+		if (id != IPC_CMD_PCNTRL_M)
+			ipc_command((count*4) << 16 |  id << 12 | 0 << 8 | op);
+		else
+			ipc_command((count*5) << 16 |  id << 12 | 0 << 8 | op);
+
 	} else {
-		for (nc = 0, offset = 0; nc < count; nc++, offset += 2)
-			ipc_data_writel(addr[nc], offset); /* Write addresses */
-		if (id != IPC_CMD_PCNTRL_R) {
-			for (nc = 0; nc < count; nc++, offset++)
-				ipc_data_writel(data[nc], offset); /* Write data */
-			if (id == IPC_CMD_PCNTRL_M)
-				ipc_data_writel(data[nc + 1], offset); /* Mask value*/
+		for (nc = 0; nc < count; nc++, offset += 2) {
+			cbuf[offset] = addr[nc];
+			cbuf[offset + 1] = addr[nc] >> 8;
 		}
-	}
 
-	if (id != IPC_CMD_PCNTRL_M)
-		ipc_command((count * 3) << 16 |  id << 12 | 0 << 8 | op);
-	else
-		ipc_command((count * 4) << 16 |  id << 12 | 0 << 8 | op);
+		if (id == IPC_CMD_PCNTRL_R) {
+			for (nc = 0, offset = 0; nc < count; nc++, offset += 4)
+				ipc_data_writel(wbuf[nc], offset);
+			ipc_command((count*2) << 16 |  id << 12 | 0 << 8 | op);
+		} else if (id == IPC_CMD_PCNTRL_W) {
+			for (nc = 0; nc < count; nc++, offset += 1)
+				cbuf[offset] = data[nc];
+			for (nc = 0, offset = 0; nc < count; nc++, offset += 4)
+				ipc_data_writel(wbuf[nc], offset);
+			ipc_command((count*3) << 16 |  id << 12 | 0 << 8 | op);
+		} else if (id == IPC_CMD_PCNTRL_M) {
+			cbuf[offset] = data[0];
+			cbuf[offset + 1] = data[1];
+			ipc_data_writel(wbuf[0], 0); /* Write wbuff */
+			ipc_command(4 << 16 |  id << 12 | 0 << 8 | op);
+		}
+	}
 
 	err = busy_loop();
-
 	if (id == IPC_CMD_PCNTRL_R) { /* Read rbuf */
 		/* Workaround: values are read as 0 without memcpy_fromio */
-		memcpy_fromio(cbuf, ipcdev.ipc_base + IPC_READ_BUFFER, 16);
-		if (platform == 1) {
+		memcpy_fromio(cbuf, ipcdev.ipc_base + 0x90, 16);
+		if (platform == PLATFORM_LANGWELL) {
 			for (nc = 0, offset = 2; nc < count; nc++, offset += 3)
 				data[nc] = ipc_data_readb(offset);
 		} else {
@@ -800,6 +812,7 @@ static void ipc_remove(struct pci_dev *pdev)
 
 static const struct pci_device_id pci_ids[] = {
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x080e)},
+	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x082a)},
 	{ 0,}
 };
 MODULE_DEVICE_TABLE(pci, pci_ids);

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

* [PATCH 03/11] Remove indirect read write api support.
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
  2010-07-26  9:02 ` [PATCH 01/11] intel_scu_ipc: detect CPU type automatically Alan Cox
  2010-07-26  9:02 ` [PATCH 02/11] intel_scu_ipc: Support Medfield processors Alan Cox
@ 2010-07-26  9:03 ` Alan Cox
  2010-07-26  9:03 ` [PATCH 04/11] intel_scu_ipc: tidy up unused bits Alan Cox
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:03 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Sreedhara DS <sreedhara.ds@intel.com>

The firmware of production devices does not support this interface so this
is dead code.

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 arch/x86/include/asm/intel_scu_ipc.h |   14 ------
 drivers/platform/x86/intel_scu_ipc.c |   82 ----------------------------------
 2 files changed, 0 insertions(+), 96 deletions(-)


diff --git a/arch/x86/include/asm/intel_scu_ipc.h b/arch/x86/include/asm/intel_scu_ipc.h
index 0320045..29f6679 100644
--- a/arch/x86/include/asm/intel_scu_ipc.h
+++ b/arch/x86/include/asm/intel_scu_ipc.h
@@ -34,20 +34,6 @@ int intel_scu_ipc_writev(u16 *addr, u8 *data, int len);
 /* Update single register based on the mask */
 int intel_scu_ipc_update_register(u16 addr, u8 data, u8 mask);
 
-/*
- * Indirect register read
- * Can be used when SCCB(System Controller Configuration Block) register
- * HRIM(Honor Restricted IPC Messages) is set (bit 23)
- */
-int intel_scu_ipc_register_read(u32 addr, u32 *data);
-
-/*
- * Indirect register write
- * Can be used when SCCB(System Controller Configuration Block) register
- * HRIM(Honor Restricted IPC Messages) is set (bit 23)
- */
-int intel_scu_ipc_register_write(u32 addr, u32 data);
-
 /* Issue commands to the SCU with or without data */
 int intel_scu_ipc_simple_command(int cmd, int sub);
 int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index a0dc41e..fd78386 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -116,24 +116,6 @@ static inline void ipc_data_writel(u32 data, u32 offset) /* Write ipc data */
 }
 
 /*
- * IPC destination Pointer (Write Only):
- * Use content as pointer for destination write
- */
-static inline void ipc_write_dptr(u32 data) /* Write dptr data */
-{
-	writel(data, ipcdev.ipc_base + 0x0C);
-}
-
-/*
- * IPC Source Pointer (Write Only):
- * Use content as pointer for read location
-*/
-static inline void ipc_write_sptr(u32 data) /* Write dptr data */
-{
-	writel(data, ipcdev.ipc_base + 0x08);
-}
-
-/*
  * Status Register (Read Only):
  * Driver will read this register to get the ready/busy status of the IPC
  * block and error status of the IPC command that was just processed by SCU
@@ -414,70 +396,6 @@ int intel_scu_ipc_update_register(u16 addr, u8 bits, u8 mask)
 EXPORT_SYMBOL(intel_scu_ipc_update_register);
 
 /**
- *	intel_scu_ipc_register_read	-	32bit indirect read
- *	@addr: register address
- *	@value: 32bit value return
- *
- *	Performs IA 32 bit indirect read, returns 0 on success, or an
- *	error code.
- *
- *	Can be used when SCCB(System Controller Configuration Block) register
- *	HRIM(Honor Restricted IPC Messages) is set (bit 23)
- *
- *	This function may sleep. Locking for SCU accesses is handled for
- *	the caller.
- */
-int intel_scu_ipc_register_read(u32 addr, u32 *value)
-{
-	u32 err = 0;
-
-	mutex_lock(&ipclock);
-	if (ipcdev.pdev == NULL) {
-		mutex_unlock(&ipclock);
-		return -ENODEV;
-	}
-	ipc_write_sptr(addr);
-	ipc_command(4 << 16 | IPC_CMD_INDIRECT_RD);
-	err = busy_loop();
-	*value = ipc_data_readl(0);
-	mutex_unlock(&ipclock);
-	return err;
-}
-EXPORT_SYMBOL(intel_scu_ipc_register_read);
-
-/**
- *	intel_scu_ipc_register_write	-	32bit indirect write
- *	@addr: register address
- *	@value: 32bit value to write
- *
- *	Performs IA 32 bit indirect write, returns 0 on success, or an
- *	error code.
- *
- *	Can be used when SCCB(System Controller Configuration Block) register
- *	HRIM(Honor Restricted IPC Messages) is set (bit 23)
- *
- *	This function may sleep. Locking for SCU accesses is handled for
- *	the caller.
- */
-int intel_scu_ipc_register_write(u32 addr, u32 value)
-{
-	u32 err = 0;
-
-	mutex_lock(&ipclock);
-	if (ipcdev.pdev == NULL) {
-		mutex_unlock(&ipclock);
-		return -ENODEV;
-	}
-	ipc_write_dptr(addr);
-	ipc_data_writel(value, 0);
-	ipc_command(4 << 16 | IPC_CMD_INDIRECT_WR);
-	err = busy_loop();
-	mutex_unlock(&ipclock);
-	return err;
-}
-EXPORT_SYMBOL(intel_scu_ipc_register_write);
-
-/**
  *	intel_scu_ipc_simple_command	-	send a simple command
  *	@cmd: command
  *	@sub: sub type

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

* [PATCH 04/11] intel_scu_ipc: tidy up unused bits
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (2 preceding siblings ...)
  2010-07-26  9:03 ` [PATCH 03/11] Remove indirect read write api support Alan Cox
@ 2010-07-26  9:03 ` Alan Cox
  2010-07-26  9:03 ` [PATCH 05/11] intel_scu_ipc: Use the new cpu identification function Alan Cox
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:03 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Sreedhara DS <sreedhara.ds@intel.com>

Delete unused constants IPC_CMD_INDIRECT_RD and IPC_CMD_INDIRECT_WR
Remove multiple inclusion of header file "asm/mrst.h"

Signed-off-by: Sreedhara DS <sreedhara.ds@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index fd78386..2245876 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -38,10 +38,6 @@
 #define IPC_CMD_PCNTRL_R      1 /* Register read */
 #define IPC_CMD_PCNTRL_M      2 /* Register read-modify-write */
 
-/* Miscelaneous Command ids */
-#define IPC_CMD_INDIRECT_RD   2 /* 32bit indirect read */
-#define IPC_CMD_INDIRECT_WR   5 /* 32bit indirect write */
-
 /*
  * IPC register summary
  *

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

* [PATCH 05/11] intel_scu_ipc: Use the new cpu identification function
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (3 preceding siblings ...)
  2010-07-26  9:03 ` [PATCH 04/11] intel_scu_ipc: tidy up unused bits Alan Cox
@ 2010-07-26  9:03 ` Alan Cox
  2010-07-26  9:04 ` [PATCH 06/11] Fix stack buffer size for IPC writev messages Alan Cox
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:03 UTC (permalink / raw)
  To: platform-driver-x86, mjg

This provides an architecture level board identify function to replace the
cpuid direct usage

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 2245876..5258749 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -74,8 +74,6 @@ struct intel_scu_ipc_dev {
 
 static struct intel_scu_ipc_dev  ipcdev; /* Only one for now */
 
-#define PLATFORM_LANGWELL 1
-#define PLATFORM_PENWELL 2
 static int platform;		/* Platform type */
 
 /*
@@ -169,7 +167,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 		return -ENODEV;
 	}
 
-	if (platform == PLATFORM_LANGWELL) {
+	if (platform != MRST_CPU_CHIP_PENWELL) {
 		/* Entry is 4 bytes for read/write, 5 bytes for read modify */
 		for (nc = 0; nc < count; nc++, offset += 3) {
 			cbuf[offset] = addr[nc];
@@ -217,7 +215,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 	if (id == IPC_CMD_PCNTRL_R) { /* Read rbuf */
 		/* Workaround: values are read as 0 without memcpy_fromio */
 		memcpy_fromio(cbuf, ipcdev.ipc_base + 0x90, 16);
-		if (platform == PLATFORM_LANGWELL) {
+		if (platform != MRST_CPU_CHIP_PENWELL) {
 			for (nc = 0, offset = 2; nc < count; nc++, offset += 3)
 				data[nc] = ipc_data_readb(offset);
 		} else {
@@ -741,14 +739,9 @@ static struct pci_driver ipc_driver = {
 
 static int __init intel_scu_ipc_init(void)
 {
-	if (boot_cpu_data.x86 == 6 &&
-		boot_cpu_data.x86_model == 0x27 &&
-		boot_cpu_data.x86_mask == 1)
-			platform = PLATFORM_PENWELL;
-	else if (boot_cpu_data.x86 == 6 &&
-		boot_cpu_data.x86_model == 0x26)
-			platform = PLATFORM_LANGWELL;
-
+	platform = mrst_identify_cpu();
+	if (platform == 0)
+		return -ENODEV;
 	return  pci_register_driver(&ipc_driver);
 }
 

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

* [PATCH 06/11] Fix stack buffer size for IPC writev messages
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (4 preceding siblings ...)
  2010-07-26  9:03 ` [PATCH 05/11] intel_scu_ipc: Use the new cpu identification function Alan Cox
@ 2010-07-26  9:04 ` Alan Cox
  2010-07-26  9:04 ` [PATCH 07/11] zero the stack buffer before giving random garbage to the SCU Alan Cox
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:04 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Arjan van de Ven <arjan@linux.intel.com>

The stack buffer for IPC messages was 16 bytes, limiting messages to a
size of 4 (each message is 32 bit).
However, the touch screen driver is trying to send messages of size 5....

(AC: Set to 20 bytes having checked the max size allowed)

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 5258749..1b0d0d5 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -58,8 +58,8 @@
 
 #define IPC_BASE_ADDR     0xFF11C000	/* IPC1 base register address */
 #define IPC_MAX_ADDR      0x100		/* Maximum IPC regisers */
-#define IPC_WWBUF_SIZE    16		/* IPC Write buffer Size */
-#define IPC_RWBUF_SIZE    16		/* IPC Read buffer Size */
+#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 */
 

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

* [PATCH 07/11] zero the stack buffer before giving random garbage to the SCU
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (5 preceding siblings ...)
  2010-07-26  9:04 ` [PATCH 06/11] Fix stack buffer size for IPC writev messages Alan Cox
@ 2010-07-26  9:04 ` Alan Cox
  2010-07-26  9:05 ` [PATCH 08/11] Clean up command packing on MRST Alan Cox
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:04 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Arjan van de Ven <arjan@linux.intel.com>

some messages take 4 bytes, but only fill 3 bytes....
this patch makes sure that whatever we send to the SCU is zeroed first

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 1b0d0d5..b903420 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -162,6 +162,8 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 
 	mutex_lock(&ipclock);
 
+	memset(cbuf, 0, sizeof(cbuf));
+
 	if (ipcdev.pdev == NULL) {
 		mutex_unlock(&ipclock);
 		return -ENODEV;

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

* [PATCH 08/11] Clean up command packing on MRST.
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (6 preceding siblings ...)
  2010-07-26  9:04 ` [PATCH 07/11] zero the stack buffer before giving random garbage to the SCU Alan Cox
@ 2010-07-26  9:05 ` Alan Cox
  2010-07-26  9:05 ` [PATCH 09/11] intel_scu_ipc: fix data packing of PMIC command on Moorestown Alan Cox
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:05 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Andy Ross <andy.ross@windriver.com>

Don't pass more bytes in the command length field than we filled.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |   29 +++++++++++------------------
 1 files changed, 11 insertions(+), 18 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index b903420..5055c52 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -154,7 +154,7 @@ static inline int busy_loop(void) /* Wait till scu status is busy */
 /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */
 static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 {
-	int nc;
+	int i, nc, bytes;
 	u32 offset = 0;
 	u32 err = 0;
 	u8 cbuf[IPC_WWBUF_SIZE] = { };
@@ -170,25 +170,18 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 	}
 
 	if (platform != MRST_CPU_CHIP_PENWELL) {
-		/* Entry is 4 bytes for read/write, 5 bytes for read modify */
-		for (nc = 0; nc < count; nc++, offset += 3) {
-			cbuf[offset] = addr[nc];
-			cbuf[offset + 1] = addr[nc] >> 8;
+		bytes = 0;
+		for(i=0; i<count; i++) {
+			cbuf[bytes++] = addr[i];
+			cbuf[bytes++] = addr[i] >> 8;
 			if (id != IPC_CMD_PCNTRL_R)
-				cbuf[offset + 2] = data[nc];
-			if (id == IPC_CMD_PCNTRL_M) {
-				cbuf[offset + 3] = data[nc + 1];
-				offset += 1;
-			}
+				cbuf[bytes++] = data[i];
+			if (id == IPC_CMD_PCNTRL_M)
+				cbuf[bytes++] = data[i + 1];
 		}
-		for (nc = 0, offset = 0; nc < count; nc++, offset += 4)
-			ipc_data_writel(wbuf[nc], offset); /* Write wbuff */
-
-		if (id != IPC_CMD_PCNTRL_M)
-			ipc_command((count*4) << 16 |  id << 12 | 0 << 8 | op);
-		else
-			ipc_command((count*5) << 16 |  id << 12 | 0 << 8 | op);
-
+		for(i=0; i<bytes; i+=4)
+			ipc_data_writel(wbuf[i/4], i);
+		ipc_command(bytes << 16 |  id << 12 | 0 << 8 | op);
 	} else {
 		for (nc = 0; nc < count; nc++, offset += 2) {
 			cbuf[offset] = addr[nc];

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

* [PATCH 09/11] intel_scu_ipc: fix data packing of PMIC command on Moorestown
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (7 preceding siblings ...)
  2010-07-26  9:05 ` [PATCH 08/11] Clean up command packing on MRST Alan Cox
@ 2010-07-26  9:05 ` Alan Cox
  2010-07-26  9:06 ` [PATCH 10/11] intel_scu_ipc: return -EIO for error condition in busy_loop Alan Cox
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:05 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Hong Liu <hong.liu@intel.com>

Data is 2-byte per entry for PMIC read-modify-update command.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 5055c52..84a2d4b 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -154,7 +154,7 @@ static inline int busy_loop(void) /* Wait till scu status is busy */
 /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */
 static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 {
-	int i, nc, bytes;
+	int i, nc, bytes, d;
 	u32 offset = 0;
 	u32 err = 0;
 	u8 cbuf[IPC_WWBUF_SIZE] = { };
@@ -171,15 +171,16 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 
 	if (platform != MRST_CPU_CHIP_PENWELL) {
 		bytes = 0;
-		for(i=0; i<count; i++) {
+		d = 0;
+		for (i = 0; i < count; i++) {
 			cbuf[bytes++] = addr[i];
 			cbuf[bytes++] = addr[i] >> 8;
 			if (id != IPC_CMD_PCNTRL_R)
-				cbuf[bytes++] = data[i];
+				cbuf[bytes++] = data[d++];
 			if (id == IPC_CMD_PCNTRL_M)
-				cbuf[bytes++] = data[i + 1];
+				cbuf[bytes++] = data[d++];
 		}
-		for(i=0; i<bytes; i+=4)
+		for (i = 0; i < bytes; i += 4)
 			ipc_data_writel(wbuf[i/4], i);
 		ipc_command(bytes << 16 |  id << 12 | 0 << 8 | op);
 	} else {

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

* [PATCH 10/11] intel_scu_ipc: return -EIO for error condition in busy_loop
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (8 preceding siblings ...)
  2010-07-26  9:05 ` [PATCH 09/11] intel_scu_ipc: fix data packing of PMIC command on Moorestown Alan Cox
@ 2010-07-26  9:06 ` Alan Cox
  2010-07-26  9:06 ` [PATCH 11/11] intel_scu_ipc: fix size field for intel_scu_ipc_command Alan Cox
  2010-08-03 13:50 ` [PATCH 00/11] Series short description Matthew Garrett
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:06 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Hong Liu <hong.liu@intel.com>

Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 84a2d4b..23b6d46 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -148,7 +148,10 @@ static inline int busy_loop(void) /* Wait till scu status is busy */
 			return -ETIMEDOUT;
 		}
 	}
-	return (status >> 1) & 1;
+	if ((status >> 1) & 1)
+		return -EIO;
+
+	return 0;
 }
 
 /* Read/Write power control(PMIC in Langwell, MSIC in PenWell) registers */

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

* [PATCH 11/11] intel_scu_ipc: fix size field for intel_scu_ipc_command
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (9 preceding siblings ...)
  2010-07-26  9:06 ` [PATCH 10/11] intel_scu_ipc: return -EIO for error condition in busy_loop Alan Cox
@ 2010-07-26  9:06 ` Alan Cox
  2010-08-03 13:50 ` [PATCH 00/11] Series short description Matthew Garrett
  11 siblings, 0 replies; 15+ messages in thread
From: Alan Cox @ 2010-07-26  9:06 UTC (permalink / raw)
  To: platform-driver-x86, mjg

From: Hong Liu <hong.liu@intel.com>

Size for PMIC read/write command is byte, while it is DWORD for other
IPC commands.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Signed-off-by: ALan Cox <alan@linux.intel.com>
---

 drivers/platform/x86/intel_scu_ipc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 23b6d46..943f908 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -444,7 +444,7 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
 	for (i = 0; i < inlen; i++)
 		ipc_data_writel(*in++, 4 * i);
 
-	ipc_command((sub << 12) | cmd | (inlen << 18));
+	ipc_command((inlen << 16) | (sub << 12) | cmd);
 	err = busy_loop();
 
 	for (i = 0; i < outlen; i++)

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

* Re: [PATCH 00/11] Series short description
  2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
                   ` (10 preceding siblings ...)
  2010-07-26  9:06 ` [PATCH 11/11] intel_scu_ipc: fix size field for intel_scu_ipc_command Alan Cox
@ 2010-08-03 13:50 ` Matthew Garrett
  11 siblings, 0 replies; 15+ messages in thread
From: Matthew Garrett @ 2010-08-03 13:50 UTC (permalink / raw)
  To: Alan Cox; +Cc: platform-driver-x86

Thanks, applied.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

end of thread, other threads:[~2010-08-03 13:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26  9:02 [PATCH 00/11] Series short description Alan Cox
2010-07-26  9:02 ` [PATCH 01/11] intel_scu_ipc: detect CPU type automatically Alan Cox
2010-07-26  9:02 ` [PATCH 02/11] intel_scu_ipc: Support Medfield processors Alan Cox
2010-07-26  9:03 ` [PATCH 03/11] Remove indirect read write api support Alan Cox
2010-07-26  9:03 ` [PATCH 04/11] intel_scu_ipc: tidy up unused bits Alan Cox
2010-07-26  9:03 ` [PATCH 05/11] intel_scu_ipc: Use the new cpu identification function Alan Cox
2010-07-26  9:04 ` [PATCH 06/11] Fix stack buffer size for IPC writev messages Alan Cox
2010-07-26  9:04 ` [PATCH 07/11] zero the stack buffer before giving random garbage to the SCU Alan Cox
2010-07-26  9:05 ` [PATCH 08/11] Clean up command packing on MRST Alan Cox
2010-07-26  9:05 ` [PATCH 09/11] intel_scu_ipc: fix data packing of PMIC command on Moorestown Alan Cox
2010-07-26  9:06 ` [PATCH 10/11] intel_scu_ipc: return -EIO for error condition in busy_loop Alan Cox
2010-07-26  9:06 ` [PATCH 11/11] intel_scu_ipc: fix size field for intel_scu_ipc_command Alan Cox
2010-08-03 13:50 ` [PATCH 00/11] Series short description Matthew Garrett
  -- strict thread matches above, loose matches on Subject: below --
2009-11-18 14:18 Alan Cox
2009-04-07 15:40 Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.