Skip to contentSkip to conversation

Get rid of big array from imx pinctrl driver

PATCH Superseded Shawn Guo 6 participants 22 messages Feb 22, 2013 – Apr 9, 2013 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

 .../bindings/pinctrl/fsl,imx-pinctrl.txt           |    6 +-
 .../bindings/pinctrl/fsl,imx35-pinctrl.txt         |  955 +--------
 .../bindings/pinctrl/fsl,imx51-pinctrl.txt         |  759 +------
 .../bindings/pinctrl/fsl,imx53-pinctrl.txt         | 1174 +---------
 .../bindings/pinctrl/fsl,imx6q-pinctrl.txt         | 1596 +-------------
 .../{imx25-karo-tx25.dts => imx25-karo-tx25.dtsp}  |    2 +-
 .../arm/boot/dts/{imx25-pdk.dts => imx25-pdk.dtsp} |    2 +-
 arch/arm/boot/dts/{imx25.dtsi => imx25.dtsip}      |    2 +-
 .../boot/dts/{imx27-apf27.dts => imx27-apf27.dtsp} |    2 +-
 .../arm/boot/dts/{imx27-pdk.dts => imx27-pdk.dtsp} |    2 +-
 ...hytec-phycore.dts => imx27-phytec-phycore.dtsp} |    2 +-
 arch/arm/boot/dts/{imx27.dtsi => imx27.dtsip}      |    2 +-
 .../arm/boot/dts/{imx31-bug.dts => imx31-bug.dtsp} |    2 +-
 arch/arm/boot/dts/{imx31.dtsi => imx31.dtsip}      |    2 +-
 arch/arm/boot/dts/imx35-pinfunc.h                  |  970 +++++++++
 .../boot/dts/{imx51-apf51.dts => imx51-apf51.dtsp} |    2 +-
 .../dts/{imx51-babbage.dts => imx51-babbage.dtsp}  |   16 +-
 arch/arm/boot/dts/imx51-pinfunc.h                  |  773 +++++++
 arch/arm/boot/dts/{imx51.dtsi => imx51.dtsip}      |  247 +--
 .../arm/boot/dts/{imx53-ard.dts => imx53-ard.dtsp} |   70 +-
 .../arm/boot/dts/{imx53-evk.dts => imx53-evk.dtsp} |   18 +-
 arch/arm/boot/dts/imx53-mba53.dts                  |  129 --
 arch/arm/boot/dts/imx53-mba53.dtsp                 |  135 ++
 arch/arm/boot/dts/imx53-pinfunc.h                  | 1189 ++++++++++
 .../arm/boot/dts/{imx53-qsb.dts => imx53-qsb.dtsp} |   22 +-
 .../arm/boot/dts/{imx53-smd.dts => imx53-smd.dtsp} |   16 +-
 .../dts/{imx53-tqma53.dtsi => imx53-tqma53.dtsip}  |   32 +-
 arch/arm/boot/dts/{imx53.dtsi => imx53.dtsip}      |  207 +-
 arch/arm/boot/dts/{imx6dl.dtsi => imx6dl.dtsip}    |    0
 .../boot/dts/{imx6q-arm2.dts => imx6q-arm2.dtsp}   |    8 +-
 arch/arm/boot/dts/imx6q-pinfunc.h                  | 1529 +++++++++++++
 .../{imx6q-sabreauto.dts => imx6q-sabreauto.dtsp}  |    6 +-
 .../{imx6q-sabrelite.dts => imx6q-sabrelite.dtsp}  |   18 +-
 .../dts/{imx6q-sabresd.dts => imx6q-sabresd.dtsp}  |   14 +-
 arch/arm/boot/dts/imx6q.dtsi                       |  302 ---
 arch/arm/boot/dts/imx6q.dtsip                      |  303 +++
 arch/arm/boot/dts/{imx6qdl.dtsi => imx6qdl.dtsip}  |    2 +-
 drivers/pinctrl/pinctrl-imx.c                      |  120 +-
 drivers/pinctrl/pinctrl-imx.h                      |   13 +-
 drivers/pinctrl/pinctrl-imx35.c                    | 1524 +++----------
 drivers/pinctrl/pinctrl-imx51.c                    | 1252 +++--------
 drivers/pinctrl/pinctrl-imx53.c                    | 1579 ++------------
 drivers/pinctrl/pinctrl-imx6q.c                    | 2263 +++-----------------
 43 files changed, 6284 insertions(+), 10983 deletions(-)
 rename arch/arm/boot/dts/{imx25-karo-tx25.dts => imx25-karo-tx25.dtsp} (96%)
 rename arch/arm/boot/dts/{imx25-pdk.dts => imx25-pdk.dtsp} (96%)
 rename arch/arm/boot/dts/{imx25.dtsi => imx25.dtsip} (99%)
 rename arch/arm/boot/dts/{imx27-apf27.dts => imx27-apf27.dtsp} (98%)
 rename arch/arm/boot/dts/{imx27-pdk.dts => imx27-pdk.dtsp} (96%)
 rename arch/arm/boot/dts/{imx27-phytec-phycore.dts => imx27-phytec-phycore.dtsp} (98%)
 rename arch/arm/boot/dts/{imx27.dtsi => imx27.dtsip} (99%)
 rename arch/arm/boot/dts/{imx31-bug.dts => imx31-bug.dtsp} (96%)
 rename arch/arm/boot/dts/{imx31.dtsi => imx31.dtsip} (98%)
 create mode 100644 arch/arm/boot/dts/imx35-pinfunc.h
 rename arch/arm/boot/dts/{imx51-apf51.dts => imx51-apf51.dtsp} (97%)
 rename arch/arm/boot/dts/{imx51-babbage.dts => imx51-babbage.dtsp} (94%)
 create mode 100644 arch/arm/boot/dts/imx51-pinfunc.h
 rename arch/arm/boot/dts/{imx51.dtsi => imx51.dtsip} (61%)
 rename arch/arm/boot/dts/{imx53-ard.dts => imx53-ard.dtsp} (55%)
 rename arch/arm/boot/dts/{imx53-evk.dts => imx53-evk.dtsp} (82%)
 delete mode 100644 arch/arm/boot/dts/imx53-mba53.dts
 create mode 100644 arch/arm/boot/dts/imx53-mba53.dtsp
 create mode 100644 arch/arm/boot/dts/imx53-pinfunc.h
 rename arch/arm/boot/dts/{imx53-qsb.dts => imx53-qsb.dtsp} (89%)
 rename arch/arm/boot/dts/{imx53-smd.dts => imx53-smd.dtsp} (88%)
 rename arch/arm/boot/dts/{imx53-tqma53.dtsi => imx53-tqma53.dtsip} (75%)
 rename arch/arm/boot/dts/{imx53.dtsi => imx53.dtsip} (69%)
 rename arch/arm/boot/dts/{imx6dl.dtsi => imx6dl.dtsip} (100%)
 rename arch/arm/boot/dts/{imx6q-arm2.dts => imx6q-arm2.dtsp} (90%)
 create mode 100644 arch/arm/boot/dts/imx6q-pinfunc.h
 rename arch/arm/boot/dts/{imx6q-sabreauto.dts => imx6q-sabreauto.dtsp} (88%)
 rename arch/arm/boot/dts/{imx6q-sabrelite.dts => imx6q-sabrelite.dtsp} (87%)
 rename arch/arm/boot/dts/{imx6q-sabresd.dts => imx6q-sabresd.dtsp} (84%)
 delete mode 100644 arch/arm/boot/dts/imx6q.dtsi
 create mode 100644 arch/arm/boot/dts/imx6q.dtsip
 rename arch/arm/boot/dts/{imx6qdl.dtsi => imx6qdl.dtsip} (99%)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v2 1/3 ARM: dts: imx: use pre-processor for device trees

