From 505a14954e2d7f2321a73f7a650bb6591d2fc1d3 Mon Sep 17 00:00:00 2001 From: Sourav Poddar Date: Tue, 20 Aug 2013 18:55:48 +0530 Subject: spi/qspi: Add qspi flash controller The patch add basic support for the quad spi controller. QSPI is a kind of spi module that allows single, dual and quad read access to external spi devices. The module has a memory mapped interface which provide direct interface for accessing data form external spi devices. The patch will configure controller clocks, device control register and for defining low level transfer apis which will be used by the spi framework to transfer data to the slave spi device(flash in this case). Test details: ------------- Tested this on dra7 board. Test1: Ran mtd_stesstest for 40000 iterations. - All iterations went through without failure. Test2: Use mtd utilities: - flash_erase to erase the flash device - mtd_debug read to read data back. - mtd_debug write to write to the data flash. diff between the write and read data shows zero. Acked-by: Felipe Balbi Reviewed-by: Felipe Balbi Signed-off-by: Sourav Poddar Signed-off-by: Mark Brown --- Documentation/devicetree/bindings/spi/ti_qspi.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/ti_qspi.txt (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/spi/ti_qspi.txt b/Documentation/devicetree/bindings/spi/ti_qspi.txt new file mode 100644 index 000000000000..398ef5959772 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/ti_qspi.txt @@ -0,0 +1,22 @@ +TI QSPI controller. + +Required properties: +- compatible : should be "ti,dra7xxx-qspi". +- reg: Should contain QSPI registers location and length. +- #address-cells, #size-cells : Must be present if the device has sub-nodes +- ti,hwmods: Name of the hwmod associated to the QSPI + +Recommended properties: +- spi-max-frequency: Definition as per + Documentation/devicetree/bindings/spi/spi-bus.txt + +Example: + +qspi: qspi@4b300000 { + compatible = "ti,dra7xxx-qspi"; + reg = <0x4b300000 0x100>; + #address-cells = <1>; + #size-cells = <0>; + spi-max-frequency = <25000000>; + ti,hwmods = "qspi"; +}; -- cgit v1.2.3 From 09222fc33f8e22e81d34a7518e6dd120e4128a11 Mon Sep 17 00:00:00 2001 From: Sourav Poddar Date: Tue, 27 Aug 2013 19:42:24 +0530 Subject: spi/qspi: Add compatible string for am4372. Add a compatible string for am4372. Signed-off-by: Sourav Poddar Signed-off-by: Mark Brown --- Documentation/devicetree/bindings/spi/ti_qspi.txt | 2 +- drivers/spi/spi-ti-qspi.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/spi/ti_qspi.txt b/Documentation/devicetree/bindings/spi/ti_qspi.txt index 398ef5959772..1f9641ade0b5 100644 --- a/Documentation/devicetree/bindings/spi/ti_qspi.txt +++ b/Documentation/devicetree/bindings/spi/ti_qspi.txt @@ -1,7 +1,7 @@ TI QSPI controller. Required properties: -- compatible : should be "ti,dra7xxx-qspi". +- compatible : should be "ti,dra7xxx-qspi" or "ti,am4372-qspi". - reg: Should contain QSPI registers location and length. - #address-cells, #size-cells : Must be present if the device has sub-nodes - ti,hwmods: Name of the hwmod associated to the QSPI diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 79081d9b3213..136d71eb6f27 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -453,6 +453,7 @@ static int ti_qspi_runtime_resume(struct device *dev) static const struct of_device_id ti_qspi_match[] = { {.compatible = "ti,dra7xxx-qspi" }, + {.compatible = "ti,am4372-qspi" }, {}, }; MODULE_DEVICE_TABLE(of, ti_qspi_match); -- cgit v1.2.3