ARM: dts: OMAP2+: use preprocessor for device trees
Subsystems (2)
v2 cover ARM: dts: OMAP2+: use preprocessor for device trees
Hello,
Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability.
Patch 1 is a preparation for the rest of the series.
Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT.
For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity.
Best regards,
Florian
Quoted 1 line
From v1:
- Remove duplicated fix
- Remove OMAP_GPIO macro
- Add pinctrl constants
Florian Vaussard (5):
ARM: dts: OMAP2+: use #include for all device trees
ARM: dts: OMAP2+: use existing constants for GPIOs
ARM: dts: OMAP4/5: use existing constants for IRQs
ARM: dts: OMAP2+: header file for pinctrl constants
ARM: dts: OMAP2+: use pinctrl constants
arch/arm/boot/dts/omap2.dtsi | 5 +- arch/arm/boot/dts/omap2420-h4.dts | 2 +- arch/arm/boot/dts/omap2420.dtsi | 2 +- arch/arm/boot/dts/omap2430.dtsi | 2 +- arch/arm/boot/dts/omap3-beagle-xm.dts | 8 +- arch/arm/boot/dts/omap3-beagle.dts | 34 ++++---- arch/arm/boot/dts/omap3-devkit8000.dts | 10 +- arch/arm/boot/dts/omap3-evm.dts | 6 +- arch/arm/boot/dts/omap3-igep.dtsi | 36 ++++---- arch/arm/boot/dts/omap3-igep0020.dts | 10 +- arch/arm/boot/dts/omap3-igep0030.dts | 10 +- arch/arm/boot/dts/omap3-overo.dtsi | 4 +- arch/arm/boot/dts/omap3-tobi.dts | 4 +- arch/arm/boot/dts/omap3.dtsi | 5 +- arch/arm/boot/dts/omap3430-sdp.dts | 4 +- arch/arm/boot/dts/omap34xx.dtsi | 2 +- arch/arm/boot/dts/omap36xx.dtsi | 2 +- arch/arm/boot/dts/omap4-panda-a4.dts | 10 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 66 ++++++++-------- arch/arm/boot/dts/omap4-panda-es.dts | 10 +- arch/arm/boot/dts/omap4-panda.dts | 4 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts | 8 +- arch/arm/boot/dts/omap4-sdp.dts | 122 ++++++++++++++-------------- arch/arm/boot/dts/omap4-var-som.dts | 8 +- arch/arm/boot/dts/omap4.dtsi | 118 ++++++++++++++------------- arch/arm/boot/dts/omap443x.dtsi | 2 +- arch/arm/boot/dts/omap4460.dtsi | 6 +- arch/arm/boot/dts/omap5-evm.dts | 92 +++++++++++----------- arch/arm/boot/dts/omap5.dtsi | 126 +++++++++++++++-------------- include/dt-bindings/pinctrl/omap.h | 54 ++++++++++++ 30 files changed, 420 insertions(+), 352 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h
Signature · 1 line
1.7.5.4
PATCH v2 1/5 ARM: dts: OMAP2+: use #include for all device trees
Replace /include/ by #include for OMAP2+ DT, in order to use the C pre-processor, making use of #define features possible.
--- arch/arm/boot/dts/omap2.dtsi | 2 +- arch/arm/boot/dts/omap2420-h4.dts | 2 +- arch/arm/boot/dts/omap2420.dtsi | 2 +- arch/arm/boot/dts/omap2430.dtsi | 2 +- arch/arm/boot/dts/omap3-beagle-xm.dts | 4 ++-- arch/arm/boot/dts/omap3-beagle.dts | 4 ++-- arch/arm/boot/dts/omap3-devkit8000.dts | 4 ++-- arch/arm/boot/dts/omap3-evm.dts | 4 ++-- arch/arm/boot/dts/omap3-igep.dtsi | 4 ++-- arch/arm/boot/dts/omap3-igep0020.dts | 2 +- arch/arm/boot/dts/omap3-igep0030.dts | 2 +- arch/arm/boot/dts/omap3-overo.dtsi | 4 ++-- arch/arm/boot/dts/omap3-tobi.dts | 2 +- arch/arm/boot/dts/omap3.dtsi | 2 +- arch/arm/boot/dts/omap3430-sdp.dts | 4 ++-- arch/arm/boot/dts/omap34xx.dtsi | 2 +- arch/arm/boot/dts/omap36xx.dtsi | 2 +- arch/arm/boot/dts/omap4-panda-a4.dts | 4 ++-- arch/arm/boot/dts/omap4-panda-common.dtsi | 4 ++-- arch/arm/boot/dts/omap4-panda-es.dts | 4 ++-- arch/arm/boot/dts/omap4-panda.dts | 4 ++-- arch/arm/boot/dts/omap4-sdp-es23plus.dts | 2 +- arch/arm/boot/dts/omap4-sdp.dts | 6 +++--- arch/arm/boot/dts/omap4-var-som.dts | 4 ++-- arch/arm/boot/dts/omap4.dtsi | 2 +- arch/arm/boot/dts/omap443x.dtsi | 2 +- arch/arm/boot/dts/omap4460.dtsi | 2 +- arch/arm/boot/dts/omap5-evm.dts | 4 ++-- arch/arm/boot/dts/omap5.dtsi | 2 +- 29 files changed, 44 insertions(+), 44 deletions(-)
arch/arm/boot/dts/omap2.dtsi +1 -1
@@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ "skeleton.dtsi" +#include "skeleton.dtsi" / { compatible = "ti,omap2430", "ti,omap2420", "ti,omap2";
arch/arm/boot/dts/omap2420-h4.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap2420.dtsi" +#include "omap2420.dtsi" / { model = "TI OMAP2420 H4 board";
arch/arm/boot/dts/omap2420.dtsi +1 -1
@@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ "omap2.dtsi" +#include "omap2.dtsi" / { compatible = "ti,omap2420", "ti,omap2";
arch/arm/boot/dts/omap2430.dtsi +1 -1
@@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ "omap2.dtsi" +#include "omap2.dtsi" / { compatible = "ti,omap2430", "ti,omap2";
arch/arm/boot/dts/omap3-beagle-xm.dts +2 -2
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap36xx.dtsi" +#include "omap36xx.dtsi" / { model = "TI OMAP3 BeagleBoard xM";
@@ -75,7 +75,7 @@ }; }; -/include/ "twl4030.dtsi" +#include "twl4030.dtsi" &i2c2 { clock-frequency = <400000>;
arch/arm/boot/dts/omap3-beagle.dts +2 -2
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap34xx.dtsi" +#include "omap34xx.dtsi" / { model = "TI OMAP3 BeagleBoard";
@@ -107,7 +107,7 @@ }; }; -/include/ "twl4030.dtsi" +#include "twl4030.dtsi" &mmc1 { vmmc-supply = <&vmmc1>;
arch/arm/boot/dts/omap3-devkit8000.dts +2 -2
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap34xx.dtsi" +#include "omap34xx.dtsi" / { model = "TimLL OMAP3 Devkit8000"; compatible = "timll,omap3-devkit8000", "ti,omap3";
@@ -80,7 +80,7 @@ status = "disabled"; }; -/include/ "twl4030.dtsi" +#include "twl4030.dtsi" &mmc1 { vmmc-supply = <&vmmc1>;
arch/arm/boot/dts/omap3-evm.dts +2 -2
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap34xx.dtsi" +#include "omap34xx.dtsi" / { model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)";
@@ -44,7 +44,7 @@ }; }; -/include/ "twl4030.dtsi" +#include "twl4030.dtsi" &i2c2 { clock-frequency = <400000>;
arch/arm/boot/dts/omap3-igep.dtsi +2 -2
@@ -10,7 +10,7 @@ */ /dts-v1/; -/include/ "omap34xx.dtsi" +#include "omap34xx.dtsi" / { memory {
@@ -80,7 +80,7 @@ }; }; -/include/ "twl4030.dtsi" +#include "twl4030.dtsi" &i2c2 { clock-frequency = <400000>;
arch/arm/boot/dts/omap3-igep0020.dts +1 -1
@@ -9,7 +9,7 @@ * published by the Free Software Foundation. */ -/include/ "omap3-igep.dtsi" +#include "omap3-igep.dtsi" / { model = "IGEPv2";
arch/arm/boot/dts/omap3-igep0030.dts +1 -1
@@ -9,7 +9,7 @@ * published by the Free Software Foundation. */ -/include/ "omap3-igep.dtsi" +#include "omap3-igep.dtsi" / { model = "IGEP COM Module";
arch/arm/boot/dts/omap3-overo.dtsi +2 -2
@@ -11,7 +11,7 @@ */ /dts-v1/; -/include/ "omap34xx.dtsi" +#include "omap34xx.dtsi" / { pwmleds {
@@ -49,7 +49,7 @@ }; }; -/include/ "twl4030.dtsi" +#include "twl4030.dtsi" /* i2c2 pins are used for gpio */ &i2c2 {
arch/arm/boot/dts/omap3-tobi.dts +1 -1
@@ -10,7 +10,7 @@ * Tobi expansion board is manufactured by Gumstix Inc. */ -/include/ "omap3-overo.dtsi" +#include "omap3-overo.dtsi" / { model = "TI OMAP3 Gumstix Overo on Tobi";
arch/arm/boot/dts/omap3.dtsi +1 -1
@@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ "skeleton.dtsi" +#include "skeleton.dtsi" / { compatible = "ti,omap3430", "ti,omap3";
arch/arm/boot/dts/omap3430-sdp.dts +2 -2
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap34xx.dtsi" +#include "omap34xx.dtsi" / { model = "TI OMAP3430 SDP";
@@ -28,7 +28,7 @@ }; }; -/include/ "twl4030.dtsi" +#include "twl4030.dtsi" &mmc1 { vmmc-supply = <&vmmc1>;
arch/arm/boot/dts/omap34xx.dtsi +1 -1
@@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ "omap3.dtsi" +#include "omap3.dtsi" / { cpus {
arch/arm/boot/dts/omap36xx.dtsi +1 -1
@@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ "omap3.dtsi" +#include "omap3.dtsi" / { aliases {
arch/arm/boot/dts/omap4-panda-a4.dts +2 -2
@@ -7,8 +7,8 @@ */ /dts-v1/; -/include/ "omap443x.dtsi" -/include/ "omap4-panda-common.dtsi" +#include "omap443x.dtsi" +#include "omap4-panda-common.dtsi" /* Pandaboard Rev A4+ have external pullups on SCL & SDA */ &dss_hdmi_pins {
arch/arm/boot/dts/omap4-panda-common.dtsi +2 -2
@@ -5,7 +5,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -/include/ "elpida_ecb240abacn.dtsi" +#include "elpida_ecb240abacn.dtsi" / { model = "TI OMAP4 PandaBoard";
@@ -164,7 +164,7 @@ }; }; -/include/ "twl6030.dtsi" +#include "twl6030.dtsi" &i2c2 { pinctrl-names = "default";
arch/arm/boot/dts/omap4-panda-es.dts +2 -2
@@ -7,8 +7,8 @@ */ /dts-v1/; -/include/ "omap4460.dtsi" -/include/ "omap4-panda-common.dtsi" +#include "omap4460.dtsi" +#include "omap4-panda-common.dtsi" /* Audio routing is differnet between PandaBoard4430 and PandaBoardES */ &sound {
arch/arm/boot/dts/omap4-panda.dts +2 -2
@@ -7,5 +7,5 @@ */ /dts-v1/; -/include/ "omap443x.dtsi" -/include/ "omap4-panda-common.dtsi" +#include "omap443x.dtsi" +#include "omap4-panda-common.dtsi"
arch/arm/boot/dts/omap4-sdp-es23plus.dts +1 -1
@@ -5,7 +5,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -/include/ "omap4-sdp.dts" +#include "omap4-sdp.dts" /* SDP boards with 4430 ES2.3+ or 4460 have external pullups on SCL & SDA */ &dss_hdmi_pins {
arch/arm/boot/dts/omap4-sdp.dts +3 -3
@@ -7,8 +7,8 @@ */ /dts-v1/; -/include/ "omap443x.dtsi" -/include/ "elpida_ecb240abacn.dtsi" +#include "omap443x.dtsi" +#include "elpida_ecb240abacn.dtsi" / { model = "TI OMAP4 SDP board";
@@ -316,7 +316,7 @@ }; }; -/include/ "twl6030.dtsi" +#include "twl6030.dtsi" &i2c2 { pinctrl-names = "default";
arch/arm/boot/dts/omap4-var-som.dts +2 -2
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap443x.dtsi" +#include "omap443x.dtsi" / { model = "Variscite OMAP4 SOM";
@@ -39,7 +39,7 @@ }; }; -/include/ "twl6030.dtsi" +#include "twl6030.dtsi" &i2c2 { clock-frequency = <400000>;
arch/arm/boot/dts/omap4.dtsi +1 -1
@@ -14,7 +14,7 @@ */ /memreserve/ 0x9d000000 0x03000000; -/include/ "skeleton.dtsi" +#include "skeleton.dtsi" / { compatible = "ti,omap4430", "ti,omap4";
arch/arm/boot/dts/omap443x.dtsi +1 -1
@@ -8,7 +8,7 @@ * kind, whether express or implied. */ -/include/ "omap4.dtsi" +#include "omap4.dtsi" / { cpus {
arch/arm/boot/dts/omap4460.dtsi +1 -1
@@ -7,7 +7,7 @@ * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. */ -/include/ "omap4.dtsi" +#include "omap4.dtsi" / { cpus {
arch/arm/boot/dts/omap5-evm.dts +2 -2
@@ -7,8 +7,8 @@ */ /dts-v1/; -/include/ "omap5.dtsi" -/include/ "samsung_k3pe0e000b.dtsi" +#include "omap5.dtsi" +#include "samsung_k3pe0e000b.dtsi" / { model = "TI OMAP5 EVM board";
arch/arm/boot/dts/omap5.dtsi +1 -1
@@ -15,7 +15,7 @@ */ /memreserve/ 0x9d000000 0x03000000; -/include/ "skeleton.dtsi" +#include "skeleton.dtsi" / { #address-cells = <1>;
Signature · 1 line
1.7.5.4
PATCH v2 2/5 ARM: dts: OMAP2+: use existing constants for GPIOs
In reply to Florian VaussardUse standard GPIO constants to enhance the readability of DT GPIOs.
--- arch/arm/boot/dts/omap2.dtsi | 2 ++ arch/arm/boot/dts/omap3-beagle-xm.dts | 4 ++-- arch/arm/boot/dts/omap3-beagle.dts | 6 +++--- arch/arm/boot/dts/omap3-devkit8000.dts | 6 +++--- arch/arm/boot/dts/omap3-evm.dts | 2 +- arch/arm/boot/dts/omap3-igep0020.dts | 8 ++++---- arch/arm/boot/dts/omap3-igep0030.dts | 8 ++++---- arch/arm/boot/dts/omap3-tobi.dts | 2 +- arch/arm/boot/dts/omap3.dtsi | 2 ++ arch/arm/boot/dts/omap4-panda-common.dtsi | 4 ++-- arch/arm/boot/dts/omap4-sdp.dts | 16 ++++++++-------- arch/arm/boot/dts/omap4.dtsi | 2 ++ arch/arm/boot/dts/omap5.dtsi | 2 ++ 13 files changed, 36 insertions(+), 28 deletions(-)
arch/arm/boot/dts/omap2.dtsi +2 -0
@@ -8,6 +8,8 @@ * kind, whether express or implied. */ +#include <dt-bindings/gpio/gpio.h> + #include "skeleton.dtsi" / {
arch/arm/boot/dts/omap3-beagle-xm.dts +2 -2
@@ -29,13 +29,13 @@ heartbeat { label = "beagleboard::usr0"; - gpios = <&gpio5 22 0>; /* 150 -> D6 LED */ + gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>; /* 150 -> D6 LED */ linux,default-trigger = "heartbeat"; }; mmc { label = "beagleboard::usr1"; - gpios = <&gpio5 21 0>; /* 149 -> D7 LED */ + gpios = <&gpio5 21 GPIO_ACTIVE_HIGH>; /* 149 -> D7 LED */ linux,default-trigger = "mmc0"; }; };
arch/arm/boot/dts/omap3-beagle.dts +3 -3
@@ -28,18 +28,18 @@ compatible = "gpio-leds"; pmu_stat { label = "beagleboard::pmu_stat"; - gpios = <&twl_gpio 19 0>; /* LEDB */ + gpios = <&twl_gpio 19 GPIO_ACTIVE_HIGH>; /* LEDB */ }; heartbeat { label = "beagleboard::usr0"; - gpios = <&gpio5 22 0>; /* 150 -> D6 LED */ + gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>; /* 150 -> D6 LED */ linux,default-trigger = "heartbeat"; }; mmc { label = "beagleboard::usr1"; - gpios = <&gpio5 21 0>; /* 149 -> D7 LED */ + gpios = <&gpio5 21 GPIO_ACTIVE_HIGH>; /* 149 -> D7 LED */ linux,default-trigger = "mmc0"; }; };
arch/arm/boot/dts/omap3-devkit8000.dts +3 -3
@@ -22,21 +22,21 @@ heartbeat { label = "devkit8000::led1"; - gpios = <&gpio6 26 0>; /* 186 -> LED1 */ + gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>; /* 186 -> LED1 */ default-state = "on"; linux,default-trigger = "heartbeat"; }; mmc { label = "devkit8000::led2"; - gpios = <&gpio6 3 0>; /* 163 -> LED2 */ + gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>; /* 163 -> LED2 */ default-state = "on"; linux,default-trigger = "none"; }; usr { label = "devkit8000::led3"; - gpios = <&gpio6 4 0>; /* 164 -> LED3 */ + gpios = <&gpio6 4 GPIO_ACTIVE_HIGH>; /* 164 -> LED3 */ default-state = "on"; linux,default-trigger = "usr"; };
arch/arm/boot/dts/omap3-evm.dts +1 -1
@@ -28,7 +28,7 @@ compatible = "gpio-leds"; ledb { label = "omap3evm::ledb"; - gpios = <&twl_gpio 19 0>; /* LEDB */ + gpios = <&twl_gpio 19 GPIO_ACTIVE_HIGH>; /* LEDB */ linux,default-trigger = "default-on"; }; };
arch/arm/boot/dts/omap3-igep0020.dts +4 -4
@@ -19,25 +19,25 @@ compatible = "gpio-leds"; boot { label = "omap3:green:boot"; - gpios = <&gpio1 26 0>; + gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; default-state = "on"; }; user0 { label = "omap3:red:user0"; - gpios = <&gpio1 27 0>; + gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; default-state = "off"; }; user1 { label = "omap3:red:user1"; - gpios = <&gpio1 28 0>; + gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; default-state = "off"; }; user2 { label = "omap3:green:user1"; - gpios = <&twl_gpio 19 1>; + gpios = <&twl_gpio 19 GPIO_ACTIVE_LOW>; }; }; };
arch/arm/boot/dts/omap3-igep0030.dts +4 -4
@@ -19,25 +19,25 @@ compatible = "gpio-leds"; boot { label = "omap3:green:boot"; - gpios = <&twl_gpio 13 1>; + gpios = <&twl_gpio 13 GPIO_ACTIVE_LOW>; default-state = "on"; }; user0 { label = "omap3:red:user0"; - gpios = <&twl_gpio 18 1>; /* LEDA */ + gpios = <&twl_gpio 18 GPIO_ACTIVE_LOW>; /* LEDA */ default-state = "off"; }; user1 { label = "omap3:green:user1"; - gpios = <&twl_gpio 19 1>; /* LEDB */ + gpios = <&twl_gpio 19 GPIO_ACTIVE_LOW>; /* LEDB */ default-state = "off"; }; user2 { label = "omap3:red:user1"; - gpios = <&gpio1 16 1>; + gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; default-state = "off"; }; };
arch/arm/boot/dts/omap3-tobi.dts +1 -1
@@ -20,7 +20,7 @@ compatible = "gpio-leds"; heartbeat { label = "overo:red:gpio21"; - gpios = <&gpio1 21 0>; + gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat"; }; };
arch/arm/boot/dts/omap3.dtsi +2 -0
@@ -8,6 +8,8 @@ * kind, whether express or implied. */ +#include <dt-bindings/gpio/gpio.h> + #include "skeleton.dtsi" / {
arch/arm/boot/dts/omap4-panda-common.dtsi +2 -2
@@ -20,13 +20,13 @@ compatible = "gpio-leds"; heartbeat { label = "pandaboard::status1"; - gpios = <&gpio1 7 0>; + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat"; }; mmc { label = "pandaboard::status2"; - gpios = <&gpio1 8 0>; + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; linux,default-trigger = "mmc0"; }; };
arch/arm/boot/dts/omap4-sdp.dts +8 -8
@@ -41,42 +41,42 @@ compatible = "gpio-leds"; debug0 { label = "omap4:green:debug0"; - gpios = <&gpio2 29 0>; /* 61 */ + gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>; /* 61 */ }; debug1 { label = "omap4:green:debug1"; - gpios = <&gpio1 30 0>; /* 30 */ + gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; /* 30 */ }; debug2 { label = "omap4:green:debug2"; - gpios = <&gpio1 7 0>; /* 7 */ + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; /* 7 */ }; debug3 { label = "omap4:green:debug3"; - gpios = <&gpio1 8 0>; /* 8 */ + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; /* 8 */ }; debug4 { label = "omap4:green:debug4"; - gpios = <&gpio2 18 0>; /* 50 */ + gpios = <&gpio2 18 GPIO_ACTIVE_HIGH>; /* 50 */ }; user1 { label = "omap4:blue:user"; - gpios = <&gpio6 9 0>; /* 169 */ + gpios = <&gpio6 9 GPIO_ACTIVE_HIGH>; /* 169 */ }; user2 { label = "omap4:red:user"; - gpios = <&gpio6 10 0>; /* 170 */ + gpios = <&gpio6 10 GPIO_ACTIVE_HIGH>; /* 170 */ }; user3 { label = "omap4:green:user"; - gpios = <&gpio5 11 0>; /* 139 */ + gpios = <&gpio5 11 GPIO_ACTIVE_HIGH>; /* 139 */ }; };
arch/arm/boot/dts/omap4.dtsi +2 -0
@@ -14,6 +14,8 @@ */ /memreserve/ 0x9d000000 0x03000000; +#include <dt-bindings/gpio/gpio.h> + #include "skeleton.dtsi" / {
arch/arm/boot/dts/omap5.dtsi +2 -0
@@ -15,6 +15,8 @@ */ /memreserve/ 0x9d000000 0x03000000; +#include <dt-bindings/gpio/gpio.h> + #include "skeleton.dtsi" / {
Signature · 1 line
1.7.5.4
PATCH v2 2/5 ARM: dts: OMAP2+: use existing constants for GPIOs
Quoted 8 lines · Florian Vaussard
arch/arm/boot/dts/omap3-beagle-xm.dts +1
-1@@ -29,13 +29,13 @@ heartbeat { label = "beagleboard::usr0"; - gpios = <&gpio5 22 0>; /* 150 -> D6 LED */ + gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>; /* 150 -> D6 LED */
arch/arm/boot/dts/omap3-beagle-xm.dts line 41
Quoted 10 lines
arch/arm/boot/dts/omap3-beagle-xm.dts +1
-1linux,default-trigger = "heartbeat"; }; mmc { label = "beagleboard::usr1"; - gpios = <&gpio5 21 0>; /* 149 -> D7 LED */ + gpios = <&gpio5 21 GPIO_ACTIVE_HIGH>; /* 149 -> D7 LED */ linux,default-trigger = "mmc0"; }; };
Great yeah this is the way to go instead of the fixed numbering. Thanks for doing this.
Regards,
Tony
PATCH v2 3/5 ARM: dts: OMAP4/5: use existing constants for IRQs
In reply to Florian VaussardUse the constants defined in include/dt-bindings/interrupt-controller/ to enhance readability.
--- arch/arm/boot/dts/omap4-panda-common.dtsi | 8 +- arch/arm/boot/dts/omap4-sdp.dts | 6 +- arch/arm/boot/dts/omap4-var-som.dts | 4 +- arch/arm/boot/dts/omap4.dtsi | 113 ++++++++++++++------------- arch/arm/boot/dts/omap4460.dtsi | 4 +- arch/arm/boot/dts/omap5.dtsi | 121 +++++++++++++++-------------- 6 files changed, 129 insertions(+), 127 deletions(-)
arch/arm/boot/dts/omap4-panda-common.dtsi +4 -4
@@ -145,16 +145,16 @@ twl: twl at 48 { reg = <0x48>; - /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = <0 7 4>; /* IRQ_SYS_1N cascaded to gic */ + /* IRQ# = 7 */ + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = <&gic>; }; twl6040: twl at 4b { compatible = "ti,twl6040"; reg = <0x4b>; - /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = <0 119 4>; /* IRQ_SYS_2N cascaded to gic */ + /* IRQ# = 119 */ + interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = <&gic>; ti,audpwron-gpio = <&gpio4 31 0>; /* gpio line 127 */
arch/arm/boot/dts/omap4-sdp.dts +3 -3
@@ -286,7 +286,7 @@ twl: twl at 48 { reg = <0x48>; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = <0 7 4>; /* IRQ_SYS_1N cascaded to gic */ + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = <&gic>; };
@@ -294,7 +294,7 @@ compatible = "ti,twl6040"; reg = <0x4b>; /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ - interrupts = <0 119 4>; /* IRQ_SYS_2N cascaded to gic */ + interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */ interrupt-parent = <&gic>; ti,audpwron-gpio = <&gpio4 31 0>; /* gpio line 127 */
@@ -375,7 +375,7 @@ spi-max-frequency = <24000000>; reg = <0>; interrupt-parent = <&gpio2>; - interrupts = <2 8>; /* gpio line 34, low triggered */ + interrupts = <2 IRQ_TYPE_LEVEL_LOW>; /* gpio line 34, low triggered */ vdd-supply = <&vdd_eth>; }; };
arch/arm/boot/dts/omap4-var-som.dts +2 -2
@@ -34,7 +34,7 @@ twl: twl at 48 { reg = <0x48>; /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */ - interrupts = <0 7 4>; /* IRQ_SYS_1N cascaded to gic */ + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_1N cascaded to gic */ interrupt-parent = <&gic>; }; };
@@ -68,7 +68,7 @@ spi-max-frequency = <24000000>; reg = <0>; interrupt-parent = <&gpio6>; - interrupts = <11 8>; /* gpio line 171, low triggered */ + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; /* gpio line 171, low triggered */ vdd-supply = <&vdd_eth>; }; };
arch/arm/boot/dts/omap4.dtsi +57 -56
431 lines not on this page · raw message
arch/arm/boot/dts/omap4460.dtsi +2 -2
@@ -25,8 +25,8 @@ pmu { compatible = "arm,cortex-a9-pmu"; - interrupts = <0 54 0x4>, - <0 55 0x4>; + interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; ti,hwmods = "debugss"; }; };
arch/arm/boot/dts/omap5.dtsi +61 -60
445 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 4/5 ARM: dts: OMAP2+: header file for pinctrl constants
In reply to Florian VaussardMost of the constants are taken from arch/arm/mach-omap2/mux.h.
--- include/dt-bindings/pinctrl/omap.h | 54 ++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) create mode 100644 include/dt-bindings/pinctrl/omap.h
include/dt-bindings/pinctrl/omap.h new file +54 -0
@@ -0,0 +1,54 @@ +/* +* This header provides constants for OMAP pinctrl bindings. +* +* Copyright (C) 2009 Nokia +* Copyright (C) 2009-2010 Texas Instruments +*/ + +/* 34xx mux mode options for each pin. See TRM for options */ +#define OMAP_MUX_MODE0 0 +#define OMAP_MUX_MODE1 1 +#define OMAP_MUX_MODE2 2 +#define OMAP_MUX_MODE3 3 +#define OMAP_MUX_MODE4 4 +#define OMAP_MUX_MODE5 5 +#define OMAP_MUX_MODE6 6 +#define OMAP_MUX_MODE7 7 + +/* 24xx/34xx mux bit defines */ +#define OMAP_PULL_ENA (1 << 3) +#define OMAP_PULL_UP (1 << 4) +#define OMAP_ALTELECTRICALSEL (1 << 5) + +/* 34xx specific mux bit defines */ +#define OMAP_INPUT_EN (1 << 8) +#define OMAP_OFF_EN (1 << 9) +#define OMAP_OFFOUT_EN (1 << 10) +#define OMAP_OFFOUT_VAL (1 << 11) +#define OMAP_OFF_PULL_EN (1 << 12) +#define OMAP_OFF_PULL_UP (1 << 13) +#define OMAP_WAKEUP_EN (1 << 14) + +/* 44xx specific mux bit defines */ +#define OMAP_WAKEUP_EVENT (1 << 15) + +/* Active pin states */ +#define OMAP_PIN_OUTPUT 0 +#define OMAP_PIN_OUTPUT_PULLUP (OMAP_PIN_OUTPUT | OMAP_PULL_ENA \ + | OMAP_PULL_UP) +#define OMAP_PIN_OUTPUT_PULLDOWN (OMAP_PIN_OUTPUT | OMAP_PULL_ENA) +#define OMAP_PIN_INPUT OMAP_INPUT_EN +#define OMAP_PIN_INPUT_PULLUP (OMAP_PULL_ENA | OMAP_INPUT_EN \ + | OMAP_PULL_UP) +#define OMAP_PIN_INPUT_PULLDOWN (OMAP_PULL_ENA | OMAP_INPUT_EN) + +/* Off mode states */ +#define OMAP_PIN_OFF_NONE 0 +#define OMAP_PIN_OFF_OUTPUT_HIGH (OMAP_OFF_EN | OMAP_OFFOUT_EN \ + | OMAP_OFFOUT_VAL) +#define OMAP_PIN_OFF_OUTPUT_LOW (OMAP_OFF_EN | OMAP_OFFOUT_EN) +#define OMAP_PIN_OFF_INPUT_PULLUP (OMAP_OFF_EN | OMAP_OFF_PULL_EN \ + | OMAP_OFF_PULL_UP) +#define OMAP_PIN_OFF_INPUT_PULLDOWN (OMAP_OFF_EN | OMAP_OFF_PULL_EN) +#define OMAP_PIN_OFF_WAKEUPENABLE OMAP_WAKEUP_EN +
Signature · 1 line
1.7.5.4
PATCH v2 5/5 ARM: dts: OMAP2+: use pinctrl constants
In reply to Florian VaussardUsing constants for pinctrl allows a better readability, and remove redundancy with comments.
--- arch/arm/boot/dts/omap2.dtsi | 1 + arch/arm/boot/dts/omap3-beagle.dts | 24 ++++---- arch/arm/boot/dts/omap3-igep.dtsi | 32 +++++----- arch/arm/boot/dts/omap3.dtsi | 1 + arch/arm/boot/dts/omap4-panda-a4.dts | 6 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 50 ++++++++-------- arch/arm/boot/dts/omap4-panda-es.dts | 6 +- arch/arm/boot/dts/omap4-sdp-es23plus.dts | 6 +- arch/arm/boot/dts/omap4-sdp.dts | 94 ++++++++++++++-------------- arch/arm/boot/dts/omap4.dtsi | 1 + arch/arm/boot/dts/omap5-evm.dts | 88 +++++++++++++------------- arch/arm/boot/dts/omap5.dtsi | 1 + 12 files changed, 157 insertions(+), 153 deletions(-)
arch/arm/boot/dts/omap2.dtsi +1 -0
@@ -9,6 +9,7 @@ */ #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pinctrl/omap.h> #include "skeleton.dtsi"
arch/arm/boot/dts/omap3-beagle.dts +12 -12
@@ -81,18 +81,18 @@ hsusbb2_pins: pinmux_hsusbb2_pins { pinctrl-single,pins = < - 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ - 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ - 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ - 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ - 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ - 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ - 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ - 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ - 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ - 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ - 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ - 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + 0x5c0 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk */ + 0x5c2 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp */ + 0x5c4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir */ + 0x5c6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt */ + 0x5c8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 */ + 0x5cA (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 */ + 0x1a4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 */ + 0x1a6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 */ + 0x1a8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 */ + 0x1aa (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 */ + 0x1ac (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 */ + 0x1ae (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 */ >; }; };
arch/arm/boot/dts/omap3-igep.dtsi +16 -16
@@ -29,37 +29,37 @@ &omap3_pmx_core { uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = < - 0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0 */ - 0x14c 0 /* uart1_tx.uart1_tx OUTPUT | MODE0 */ + 0x152 (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* uart1_rx.uart1_rx */ + 0x14c (OMAP_PIN_OUTPUT |OMAP_MUX_MODE0) /* uart1_tx.uart1_tx */ >; }; uart2_pins: pinmux_uart2_pins { pinctrl-single,pins = < - 0x14a 0x100 /* uart2_rx.uart2_rx INPUT | MODE0 */ - 0x148 0 /* uart2_tx.uart2_tx OUTPUT | MODE0 */ + 0x14a (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* uart2_rx.uart2_rx */ + 0x148 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE0) /* uart2_tx.uart2_tx */ >; }; uart3_pins: pinmux_uart3_pins { pinctrl-single,pins = < - 0x16e 0x100 /* uart3_rx.uart3_rx INPUT | MODE0 */ - 0x170 0 /* uart3_tx.uart3_tx OUTPUT | MODE0 */ + 0x16e (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* uart3_rx.uart3_rx */ + 0x170 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE0) /* uart3_tx.uart3_tx */ >; }; mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < - 0x114 0x0118 /* sdmmc1_clk.sdmmc1_clk INPUT PULLUP | MODE 0 */ - 0x116 0x0118 /* sdmmc1_cmd.sdmmc1_cmd INPUT PULLUP | MODE 0 */ - 0x118 0x0118 /* sdmmc1_dat0.sdmmc1_dat0 INPUT PULLUP | MODE 0 */ - 0x11a 0x0118 /* sdmmc1_dat1.sdmmc1_dat1 INPUT PULLUP | MODE 0 */ - 0x11c 0x0118 /* sdmmc1_dat2.sdmmc1_dat2 INPUT PULLUP | MODE 0 */ - 0x11e 0x0118 /* sdmmc1_dat3.sdmmc1_dat3 INPUT PULLUP | MODE 0 */ - 0x120 0x0100 /* sdmmc1_dat4.sdmmc1_dat4 INPUT | MODE 0 */ - 0x122 0x0100 /* sdmmc1_dat5.sdmmc1_dat5 INPUT | MODE 0 */ - 0x124 0x0100 /* sdmmc1_dat6.sdmmc1_dat6 INPUT | MODE 0 */ - 0x126 0x0100 /* sdmmc1_dat7.sdmmc1_dat7 INPUT | MODE 0 */ + 0x114 (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */ + 0x116 (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */ + 0x118 (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */ + 0x11a (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */ + 0x11c (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */ + 0x11e (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */ + 0x120 (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* sdmmc1_dat4.sdmmc1_dat4 */ + 0x122 (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* sdmmc1_dat5.sdmmc1_dat5 */ + 0x124 (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* sdmmc1_dat6.sdmmc1_dat6 */ + 0x126 (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* sdmmc1_dat7.sdmmc1_dat7 */ >; }; };
arch/arm/boot/dts/omap3.dtsi +1 -0
@@ -9,6 +9,7 @@ */ #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pinctrl/omap.h> #include "skeleton.dtsi"
arch/arm/boot/dts/omap4-panda-a4.dts +3 -3
@@ -13,8 +13,8 @@ /* Pandaboard Rev A4+ have external pullups on SCL & SDA */ &dss_hdmi_pins { pinctrl-single,pins = < - 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */ - 0x5c 0x100 /* hdmi_scl.hdmi_scl INPUT | MODE 0 */ - 0x5e 0x100 /* hdmi_sda.hdmi_sda INPUT | MODE 0 */ + 0x5a (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* hdmi_cec.hdmi_cec */ + 0x5c (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* hdmi_scl.hdmi_scl */ + 0x5e (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* hdmi_sda.hdmi_sda */ >; };
arch/arm/boot/dts/omap4-panda-common.dtsi +25 -25
96 lines not on this page · raw message
arch/arm/boot/dts/omap4-panda-es.dts +3 -3
@@ -29,8 +29,8 @@ /* PandaboardES has external pullups on SCL & SDA */ &dss_hdmi_pins { pinctrl-single,pins = < - 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */ - 0x5c 0x100 /* hdmi_scl.hdmi_scl INPUT | MODE 0 */ - 0x5e 0x100 /* hdmi_sda.hdmi_sda INPUT | MODE 0 */ + 0x5a (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* hdmi_cec.hdmi_cec */ + 0x5c (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* hdmi_scl.hdmi_scl */ + 0x5e (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* hdmi_sda.hdmi_sda */ >; };
arch/arm/boot/dts/omap4-sdp-es23plus.dts +3 -3
@@ -10,8 +10,8 @@ /* SDP boards with 4430 ES2.3+ or 4460 have external pullups on SCL & SDA */ &dss_hdmi_pins { pinctrl-single,pins = < - 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */ - 0x5c 0x100 /* hdmi_scl.hdmi_scl INPUT | MODE 0 */ - 0x5e 0x100 /* hdmi_sda.hdmi_sda INPUT | MODE 0 */ + 0x5a (OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0) /* hdmi_cec.hdmi_cec */ + 0x5c (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* hdmi_scl.hdmi_scl */ + 0x5e (OMAP_PIN_INPUT | OMAP_MUX_MODE0) /* hdmi_sda.hdmi_sda */ >; };
arch/arm/boot/dts/omap4-sdp.dts +47 -47
170 lines not on this page · raw message
arch/arm/boot/dts/omap4.dtsi +1 -0
@@ -16,6 +16,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/pinctrl/omap.h> #include "skeleton.dtsi"
arch/arm/boot/dts/omap5-evm.dts +44 -44
150 lines not on this page · raw message
arch/arm/boot/dts/omap5.dtsi +1 -0
@@ -17,6 +17,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/pinctrl/omap.h> #include "skeleton.dtsi"
Signature · 1 line
1.7.5.4
PATCH v2 5/5 ARM: dts: OMAP2+: use pinctrl constants
Quoted 36 lines · Florian Vaussard
index f39b237..b3cc896 100644
arch/arm/boot/dts/omap2.dtsi +1
-0@@ -9,6 +9,7 @@ */ #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pinctrl/omap.h> #include "skeleton.dtsi"arch/arm/boot/dts/omap3-beagle.dts +5
-12@@ -81,18 +81,18 @@ hsusbb2_pins: pinmux_hsusbb2_pins { pinctrl-single,pins = < - 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ - 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ - 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ - 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ - 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ - 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ - 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ - 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ - 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ - 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ - 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ - 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + 0x5c0 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk */ + 0x5c2 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp */ + 0x5c4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir */ + 0x5c6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt */ + 0x5c8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 */
arch/arm/boot/dts/omap3-beagle.dts line 98
Quoted 10 lines
arch/arm/boot/dts/omap3-beagle.dts +7
-0+ 0x5cA (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 */ + 0x1a4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 */ + 0x1a6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 */ + 0x1a8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 */ + 0x1aa (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 */ + 0x1ac (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 */ + 0x1ae (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 */ >; }; };
Nice!
While at it, can you lowercase the USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk naming to usbb2_ulpittl_clk.usbb1_ulpiphy_clk? You can also leave out _MUXMODE from these for consistency.
I wonder if we can leave out the OMAP_ prefix from the mux mode defines here and just assume PIN_OUTPUT etc would not conflict with other SoC's naming?
Regards,
Tony
PATCH v2 5/5 ARM: dts: OMAP2+: use pinctrl constants
Hello Tony,
Thanks for your review.
Quoted 50 lines · Tony Lindgren
Quoted 36 lines · Florian Vaussard
index f39b237..b3cc896 100644
arch/arm/boot/dts/omap2.dtsi +1
-0@@ -9,6 +9,7 @@ */ #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pinctrl/omap.h> #include "skeleton.dtsi"arch/arm/boot/dts/omap3-beagle.dts +5
-12@@ -81,18 +81,18 @@ hsusbb2_pins: pinmux_hsusbb2_pins { pinctrl-single,pins = < - 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ - 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ - 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ - 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ - 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ - 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ - 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ - 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ - 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ - 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ - 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ - 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + 0x5c0 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk */ + 0x5c2 (OMAP_PIN_OUTPUT | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp */ + 0x5c4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir */ + 0x5c6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt */ + 0x5c8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 */arch/arm/boot/dts/omap3-beagle.dts line 98
Quoted 10 lines
arch/arm/boot/dts/omap3-beagle.dts +7
-0+ 0x5cA (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 */ + 0x1a4 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 */ + 0x1a6 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 */ + 0x1a8 (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 */ + 0x1aa (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 */ + 0x1ac (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 */ + 0x1ae (OMAP_PIN_INPUT_PULLDOWN | OMAP_MUX_MODE3) /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 */ >; }; };Nice!
Quoted 4 lines
While at it, can you lowercase the USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk naming to usbb2_ulpittl_clk.usbb1_ulpiphy_clk? You can also leave out
_MUXMODEfrom these for consistency.
Sure. I will send out a v3 ASAP.
Quoted 4 lines
I wonder if we can leave out the
OMAP_prefix from the mux mode defines here and just assumePIN_OUTPUTetc would not conflict with other SoC's naming?
We can avoid conflicts as long as we do not include two headers from two different arch,
which should not happen if designed with care. I will do the change.
Regards,
Florian
v2 cover ARM: dts: OMAP2+: use preprocessor for device trees
In reply to Florian VaussardQuoted 16 lines · Florian Vaussard
Hello,
Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability.
Patch 1 is a preparation for the rest of the series.
Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT.For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity.
Quoted 7 lines
Florian Vaussard (5):
ARM: dts: OMAP2+: use #include for all device trees
ARM: dts: OMAP2+: use existing constants for GPIOs
ARM: dts: OMAP4/5: use existing constants for IRQs
ARM: dts: OMAP2+: header file for pinctrl constants
ARM: dts: OMAP2+: use pinctrl constants
I just quickly scanned the series and patches looks good to my eyes. Its a nice clean-up to align OMAP dts files with others.
FWIW,
v2 cover ARM: dts: OMAP2+: use preprocessor for device trees
Hello Santosh,
Thank you for your review.
Quoted 24 lines · Santosh Shilimkar
Quoted 16 lines · Florian Vaussard
Hello,
Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability.
Patch 1 is a preparation for the rest of the series.
Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT.For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity.
Quoted 7 lines
Florian Vaussard (5):
ARM: dts: OMAP2+: use #include for all device trees
ARM: dts: OMAP2+: use existing constants for GPIOs
ARM: dts: OMAP4/5: use existing constants for IRQs
ARM: dts: OMAP2+: header file for pinctrl constants
ARM: dts: OMAP2+: use pinctrl constants
Quoted 7 lines
I just quickly scanned the series and patches looks good to my eyes. Its a nice clean-up to align OMAP dts files with others.
FWIW,
I will send a v3 with minor changes to address Tony's comments, with your Ack if ok for you.
Regards,
Florian
v2 cover ARM: dts: OMAP2+: use preprocessor for device trees
In reply to Florian VaussardQuoted 6 lines · Florian Vaussard
Hello,
Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability.
Quoted 7 lines
Patch 1 is a preparation for the rest of the series.
Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT.For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity.
The series briefly,
v2 cover ARM: dts: OMAP2+: use preprocessor for device trees
Quoted 12 lines · Stephen Warren
Quoted 11 lines · Florian Vaussard
Hello,
Following a similar proposal by Stephen Warren for tegra [1], this series makes use of the C preprocessor when compiling OMAP DT files, and accomplishes some improvements to improve overall readability.
Patch 1 is a preparation for the rest of the series.
Patch 2 uses existing constants for GPIOs. Patch 3 does the same for IRQs. Patch 4 creates a new header for OMAP's padmux, and patch 5 uses it to simplify pinctrl DT.
Quoted 7 lines
Quoted 2 lines
For all targets, the .dtb files were diff-tested before and after applying the series to guarantee identity.
The series briefly,
Reviewed-by Stephen Warren <[email protected]>
Thank you. FYI, I posted a v3 addressing Tony's comments [1].
Regards,
Florian
[1] http://thread.gmane.org/gmane.linux.ports.arm.omap/98320