Skip to contentSkip to conversation

SPI: SSP SPI Controller driver v3

PATCH In review chao bi 3 participants 6 messages Dec 18, 2012 – Jan 7, 2013 SPI

lore
Share & tools
lore

chao bi

author
#0 lore raw

PATCH 1/1 SPI: SSP SPI Controller driver v3

This patch is to implement SSP SPI controller driver, which has been applied and validated on intel Moorestown & Medfield platform. The patch are originated by Ken Mills <[email protected]> and Sylvain Centelles <[email protected]>, migrating to lateset Linux mainline SPI framework by Channing <[email protected]> and Chen Jun <[email protected]> according to their integration & validation on Medfield platform.

---
 drivers/spi/Kconfig                   |    9 +
 drivers/spi/Makefile                  |    1 +
 drivers/spi/spi-intel-mid-ssp.c       | 1614 +++++++++++++++++++++++++++++++++
 include/linux/spi/spi-intel-mid-ssp.h |  103 +++
 4 files changed, 1727 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/spi-intel-mid-ssp.c
 create mode 100644 include/linux/spi/spi-intel-mid-ssp.h
drivers/spi/Kconfig +9 -0
index 2e188e1..6285f17 100644
@@ -186,6 +186,15 @@ config SPI_IMX
 	  This enables using the Freescale i.MX SPI controllers in master
 	  mode.
 
+config SPI_INTEL_MID_SSP
+	tristate "SSP SPI controller driver for Intel MID platforms"
+	depends on SPI_MASTER && INTEL_MID_DMAC
+	help
+	  This is the unified SSP SPI master controller driver for
+	  the Intel MID platforms, handling Moorestown & Medfield,
+	  master clock mode.
+	  It supports Bulverde SSP core.
+
 config SPI_LM70_LLP
 	tristate "Parallel port adapter for LM70 eval board (DEVELOPMENT)"
 	depends on PARPORT && EXPERIMENTAL
drivers/spi/Makefile +1 -0
index 64e970b..1738966 100644
@@ -33,6 +33,7 @@ obj-$(CONFIG_SPI_FSL_ESPI)		+= spi-fsl-espi.o
 obj-$(CONFIG_SPI_FSL_SPI)		+= spi-fsl-spi.o
 obj-$(CONFIG_SPI_GPIO)			+= spi-gpio.o
 obj-$(CONFIG_SPI_IMX)			+= spi-imx.o
+obj-$(CONFIG_SPI_INTEL_MID_SSP)		+= spi-intel-mid-ssp.o
 obj-$(CONFIG_SPI_LM70_LLP)		+= spi-lm70llp.o
 obj-$(CONFIG_SPI_MPC512x_PSC)		+= spi-mpc512x-psc.o
 obj-$(CONFIG_SPI_MPC52xx_PSC)		+= spi-mpc52xx-psc.o
drivers/spi/spi-intel-mid-ssp.c new file +1614 -0

1,614 lines not on this page · raw message

include/linux/spi/spi-intel-mid-ssp.h new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw
Quoted 7 lines · chao bi

This patch is to implement SSP SPI controller driver, which has been applied and validated on intel Moorestown & Medfield platform. The patch are originated by Ken Mills <[email protected]> and Sylvain Centelles <[email protected]>, migrating to lateset Linux mainline SPI framework by Channing <[email protected]> and Chen Jun <[email protected]> according to their integration & validation on Medfield platform.

This is the same IP block as used in PXA, right? With few modifications here and there. Is there a reason not to use spi-pxa2xx.c?

I have a set of patches for spi-pxa2xx.c that adds support for Lynxpoint LPSS, DMA engine and ACPI enumeration. I'm hoping to send those soon (once -rc1 is released) to the list.

Maybe we can co-operate to get the Medfield support there as well?

#2 lore raw
Quoted 11 lines · Mika Westerberg
Quoted 7 lines · chao bi

