Skip to contentSkip to conversation

ARM: i.MX6QDL-SabreAuto: assert GPIO hog for imx-weim

PATCH New alchaiken at gmail.com 4 participants 8 messages Dec 6, 2015 – Dec 9, 2015

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

cover ARM: i.MX6QDL-SabreAuto: assert GPIO hog for imx-weim

From: Alison Chaiken <[email protected]>

The parallel NOR that is attached to the i.MX6-SabreAuto WEIM switch needs a GPIO asserted at boot in order to probe properly. Employ the GPIO hogging mechanism to set the GPIO properly. Also, add partitions subnode to NOR device-tree node to make MTD initialization work.

Alison Chaiken (2):
bus: imx-weim: assert GPIO at boot in order to connect NOR
ARM: dts: imx6qdl-sabreauto: enable partitions for parallel NOR

 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi |  5 ++++
 drivers/bus/imx-weim.c                   | 45 ++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/2 bus: imx-weim: assert GPIO at boot in order to connect NOR

From: Alison Chaiken <[email protected]>

PAD_EIM_D18 must be pulled low at boot in order for the parallel NOR connected to the EIM switch to probe properly. Otherwise cfi_qry_present() may return "U-V-]" rather than "Q-R-Y" if the PAD_EIM_D18 is high. Add a nor-gpios property to the nor node in the SabreAuto device-tree and add a function to the imx-weim probe to set GPIO5 to drive the pad.

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi |  1 +
 drivers/bus/imx-weim.c                   | 45 ++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +1 -0
index 8263fc1..530b4d6 100644
@@ -625,5 +625,6 @@
 		bank-width = <2>;
 		fsl,weim-cs-timing = <0x00620081 0x00000001 0x1c022000
 				0x0000c000 0x1404a38e 0x00000000>;
+		nor-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
 	};
 };
drivers/bus/imx-weim.c +45 -0

63 lines not on this page · raw message

Signature · 1 line
2.6.2
maintainer
#2 lore raw

PATCH 1/2 bus: imx-weim: assert GPIO at boot in order to connect NOR

Quoted 20 lines · alchaiken at gmail.com

From: Alison Chaiken <[email protected]>

PAD_EIM_D18 must be pulled low at boot in order for the parallel NOR connected to the EIM switch to probe properly. Otherwise cfi_qry_present() may return "U-V-]" rather than "Q-R-Y" if the PAD_EIM_D18 is high. Add a nor-gpios property to the nor node in the SabreAuto device-tree and add a function to the imx-weim probe to set GPIO5 to drive the pad.

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi |  1 +
 drivers/bus/imx-weim.c                   | 45 ++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +0 -0
index 8263fc1..530b4d6 100644

arch/arm/boot/dts/imx6qdl-sabreauto.dtsi line 630

Quoted 6 lines
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +1 -0
@@ -625,5 +625,6 @@
 		bank-width = <2>;
 		fsl,weim-cs-timing = <0x00620081 0x00000001 0x1c022000
 				0x0000c000 0x1404a38e 0x00000000>;
+		nor-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
 	};
 };

Please do not make board specific and driver specific changes in a single patch. Also this would need an update to the binding documentation.

How is this pin connected? Is this a problem of this NOR flash, something i.MX6 specific or some problem of this particular board? Depending on the answer we may find a better place to implement the handling of this gpio. If it's a board problem Markus Pargmanns gpio-initval series is better suited, if it's a problem of the NOR flash the parallel NOR flash driver is a better place.

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 |
#3 lore raw

v2 cover ARM: dts: imx6qdl-sabreauto: employ GPIO init-val for p-NOR

The parallel NOR that is attached to the i.MX6-SabreAuto WEIM switch needs a GPIO asserted at boot in order to probe properly. Employ the GPIO init-val mechanism to set the GPIO. Also, add partitions subnode to NOR device-tree node to make MTD initialization work.

