[PATCH] spi: simple SPI framework
This is the core of a small SPI framework, implementing the model of a
queue of messages which complete asynchronously (with thin synchronous
wrappers on top).
- It's still less than 2KB of ".text" (ARM). If there's got to be a
mid-layer for something so simple, that's the right size budget. :)
- The guts use board-specific SPI device tables to build the driver
model tree. (Hardware probing is rarely an option.)
- This version of Kconfig includes no drivers. At this writing there
are two known master controller drivers (PXA/SSP, OMAP MicroWire)
and three protocol drivers (CS8415a, ADS7846, DataFlash) with LKML
mentions of other drivers in development.
- No userspace API. There are several implementations to compare.
Implement them like any other driver, and bind them with sysfs.
The changes from last version posted to LKML (on 11-Nov-2005) are minor,
and include:
- One bugfix (removes a FIXME), with the visible effect of making device
names be "spiB.C" where B is the bus number and C is the chipselect.
- The "caller provides DMA mappings" mechanism now has kerneldoc, for
DMA drivers that want to be fancy.
- Hey, the framework init can be subsys_init. Even though board init
logic fires earlier, at arch_init ... since the framework init is
for driver support, and the board init support uses static init.
- Various additional spec/doc clarifications based on discussions
with other folk. It adds a brief "thank you" at the end, for folk
who've helped nudge this framework into existence.
As I've said before, I think that "protocol tweaking" is the main support
that this driver framework will need to evolve.
From: Mark Underwood <basicmark@yahoo.com>
Update the SPI framework to remove a potential priority inversion case by
reverting to kmalloc if the pre-allocated DMA-safe buffer isn't available.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-08 21:34:19 +00:00
|
|
|
#
|
|
|
|
# Makefile for kernel SPI drivers.
|
|
|
|
#
|
|
|
|
|
2010-09-24 19:17:32 +00:00
|
|
|
ccflags-$(CONFIG_SPI_DEBUG) := -DDEBUG
|
[PATCH] spi: simple SPI framework
This is the core of a small SPI framework, implementing the model of a
queue of messages which complete asynchronously (with thin synchronous
wrappers on top).
- It's still less than 2KB of ".text" (ARM). If there's got to be a
mid-layer for something so simple, that's the right size budget. :)
- The guts use board-specific SPI device tables to build the driver
model tree. (Hardware probing is rarely an option.)
- This version of Kconfig includes no drivers. At this writing there
are two known master controller drivers (PXA/SSP, OMAP MicroWire)
and three protocol drivers (CS8415a, ADS7846, DataFlash) with LKML
mentions of other drivers in development.
- No userspace API. There are several implementations to compare.
Implement them like any other driver, and bind them with sysfs.
The changes from last version posted to LKML (on 11-Nov-2005) are minor,
and include:
- One bugfix (removes a FIXME), with the visible effect of making device
names be "spiB.C" where B is the bus number and C is the chipselect.
- The "caller provides DMA mappings" mechanism now has kerneldoc, for
DMA drivers that want to be fancy.
- Hey, the framework init can be subsys_init. Even though board init
logic fires earlier, at arch_init ... since the framework init is
for driver support, and the board init support uses static init.
- Various additional spec/doc clarifications based on discussions
with other folk. It adds a brief "thank you" at the end, for folk
who've helped nudge this framework into existence.
As I've said before, I think that "protocol tweaking" is the main support
that this driver framework will need to evolve.
From: Mark Underwood <basicmark@yahoo.com>
Update the SPI framework to remove a potential priority inversion case by
reverting to kmalloc if the pre-allocated DMA-safe buffer isn't available.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-08 21:34:19 +00:00
|
|
|
|
|
|
|
# small core, mostly translating board-specific
|
|
|
|
# config declarations into driver model code
|
|
|
|
obj-$(CONFIG_SPI_MASTER) += spi.o
|
|
|
|
|
|
|
|
# SPI master controller drivers (bus)
|
2011-02-14 02:10:43 +00:00
|
|
|
obj-$(CONFIG_SPI_ALTERA) += spi_altera.o
|
2007-02-14 08:33:09 +00:00
|
|
|
obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o
|
2011-01-04 20:28:22 +00:00
|
|
|
obj-$(CONFIG_SPI_ATH79) += ath79_spi.o
|
2007-05-06 21:50:34 +00:00
|
|
|
obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o
|
|
|
|
obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o
|
2007-05-08 07:32:25 +00:00
|
|
|
obj-$(CONFIG_SPI_AU1550) += au1550_spi.o
|
2006-01-08 21:34:29 +00:00
|
|
|
obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o
|
2010-01-20 20:49:44 +00:00
|
|
|
obj-$(CONFIG_SPI_COLDFIRE_QSPI) += coldfire_qspi.o
|
2009-12-16 22:02:18 +00:00
|
|
|
obj-$(CONFIG_SPI_DAVINCI) += davinci_spi.o
|
2009-12-14 22:20:22 +00:00
|
|
|
obj-$(CONFIG_SPI_DESIGNWARE) += dw_spi.o
|
2010-12-24 05:59:11 +00:00
|
|
|
obj-$(CONFIG_SPI_DW_PCI) += dw_spi_midpci.o
|
|
|
|
dw_spi_midpci-objs := dw_spi_pci.o dw_spi_mid.o
|
2010-01-21 14:46:42 +00:00
|
|
|
obj-$(CONFIG_SPI_DW_MMIO) += dw_spi_mmio.o
|
2010-05-06 04:47:04 +00:00
|
|
|
obj-$(CONFIG_SPI_EP93XX) += ep93xx_spi.o
|
2009-01-06 22:41:41 +00:00
|
|
|
obj-$(CONFIG_SPI_GPIO) += spi_gpio.o
|
2009-10-01 22:44:28 +00:00
|
|
|
obj-$(CONFIG_SPI_IMX) += spi_imx.o
|
2007-07-17 11:04:05 +00:00
|
|
|
obj-$(CONFIG_SPI_LM70_LLP) += spi_lm70llp.o
|
2006-03-08 07:53:24 +00:00
|
|
|
obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o
|
2010-11-24 09:17:14 +00:00
|
|
|
obj-$(CONFIG_SPI_PXA2XX_PCI) += pxa2xx_spi_pci.o
|
2011-02-14 02:20:39 +00:00
|
|
|
obj-$(CONFIG_SPI_OC_TINY) += spi_oc_tiny.o
|
2007-02-12 08:52:37 +00:00
|
|
|
obj-$(CONFIG_SPI_OMAP_UWIRE) += omap_uwire.o
|
2007-07-17 11:04:13 +00:00
|
|
|
obj-$(CONFIG_SPI_OMAP24XX) += omap2_mcspi.o
|
2009-12-13 08:02:11 +00:00
|
|
|
obj-$(CONFIG_SPI_OMAP_100K) += omap_spi_100k.o
|
2008-08-05 20:01:09 +00:00
|
|
|
obj-$(CONFIG_SPI_ORION) += orion_spi.o
|
2009-06-09 07:11:42 +00:00
|
|
|
obj-$(CONFIG_SPI_PL022) += amba-pl022.o
|
2010-04-30 13:21:27 +00:00
|
|
|
obj-$(CONFIG_SPI_MPC512x_PSC) += mpc512x_psc_spi.o
|
2007-05-11 05:22:52 +00:00
|
|
|
obj-$(CONFIG_SPI_MPC52xx_PSC) += mpc52xx_psc_spi.o
|
2009-11-04 22:34:18 +00:00
|
|
|
obj-$(CONFIG_SPI_MPC52xx) += mpc52xx_spi.o
|
2010-10-12 10:18:31 +00:00
|
|
|
obj-$(CONFIG_SPI_FSL_LIB) += spi_fsl_lib.o
|
spi/fsl_spi: add eSPI controller support
Add eSPI controller support based on the library code spi_fsl_lib.c.
The eSPI controller is newer controller 85xx/Pxxx devices supported.
There're some differences comparing to the SPI controller:
1. Has different register map and different bit definition
So leave the code operated the register to the driver code, not
the common code.
2. Support 4 dedicated chip selects
The software can't controll the chip selects directly, The SPCOM[CS]
field is used to select which chip selects is used, and the
SPCOM[TRANLEN] field is set to tell the controller how long the CS
signal need to be asserted. So the driver doesn't need the chipselect
related function when transfering data, just set corresponding register
fields to controll the chipseclect.
3. Different Transmit/Receive FIFO access register behavior
For SPI controller, the Tx/Rx FIFO access register can hold only
one character regardless of the character length, but for eSPI
controller, the register can hold 4 or 2 characters according to
the character lengths. Access the Tx/Rx FIFO access register of the
eSPI controller will shift out/in 4/2 characters one time. For SPI
subsystem, the command and data are put into different transfers, so
we need to combine all the transfers to one transfer in order to pass
the transfer to eSPI controller.
4. The max transaction length limitation
The max transaction length one time is limitted by the SPCOM[TRANSLEN]
field which is 0xFFFF. When used mkfs.ext2 command to create ext2
filesystem on the flash, the read length will exceed the max value of
the SPCOM[TRANSLEN] field.
Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-10-12 10:18:32 +00:00
|
|
|
obj-$(CONFIG_SPI_FSL_ESPI) += spi_fsl_espi.o
|
2010-10-12 10:18:30 +00:00
|
|
|
obj-$(CONFIG_SPI_FSL_SPI) += spi_fsl_spi.o
|
2009-09-22 23:45:58 +00:00
|
|
|
obj-$(CONFIG_SPI_PPC4xx) += spi_ppc4xx.o
|
2006-05-20 22:00:17 +00:00
|
|
|
obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o
|
2009-12-15 06:20:24 +00:00
|
|
|
obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx_hw.o
|
2009-11-30 07:39:42 +00:00
|
|
|
obj-$(CONFIG_SPI_S3C64XX) += spi_s3c64xx.o
|
2010-04-22 22:58:25 +00:00
|
|
|
obj-$(CONFIG_SPI_TEGRA) += spi_tegra.o
|
2011-01-18 19:21:36 +00:00
|
|
|
obj-$(CONFIG_SPI_TI_SSP) += ti-ssp-spi.o
|
2010-10-08 18:44:49 +00:00
|
|
|
obj-$(CONFIG_SPI_TOPCLIFF_PCH) += spi_topcliff_pch.o
|
2007-07-17 11:04:15 +00:00
|
|
|
obj-$(CONFIG_SPI_TXX9) += spi_txx9.o
|
2007-07-17 11:04:11 +00:00
|
|
|
obj-$(CONFIG_SPI_XILINX) += xilinx_spi.o
|
2011-02-15 01:30:32 +00:00
|
|
|
obj-$(CONFIG_SPI_SH) += spi_sh.o
|
2008-02-06 09:38:15 +00:00
|
|
|
obj-$(CONFIG_SPI_SH_SCI) += spi_sh_sci.o
|
2009-11-26 11:10:05 +00:00
|
|
|
obj-$(CONFIG_SPI_SH_MSIOF) += spi_sh_msiof.o
|
2009-09-22 23:46:15 +00:00
|
|
|
obj-$(CONFIG_SPI_STMP3XXX) += spi_stmp.o
|
2009-12-01 14:29:20 +00:00
|
|
|
obj-$(CONFIG_SPI_NUC900) += spi_nuc900.o
|
2009-12-15 06:20:24 +00:00
|
|
|
|
|
|
|
# special build for s3c24xx spi driver with fiq support
|
|
|
|
spi_s3c24xx_hw-y := spi_s3c24xx.o
|
|
|
|
spi_s3c24xx_hw-$(CONFIG_SPI_S3C24XX_FIQ) += spi_s3c24xx_fiq.o
|
|
|
|
|
[PATCH] spi: simple SPI framework
This is the core of a small SPI framework, implementing the model of a
queue of messages which complete asynchronously (with thin synchronous
wrappers on top).
- It's still less than 2KB of ".text" (ARM). If there's got to be a
mid-layer for something so simple, that's the right size budget. :)
- The guts use board-specific SPI device tables to build the driver
model tree. (Hardware probing is rarely an option.)
- This version of Kconfig includes no drivers. At this writing there
are two known master controller drivers (PXA/SSP, OMAP MicroWire)
and three protocol drivers (CS8415a, ADS7846, DataFlash) with LKML
mentions of other drivers in development.
- No userspace API. There are several implementations to compare.
Implement them like any other driver, and bind them with sysfs.
The changes from last version posted to LKML (on 11-Nov-2005) are minor,
and include:
- One bugfix (removes a FIXME), with the visible effect of making device
names be "spiB.C" where B is the bus number and C is the chipselect.
- The "caller provides DMA mappings" mechanism now has kerneldoc, for
DMA drivers that want to be fancy.
- Hey, the framework init can be subsys_init. Even though board init
logic fires earlier, at arch_init ... since the framework init is
for driver support, and the board init support uses static init.
- Various additional spec/doc clarifications based on discussions
with other folk. It adds a brief "thank you" at the end, for folk
who've helped nudge this framework into existence.
As I've said before, I think that "protocol tweaking" is the main support
that this driver framework will need to evolve.
From: Mark Underwood <basicmark@yahoo.com>
Update the SPI framework to remove a potential priority inversion case by
reverting to kmalloc if the pre-allocated DMA-safe buffer isn't available.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-08 21:34:19 +00:00
|
|
|
# ... add above this line ...
|
|
|
|
|
|
|
|
# SPI protocol drivers (device/link on bus)
|
2007-05-08 07:32:15 +00:00
|
|
|
obj-$(CONFIG_SPI_SPIDEV) += spidev.o
|
2007-07-17 11:04:10 +00:00
|
|
|
obj-$(CONFIG_SPI_TLE62X0) += tle62x0.o
|
[PATCH] spi: simple SPI framework
This is the core of a small SPI framework, implementing the model of a
queue of messages which complete asynchronously (with thin synchronous
wrappers on top).
- It's still less than 2KB of ".text" (ARM). If there's got to be a
mid-layer for something so simple, that's the right size budget. :)
- The guts use board-specific SPI device tables to build the driver
model tree. (Hardware probing is rarely an option.)
- This version of Kconfig includes no drivers. At this writing there
are two known master controller drivers (PXA/SSP, OMAP MicroWire)
and three protocol drivers (CS8415a, ADS7846, DataFlash) with LKML
mentions of other drivers in development.
- No userspace API. There are several implementations to compare.
Implement them like any other driver, and bind them with sysfs.
The changes from last version posted to LKML (on 11-Nov-2005) are minor,
and include:
- One bugfix (removes a FIXME), with the visible effect of making device
names be "spiB.C" where B is the bus number and C is the chipselect.
- The "caller provides DMA mappings" mechanism now has kerneldoc, for
DMA drivers that want to be fancy.
- Hey, the framework init can be subsys_init. Even though board init
logic fires earlier, at arch_init ... since the framework init is
for driver support, and the board init support uses static init.
- Various additional spec/doc clarifications based on discussions
with other folk. It adds a brief "thank you" at the end, for folk
who've helped nudge this framework into existence.
As I've said before, I think that "protocol tweaking" is the main support
that this driver framework will need to evolve.
From: Mark Underwood <basicmark@yahoo.com>
Update the SPI framework to remove a potential priority inversion case by
reverting to kmalloc if the pre-allocated DMA-safe buffer isn't available.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-08 21:34:19 +00:00
|
|
|
# ... add above this line ...
|
|
|
|
|
|
|
|
# SPI slave controller drivers (upstream link)
|
|
|
|
# ... add above this line ...
|
|
|
|
|
|
|
|
# SPI slave drivers (protocol for that link)
|
|
|
|
# ... add above this line ...
|