This patch is to implement SSP SPI controller driver, which has been applied and validated on intel Moorestown & Medfield platform. The patch are originated by Ken Mills <[email protected]> and Sylvain Centelles <[email protected]>, migrating to lateset Linux mainline SPI framework by Channing <[email protected]> and Chen Jun <[email protected]> according to their integration & validation on Medfield platform.

This is the same IP block as used in PXA, right? With few modifications here and there. Is there a reason not to use spi-pxa2xx.c?

This needs to be investigated. Two drivers for the same or closely related hardware block is never a good sign...

Yours,
Linus Walleij

author
#3 lore raw
Quoted 11 lines · Linus Walleij
Quoted 9 lines · Mika Westerberg
Quoted 7 lines · chao bi

This patch is to implement SSP SPI controller driver, which has been applied and validated on intel Moorestown & Medfield platform. The patch are originated by Ken Mills <[email protected]> and Sylvain Centelles <[email protected]>, migrating to lateset Linux mainline SPI framework by Channing <[email protected]> and Chen Jun <[email protected]> according to their integration & validation on Medfield platform.

Quoted 8 lines
Quoted 2 lines

This is the same IP block as used in PXA, right? With few modifications here and there. Is there a reason not to use spi-pxa2xx.c?

This needs to be investigated. Two drivers for the same or closely related hardware block is never a good sign...

Yours,
Linus Walleij

Dear Linus ,Mika and Grant,

Thanks for your remind.

Frankly I'm currently not sure whether they share same IP.. per your reminds, I tried to find but get limited info about PXA SSP's IP, from the code, looks like they have part of registers the same.

As far as I know, spi-pxa2xx.c is specific for SSP controller of PXA2XX/PXA3XX core, right? While Medfield platform is embedded with ATOM core, the SSP driver we upload is validated on SSP controller of ATOM. In my view, they're specific for different AP & Platforms, if compare the 2 files, there are still many difference in how they works, if to choose a driver for Intel Medfild/Moorestown platform, I believe spi-intel-mid-ssp.c driver could be a more mature solution.

What do you think? please correct me if I'm mistaken.

-chao

#4 lore raw
Quoted 4 lines · channing

Frankly I'm currently not sure whether they share same IP.. per your reminds, I tried to find but get limited info about PXA SSP's IP, from the code, looks like they have part of registers the same.

As far as I know, spi-pxa2xx.c is specific for SSP controller of PXA2XX/PXA3XX core, right?

As pointed out by Mika it may very well be the same IP anyway. People copy/paste share and fork VHDL/Verilog/SystemC code just as much as they do with kernel code.

Quoted 7 lines

While Medfield
platform is embedded with ATOM core, the SSP driver we upload is validated on SSP controller of ATOM. In my view, they're specific for different AP & Platforms, if compare the 2 files, there are still many difference in how they works, if to choose a driver for Intel Medfild/Moorestown platform, I believe spi-intel-mid-ssp.c driver could be a more mature solution.

From the kernel community point of view the driver that is being

maintained in-tree
is the more mature solution.

For your productization maybe the other driver is more mature.

These are two different definitions of maturity.

In the kernel we worry that we do not needlessly need to fix bugs in two places or leave a bug in one place while fixing it in another place, which is potentially the
problem we run into here.

There may be an initial time/testing cost for you to adopt to the PXA driver, but on the other hand the PXA developers will review your code and fix bugs for you also, so it's what we call a win-win situation if you can share the driver.

Yours,
Linus Walleij

#5 lore raw
Quoted 10 lines · Linus Walleij
Quoted 4 lines · channing

Frankly I'm currently not sure whether they share same IP.. per your reminds, I tried to find but get limited info about PXA SSP's IP, from the code, looks like they have part of registers the same.

As far as I know, spi-pxa2xx.c is specific for SSP controller of PXA2XX/PXA3XX core, right?

As pointed out by Mika it may very well be the same IP anyway. People copy/paste share and fork VHDL/Verilog/SystemC code just as much as they do with kernel code.

Yes, at least on Intel Lynxpoint it is the same IP with few additional features. I'm about to send patches to spi-pxa2xx which enable the Lynxpoint support shortly.