Alison Chaiken (2):
ARM: dts: imx6qdl-sabreauto: assert GPIO at boot in order to connect
NOR
ARM: dts: imx6qdl-sabreauto: enable partitions for parallel NOR

 arch/arm/boot/dts/imx6qdl-sabreauto-eim-nor.dtsi | 43 ++++++++++++++++++++++++
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi         |  4 +++
 2 files changed, 47 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6qdl-sabreauto-eim-nor.dtsi
Signature · 1 line
2.6.2
#4 lore raw

PATCH v2 1/2 ARM: dts: imx6qdl-sabreauto: assert GPIO at boot in order to connect NOR

PAD_EIM_D18 must be pulled low at boot in order for the parallel NOR connected to the EIM switch to probe properly. Otherwise the imx-weim device will register properly, but cfi_qry_present() will return "U-V-]" rather than "Q-R-Y". Employ the gpio-initval mechanism in GPIO5 node in the SabreAuto device-tree in order to set the pin.

---
 arch/arm/boot/dts/imx6qdl-sabreauto-eim-nor.dtsi | 43 ++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6qdl-sabreauto-eim-nor.dtsi
arch/arm/boot/dts/imx6qdl-sabreauto-eim-nor.dtsi new file +43 -0
new file mode 100644
index 0000000..66a9aa2
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ * Copyright (c) 2012-2015 Mentor Graphics Inc.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+&weim {
+	status = "okay";
+};
+
+&gpio5 {
+	p4 {
+		/* Select NOR or I2C3 via setting of port-expander
+		 * steering logic.
+		 * Low: Attach p-NOR line D18.
+		 * High: Attach I2C3 line SDA.
+		 */
+		gpio-initval;
+		gpios = <4 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "SelNORorI2C3";
+	};
+};
+
+&i2c3 {
+	status = "disabled";
+};
+
+/* the following devices have pinmux conflicts with NOR */
+&uart3 {
+	status = "disabled";
+};
+
+&ecspi1 {
+	status = "disabled";
+};
Signature · 1 line
2.6.2
reviewer
#5 lore raw

PATCH v2 1/2 ARM: dts: imx6qdl-sabreauto: assert GPIO at boot in order to connect NOR

arch/arm/boot/dts/imx6qdl-sabreauto-eim-nor.dtsi line 25

Quoted 8 lines · Alison Chaiken

+&gpio5 {

arch/arm/boot/dts/imx6qdl-sabreauto-eim-nor.dtsi new file +7 -0
+       p4 {
+               /* Select NOR or I2C3 via setting of port-expander
+                * steering logic.
+                * Low: Attach p-NOR line D18.
+                * High: Attach I2C3 line SDA.
+                */
+               gpio-initval;

Markus' series that add gpio-initval property has not been applied yet. I could not see it in linux-next.

It seems you need his series to be applied first.

#6 lore raw

PATCH v2 2/2 ARM: dts: imx6qdl-sabreauto: enable partitions for parallel NOR

In reply to Alison Chaiken

Add a 'partitions' property to the nor child of the WEIM bus so that ofpart will allow partition creation.

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +4 -0
index 8263fc1..1a29fff 100644
@@ -625,5 +625,9 @@
 		bank-width = <2>;
 		fsl,weim-cs-timing = <0x00620081 0x00000001 0x1c022000
 				0x0000c000 0x1404a38e 0x00000000>;
+		partitions at 0 {
+			label = "pnor";
+			reg = <0x0 0x1000000>;
+		};
 	};
 };
Signature · 1 line
2.6.2
#7 lore raw

PATCH 2/2 ARM: dts: imx6qdl-sabreauto: enable partitions for parallel NOR

In reply to alchaiken at gmail.com

From: Alison Chaiken <[email protected]>

Add a 'partitions' property to the nor child of the WEIM bus so that ofpart will allow partiton creation.

---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +4 -0
index 530b4d6..10293f2 100644
@@ -626,5 +626,9 @@
 		fsl,weim-cs-timing = <0x00620081 0x00000001 0x1c022000
 				0x0000c000 0x1404a38e 0x00000000>;
 		nor-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
+		partitions at 0 {
+			label = "pnor";
+			reg = <0x0 0x1000000>;
+		};
 	};
 };
Signature · 1 line
2.6.2