Enable C pre-processing on imx device trees. This allows future use of defining names for various constants, to increase the readability of the device tree sources.

---
 .../{imx25-karo-tx25.dts => imx25-karo-tx25.dtsp}  |    2 +-
 .../arm/boot/dts/{imx25-pdk.dts => imx25-pdk.dtsp} |    2 +-
 arch/arm/boot/dts/{imx25.dtsi => imx25.dtsip}      |    2 +-
 .../boot/dts/{imx27-apf27.dts => imx27-apf27.dtsp} |    2 +-
 .../arm/boot/dts/{imx27-pdk.dts => imx27-pdk.dtsp} |    2 +-
 ...hytec-phycore.dts => imx27-phytec-phycore.dtsp} |    2 +-
 arch/arm/boot/dts/{imx27.dtsi => imx27.dtsip}      |    2 +-
 .../arm/boot/dts/{imx31-bug.dts => imx31-bug.dtsp} |    2 +-
 arch/arm/boot/dts/{imx31.dtsi => imx31.dtsip}      |    2 +-
 .../boot/dts/{imx51-apf51.dts => imx51-apf51.dtsp} |    2 +-
 .../dts/{imx51-babbage.dts => imx51-babbage.dtsp}  |    2 +-
 arch/arm/boot/dts/{imx51.dtsi => imx51.dtsip}      |    2 +-
 .../arm/boot/dts/{imx53-ard.dts => imx53-ard.dtsp} |    2 +-
 .../arm/boot/dts/{imx53-evk.dts => imx53-evk.dtsp} |    2 +-
 .../boot/dts/{imx53-mba53.dts => imx53-mba53.dtsp} |    2 +-
 .../arm/boot/dts/{imx53-qsb.dts => imx53-qsb.dtsp} |    2 +-
 .../arm/boot/dts/{imx53-smd.dts => imx53-smd.dtsp} |    2 +-
 .../dts/{imx53-tqma53.dtsi => imx53-tqma53.dtsip}  |    2 +-
 arch/arm/boot/dts/{imx53.dtsi => imx53.dtsip}      |    2 +-
 arch/arm/boot/dts/{imx6dl.dtsi => imx6dl.dtsip}    |    0
 .../boot/dts/{imx6q-arm2.dts => imx6q-arm2.dtsp}   |    2 +-
 .../{imx6q-sabreauto.dts => imx6q-sabreauto.dtsp}  |    2 +-
 .../{imx6q-sabrelite.dts => imx6q-sabrelite.dtsp}  |    2 +-
 .../dts/{imx6q-sabresd.dts => imx6q-sabresd.dtsp}  |    2 +-
 arch/arm/boot/dts/{imx6q.dtsi => imx6q.dtsip}      |    2 +-
 arch/arm/boot/dts/{imx6qdl.dtsi => imx6qdl.dtsip}  |    2 +-
 26 files changed, 25 insertions(+), 25 deletions(-)
 rename arch/arm/boot/dts/{imx25-karo-tx25.dts => imx25-karo-tx25.dtsp} (96%)
 rename arch/arm/boot/dts/{imx25-pdk.dts => imx25-pdk.dtsp} (96%)
 rename arch/arm/boot/dts/{imx25.dtsi => imx25.dtsip} (99%)
 rename arch/arm/boot/dts/{imx27-apf27.dts => imx27-apf27.dtsp} (98%)
 rename arch/arm/boot/dts/{imx27-pdk.dts => imx27-pdk.dtsp} (96%)
 rename arch/arm/boot/dts/{imx27-phytec-phycore.dts => imx27-phytec-phycore.dtsp} (98%)
 rename arch/arm/boot/dts/{imx27.dtsi => imx27.dtsip} (99%)
 rename arch/arm/boot/dts/{imx31-bug.dts => imx31-bug.dtsp} (96%)
 rename arch/arm/boot/dts/{imx31.dtsi => imx31.dtsip} (98%)
 rename arch/arm/boot/dts/{imx51-apf51.dts => imx51-apf51.dtsp} (97%)
 rename arch/arm/boot/dts/{imx51-babbage.dts => imx51-babbage.dtsp} (99%)
 rename arch/arm/boot/dts/{imx51.dtsi => imx51.dtsip} (99%)
 rename arch/arm/boot/dts/{imx53-ard.dts => imx53-ard.dtsp} (99%)
 rename arch/arm/boot/dts/{imx53-evk.dts => imx53-evk.dtsp} (99%)
 rename arch/arm/boot/dts/{imx53-mba53.dts => imx53-mba53.dtsp} (98%)
 rename arch/arm/boot/dts/{imx53-qsb.dts => imx53-qsb.dtsp} (99%)
 rename arch/arm/boot/dts/{imx53-smd.dts => imx53-smd.dtsp} (99%)
 rename arch/arm/boot/dts/{imx53-tqma53.dtsi => imx53-tqma53.dtsip} (99%)
 rename arch/arm/boot/dts/{imx53.dtsi => imx53.dtsip} (99%)
 rename arch/arm/boot/dts/{imx6dl.dtsi => imx6dl.dtsip} (100%)
 rename arch/arm/boot/dts/{imx6q-arm2.dts => imx6q-arm2.dtsp} (98%)
 rename arch/arm/boot/dts/{imx6q-sabreauto.dts => imx6q-sabreauto.dtsp} (98%)
 rename arch/arm/boot/dts/{imx6q-sabrelite.dts => imx6q-sabrelite.dtsp} (99%)
 rename arch/arm/boot/dts/{imx6q-sabresd.dts => imx6q-sabresd.dtsp} (98%)
 rename arch/arm/boot/dts/{imx6q.dtsi => imx6q.dtsip} (99%)
 rename arch/arm/boot/dts/{imx6qdl.dtsi => imx6qdl.dtsip} (99%)
