Skip to contentSkip to conversation

m68knommu: Freescale/Motorola Coldfire QSPI driver

PATCH New Steven King 1 participant 1 message Jan 11, 2010 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68knommu: Freescale/Motorola Coldfire QSPI driver

Add support for the QSPI controller found some on Freescale/Motorola Coldfire MCUs.

Full duplex, active high cs, spi modes 0-3 and word sizes 8-16 bits are supported. The hardware drives the MISO, MOSI and SCLK lines, but the chip selects are managed via GPIO and must be configured by the board code.

The QSPI controller has an 80 byte buffer which allows us to transfer up to 16 words at a time. For transfers longer than 16 words, we split the buffer in half so we can update in one half while the controller is operating on the other half. Interrupt latencies then ultimately limits our sustained thru-put to something less than half the maximum speed supported by the part.

--

 drivers/spi/Kconfig         |   10 +
 drivers/spi/Makefile        |    1 +
 drivers/spi/coldfire_qspi.c |  640 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 651 insertions(+), 0 deletions(-)
drivers/spi/Kconfig +10 -0
index f55eb01..6b32316 100644
@@ -100,6 +100,16 @@ config SPI_BUTTERFLY
 	  inexpensive battery powered microcontroller evaluation board.
 	  This same cable can be used to flash new firmware.
 
+config SPI_COLDFIRE_QSPI
+	tristate "Freescale Coldfire QSPI controller"
+	depends on (M520x || M523x || M5249 || M527x || M528x || M532x)
+	help
+	  This enables support for the Coldfire QSPI controller in master
+	  mode.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called coldfire_qspi.
+
 config SPI_GPIO
 	tristate "GPIO-based bitbanging SPI Master"
 	depends on GENERIC_GPIO
drivers/spi/Makefile +1 -0
index f3d2810..e310d21 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_SPI_BFIN)			+= spi_bfin5xx.o
 obj-$(CONFIG_SPI_BITBANG)		+= spi_bitbang.o
 obj-$(CONFIG_SPI_AU1550)		+= au1550_spi.o
 obj-$(CONFIG_SPI_BUTTERFLY)		+= spi_butterfly.o
+obj-$(CONFIG_SPI_COLDFIRE_QSPI)		+= coldfire_qspi.o
 obj-$(CONFIG_SPI_DESIGNWARE)		+= dw_spi.o
 obj-$(CONFIG_SPI_DW_PCI)		+= dw_spi_pci.o
 obj-$(CONFIG_SPI_GPIO)			+= spi_gpio.o
drivers/spi/coldfire_qspi.c new file +640 -0

640 lines not on this page · raw message