Skip to contentSkip to conversation

spi: tegra: add spi driver for sflash controller

PATCH Applied Laxman Dewangan 2 participants 2 messages Nov 14, 2012

Subsystems (4)
lore
Share & tools
lore

Laxman Dewangan

author maintainer
#0 lore raw

PATCH v2 1/1 spi: tegra: add spi driver for sflash controller

NVIDIA's Tegra20 have the SPI (SFLASH) controller to interface with spi flash device which is used for system boot. Add the spi driver for this controller.

---
Changes from V1:
- nit cleanups as suggested by Stephen.
- Use of_property_read_u32() in place of doing the same locally.

 .../bindings/spi/nvidia,tegra20-sflash.txt         |   26 +
 drivers/spi/Kconfig                                |    8 +
 drivers/spi/Makefile                               |    1 +
 drivers/spi/spi-tegra20-sflash.c                   |  665 ++++++++++++++++++++
 4 files changed, 700 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/nvidia,tegra20-sflash.txt
 create mode 100644 drivers/spi/spi-tegra20-sflash.c
Documentation/devicetree/bindings/spi/nvidia,tegra20-sflash.txt new file +26 -0
new file mode 100644
index 0000000..8cf24f6
@@ -0,0 +1,26 @@
+NVIDIA Tegra20 SFLASH controller.
+
+Required properties:
+- compatible : should be "nvidia,tegra20-sflash".
+- reg: Should contain SFLASH registers location and length.
+- interrupts: Should contain SFLASH interrupts.
+- nvidia,dma-request-selector : The Tegra DMA controller's phandle and
+  request selector for this SFLASH controller.
+
+Recommended properties:
+- spi-max-frequency: Definition as per
+                     Documentation/devicetree/bindings/spi/spi-bus.txt
+
+Example:
+
+spi@7000d600 {
+	compatible = "nvidia,tegra20-sflash";
+	reg = <0x7000c380 0x80>;
+	interrupts = <0 39 0x04>;
+	nvidia,dma-request-selector = <&apbdma 16>;
+	spi-max-frequency = <25000000>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "disabled";
+};
+
drivers/spi/Kconfig +8 -0
index 25290d9..3cbc9fb 100644
@@ -385,6 +385,14 @@ config SPI_MXS
 	help
 	  SPI driver for Freescale MXS devices.
 
+config SPI_TEGRA20_SFLASH
+	tristate "Nvidia Tegra20 Serial flash Controller"
+	depends on ARCH_TEGRA
+	help
+	  SPI driver for Nvidia Tegra20 Serial flash Controller interface.
+	  The main usecase of this controller is to use spi flash as boot
+	  device.
+
 config SPI_TEGRA20_SLINK
 	tristate "Nvidia Tegra20/Tegra30 SLINK Controller"
 	depends on ARCH_TEGRA && TEGRA20_APB_DMA
drivers/spi/Makefile +1 -0
index f87c0f1..9f6b3d8 100644
@@ -60,6 +60,7 @@ obj-$(CONFIG_SPI_SH_MSIOF)		+= spi-sh-msiof.o
 obj-$(CONFIG_SPI_SH_SCI)		+= spi-sh-sci.o
 obj-$(CONFIG_SPI_SIRF)		+= spi-sirf.o
 obj-$(CONFIG_SPI_STMP3XXX)		+= spi-stmp.o
+obj-$(CONFIG_SPI_TEGRA20_SFLASH)	+= spi-tegra20-sflash.o
 obj-$(CONFIG_SPI_TEGRA20_SLINK)		+= spi-tegra20-slink.o
 obj-$(CONFIG_SPI_TI_SSP)		+= spi-ti-ssp.o
 obj-$(CONFIG_SPI_TLE62X0)		+= spi-tle62x0.o
drivers/spi/spi-tegra20-sflash.c new file +665 -0

665 lines not on this page · raw message

Signature · 1 line
1.7.1.1
Applied
#1 lore raw
Quoted 3 lines · Laxman Dewangan

NVIDIA's Tegra20 have the SPI (SFLASH) controller to interface with spi flash device which is used for system boot. Add the spi driver for this controller.

Applied, thanks.