arch/arm/boot/dts/imx25-karo-tx25.dtsp renamed from arch/arm/boot/dts/imx25-karo-tx25.dts +1 -1
similarity index 96%
rename from arch/arm/boot/dts/imx25-karo-tx25.dts
rename to arch/arm/boot/dts/imx25-karo-tx25.dtsp
index 1a9d049..3dbe775 100644
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "imx25.dtsi"
+#include "imx25.dtsip"
 
 / {
 	model = "Ka-Ro TX25";
arch/arm/boot/dts/imx25-pdk.dtsp renamed from arch/arm/boot/dts/imx25-pdk.dts +1 -1
similarity index 96%
rename from arch/arm/boot/dts/imx25-pdk.dts
rename to arch/arm/boot/dts/imx25-pdk.dtsp
index a02a860..8064b76 100644
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "imx25.dtsi"
+#include "imx25.dtsip"
 
 / {
 	model = "Freescale i.MX25 Product Development Kit";
arch/arm/boot/dts/imx25.dtsip renamed from arch/arm/boot/dts/imx25.dtsi +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx25.dtsi
rename to arch/arm/boot/dts/imx25.dtsip
index 94f3305..d2550e0 100644
@@ -9,7 +9,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	aliases {
arch/arm/boot/dts/imx27-apf27.dtsp renamed from arch/arm/boot/dts/imx27-apf27.dts +1 -1
similarity index 98%
rename from arch/arm/boot/dts/imx27-apf27.dts
rename to arch/arm/boot/dts/imx27-apf27.dtsp
index b464c80..59f276f 100644
@@ -13,7 +13,7 @@
  */
 
 /dts-v1/;
-/include/ "imx27.dtsi"
+#include "imx27.dtsip"
 
 / {
 	model = "Armadeus Systems APF27 module";
arch/arm/boot/dts/imx27-pdk.dtsp renamed from arch/arm/boot/dts/imx27-pdk.dts +1 -1
similarity index 96%
rename from arch/arm/boot/dts/imx27-pdk.dts
rename to arch/arm/boot/dts/imx27-pdk.dtsp
index 41cd110..fe5f609 100644
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "imx27.dtsi"
+#include "imx27.dtsip"
 
 / {
 	model = "Freescale i.MX27 Product Development Kit";
arch/arm/boot/dts/imx27-phytec-phycore.dtsp renamed from arch/arm/boot/dts/imx27-phytec-phycore.dts +1 -1
similarity index 98%
rename from arch/arm/boot/dts/imx27-phytec-phycore.dts
rename to arch/arm/boot/dts/imx27-phytec-phycore.dtsp
index 53b0ec0..924097a 100644
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "imx27.dtsi"
+#include "imx27.dtsip"
 
 / {
 	model = "Phytec pcm038";
arch/arm/boot/dts/imx27.dtsip renamed from arch/arm/boot/dts/imx27.dtsi +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx27.dtsi
rename to arch/arm/boot/dts/imx27.dtsip
index 5a82cb5..324130f 100644
@@ -9,7 +9,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	aliases {
arch/arm/boot/dts/imx31-bug.dtsp renamed from arch/arm/boot/dts/imx31-bug.dts +1 -1
similarity index 96%
rename from arch/arm/boot/dts/imx31-bug.dts
rename to arch/arm/boot/dts/imx31-bug.dtsp
index 9ac6f6b..8e26e91 100644
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "imx31.dtsi"
+#include "imx31.dtsip"
 
 / {
 	model = "Buglabs i.MX31 Bug 1.x";
arch/arm/boot/dts/imx31.dtsip renamed from arch/arm/boot/dts/imx31.dtsi +1 -1
similarity index 98%
rename from arch/arm/boot/dts/imx31.dtsi
rename to arch/arm/boot/dts/imx31.dtsip
index 454c2d1..aa488ac 100644
@@ -9,7 +9,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	aliases {
arch/arm/boot/dts/imx51-apf51.dtsp renamed from arch/arm/boot/dts/imx51-apf51.dts +1 -1
similarity index 97%
rename from arch/arm/boot/dts/imx51-apf51.dts
rename to arch/arm/boot/dts/imx51-apf51.dtsp
index 92d3a66..4ef88fc 100644
@@ -15,7 +15,7 @@
  */
 
 /dts-v1/;
-/include/ "imx51.dtsi"
+#include "imx51.dtsip"
 
 / {
 	model = "Armadeus Systems APF51 module";
arch/arm/boot/dts/imx51-babbage.dtsp renamed from arch/arm/boot/dts/imx51-babbage.dts +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx51-babbage.dts
rename to arch/arm/boot/dts/imx51-babbage.dtsp
index aab6e43..965a8c8 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx51.dtsi"
+#include "imx51.dtsip"
 
 / {
 	model = "Freescale i.MX51 Babbage Board";
arch/arm/boot/dts/imx51.dtsip renamed from arch/arm/boot/dts/imx51.dtsi +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx51.dtsi
rename to arch/arm/boot/dts/imx51.dtsip
index fcf035b..606a167 100644
@@ -10,7 +10,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	aliases {
arch/arm/boot/dts/imx53-ard.dtsp renamed from arch/arm/boot/dts/imx53-ard.dts +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx53-ard.dts
rename to arch/arm/boot/dts/imx53-ard.dtsp
index e049fd0..78425a4 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx53.dtsi"
+#include "imx53.dtsip"
 
 / {
 	model = "Freescale i.MX53 Automotive Reference Design Board";
arch/arm/boot/dts/imx53-evk.dtsp renamed from arch/arm/boot/dts/imx53-evk.dts +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx53-evk.dts
rename to arch/arm/boot/dts/imx53-evk.dtsp
index 85a89b5..20fa799 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx53.dtsi"
+#include "imx53.dtsip"
 
 / {
 	model = "Freescale i.MX53 Evaluation Kit";
arch/arm/boot/dts/imx53-mba53.dtsp renamed from arch/arm/boot/dts/imx53-mba53.dts +1 -1
similarity index 98%
rename from arch/arm/boot/dts/imx53-mba53.dts
rename to arch/arm/boot/dts/imx53-mba53.dtsp
index 468c0a1..e7bde54 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx53-tqma53.dtsi"
+#include "imx53-tqma53.dtsip"
 
 / {
 	model = "TQ MBa53 starter kit";
arch/arm/boot/dts/imx53-qsb.dtsp renamed from arch/arm/boot/dts/imx53-qsb.dts +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx53-qsb.dts
rename to arch/arm/boot/dts/imx53-qsb.dtsp
index 05cc562..37fc83c 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx53.dtsi"
+#include "imx53.dtsip"
 
 / {
 	model = "Freescale i.MX53 Quick Start Board";
arch/arm/boot/dts/imx53-smd.dtsp renamed from arch/arm/boot/dts/imx53-smd.dts +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx53-smd.dts
rename to arch/arm/boot/dts/imx53-smd.dtsp
index 995554c..c429f44 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx53.dtsi"
+#include "imx53.dtsip"
 
 / {
 	model = "Freescale i.MX53 Smart Mobile Reference Design Board";
arch/arm/boot/dts/imx53-tqma53.dtsip renamed from arch/arm/boot/dts/imx53-tqma53.dtsi +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx53-tqma53.dtsi
rename to arch/arm/boot/dts/imx53-tqma53.dtsip
index 8278ec5..af24cb4 100644
@@ -10,7 +10,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "imx53.dtsi"
+#include "imx53.dtsip"
 
 / {
 	model = "TQ TQMa53";
arch/arm/boot/dts/imx53.dtsip renamed from arch/arm/boot/dts/imx53.dtsi +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx53.dtsi
rename to arch/arm/boot/dts/imx53.dtsip
index d05aa21..baea3b5 100644
@@ -10,7 +10,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	aliases {
arch/arm/boot/dts/imx6dl.dtsip renamed from arch/arm/boot/dts/imx6dl.dtsi +0 -0
similarity index 100%
rename from arch/arm/boot/dts/imx6dl.dtsi
rename to arch/arm/boot/dts/imx6dl.dtsip
arch/arm/boot/dts/imx6q-arm2.dtsp renamed from arch/arm/boot/dts/imx6q-arm2.dts +1 -1
similarity index 98%
rename from arch/arm/boot/dts/imx6q-arm2.dts
rename to arch/arm/boot/dts/imx6q-arm2.dtsp
index 53eb241..3028f96 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx6q.dtsi"
+#include "imx6q.dtsip"
 
 / {
 	model = "Freescale i.MX6 Quad Armadillo2 Board";
arch/arm/boot/dts/imx6q-sabreauto.dtsp renamed from arch/arm/boot/dts/imx6q-sabreauto.dts +1 -1
similarity index 98%
rename from arch/arm/boot/dts/imx6q-sabreauto.dts
rename to arch/arm/boot/dts/imx6q-sabreauto.dtsp
index 656d489..4063b90 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx6q.dtsi"
+#include "imx6q.dtsip"
 
 / {
 	model = "Freescale i.MX6 Quad SABRE Automotive Board";
arch/arm/boot/dts/imx6q-sabrelite.dtsp renamed from arch/arm/boot/dts/imx6q-sabrelite.dts +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx6q-sabrelite.dts
rename to arch/arm/boot/dts/imx6q-sabrelite.dtsp
index 2ce355c..c6a7737 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx6q.dtsi"
+#include "imx6q.dtsip"
 
 / {
 	model = "Freescale i.MX6 Quad SABRE Lite Board";
arch/arm/boot/dts/imx6q-sabresd.dtsp renamed from arch/arm/boot/dts/imx6q-sabresd.dts +1 -1
similarity index 98%
rename from arch/arm/boot/dts/imx6q-sabresd.dts
rename to arch/arm/boot/dts/imx6q-sabresd.dtsp
index bafaccd..306d101 100644
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "imx6q.dtsi"
+#include "imx6q.dtsip"
 
 / {
 	model = "Freescale i.MX6Q SABRE Smart Device Board";
arch/arm/boot/dts/imx6q.dtsip renamed from arch/arm/boot/dts/imx6q.dtsi +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx6q.dtsi
rename to arch/arm/boot/dts/imx6q.dtsip
index 0125250..5ca905c 100644
@@ -8,7 +8,7 @@
  *
  */
 
-/include/ "imx6qdl.dtsi"
+#include "imx6qdl.dtsip"
 
 / {
 	cpus {
arch/arm/boot/dts/imx6qdl.dtsip renamed from arch/arm/boot/dts/imx6qdl.dtsi +1 -1
similarity index 99%
rename from arch/arm/boot/dts/imx6qdl.dtsi
rename to arch/arm/boot/dts/imx6qdl.dtsip
index 8f34a3cd..52b156f 100644
@@ -10,7 +10,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	aliases {
Signature · 1 line
1.7.9.5
maintainer
#2 lore raw

v2 cover Get rid of big array from imx pinctrl driver

In reply to Shawn Guo
Quoted 8 lines · Shawn Guo

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

Looks good to me. The patches are really *huge*. Does it make sense to make 2/3 and 3/3 a single patch to make the churn smaller?

Sascha

Quoted 83 lines
 .../bindings/pinctrl/fsl,imx-pinctrl.txt           |    6 +-
 .../bindings/pinctrl/fsl,imx35-pinctrl.txt         |  955 +--------
 .../bindings/pinctrl/fsl,imx51-pinctrl.txt         |  759 +------
 .../bindings/pinctrl/fsl,imx53-pinctrl.txt         | 1174 +---------
 .../bindings/pinctrl/fsl,imx6q-pinctrl.txt         | 1596 +-------------
 .../{imx25-karo-tx25.dts => imx25-karo-tx25.dtsp}  |    2 +-
 .../arm/boot/dts/{imx25-pdk.dts => imx25-pdk.dtsp} |    2 +-
 arch/arm/boot/dts/{imx25.dtsi => imx25.dtsip}      |    2 +-
 .../boot/dts/{imx27-apf27.dts => imx27-apf27.dtsp} |    2 +-
 .../arm/boot/dts/{imx27-pdk.dts => imx27-pdk.dtsp} |    2 +-
 ...hytec-phycore.dts => imx27-phytec-phycore.dtsp} |    2 +-
 arch/arm/boot/dts/{imx27.dtsi => imx27.dtsip}      |    2 +-
 .../arm/boot/dts/{imx31-bug.dts => imx31-bug.dtsp} |    2 +-
 arch/arm/boot/dts/{imx31.dtsi => imx31.dtsip}      |    2 +-
 arch/arm/boot/dts/imx35-pinfunc.h                  |  970 +++++++++
 .../boot/dts/{imx51-apf51.dts => imx51-apf51.dtsp} |    2 +-
 .../dts/{imx51-babbage.dts => imx51-babbage.dtsp}  |   16 +-
 arch/arm/boot/dts/imx51-pinfunc.h                  |  773 +++++++
 arch/arm/boot/dts/{imx51.dtsi => imx51.dtsip}      |  247 +--
 .../arm/boot/dts/{imx53-ard.dts => imx53-ard.dtsp} |   70 +-
 .../arm/boot/dts/{imx53-evk.dts => imx53-evk.dtsp} |   18 +-
 arch/arm/boot/dts/imx53-mba53.dts                  |  129 --
 arch/arm/boot/dts/imx53-mba53.dtsp                 |  135 ++
 arch/arm/boot/dts/imx53-pinfunc.h                  | 1189 ++++++++++
 .../arm/boot/dts/{imx53-qsb.dts => imx53-qsb.dtsp} |   22 +-
 .../arm/boot/dts/{imx53-smd.dts => imx53-smd.dtsp} |   16 +-
 .../dts/{imx53-tqma53.dtsi => imx53-tqma53.dtsip}  |   32 +-
 arch/arm/boot/dts/{imx53.dtsi => imx53.dtsip}      |  207 +-
 arch/arm/boot/dts/{imx6dl.dtsi => imx6dl.dtsip}    |    0
 .../boot/dts/{imx6q-arm2.dts => imx6q-arm2.dtsp}   |    8 +-
 arch/arm/boot/dts/imx6q-pinfunc.h                  | 1529 +++++++++++++
 .../{imx6q-sabreauto.dts => imx6q-sabreauto.dtsp}  |    6 +-
 .../{imx6q-sabrelite.dts => imx6q-sabrelite.dtsp}  |   18 +-
 .../dts/{imx6q-sabresd.dts => imx6q-sabresd.dtsp}  |   14 +-
 arch/arm/boot/dts/imx6q.dtsi                       |  302 ---
 arch/arm/boot/dts/imx6q.dtsip                      |  303 +++
 arch/arm/boot/dts/{imx6qdl.dtsi => imx6qdl.dtsip}  |    2 +-
 drivers/pinctrl/pinctrl-imx.c                      |  120 +-
 drivers/pinctrl/pinctrl-imx.h                      |   13 +-
 drivers/pinctrl/pinctrl-imx35.c                    | 1524 +++----------
 drivers/pinctrl/pinctrl-imx51.c                    | 1252 +++--------
 drivers/pinctrl/pinctrl-imx53.c                    | 1579 ++------------
 drivers/pinctrl/pinctrl-imx6q.c                    | 2263 +++-----------------
 43 files changed, 6284 insertions(+), 10983 deletions(-)
 rename arch/arm/boot/dts/{imx25-karo-tx25.dts => imx25-karo-tx25.dtsp} (96%)
 rename arch/arm/boot/dts/{imx25-pdk.dts => imx25-pdk.dtsp} (96%)
 rename arch/arm/boot/dts/{imx25.dtsi => imx25.dtsip} (99%)
 rename arch/arm/boot/dts/{imx27-apf27.dts => imx27-apf27.dtsp} (98%)
 rename arch/arm/boot/dts/{imx27-pdk.dts => imx27-pdk.dtsp} (96%)
 rename arch/arm/boot/dts/{imx27-phytec-phycore.dts => imx27-phytec-phycore.dtsp} (98%)
 rename arch/arm/boot/dts/{imx27.dtsi => imx27.dtsip} (99%)
 rename arch/arm/boot/dts/{imx31-bug.dts => imx31-bug.dtsp} (96%)
 rename arch/arm/boot/dts/{imx31.dtsi => imx31.dtsip} (98%)
 create mode 100644 arch/arm/boot/dts/imx35-pinfunc.h
 rename arch/arm/boot/dts/{imx51-apf51.dts => imx51-apf51.dtsp} (97%)
 rename arch/arm/boot/dts/{imx51-babbage.dts => imx51-babbage.dtsp} (94%)
 create mode 100644 arch/arm/boot/dts/imx51-pinfunc.h
 rename arch/arm/boot/dts/{imx51.dtsi => imx51.dtsip} (61%)
 rename arch/arm/boot/dts/{imx53-ard.dts => imx53-ard.dtsp} (55%)
 rename arch/arm/boot/dts/{imx53-evk.dts => imx53-evk.dtsp} (82%)
 delete mode 100644 arch/arm/boot/dts/imx53-mba53.dts
 create mode 100644 arch/arm/boot/dts/imx53-mba53.dtsp
 create mode 100644 arch/arm/boot/dts/imx53-pinfunc.h
 rename arch/arm/boot/dts/{imx53-qsb.dts => imx53-qsb.dtsp} (89%)
 rename arch/arm/boot/dts/{imx53-smd.dts => imx53-smd.dtsp} (88%)
 rename arch/arm/boot/dts/{imx53-tqma53.dtsi => imx53-tqma53.dtsip} (75%)
 rename arch/arm/boot/dts/{imx53.dtsi => imx53.dtsip} (69%)
 rename arch/arm/boot/dts/{imx6dl.dtsi => imx6dl.dtsip} (100%)
 rename arch/arm/boot/dts/{imx6q-arm2.dts => imx6q-arm2.dtsp} (90%)
 create mode 100644 arch/arm/boot/dts/imx6q-pinfunc.h
 rename arch/arm/boot/dts/{imx6q-sabreauto.dts => imx6q-sabreauto.dtsp} (88%)
 rename arch/arm/boot/dts/{imx6q-sabrelite.dts => imx6q-sabrelite.dtsp} (87%)
 rename arch/arm/boot/dts/{imx6q-sabresd.dts => imx6q-sabresd.dtsp} (84%)
 delete mode 100644 arch/arm/boot/dts/imx6q.dtsi
 create mode 100644 arch/arm/boot/dts/imx6q.dtsip
 rename arch/arm/boot/dts/{imx6qdl.dtsi => imx6qdl.dtsip} (99%)
Signature · 1 line
1.7.9.5
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 |
author
#3 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 5 lines · Sascha Hauer
Quoted 4 lines · Shawn Guo

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Quoted 8 lines
Quoted 4 lines

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

Looks good to me. The patches are really *huge*. Does it make sense to make 2/3 and 3/3 a single patch to make the churn smaller?

Yeah, no problem, as we need to have them go through the same tree anyway. I just squashed the two patches into one.

Linus,

May I have your ACK on the pinctrl driver changes? I would like to have the series go via IMX tree for 3.10.

Shawn

#4 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 2 lines · Shawn Guo

May I have your ACK on the pinctrl driver changes? I would like to have the series go via IMX tree for 3.10.

Of course. Looking great.

For the pinctrl parts.

Yours,
Linus Walleij

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

PATCH v2 3/3 pinctrl: imx: move hard-coding data into device tree

Quoted 6 lines · Shawn Guo

Currently, all imx pinctrl drivers maintain a big array of struct imx_pin_reg which hard-codes data like register offset and mux mode setting for each pin function. Every time a new imx SoC support is added, we need to add such a big mount of data. With moving to single kernel build, it's only matter of time to be blamed on memory consuming.

Quoted 7 lines

With DTC pre-processor support in place, the patch moves all these data into device tree by redefining the PIN_FUNC_ID in imxXX-pinfunc.h and changing the PIN_FUNC_ID parsing code a little bit.

The pin id gets re-numbered based on mux register offset, or config register offset if the pin has no mux register, so that kernel can identify the pin id from register offsets provided by device tree.

This looks ok to me.

Quoted 1 line

........

Review

Quoted 6 lines

+ * The pin function ID is a tuple of
+ * <mux_reg conf_reg input_reg mux_mode input_val>
+ */

(quoted diff) +3 -0
+#define MX6Q_PAD_SD2_DAT1__USDHC2_DAT1                 0x04c 0x360 0x000 0x0 0x0
+#define MX6Q_PAD_SD2_DAT1__ECSPI5_SS0                  0x04c 0x360 0x834 0x1 0x0
+#define MX6Q_PAD_SD2_DAT1__WEIM_WEIM_CS_2              0x04c 0x360 0x000 0x2 0x0

Is there any special reason we change the register order comparing to iomux-v3? How did you generate this new table?

Quoted 9 lines

static struct of_device_id imx53_pinctrl_of_match[] = {

drivers/pinctrl/pinctrl-imx6q.c +0 -0
index 663346b..74ea946 100644
@@ -23,1935 +23,256 @@
 #include "pinctrl-imx.h"
 
 enum imx6q_pads {

....

drivers/pinctrl/pinctrl-imx6q.c

Quoted 3 lines
drivers/pinctrl/pinctrl-imx6q.c +3 -0
+       MX6Q_PAD_JTAG_TDI = 417,
+       MX6Q_PAD_JTAG_TCK = 418,
+       MX6Q_PAD_JTAG_TDO = 419,

Ideally even for this table, we may also do not need it. Because the pin id defined here actually is dynamically calculated by mux_reg/config_reg offset.
If that, why can't we also define the pinctrl_pin_desc dynamically and register it into the core?
However, it may need the pinctrl core to provide register a single pin function to driver.
Since it does not affect the binding itself, i'm ok it may be discussed or done in the future
in a separate patch.

Besides above minor comments, this binding improvement patch is ok to me.

Regards
Dong Aisheng

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

PATCH v2 2/3 ARM: dts: imx: replace magic number with pin function name

Quoted 6 lines · Shawn Guo

This turns the imx pin function number defined by binding document into #define constants in header which can be used in dts and handled by pre-processor to improve the readability of device tree sources.

I agree and wanted this to be fixed all the time, so

Yours,
Linus Walleij

#9 lore raw

v2 cover Get rid of big array from imx pinctrl driver

In reply to Shawn Guo
Quoted 8 lines · Shawn Guo

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

These patches were too large to make it out on any mailing list. I'm guessing only the people who were recipients of them saw them.

Please figure out a way to post your work in a way that it can be reviewed.

-Olof

author
#10 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 10 lines · Olof Johansson
Quoted 8 lines · Shawn Guo

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

Quoted 5 lines

These patches were too large to make it out on any mailing list. I'm guessing only the people who were recipients of them saw them.

Please figure out a way to post your work in a way that it can be reviewed.

Yeah, I will publish a branch after v3.9-rc1 is available.

Shawn

author
#11 lore raw

v2 cover Get rid of big array from imx pinctrl driver

In reply to Olof Johansson
Quoted 10 lines · Olof Johansson
Quoted 8 lines · Shawn Guo

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

Quoted 4 lines

These patches were too large to make it out on any mailing list. I'm guessing only the people who were recipients of them saw them.

Please figure out a way to post your work in a way that it can be reviewed.

I just merged patches #2 and #3 into one to make the diff stat a little smaller, as per Sascha's suggestion, and push out the patches to branch blow.

git://git.linaro.org/people/shawnguo/linux-2.6.git imx/dt

Shawn

reviewer
#12 lore raw

v2 cover Get rid of big array from imx pinctrl driver

In reply to Shawn Guo

Hi Shawn,

Quoted 8 lines · Shawn Guo

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

The last patch breaks audio on mx6qsabrelite: after a aplay command the processor hangs.

author
#13 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 7 lines · Fabio Estevam

Hi Shawn,

Quoted 4 lines · Shawn Guo

Changes since v1:
* Remove the absolute path of imxXX-pinfunc.h in binding doc
* Remove the pin id from PIN_FUNC_ID/macro

Quoted 7 lines
Quoted 4 lines

Shawn Guo (3):
ARM: dts: imx: use pre-processor for device trees
ARM: dts: imx: replace magic number with pin function name
pinctrl: imx: move hard-coding data into device tree

The last patch breaks audio on mx6qsabrelite: after a aplay command the processor hangs.

Thanks for spotting it, Fabio.

There is indeed a bug with the patch. The select input register should not be defined in imx_pin_reg, because the same pad may have multiple select input registers for different mux setting values. So it should be something defined with pin group. The following code change should fix the problem.

I just rebuilt imx/dt branch with the problem fixed and also had the branch based on Stephen Warren's for-3.10/dtc-cpp-chroot-std-headers branch so avoid all those dts files renaming.

Shawn

--8<----

drivers/pinctrl/pinctrl-imx.c +8 -4
index 479ceb6..b83be7c 100644
@@ -198,6 +198,7 @@ static int imx_pmx_enable(struct pinctrl_dev *pctldev, unsigned selector,
 	const struct imx_pinctrl_soc_info *info = ipctl->info;
 	const struct imx_pin_reg *pin_reg;
 	const unsigned *pins, *mux, *input_val;
+	u16 *input_reg;
 	unsigned int npins, pin_id;
 	int i;
 
@@ -209,6 +210,7 @@ static int imx_pmx_enable(struct pinctrl_dev *pctldev, unsigned selector,
 	npins = info->groups[group].npins;
 	mux = info->groups[group].mux_mode;
 	input_val = info->groups[group].input_val;
+	input_reg = info->groups[group].input_reg;
 
 	WARN_ON(!pins || !npins || !mux || !input_val);
 
@@ -230,11 +232,11 @@ static int imx_pmx_enable(struct pinctrl_dev *pctldev, unsigned selector,
 			pin_reg->mux_reg, mux[i]);
 
 		/* some pins also need select input setting, set it if found */
-		if (pin_reg->input_reg) {
-			writel(input_val[i], ipctl->base + pin_reg->input_reg);
+		if (input_reg[i]) {
+			writel(input_val[i], ipctl->base + input_reg[i]);
 			dev_dbg(ipctl->dev,
 				"==>select_input: offset 0x%x val 0x%x\n",
-				pin_reg->input_reg, input_val[i]);
+				input_reg[i], input_val[i]);
 		}
 	}
 
@@ -411,6 +413,8 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 				GFP_KERNEL);
 	grp->mux_mode = devm_kzalloc(info->dev, grp->npins * sizeof(unsigned int),
 				GFP_KERNEL);
+	grp->input_reg = devm_kzalloc(info->dev, grp->npins * sizeof(u16),
+				GFP_KERNEL);
 	grp->input_val = devm_kzalloc(info->dev, grp->npins * sizeof(unsigned int),
 				GFP_KERNEL);
 	grp->configs = devm_kzalloc(info->dev, grp->npins * sizeof(unsigned long),
@@ -424,7 +428,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 		grp->pins[i] = pin_id;
 		pin_reg->mux_reg = mux_reg;
 		pin_reg->conf_reg = conf_reg;
-		pin_reg->input_reg = be32_to_cpu(*list++);
+		grp->input_reg[i] = be32_to_cpu(*list++);
 		grp->mux_mode[i] = be32_to_cpu(*list++);
 		grp->input_val[i] = be32_to_cpu(*list++);
 
drivers/pinctrl/pinctrl-imx.h +3 -3
index 4749b0a..1f27f24 100644
@@ -26,6 +26,8 @@ struct platform_device;
  *	elements in .pins so we can iterate over that array
  * @mux_mode: the mux mode for each pin in this group. The size of this
  *	array is the same as pins.
+ * @input_reg: select input register offset for this mux if any
+ *	0 if no select input setting needed.
  * @input_val: the select input value for each pin in this group. The size of
  *	this array is the same as pins.
  * @configs: the config for each pin in this group. The size of this
@@ -36,6 +38,7 @@ struct imx_pin_group {
 	unsigned int *pins;
 	unsigned npins;
 	unsigned int *mux_mode;
+	u16 *input_reg;
 	unsigned int *input_val;
 	unsigned long *configs;
 };
@@ -56,13 +59,10 @@ struct imx_pmx_func {
  * struct imx_pin_reg - describe a pin reg map
  * @mux_reg: mux register offset
  * @conf_reg: config register offset
- * @input_reg: select input register offset for this mux if any
- *  0 if no select input setting needed.
  */
 struct imx_pin_reg {
 	u16 mux_reg;
 	u16 conf_reg;
-	u16 input_reg;
 };
 
 struct imx_pinctrl_soc_info {
Signature · 1 line
1.7.9.5
reviewer
#14 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 11 lines · Shawn Guo

Thanks for spotting it, Fabio.

There is indeed a bug with the patch. The select input register should not be defined in imx_pin_reg, because the same pad may have multiple select input registers for different mux setting values. So it should be something defined with pin group. The following code change should fix the problem.

I just rebuilt imx/dt branch with the problem fixed and also had the branch based on Stephen Warren's for-3.10/dtc-cpp-chroot-std-headers branch so avoid all those dts files renaming.

With this change the audmux input registers are set and I can get audio functional again.

I still see a different issue though:

In 3.6-rc5 we get:

imx6q-pinctrl 20e0000.iomuxc: maps: function i2c1 group i2c1grp-1 num 3 imx6q-pinctrl 20e0000.iomuxc: enable function i2c1 group i2c1grp-1 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xa4 val 0x16 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x898 val 0x0 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xc4 val 0x11 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x89c val 0x0 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_D21 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3b8 val 0x1b8b1 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_D28 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3d8 val 0x1b8b1

,but we get the following on your branch:

imx6q-pinctrl 20e0000.iomuxc: maps: function i2c1 group i2c1grp-1 num 3 imx6q-pinctrl 20e0000.iomuxc: enable function i2c1 group i2c1grp-1 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xa4 val 0x16 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x898 val 0x0 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xc4 val 0x11 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x89c val 0x0 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_A17 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3b8 val 0x1b8b1 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_EB1 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3d8 val 0x1b8b1

The pin name passed in the 'pinconf set pin' line is wrong.

On 3.6-rc5 MX6Q_PAD_EIM_D21 is number 22 and MX6Q_PAD_EIM_A17 is 41.

On your branch: MX6Q_PAD_EIM_D21 is 41 and MX6Q_PAD_EIM_A17 is 60

So this offset of 19 is causing troubles and I can see that you added this offset in the enum:

enum imx6q_pads {
	MX6Q_PAD_SD2_DAT1 = 19,
	MX6Q_PAD_SD2_DAT2 = 20,
	MX6Q_PAD_SD2_DAT0 = 21,
	MX6Q_PAD_RGMII_TXC = 22,
	MX6Q_PAD_RGMII_TD0 = 23,
	MX6Q_PAD_RGMII_TD1 = 24,
	MX6Q_PAD_RGMII_TD2 = 25,
author
#15 lore raw

v2 cover Get rid of big array from imx pinctrl driver

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

Thanks for spotting it, Fabio.

There is indeed a bug with the patch. The select input register should not be defined in imx_pin_reg, because the same pad may have multiple select input registers for different mux setting values. So it should be something defined with pin group. The following code change should fix the problem.

Quoted 9 lines
Quoted 3 lines

I just rebuilt imx/dt branch with the problem fixed and also had the branch based on Stephen Warren's for-3.10/dtc-cpp-chroot-std-headers branch so avoid all those dts files renaming.

With this change the audmux input registers are set and I can get audio functional again.

I still see a different issue though:

That's expected, as the pin ID gets re-numbered based on offset of mux/conf register, so that we can determine the pin ID at runtime and avoid encoding it in device tree.

Shawn

Quoted 43 lines

In 3.6-rc5 we get:

imx6q-pinctrl 20e0000.iomuxc: maps: function i2c1 group i2c1grp-1 num 3 imx6q-pinctrl 20e0000.iomuxc: enable function i2c1 group i2c1grp-1 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xa4 val 0x16 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x898 val 0x0 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xc4 val 0x11 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x89c val 0x0 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_D21 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3b8 val 0x1b8b1 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_D28 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3d8 val 0x1b8b1

,but we get the following on your branch:

imx6q-pinctrl 20e0000.iomuxc: maps: function i2c1 group i2c1grp-1 num 3 imx6q-pinctrl 20e0000.iomuxc: enable function i2c1 group i2c1grp-1 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xa4 val 0x16 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x898 val 0x0 imx6q-pinctrl 20e0000.iomuxc: write: offset 0xc4 val 0x11 imx6q-pinctrl 20e0000.iomuxc: ==>select_input: offset 0x89c val 0x0 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_A17 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3b8 val 0x1b8b1 imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_EB1 imx6q-pinctrl 20e0000.iomuxc: write: offset 0x3d8 val 0x1b8b1

The pin name passed in the 'pinconf set pin' line is wrong.

On 3.6-rc5 MX6Q_PAD_EIM_D21 is number 22 and MX6Q_PAD_EIM_A17 is 41.

On your branch: MX6Q_PAD_EIM_D21 is 41 and MX6Q_PAD_EIM_A17 is 60

So this offset of 19 is causing troubles and I can see that you added this offset in the enum:

enum imx6q_pads {
	MX6Q_PAD_SD2_DAT1 = 19,
	MX6Q_PAD_SD2_DAT2 = 20,
	MX6Q_PAD_SD2_DAT0 = 21,
	MX6Q_PAD_RGMII_TXC = 22,
	MX6Q_PAD_RGMII_TD0 = 23,
	MX6Q_PAD_RGMII_TD1 = 24,
	MX6Q_PAD_RGMII_TD2 = 25,
reviewer
#16 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 3 lines · Shawn Guo

That's expected, as the pin ID gets re-numbered based on offset of mux/conf register, so that we can determine the pin ID at runtime and avoid encoding it in device tree.

but debug messages seems buggy now:

Prior to the patch we had:

imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_D21

and now we have:

imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_A17

MX6Q_PAD_EIM_A17 has nothing to do with I2C, so we should print MX6Q_PAD_EIM_A17 when we are actually configuring MX6Q_PAD_EIM_D21.

Also, where does the 19 offset in the imx6q_pads enum come from?

reviewer
#17 lore raw

v2 cover Get rid of big array from imx pinctrl driver

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

That's expected, as the pin ID gets re-numbered based on offset of mux/conf register, so that we can determine the pin ID at runtime and avoid encoding it in device tree.

but debug messages seems buggy now:

Prior to the patch we had:

Quoted 7 lines

imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_D21

and now we have:

imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_A17

MX6Q_PAD_EIM_A17 has nothing to do with I2C, so we should print

/s/should/should not/

Quoted 3 lines

MX6Q_PAD_EIM_A17 when we are actually configuring MX6Q_PAD_EIM_D21.

Also, where does the 19 offset in the imx6q_pads enum come from?

author
#18 lore raw

v2 cover Get rid of big array from imx pinctrl driver

In reply to Fabio Estevam
Quoted 8 lines · Fabio Estevam
Quoted 3 lines · Shawn Guo

That's expected, as the pin ID gets re-numbered based on offset of mux/conf register, so that we can determine the pin ID at runtime and avoid encoding it in device tree.

but debug messages seems buggy now:

Yes, you are right. The change attached below should fix the problem. I am fixing it up for all imx pinctrl drivers on imx/dt branch.

Quoted 4 lines

Prior to the patch we had:

imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_D21

Quoted 8 lines

and now we have:

imx6q-pinctrl 20e0000.iomuxc: pinconf set pin MX6Q_PAD_EIM_A17

MX6Q_PAD_EIM_A17 has nothing to do with I2C, so we should print MX6Q_PAD_EIM_A17 when we are actually configuring MX6Q_PAD_EIM_D21.

Also, where does the 19 offset in the imx6q_pads enum come from?

We choose to have the pin ID simply calculated from register offset. For example, the mux register offset for MX6Q_PAD_SD2_DAT1 is 0x4c, and the ID would be 0x4c / 4 = 19.

Shawn

--8<-----

drivers/pinctrl/pinctrl-imx6q.c +38 -0
index f00f532..76dd9c4 100644
@@ -23,6 +23,25 @@
 #include "pinctrl-imx.h"
 
 enum imx6q_pads {
+	MX6Q_PAD_RESERVE0 = 0,
+	MX6Q_PAD_RESERVE1 = 1,
+	MX6Q_PAD_RESERVE2 = 2,
+	MX6Q_PAD_RESERVE3 = 3,
+	MX6Q_PAD_RESERVE4 = 4,
+	MX6Q_PAD_RESERVE5 = 5,
+	MX6Q_PAD_RESERVE6 = 6,
+	MX6Q_PAD_RESERVE7 = 7,
+	MX6Q_PAD_RESERVE8 = 8,
+	MX6Q_PAD_RESERVE9 = 9,
+	MX6Q_PAD_RESERVE10 = 10,
+	MX6Q_PAD_RESERVE11 = 11,
+	MX6Q_PAD_RESERVE12 = 12,
+	MX6Q_PAD_RESERVE13 = 13,
+	MX6Q_PAD_RESERVE14 = 14,
+	MX6Q_PAD_RESERVE15 = 15,
+	MX6Q_PAD_RESERVE16 = 16,
+	MX6Q_PAD_RESERVE17 = 17,
+	MX6Q_PAD_RESERVE18 = 18,
 	MX6Q_PAD_SD2_DAT1 = 19,
 	MX6Q_PAD_SD2_DAT2 = 20,
 	MX6Q_PAD_SD2_DAT0 = 21,
@@ -224,6 +243,25 @@ enum imx6q_pads {
 
 /* Pad names for the pinmux subsystem */
 static const struct pinctrl_pin_desc imx6q_pinctrl_pads[] = {
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE0),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE1),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE2),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE3),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE4),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE5),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE6),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE7),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE8),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE9),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE10),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE11),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE12),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE13),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE14),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE15),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE16),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE17),
+	IMX_PINCTRL_PIN(MX6Q_PAD_RESERVE18),
 	IMX_PINCTRL_PIN(MX6Q_PAD_SD2_DAT1),
 	IMX_PINCTRL_PIN(MX6Q_PAD_SD2_DAT2),
 	IMX_PINCTRL_PIN(MX6Q_PAD_SD2_DAT0),
#19 lore raw

v2 cover Get rid of big array from imx pinctrl driver

drivers/pinctrl/pinctrl-imx6q.c

Quoted 6 lines · Shawn Guo

--8<-----

drivers/pinctrl/pinctrl-imx6q.c +0 -0
index f00f532..76dd9c4 100644

Acked-by. I trust you to fix up and merge the outcome of this Shawn...

Yours,
Linus Walleij

author
#20 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 10 lines · Linus Walleij

drivers/pinctrl/pinctrl-imx6q.c

Quoted 6 lines · Shawn Guo

--8<-----

drivers/pinctrl/pinctrl-imx6q.c +0 -0
index f00f532..76dd9c4 100644

Acked-by. I trust you to fix up and merge the outcome of this Shawn...

Thanks, Linus. Thanks to Fabio too for noticing the bugs.

Shawn

reviewer
#21 lore raw

v2 cover Get rid of big array from imx pinctrl driver

In reply to Shawn Guo
Quoted 3 lines · Shawn Guo

I just rebuilt imx/dt branch with the problem fixed and also had the branch based on Stephen Warren's for-3.10/dtc-cpp-chroot-std-headers branch so avoid all those dts files renaming.

Does imx6dl boot for you in your updated imx/dt branch?

It used to boot previously, but after the update it no longer boots.

reviewer
#22 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 9 lines · Fabio Estevam
Quoted 3 lines · Shawn Guo

I just rebuilt imx/dt branch with the problem fixed and also had the branch based on Stephen Warren's for-3.10/dtc-cpp-chroot-std-headers branch so avoid all those dts files renaming.

Does imx6dl boot for you in your updated imx/dt branch?

It used to boot previously, but after the update it no longer boots.

Your updated branch missed:

[PATCH 3/6] ARM: imx: add initial imx6dl support

author
#23 lore raw

v2 cover Get rid of big array from imx pinctrl driver

Quoted 7 lines · Fabio Estevam
Quoted 6 lines · Fabio Estevam
Quoted 3 lines · Shawn Guo

I just rebuilt imx/dt branch with the problem fixed and also had the branch based on Stephen Warren's for-3.10/dtc-cpp-chroot-std-headers branch so avoid all those dts files renaming.

Quoted 7 lines
Quoted 3 lines

Does imx6dl boot for you in your updated imx/dt branch?

It used to boot previously, but after the update it no longer boots.

Your updated branch missed:

[PATCH 3/6] ARM: imx: add initial imx6dl support

It's never been on imx/dt branch but imx/soc. So for-next can be used to boot imx6dl.

Shawn