Skip to contentSkip to conversation

Enable SPI flash support on da850-evm DT kernel

PATCH Superseded Manjunathappa, Prakash 2 participants 9 messages Mar 20, 2013 – Apr 3, 2013

Subsystems (5)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover Enable SPI flash support on da850-evm DT kernel

Patch enables support for m25p64 SPI flash support on da850-EVM.

Testing information:
da850-evm comes with partitions specified in DT blob.
Able to mount/umount and create/delete files on filesystem partition.

Applies on top of linux_davinci/master tree:
git://gitorious.org/linux-davinci/linux-davinci.git

Since v3:
Minor nit, fix tabs and commit message of 2/5.

Since v2:
Fix compatible property DT naming convention.

Since v1:
Look for m25p64 instead of m25p80 flash chip and correct partition information. Dropped below accepted patch:
"spi/davinci: fix module build error"
Considered below missed out patch:
spi/davinci: add DT binding documentation

Manjunathappa, Prakash (4):
spi/davinci: no wildcards in DT compatible property
ARM: davinci: da850: add SPI1 DT node
ARM: davinci: da850: override SPI DT node device name
ARM: davinci: da850-evm: add SPI flash support

Murali Karicheri (1):
spi/davinci: add DT binding documentation

 .../devicetree/bindings/spi/spi-davinci.txt        |   51 ++++++++++++++++++++
 arch/arm/boot/dts/da850-evm.dts                    |   40 +++++++++++++++
 arch/arm/boot/dts/da850.dtsi                       |   18 +++++++
 arch/arm/mach-davinci/da8xx-dt.c                   |    1 +
 drivers/spi/spi-davinci.c                          |    4 +-
 5 files changed, 112 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-davinci.txt
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v4 1/5 spi/davinci: no wildcards in DT compatible property

Follow DT naming convention for compatible property of the blob. Use first chip name that introduced the specific version of the device.

---
 drivers/spi/spi-davinci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-davinci.c +2 -2
index 8234d22..2e8f24a 100644
@@ -776,10 +776,10 @@ rx_dma_failed:
 #if defined(CONFIG_OF)
 static const struct of_device_id davinci_spi_of_match[] = {
 	{
-		.compatible = "ti,dm644x-spi",
+		.compatible = "ti,dm6441-spi",
 	},
 	{
-		.compatible = "ti,da8xx-spi",
+		.compatible = "ti,da830-spi",
 		.data = (void *)SPI_VERSION_2,
 	},
 	{ },
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH v4 2/5 spi/davinci: add DT binding documentation

In reply to Manjunathappa, Prakash

From: Murali Karicheri <[email protected]>

Add binding documentation for spi-davinci module.

[prakash.pm at ti.com: Follow DT naming convention for compatible property]

---
Since v3:
Changed the commit message and fixed alignment issues.

 .../devicetree/bindings/spi/spi-davinci.txt        |   51 ++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-davinci.txt
Documentation/devicetree/bindings/spi/spi-davinci.txt new file +51 -0
new file mode 100644
index 0000000..6d0ac8d
@@ -0,0 +1,51 @@
+Davinci SPI controller device bindings
+
+Required properties:
+- #address-cells: number of cells required to define a chip select
+	address on the SPI bus. Should be set to 1.
+- #size-cells: should be zero.
+- compatible:
+	- "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
+	- "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
+- reg: Offset and length of SPI controller register space
+- num-cs: Number of chip selects
+- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
+	IP to the interrupt controller within the SoC. Possible values
+	are 0 and 1. Manual says one of the two possible interrupt
+	lines can be tied to the interrupt controller. Set this
+	based on a specifc SoC configuration.
+- interrupts: interrupt number mapped to CPU.
+- clocks: spi clk phandle
+
+Example of a NOR flash slave device (n25q032) connected to DaVinci
+SPI controller device over the SPI bus.
+
+spi0:spi at 20BF0000 {
+	#address-cells			= <1>;
+	#size-cells			= <0>;
+	compatible			= "ti,dm6446-spi";
+	reg				= <0x20BF0000 0x1000>;
+	num-cs				= <4>;
+	ti,davinci-spi-intr-line	= <0>;
+	interrupts			= <338>;
+	clocks				= <&clkspi>;
+
+	flash: n25q032 at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "st,m25p32";
+		spi-max-frequency = <25000000>;
+		reg = <0>;
+
+		partition at 0 {
+			label = "u-boot-spl";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 1 {
+			label = "test";
+			reg = <0x80000 0x380000>;
+		};
+	};
+};
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH v4 3/5 ARM: davinci: da850: add SPI1 DT node

In reply to Manjunathappa, Prakash

Patch adds SPI1 DT node along with pinmux data.

---
 arch/arm/boot/dts/da850.dtsi |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850.dtsi +18 -0
index 3ec1bda..327fb06 100644
@@ -62,6 +62,14 @@
 					0x10 0x00002200 0x0000ff00
 				>;
 			};
