Skip to contentSkip to conversation

Enable SPI flash support on da850-evm DT kernel

PATCH New Manjunathappa, Prakash 3 participants 13 messages Feb 25, 2013 – Mar 4, 2013

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

cover Enable SPI flash support on da850-evm DT kernel

Patch enables support for m25p80 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.

Depends on below patch in spi-next branch of git://git.secretlab.ca/git/linux-2.6.git.
"spi/davinci: add OF support for the spi controller"

Applies on top of below patch under community review:
http://www.mail-archive.com/davinci-linux-open-source at linux.davincidsp.com/msg25184.html

Manjunathappa, Prakash (4):
spi/davinci: fix module build error
ARM: davinci: da850: add SPI1 DT node
ARM: davinci: da850: override SPI DT node device name
ARM: davinci: da850-evm: add SPI flash support

 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        |    2 +-
 4 files changed, 60 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/4 spi/davinci: fix module build error

Fix below module build error:

CC [M] drivers/spi/spi-davinci.o
drivers/spi/spi-davinci.c:774:1: error: '__mod_of_device_table' aliased to undefined symbol 'davini_spi_of_match' drivers/spi/spi-davinci.c:774:1: error: '__mod_of_device_table' aliased to undefined symbol 'davini_spi_of_match'
make[2]: *** [drivers/spi/spi-davinci.o] Error 1
make[1]: *** [drivers/spi] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

---
 drivers/spi/spi-davinci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/spi/spi-davinci.c +1 -1
index 50bd2cd..b30064b 100644
@@ -771,7 +771,7 @@ static const struct of_device_id davinci_spi_of_match[] = {
 	},
 	{ },
 };
