Skip to contentSkip to conversation

spi: Add SPI driver for Mikrotik RB4xx series boards

PATCH Applied Bert Vermeulen 2 participants 2 messages Apr 15, 2015 – Apr 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 spi: Add SPI driver for Mikrotik RB4xx series boards

This driver mediates access between the connected CPLD and other devices on the bus.

The m25p80-compatible boot flash and (some models) MMC use regular SPI, bitbanged as required by the SoC. However the SPI-connected CPLD has a two-wire mode, in which two bits are transferred per SPI clock cycle. The second bit is transmitted with the SoC's CS2 pin.

---
Changes in v7:
- use SPI_TX_DUAL/tx_nbits to signal two-wire mode
- use SPI_MASTER_MUST_TX for dummy writes
- use bits_per_word_mask to restrict word size
- properly disable/unprepare clock on module removal
- code cleanup
Changes in v6:
- removed unnecessary SPI mode check
- whitespace fixes

 drivers/spi/Kconfig     |   6 ++
 drivers/spi/Makefile    |   1 +
 drivers/spi/spi-rb4xx.c | 210 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 217 insertions(+)
 create mode 100644 drivers/spi/spi-rb4xx.c
drivers/spi/Kconfig +6 -0
index ab8dfbe..8b1beaf6 100644
@@ -429,6 +429,12 @@ config SPI_ROCKCHIP
 	  The main usecase of this controller is to use spi flash as boot
 	  device.
 
+config SPI_RB4XX
+	tristate "Mikrotik RB4XX SPI master"
+	depends on SPI_MASTER && ATH79
+	help
+	  SPI controller driver for the Mikrotik RB4xx series boards.
+
 config SPI_RSPI
 	tristate "Renesas RSPI/QSPI controller"
 	depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
drivers/spi/Makefile +1 -0
index d8cbf65..0218f39 100644
@@ -66,6 +66,7 @@ obj-$(CONFIG_SPI_PXA2XX)		+= spi-pxa2xx-platform.o
 obj-$(CONFIG_SPI_PXA2XX_PCI)		+= spi-pxa2xx-pci.o
 obj-$(CONFIG_SPI_QUP)			+= spi-qup.o
 obj-$(CONFIG_SPI_ROCKCHIP)		+= spi-rockchip.o
+obj-$(CONFIG_SPI_RB4XX)			+= spi-rb4xx.o
 obj-$(CONFIG_SPI_RSPI)			+= spi-rspi.o
 obj-$(CONFIG_SPI_S3C24XX)		+= spi-s3c24xx-hw.o
 spi-s3c24xx-hw-y			:= spi-s3c24xx.o
drivers/spi/spi-rb4xx.c new file +210 -0

210 lines not on this page · raw message

Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Applied
#1 lore raw
Quoted 2 lines · Bert Vermeulen

This driver mediates access between the connected CPLD and other devices on the bus.

Applied, thanks.