Skip to contentSkip to conversation

SPI: MIPS: lantiq: add FALCON spi driver

PATCH Superseded John Crispin 1 participant 2 messages May 20, 2012

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 16/17 SPI: MIPS: lantiq: add FALCON spi driver

From: Thomas Langer <[email protected]>

The external bus unit (EBU) found on the FALCON SoC has spi emulation that is designed for serial flash access. This driver has only been tested with m25p80 type chips. The hardware has no support for other types of spi peripherals.

Cc spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

---
This patch is part of a series moving the mips/lantiq target to OF and clkdev support. The patch, once Acked, should go upstream via Ralf's MIPS tree.

Changes in V4
* drop busnum property

Changes in V3
* rephrase spi->SPI
* fix rate detection
* adds support for transfer_one & co
* adds of support

Changes in V2
* remove several superflous calls to dev_dbg
* make use of module_platform_driver
* remove falcon_spi_cleanup as it was an empty function
* return real error codes instead of -1
* fixes operator spacing errors
* split arch and driver specific patches
* squash some lines to make use of the full 80 available chars
* Kconfig is now alphabetic again
* replace BUG() with WARN_ON()

 drivers/spi/Kconfig      |    9 +
 drivers/spi/Makefile     |    1 +
 drivers/spi/spi-falcon.c |  470 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 480 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/spi-falcon.c
drivers/spi/Kconfig +9 -0
index 00c0240..62b2b5e 100644
@@ -144,6 +144,15 @@ config SPI_EP93XX
 	  This enables using the Cirrus EP93xx SPI controller in master
 	  mode.
 
+config SPI_FALCON
+	tristate "Falcon SPI controller support"
+	depends on SOC_FALCON
+	help
+	  The external bus unit (EBU) found on the FALC-ON SoC has SPI
+	  emulation that is designed for serial flash access. This driver
+	  has only been tested with m25p80 type chips. The hardware has no
+	  support for other types of SPI peripherals.
+
 config SPI_GPIO
 	tristate "GPIO-based bitbanging SPI Master"
 	depends on GENERIC_GPIO
drivers/spi/Makefile +1 -0
index 9d75d21..b5cbab2 100644
@@ -26,6 +26,7 @@ obj-$(CONFIG_SPI_DW_MMIO)		+= spi-dw-mmio.o
 obj-$(CONFIG_SPI_DW_PCI)		+= spi-dw-midpci.o
 spi-dw-midpci-objs			:= spi-dw-pci.o spi-dw-mid.o
 obj-$(CONFIG_SPI_EP93XX)		+= spi-ep93xx.o
+obj-$(CONFIG_SPI_FALCON)		+= spi-falcon.o
 obj-$(CONFIG_SPI_FSL_LIB)		+= spi-fsl-lib.o
 obj-$(CONFIG_SPI_FSL_ESPI)		+= spi-fsl-espi.o
 obj-$(CONFIG_SPI_FSL_SPI)		+= spi-fsl-spi.o
drivers/spi/spi-falcon.c new file +470 -0

470 lines not on this page · raw message

Signature · 9 lines
1.7.9.1


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
#1 lore raw

drivers/spi/spi-falcon.c line 426

Quoted 3 lines · John Crispin
drivers/spi/spi-falcon.c new file +3 -0
+	master->mode_bits = SPI_MODE_3;
+	master->num_chipselect = 1;
+	master->bus_num = -1;

once

drivers/spi/spi-falcon.c line 432

Quoted 6 lines
drivers/spi/spi-falcon.c new file +6 -0
+	master->setup = falcon_sflash_setup;
+	master->prepare_transfer_hardware = falcon_sflash_prepare_xfer;
+	master->transfer_one_message = falcon_sflash_xfer_one;
+	master->unprepare_transfer_hardware = falcon_sflash_unprepare_xfer;
+	master->dev.of_node = pdev->dev.of_node;
+	master->bus_num = -1;

twice :-)

sorry ....

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/