Skip to contentSkip to conversation

ARM: imx6q-sabrelite.dts: Add SPI NOR support

PATCH New Fabio Estevam 5 participants 16 messages Apr 24, 2012 – May 1, 2012

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

mx6qsabrelite has a sst25vf016b SPI NOR flash connected to eCSPI1.

Add support for it.

---
 arch/arm/boot/dts/imx6q-sabrelite.dts |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx6q-sabrelite.dts +17 -0
index 4663a4e..35be687 100644
@@ -22,6 +22,23 @@
 	};
 
 	soc {
+		aips-bus at 02000000 { /* AIPS1 */
+			spba-bus at 02000000 {
+				ecspi at 02008000 { /* eCSPI1 */
+					fsl,spi-num-chipselects = <1>;
+					cs-gpios = <&gpio3 19 0>;
+					status = "okay";
+
+					flash: m25p80 at 0 {
+						compatible = "sst,sst25vf016b";
+						spi-max-frequency = <20000000>;
+						reg = <0>;
+					};
+				};
+			};
+
+		};
+
 		aips-bus at 02100000 { /* AIPS2 */
 			enet at 02188000 {
 				phy-mode = "rgmii";
Signature · 1 line
1.7.1
author reviewer
#1 lore raw

PATCH 2/2 ARM: imx_v6_v7_defconfig: Add SPI NOR support

Add SPI NOR support in defconfig.

---
 arch/arm/configs/imx_v6_v7_defconfig |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/configs/imx_v6_v7_defconfig +7 -0
index ff562c9..0a0eacb 100644
@@ -64,6 +64,13 @@ CONFIG_IPV6=y
 # CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_DATAFLASH=y
+CONFIG_MTD_M25P80=y
+CONFIG_M25PXX_USE_FAST_READ=y
+CONFIG_MTD_SST25L=y
 # CONFIG_STANDALONE is not set
 CONFIG_CONNECTOR=y
 CONFIG_BLK_DEV_LOOP=y
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/2 ARM: imx_v6_v7_defconfig: Add SPI NOR support

Quoted 12 lines · Fabio Estevam

Add SPI NOR support in defconfig.

---
 arch/arm/configs/imx_v6_v7_defconfig |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/configs/imx_v6_v7_defconfig +0 -0
index ff562c9..0a0eacb 100644

arch/arm/configs/imx_v6_v7_defconfig CONFIG_IPV6=y · line 72

Quoted 9 lines
arch/arm/configs/imx_v6_v7_defconfig +6 -0
@@ -64,6 +64,13 @@ CONFIG_IPV6=y
 # CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_DATAFLASH=y
+CONFIG_MTD_M25P80=y
+CONFIG_M25PXX_USE_FAST_READ=y

I did not see this line in my savedefconfig generated from the .config with your patch applied.

Regards,
Shawn

Quoted 6 lines
arch/arm/configs/imx_v6_v7_defconfig +1 -0
+CONFIG_MTD_SST25L=y
 # CONFIG_STANDALONE is not set
 CONFIG_CONNECTOR=y
 CONFIG_BLK_DEV_LOOP=y
Signature · 1 line
1.7.1
maintainer
#3 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

mx6qsabrelite has a sst25vf016b SPI NOR flash connected to eCSPI1.

Add support for it.

Shawn, are you ok with this? If yes I would take this into my queue

Sascha

Quoted 36 lines
---
 arch/arm/boot/dts/imx6q-sabrelite.dts |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx6q-sabrelite.dts +17 -0
index 4663a4e..35be687 100644
@@ -22,6 +22,23 @@
 	};
 
 	soc {
+		aips-bus at 02000000 { /* AIPS1 */
+			spba-bus at 02000000 {
+				ecspi at 02008000 { /* eCSPI1 */
+					fsl,spi-num-chipselects = <1>;
+					cs-gpios = <&gpio3 19 0>;
+					status = "okay";
+
+					flash: m25p80 at 0 {
+						compatible = "sst,sst25vf016b";
+						spi-max-frequency = <20000000>;
+						reg = <0>;
+					};
+				};
+			};
+
+		};
+
 		aips-bus at 02100000 { /* AIPS2 */
 			enet at 02188000 {
 				phy-mode = "rgmii";
Signature · 1 line
1.7.1
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#4 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

Quoted 9 lines · Sascha Hauer
Quoted 5 lines · Fabio Estevam

mx6qsabrelite has a sst25vf016b SPI NOR flash connected to eCSPI1.

Add support for it.

Shawn, are you ok with this? If yes I would take this into my queue

Then please take the pull request below. It contains my collecting of imx dts changes.

Regards,
Shawn

---

The following changes since commit dd775ae2549217d3ae09363e3edb305d0fa19928:

Linux 3.4-rc1 (2012-03-31 16:24:09 -0700)

are available in the git repository at:
git://git.linaro.org/people/shawnguo/linux-2.6.git imx/dt

Fabio Estevam (3):
ARM: dts: imx: Remove bootargs field
ARM: imx6q-arm2: Remove hardcoded mac address
ARM: dts: Add basic support for imx6q-sabresd

Shawn Guo (1):
ARM: imx: rename uart and fec device tree nodes

Ying-Chun Liu (PaulLiu) (1):
ARM: dts: imx6q: add anatop regulators

 Documentation/devicetree/bindings/arm/fsl.txt      |    4 +
 Documentation/devicetree/bindings/net/fsl-fec.txt  |    2 +-
 .../bindings/tty/serial/fsl-imx-uart.txt           |    2 +-
 arch/arm/boot/dts/imx27-phytec-phycore.dts         |    8 +-
 arch/arm/boot/dts/imx27.dtsi                       |   14 ++--
 arch/arm/boot/dts/imx51-babbage.dts                |   12 +--
 arch/arm/boot/dts/imx51.dtsi                       |    8 +-
 arch/arm/boot/dts/imx53-ard.dts                    |    6 +-
 arch/arm/boot/dts/imx53-evk.dts                    |    8 +--
 arch/arm/boot/dts/imx53-qsb.dts                    |    8 +--
 arch/arm/boot/dts/imx53-smd.dts                    |   12 +--
 arch/arm/boot/dts/imx53.dtsi                       |   12 ++--
 arch/arm/boot/dts/imx6q-arm2.dts                   |    9 +--
 arch/arm/boot/dts/imx6q-sabrelite.dts              |    4 +-
 arch/arm/boot/dts/imx6q-sabresd.dts                |   53 +++++++++++
 arch/arm/boot/dts/imx6q.dtsi                       |   96 ++++++++++++++++++--
 arch/arm/mach-imx/Makefile.boot                    |    3 +-
 arch/arm/mach-imx/clock-imx6q.c                    |   12 ++--
 arch/arm/mach-imx/mach-imx6q.c                     |    1 +
 19 files changed, 196 insertions(+), 78 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx6q-sabresd.dts
#5 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

mx6qsabrelite has a sst25vf016b SPI NOR flash connected to eCSPI1.

Add support for it.

One question below though:

I applied both patches and see the following modprobe error message with my testing. Any relevance, or I missed something?

spi_imx 2008000.ecspi: master is unqueued, this is deprecated
modprobe: FATAL: Could not load /lib/modules/3.4.0-rc4+/modules.dep: No such fil e or directory

m25p80 spi32766.0: sst25vf016b (2048 Kbytes)
modprobe: FATAL: Could not load /lib/modules/3.4.0-rc4+/modules.dep: No such fil e or directory

Regards,
Shawn

author reviewer
#6 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

Quoted 4 lines · Shawn Guo

I applied both patches and see the following modprobe error message with my testing. ?Any relevance, or I missed something?

spi_imx 2008000.ecspi: master is unqueued, this is deprecated

This happens in imx-spi driver and I have reported it in the spi-devel list:
http://www.mail-archive.com/spi-devel-general at lists.sourceforge.net/msg08019.html

Quoted 1 line

modprobe: FATAL: Could not load /lib/modules/3.4.0-rc4+/modules.dep: No such fil

I have only tested it as built-in.

Regards,

Fabio Estevam

#7 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

Quoted 10 lines · Fabio Estevam
Quoted 4 lines · Shawn Guo

I applied both patches and see the following modprobe error message with my testing. ?Any relevance, or I missed something?

spi_imx 2008000.ecspi: master is unqueued, this is deprecated

This happens in imx-spi driver and I have reported it in the spi-devel list:
http://www.mail-archive.com/spi-devel-general at lists.sourceforge.net/msg08019.html

I'm fine with that, since it's an info printed by spi core to draw people's attention on purpose.

Quoted 4 lines
Quoted 1 line

modprobe: FATAL: Could not load /lib/modules/3.4.0-rc4+/modules.dep: No such fil

I have only tested it as built-in.

The problem is we do not have this error message before applying these two patches, while we are seeing the message with your patches applied. What I am saying is your changes on defconfig should not introduce any message like that.

Signature · 2 lines
Regards,
Shawn
#8 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

Quoted 14 lines · Shawn Guo
Quoted 10 lines · Fabio Estevam
Quoted 4 lines · Shawn Guo

I applied both patches and see the following modprobe error message with my testing. ?Any relevance, or I missed something?

spi_imx 2008000.ecspi: master is unqueued, this is deprecated

This happens in imx-spi driver and I have reported it in the spi-devel list:
http://www.mail-archive.com/spi-devel-general at lists.sourceforge.net/msg08019.html

I'm fine with that, since it's an info printed by spi core to draw people's attention on purpose.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

modprobe: FATAL: Could not load /lib/modules/3.4.0-rc4+/modules.dep: No such fil

I have only tested it as built-in.

The problem is we do not have this error message before applying these two patches, while we are seeing the message with your patches applied. What I am saying is your changes on defconfig should not introduce any message like that.

This seems to me to be a userspace problem? My guess is applying the patch changed the kernel version (appends '+') and you didn't run make modules_install and/or depmod?!

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#9 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

Quoted 4 lines · Uwe Kleine-K?nig

This seems to me to be a userspace problem? My guess is applying the patch changed the kernel version (appends '+') and you didn't run make modules_install and/or depmod?!

Hmm, what the modules are we missing here? That's actually my question. Fabio, Uwe, Sascha, you do not see this error message with your testing?

Signature · 2 lines
Regards,
Shawn
maintainer
#10 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

Quoted 7 lines · Shawn Guo
Quoted 4 lines · Uwe Kleine-K?nig

This seems to me to be a userspace problem? My guess is applying the patch changed the kernel version (appends '+') and you didn't run make modules_install and/or depmod?!

Hmm, what the modules are we missing here? That's actually my question. Fabio, Uwe, Sascha, you do not see this error message with your testing?

Every imx spi user (in fact most spi users no matter which driver) will see this message.

See:

commit ffbbdd21329f3e15eeca6df2d4bc11c04d9d91c0

Author: Linus Walleij <[email protected]>
Date:   Wed Feb 22 10:05:38 2012 +0100

spi: create a message queueing infrastructure

This rips the message queue in the PL022 driver out and pushes it into (optional) common infrastructure. Drivers that want to use the message pumping thread will need to define the new per-messags transfer methods and leave the deprecated transfer() method as NULL.

Most of the design is described in the documentation changes that are included in this patch.

Since there is a queue that need to be stopped when the system is suspending/resuming, two new calls are implemented for the device drivers to call in their suspend()/resume() functions:
spi_master_suspend() and spi_master_resume().

ChangeLog v1->v2:
- Remove Kconfig entry and do not make the queue support optional at all, instead be more agressive and have it as part of the compulsory infrastructure.
- If the .transfer() method is implemented, delete print a small deprecation notice and do not start the transfer pump.
- Fix a bitrotted comment.
ChangeLog v2->v3:
- Fix up a problematic sequence courtesy of Chris Blair.
- Stop rather than destroy the queue on suspend() courtesy of Chris Blair.

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
maintainer
#11 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

In reply to Shawn Guo
Quoted 14 lines · Shawn Guo
Quoted 10 lines · Fabio Estevam
Quoted 4 lines · Shawn Guo

I applied both patches and see the following modprobe error message with my testing. ?Any relevance, or I missed something?

spi_imx 2008000.ecspi: master is unqueued, this is deprecated

This happens in imx-spi driver and I have reported it in the spi-devel list:
http://www.mail-archive.com/spi-devel-general at lists.sourceforge.net/msg08019.html

I'm fine with that, since it's an info printed by spi core to draw people's attention on purpose.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

modprobe: FATAL: Could not load /lib/modules/3.4.0-rc4+/modules.dep: No such fil

I have only tested it as built-in.

The problem is we do not have this error message before applying these two patches, while we are seeing the message with your patches applied. What I am saying is your changes on defconfig should not introduce any message like that.

This is an orthogonal issue. It should be fixed in the SPI driver, but it shouldn't be a reason to to not turn on SPI support.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#12 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

Quoted 3 lines · Sascha Hauer

This is an orthogonal issue. It should be fixed in the SPI driver, but it shouldn't be a reason to to not turn on SPI support.

I'm asking for explanation to the error message, and I did not say we should block turning on SPI support. Of course not, if this is an orthogonal issue. But again, what's the issue exactly?

Signature · 2 lines
Regards,
Shawn
#13 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

In reply to Fabio Estevam
Quoted 9 lines · Fabio Estevam
Quoted 4 lines · Shawn Guo

I applied both patches and see the following modprobe error message with my testing. ?Any relevance, or I missed something?

spi_imx 2008000.ecspi: master is unqueued, this is deprecated

This happens in imx-spi driver and I have reported it in the spi-devel list:
http://www.mail-archive.com/spi-devel-general at lists.sourceforge.net/msg08019.html

Sorry for missing to reply on your mail on how to fix it, will do that now!

Yours,
Linus Walleij

author reviewer
#14 lore raw

PATCH v2 2/2 ARM: imx_v6_v7_defconfig: Add SPI NOR support

In reply to Fabio Estevam

Add SPI NOR support in defconfig.

---
Changes since v1:
- Drop CONFIG_M25PXX_USE_FAST_READ

 arch/arm/configs/imx_v6_v7_defconfig |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/configs/imx_v6_v7_defconfig +6 -0
index ff562c9..b1d3675 100644
@@ -64,6 +64,12 @@ CONFIG_IPV6=y
 # CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_DATAFLASH=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SST25L=y
 # CONFIG_STANDALONE is not set
 CONFIG_CONNECTOR=y
 CONFIG_BLK_DEV_LOOP=y
Signature · 1 line
1.7.1
#15 lore raw

PATCH 1/2 ARM: imx6q-sabrelite.dts: Add SPI NOR support

In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

mx6qsabrelite has a sst25vf016b SPI NOR flash connected to eCSPI1.

Add support for it.

Applied on my imx/dt branch, thanks.

Regards,
Shawn

Quoted 34 lines
---
 arch/arm/boot/dts/imx6q-sabrelite.dts |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx6q-sabrelite.dts +17 -0
index 4663a4e..35be687 100644
@@ -22,6 +22,23 @@
 	};
 
 	soc {
+		aips-bus at 02000000 { /* AIPS1 */
+			spba-bus at 02000000 {
+				ecspi at 02008000 { /* eCSPI1 */
+					fsl,spi-num-chipselects = <1>;
+					cs-gpios = <&gpio3 19 0>;
+					status = "okay";
+
+					flash: m25p80 at 0 {
+						compatible = "sst,sst25vf016b";
+						spi-max-frequency = <20000000>;
+						reg = <0>;
+					};
+				};
+			};
+
+		};
+
 		aips-bus at 02100000 { /* AIPS2 */
 			enet at 02188000 {
 				phy-mode = "rgmii";
Signature · 1 line
1.7.1