Skip to contentSkip to conversation

ARM:MXS: Initial support for the Crystalfontz CFA-10036

PATCH Superseded Maxime Ripard 3 participants 9 messages Jun 22, 2012 – Jun 26, 2012

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM:MXS: Initial support for the Crystalfontz CFA-10036

Hi everyone,

This is the second version for the initial support for the Crystalfontz CFA-10036 module.

The module basically has a iMX28 SoC, plus a micro-SD slot, 3 pins to access the DUART, a USB OTG port, a OLED screen using the Solomon SSD1307 controller over I2C and a 200-pins SODIMM port to plug an expansion board.

Support for this board and the additional devices will come eventually.

For now, only the DUART and the MMC controller are used.

What changed from v1:
* MMC now works thanks to Shawn Guo
* Removed the board file
* Moved alternate muxing options for the imx28 to the DTSI

Thanks,
Maxime

#1 lore raw

PATCH 1/2 ARM:MX28: Add additionnal muxing options to iMX28 DTSI

---
 arch/arm/boot/dts/imx28.dtsi |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx28.dtsi +18 -1
index 4634cb8..babc604 100644
@@ -159,7 +159,7 @@
 					#interrupt-cells = <2>;
 				};
 
-				duart_pins_a: duart at 0 {
+				duart_pins_a: duart-a at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <0x3102 0x3112>;
 					fsl,drive-strength = <0>;
@@ -167,6 +167,14 @@
 					fsl,pull-up = <0>;
 				};
 
+				duart_pins_b: duart-b at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <0x3022 0x3032>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				mac0_pins_a: mac0 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <0x4000 0x4010 0x4020
@@ -196,6 +204,15 @@
 					fsl,pull-up = <1>;
 				};
 
+				mmc0_4bit_pins_a: mmc0-4bit at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <0x2000 0x2010 0x2020
+						0x2030 0x2080 0x2090 0x20a0>;
+					fsl,drive-strength = <1>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <1>;
+				};
+
 				mmc0_cd_cfg: mmc0-cd-cfg {
 					fsl,pinmux-ids = <0x2090>;
 					fsl,pull-up = <0>;
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/2 ARM:MX28: Add additionnal muxing options to iMX28 DTSI

Suggested subject prefix "ARM: dts: imx28: ..."

Quoted 10 lines · Maxime Ripard
---
 arch/arm/boot/dts/imx28.dtsi |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx28.dtsi +0 -0
index 4634cb8..babc604 100644

arch/arm/boot/dts/imx28.dtsi line 162

Quoted 5 lines
arch/arm/boot/dts/imx28.dtsi +1 -1
@@ -159,7 +159,7 @@
 					#interrupt-cells = <2>;
 				};
 