+			spi1_pins: pinmux_spi_pins {
+				pinctrl-single,bits = <
+					/* SIMO, SOMI, ENA,
+					 * CLK, CS[0], CS[1]
+					 */
+					0x14 0x00111111 0x00ffffff
+				>;
+			};
 		};
 		serial0: serial at 1c42000 {
 			compatible = "ns16550a";
@@ -107,6 +115,16 @@
 			reg = <0x21000 0x1000>;
 			status = "disabled";
 		};
+		spi1: spi at 1f0e000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "ti,da830-spi";
+			reg = <0x30e000 0x1000>;
+			num-cs = <4>;
+			ti,davinci-spi-intr-line = <1>;
+			interrupts = <56>;
+			status = "disabled";
+		};
 	};
 	nand_cs3 at 62000000 {
 		compatible = "ti,davinci-nand";
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH v4 3/5 ARM: davinci: da850: add SPI1 DT node

Hi,

Quoted 12 lines · Prakash

Patch adds SPI1 DT node along with pinmux data.

---
 arch/arm/boot/dts/da850.dtsi |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850.dtsi +0 -0
index 3ec1bda..327fb06 100644

arch/arm/boot/dts/da850.dtsi line 70

Quoted 9 lines
arch/arm/boot/dts/da850.dtsi +6 -0
@@ -62,6 +62,14 @@
 					0x10 0x00002200 0x0000ff00
 				>;
 			};
+			spi1_pins: pinmux_spi_pins {
+				pinctrl-single,bits = <
+					/* SIMO, SOMI, ENA,
+					 * CLK, CS[0], CS[1]
+					 */
+					0x14 0x00111111 0x00ffffff

Since chip select is specific to a board, let me separate it out so as to allow boards choose accordingly.

Thanks,
Prakash

#5 lore raw

PATCH v4 4/5 ARM: davinci: da850: override SPI DT node device name

In reply to Manjunathappa, Prakash

Populate OF_DEV_AUXDATA with desired device name expected by spi-davinci driver. Without this clk_get of spi-davinci DT driver fails.

---
 arch/arm/mach-davinci/da8xx-dt.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/da8xx-dt.c +1 -0
index 6b7a0a2..24146de 100644
@@ -40,6 +40,7 @@ static void __init da8xx_init_irq(void)
 struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
 	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
+	OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL),
 	{}
 };
 
Signature · 1 line
1.7.4.1
#6 lore raw

PATCH v4 5/5 ARM: davinci: da850-evm: add SPI flash support

In reply to Manjunathappa, Prakash

Enable m25p64 SPI flash support on da850-EVM. Also add partition information of SPI flash.

---
Since v2:
Fixed partition sizes.

Since v1:
Look for m25p64 instead of m25p80.
Corrected the filesystem partition information.

 arch/arm/boot/dts/da850-evm.dts |   40 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850-evm.dts +40 -0
index c359872..fe2bbe7 100644
@@ -41,6 +41,46 @@
 		wdt: wdt at 1c21000 {
 			status = "okay";
 		};
+		spi1: spi at 1f0e000 {
+			status = "okay";
+			pinctrl-names = "default";
+			pinctrl-0 = <&spi1_pins>;
+			flash: m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "m25p64";
+				spi-max-frequency = <30000000>;
+				reg = <0>;
+				partition at 0 {
+					label = "U-Boot-SPL";
+					reg = <0x00000000 0x00010000>;
+					read-only;
+				};
+				partition at 1 {
+					label = "U-Boot";
+					reg = <0x00010000 0x00080000>;
+					read-only;
+				};
+				partition at 2 {
+					label = "U-Boot-Env";
+					reg = <0x00090000 0x00010000>;
+					read-only;
+				};
+				partition at 3 {
+					label = "Kernel";
+					reg = <0x000a0000 0x00280000>;
+				};
+				partition at 4 {
+					label = "Filesystem";
+					reg = <0x00320000 0x00400000>;
+				};
+				partition at 5 {
+					label = "MAC-Address";
+					reg = <0x007f0000 0x00010000>;
+					read-only;
+				};
+			};
+		};
 	};
 	nand_cs3 at 62000000 {
 		status = "okay";
Signature · 1 line
1.7.4.1
#7 lore raw

v4 cover Enable SPI flash support on da850-evm DT kernel

In reply to Manjunathappa, Prakash

Grant,

Quoted 2 lines · Prakash

Patch enables support for m25p64 SPI flash support on da850-EVM.

With your ack, I would like to merge this series through davinci tree for v3.10. This will help manage dependencies for DT files.

Thanks,
Sekhar

#8 lore raw

v4 cover Enable SPI flash support on da850-evm DT kernel

Quoted 8 lines · Sekhar Nori

Grant,

Quoted 2 lines · Prakash

Patch enables support for m25p64 SPI flash support on da850-EVM.

With your ack, I would like to merge this series through davinci tree for v3.10. This will help manage dependencies for DT files.

Ping?

Thanks,
Sekhar