-MODULE_DEVICE_TABLE(of, davini_spi_of_match);
+MODULE_DEVICE_TABLE(of, davinci_spi_of_match);
 
 /**
  * spi_davinci_get_pdata - Get platform data from DTS binding
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 1/4 spi/davinci: fix module build error

Quoted 12 lines · Prakash

Fix below module build error:

CC [M] drivers/spi/spi-davinci.o
drivers/spi/spi-davinci.c:774:1: error: '__mod_of_device_table' aliased to undefined symbol 'davini_spi_of_match' drivers/spi/spi-davinci.c:774:1: error: '__mod_of_device_table' aliased to undefined symbol 'davini_spi_of_match'
make[2]: *** [drivers/spi/spi-davinci.o] Error 1
make[1]: *** [drivers/spi] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

Quoted 1 line

Thanks,
Sekhar

Applied
#3 lore raw

PATCH 1/4 spi/davinci: fix module build error

Quoted 13 lines · Sekhar Nori
Quoted 12 lines · Prakash

Fix below module build error:

CC [M] drivers/spi/spi-davinci.o
drivers/spi/spi-davinci.c:774:1: error: '__mod_of_device_table' aliased to undefined symbol 'davini_spi_of_match' drivers/spi/spi-davinci.c:774:1: error: '__mod_of_device_table' aliased to undefined symbol 'davini_spi_of_match'
make[2]: *** [drivers/spi/spi-davinci.o] Error 1
make[1]: *** [drivers/spi] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

Quoted 3 lines
Quoted 1 line

Applied, thanks.

g.

#4 lore raw

PATCH 2/4 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 ebe7386..e921c82 100644
@@ -76,6 +76,14 @@
 					0x28 0x00222222  0x00ffffff
 				>;
 			};
+			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";
@@ -126,6 +134,16 @@
 			interrupts = <16>;
 			status = "disabled";
 		};
+		spi1: spi at 1f0e000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "ti,da8xx-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
#5 lore raw

PATCH 3/4 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 2b740a9..d9c76009 100644
@@ -42,6 +42,7 @@ struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
 	OF_DEV_AUXDATA("ti,davinci-mmc-da830", 0x01c40000, "davinci-mmc-da830.0",
 			NULL),
+	OF_DEV_AUXDATA("ti,da8xx-spi", 0x01f0e000, "spi_davinci.1", NULL),
 	{}
 };
 
Signature · 1 line
1.7.4.1
#6 lore raw

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

In reply to Manjunathappa, Prakash

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

---
 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 78c8e54..1a28d43 100644
@@ -46,6 +46,46 @@
 			pinctrl-names = "default";
 			pinctrl-0 = <&mmc0_pins>;
 		};
+		spi1: spi at 1f0e000 {
+			status = "okay";
+			pinctrl-names = "default";
+			pinctrl-0 = <&spi1_pins>;
+			flash: m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "m25p80";
+				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 = <0x00220000 0x00400000>;
+				};
+				partition at 5 {
+					label = "MAC-Address";
+					reg = <0x00620000 0x00010000>;
+					read-only;
+				};
+			};
+		};
 	};
 	nand_cs3 at 62000000 {
 		status = "okay";
Signature · 1 line
1.7.4.1
#7 lore raw

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

Quoted 14 lines · Prakash

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

---
 arch/arm/boot/dts/da850-evm.dts |   40 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850-evm.dts +0 -0
index 78c8e54..1a28d43 100644
@@ -46,6 +46,46 @@
 			pinctrl-names = "default";

arch/arm/boot/dts/da850-evm.dts line 56

Quoted 10 lines
arch/arm/boot/dts/da850-evm.dts +8 -0
 			pinctrl-0 = <&mmc0_pins>;
 		};
+		spi1: spi at 1f0e000 {
+			status = "okay";
+			pinctrl-names = "default";
+			pinctrl-0 = <&spi1_pins>;
+			flash: m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "m25p80";

Are you sure there is a m25p80 part on these boards? On my board using this patch I get:

m25p80 spi32766.0: found m25p64, expected m25p80

I can access the flash just fine though.

Thanks,
Sekhar

#8 lore raw

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

Quoted 29 lines · Sekhar
Quoted 14 lines · Prakash

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

---
 arch/arm/boot/dts/da850-evm.dts |   40 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850-evm.dts +0 -0
index 78c8e54..1a28d43 100644
@@ -46,6 +46,46 @@
 			pinctrl-names = "default";

arch/arm/boot/dts/da850-evm.dts line 56

Quoted 10 lines
arch/arm/boot/dts/da850-evm.dts +8 -0
 			pinctrl-0 = <&mmc0_pins>;
 		};
+		spi1: spi at 1f0e000 {
+			status = "okay";
+			pinctrl-names = "default";
+			pinctrl-0 = <&spi1_pins>;
+			flash: m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "m25p80";

Are you sure there is a m25p80 part on these boards? On my board using this patch I get:

Quoted 2 lines

m25p80 spi32766.0: found m25p64, expected m25p80

On my board also I see this warning. Also there is mistake in filesystem partition information specified in this patch, will correct it in next version of patch.

Thanks,
Prakash

Quoted 5 lines

I can access the flash just fine though.

Thanks,
Sekhar

#9 lore raw

cover Enable SPI flash support on da850-evm DT kernel

In reply to Manjunathappa, Prakash
Quoted 7 lines · Prakash

Patch enables support for m25p80 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.

Quoted 5 lines

Depends on below patch in spi-next branch of git://git.secretlab.ca/git/linux-2.6.git.
"spi/davinci: add OF support for the spi controller"

Applies on top of below patch under community review:
http://www.mail-archive.com/davinci-linux-open-source at linux.davincidsp.com/msg25184.html

The series looks good to me except a minor comment I gave on 4/4. Patch 1/4 should be picked by Grant (ideally before v3.9-rc1). I will queue rest of patches for v3.10.

Thanks,
Sekhar

#10 lore raw

cover Enable SPI flash support on da850-evm DT kernel

Quoted 11 lines · Sekhar
Quoted 10 lines · Prakash

Patch enables support for m25p80 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.

Depends on below patch in spi-next branch of git://git.secretlab.ca/git/linux-2.6.git.
"spi/davinci: add OF support for the spi controller"

Grant,
I could not find binding documentation changes submitted with above patch. I checked in spi-next and linux-next.

Quoted 7 lines
Quoted 2 lines

Applies on top of below patch under community review:
http://www.mail-archive.com/davinci-linux-open-source at linux.davincidsp.com/msg25184.html

The series looks good to me except a minor comment I gave on 4/4. Patch 1/4 should be picked by Grant (ideally before v3.9-rc1). I will queue rest of patches for v3.10.

Thanks for review Sekhar, I will put your Acked-by for 1/4 for v2 of this series.

Regards,
Prakash

#11 lore raw

cover Enable SPI flash support on da850-evm DT kernel

Quoted 9 lines · Prakash
Quoted 8 lines · Sekhar
Quoted 7 lines · Prakash

Patch enables support for m25p80 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.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

Depends on below patch in spi-next branch of git://git.secretlab.ca/git/linux-2.6.git.
"spi/davinci: add OF support for the spi controller"

Grant,
I could not find binding documentation changes submitted with above patch. I checked in spi-next and linux-next.

It must have been missed then. It happens sometimes. Can someone submit a fixup patch please?

Thanks,
g.

#12 lore raw

cover Enable SPI flash support on da850-evm DT kernel

Hi Grant,

Quoted 14 lines · Grant Likely
Quoted 13 lines · Prakash
Quoted 11 lines · Sekhar
Quoted 10 lines · Prakash

Patch enables support for m25p80 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.

Depends on below patch in spi-next branch of git://git.secretlab.ca/git/linux-2.6.git.
"spi/davinci: add OF support for the spi controller"

Quoted 7 lines
Quoted 3 lines

Grant,
I could not find binding documentation changes submitted with above patch. I checked in spi-next and linux-next.

It must have been missed then. It happens sometimes. Can someone submit a fixup patch please?

I have taken care in my next version of this series.

Thanks,
Prakash