-				duart_pins_a: duart at 0 {
+				duart_pins_a: duart-a at 0 {

Leave this line unchanged ...

arch/arm/boot/dts/imx28.dtsi line 171

Quoted 9 lines
arch/arm/boot/dts/imx28.dtsi +2 -0
 					reg = <0>;
 					fsl,pinmux-ids = <0x3102 0x3112>;
 					fsl,drive-strength = <0>;
@@ -167,6 +167,14 @@
 					fsl,pull-up = <0>;
 				};
 
+				duart_pins_b: duart-b at 0 {
+					reg = <0>;

... and have the new mux option for duart like

				duart_pins_b: duart at 1 {
					reg = <1>;

then, pinctrl system will be able to report there are 2 pin groups for function "duart" in debugfs.

Regards,
Shawn

Quoted 28 lines
arch/arm/boot/dts/imx28.dtsi +15 -0
+					fsl,pinmux-ids = <0x3022 0x3032>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <0>;
+				};
+
 				mac0_pins_a: mac0 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <0x4000 0x4010 0x4020
@@ -196,6 +204,15 @@
 					fsl,pull-up = <1>;
 				};
 
+				mmc0_4bit_pins_a: mmc0-4bit at 0 {
+					reg = <0>;
+					fsl,pinmux-ids = <0x2000 0x2010 0x2020
+						0x2030 0x2080 0x2090 0x20a0>;
+					fsl,drive-strength = <1>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <1>;
+				};
+
 				mmc0_cd_cfg: mmc0-cd-cfg {
 					fsl,pinmux-ids = <0x2090>;
 					fsl,pull-up = <0>;
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 1/2 ARM:MX28: Add additionnal muxing options to iMX28 DTSI

Hello Shawn,

Le Mon, 25 Jun 2012 23:50:49 +0800,
Shawn Guo <[email protected]> a ?crit :

Quoted 2 lines

then, pinctrl system will be able to report there are 2 pin groups for function "duart" in debugfs.

Ah nice, this explains why the mxs pinctrl driver creates a separate group for each pinctrl DT subnode, but only creates a new function when the name changes.

However, how would the mxs pinctrl driver handle the following case:

	pinctrl {
		duart_pins_a: duart at 0 {
			...
		}
		something_pins: something at 0 {
			...
		}
		duart_pins_b: duart at 1 {
			...
		}
	}

Reading the driver code, I have the feeling that the logic that creates the functions will only work if the different groups for a given function are given as consecutive subnodes in the DT. Is this correct?

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/2 ARM:MX28: Add additionnal muxing options to iMX28 DTSI

Quoted 26 lines · Thomas Petazzoni

Hello Shawn,

Le Mon, 25 Jun 2012 23:50:49 +0800,
Shawn Guo <[email protected]> a ?crit :

Quoted 2 lines

then, pinctrl system will be able to report there are 2 pin groups for function "duart" in debugfs.

Ah nice, this explains why the mxs pinctrl driver creates a separate group for each pinctrl DT subnode, but only creates a new function when the name changes.

However, how would the mxs pinctrl driver handle the following case:

	pinctrl {
		duart_pins_a: duart at 0 {
			...
		}
		something_pins: something at 0 {
			...
		}
		duart_pins_b: duart at 1 {
			...
		}
	}
Quoted 4 lines

Reading the driver code, I have the feeling that the logic that creates the functions will only work if the different groups for a given function are given as consecutive subnodes in the DT. Is this correct?

That's correct. We really need to put the pin groups for the same function together and have then sorted in "reg" value.

Signature · 2 lines
Regards,
Shawn
#5 lore raw

PATCH 1/2 ARM:MX28: Add additionnal muxing options to iMX28 DTSI

In reply to Shawn Guo

Hi,

Le 25/06/2012 17:50, Shawn Guo a ?crit :

Quoted 1 line

Suggested subject prefix "ARM: dts: imx28: ..."

Ok.

Quoted 31 lines · Maxime Ripard
Quoted 10 lines
---
 arch/arm/boot/dts/imx28.dtsi |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx28.dtsi +0 -0
index 4634cb8..babc604 100644

arch/arm/boot/dts/imx28.dtsi line 162

Quoted 5 lines
arch/arm/boot/dts/imx28.dtsi +1 -1
@@ -159,7 +159,7 @@
 					#interrupt-cells = <2>;
 				};
 
-				duart_pins_a: duart at 0 {
+				duart_pins_a: duart-a at 0 {

Leave this line unchanged ...

arch/arm/boot/dts/imx28.dtsi line 171

Quoted 9 lines
arch/arm/boot/dts/imx28.dtsi +2 -0
 					reg = <0>;
 					fsl,pinmux-ids = <0x3102 0x3112>;
 					fsl,drive-strength = <0>;
@@ -167,6 +167,14 @@
 					fsl,pull-up = <0>;
 				};
 
+				duart_pins_b: duart-b at 0 {
+					reg = <0>;

... and have the new mux option for duart like

Quoted 5 lines
				duart_pins_b: duart at 1 {
					reg = <1>;

then, pinctrl system will be able to report there are 2 pin groups for function "duart" in debugfs.

Ok.

I have two questions here though.

First, I'm worrying a bit about the fact that the duart_pins_b is actually the first pin groups in the muxing selection register by index, before duart_pins_a. It's a bit confusing, but it would imply that we would need to rename duart_pins_a to duart_pins_b, and change all the references to it as well, but I can definitely send a patch for it. What is your opinion ?

Secondly, why do we need to change the reg field as well ?

Thanks,
Maxime

Signature · 4 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw

PATCH 1/2 ARM:MX28: Add additionnal muxing options to iMX28 DTSI

Quoted 9 lines · Maxime Ripard

I have two questions here though.

First, I'm worrying a bit about the fact that the duart_pins_b is actually the first pin groups in the muxing selection register by index, before duart_pins_a. It's a bit confusing, but it would imply that we would need to rename duart_pins_a to duart_pins_b, and change all the references to it as well, but I can definitely send a patch for it. What is your opinion ?

The numbering of mux options for a function is not meant to match the register index in any case. Actually, it's no way to match. For example, if pin pair <0x3102 0x3032> is used on one board, how would you number it? (Well, the example is odd but it's possible.)

Quoted 2 lines

Secondly, why do we need to change the reg field as well ?

We need to use the same node name "duart" for pin groups that are mux-ed on duart function. "reg" value is used to distinguish the node name, as the "reg" value is required to be part of node name.

Signature · 2 lines
Regards,
Shawn
#7 lore raw

PATCH 2/2 ARM: MXS: Add Crystalfontz CFA-10036 DTS

In reply to Maxime Ripard
Cc Brian Lily <[email protected]>
---
 arch/arm/boot/dts/cfa10036.dts |   43 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 arch/arm/boot/dts/cfa10036.dts
arch/arm/boot/dts/cfa10036.dts new file +43 -0
new file mode 100644
index 0000000..28b9326
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2012 Free Electrons
+ *
+ * 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
+ */
+
+/dts-v1/;
+/include/ "imx28.dtsi"
+
+/ {
+	model = "Crystalfontz CFA-10036 Board";
+	compatible = "crystalfontz,cfa10036", "fsl,imx28";
+
+	memory {
+		reg = <0x40000000 0x08000000>;
+	};
+
+	apb at 80000000 {
+		apbh at 80000000 {
+			ssp0: ssp at 80010000 {
+				compatible = "fsl,imx28-mmc";
+				pinctrl-names = "default";
+				pinctrl-0 = <&mmc0_4bit_pins_a
+					&mmc0_cd_cfg &mmc0_sck_cfg>;
+				bus-width = <4>;
+				status = "okay";
+			};
+		};
+
+		apbx at 80040000 {
+			duart: serial at 80074000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&duart_pins_b>;
+				status = "okay";
+			};
+		};
+	};
+};
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 2/2 ARM: MXS: Add Crystalfontz CFA-10036 DTS

Quoted 21 lines · Maxime Ripard
Cc Brian Lily <[email protected]>
---
 arch/arm/boot/dts/cfa10036.dts |   43 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 arch/arm/boot/dts/cfa10036.dts
arch/arm/boot/dts/cfa10036.dts new file +7 -0
new file mode 100644
index 0000000..28b9326
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2012 Free Electrons
+ *
+ * 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:
+ *

arch/arm/boot/dts/cfa10036.dts line 17

Quoted 10 lines
arch/arm/boot/dts/cfa10036.dts new file +10 -0
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx28.dtsi"
+
+/ {
+	model = "Crystalfontz CFA-10036 Board";
+	compatible = "crystalfontz,cfa10036", "fsl,imx28";

I would like to maintain a explicit list of in-tree boards that imx28 DT machine supports, so please have the compatible string added into imx28_dt_compat.

Regards,
Shawn

Quoted 29 lines
arch/arm/boot/dts/cfa10036.dts new file +26 -0
+
+	memory {
+		reg = <0x40000000 0x08000000>;
+	};
+
+	apb at 80000000 {
+		apbh at 80000000 {
+			ssp0: ssp at 80010000 {
+				compatible = "fsl,imx28-mmc";
+				pinctrl-names = "default";
+				pinctrl-0 = <&mmc0_4bit_pins_a
+					&mmc0_cd_cfg &mmc0_sck_cfg>;
+				bus-width = <4>;
+				status = "okay";
+			};
+		};
+
+		apbx at 80040000 {
+			duart: serial at 80074000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&duart_pins_b>;
+				status = "okay";
+			};
+		};
+	};
+};
Signature · 1 line
1.7.9.5