[PATCH v1] ARM: dts: imx: Fix iMX6QDL DHCOM PDK2 DTC Warnings

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Currently, compiling any i.MX 6 based target results in the following warning:
w+arch/arm/dts/imx6q-dhcom-pdk2.dtb: Warning (pwms_property): /display-bl:pwms: cell 3 is not a phandle reference w+arch/arm/dts/imx6q-dhcom-pdk2.dtb: Warning (pwms_property): /display-bl: Missing property '#pwm-cells' in node /soc/bus@2000000/gpc@20dc000 or bad phandle (referred from pwms[3]) w+arch/arm/dts/imx6dl-dhcom-pdk2.dtb: Warning (pwms_property): /display-bl:pwms: cell 3 is not a phandle reference w+arch/arm/dts/imx6dl-dhcom-pdk2.dtb: Warning (pwms_property): /display-bl: Missing property '#pwm-cells' in node /soc/bus@2000000/gpc@20dc000 or bad phandle (referred from pwms[3])
This is due to the imx6qdl-dhcom-pdk2.dtsi using a later pwm-cells of 3 (e.g. the one with the last cell indicating whether or not it is inverted) then what U-Boot's current imx6qdl.dtsi has. Unfortunately, fixing aka synchronising that one as well would lead to further issues:
w+arch/arm/dts/imx6dl-aristainetos2c_cslb_7.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-brppt2.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-cubox-i.dtb: Warning (pwms_property): /pwmleds/front:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-aristainetos2c_7.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-cubox-i-emmc-som-v15.dtb: Warning (pwms_property): /pwmleds/front:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-cubox-i-som-v15.dtb: Warning (pwms_property): /pwmleds/front:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-icore.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-icore-mipi.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-sabreauto.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6dl-sabresd.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-cubox-i.dtb: Warning (pwms_property): /pwmleds/front:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-cubox-i-emmc-som-v15.dtb: Warning (pwms_property): /pwmleds/front:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-cubox-i-som-v15.dtb: Warning (pwms_property): /pwmleds/front:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-icore.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-icore-mipi.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-logicpd.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-novena.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-phytec-mira-rdk-nand.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-sabreauto.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6q-sabresd.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6qp-sabreauto.dtb: Warning (pwms_property): /backlight:pwms: property size (12) too small for cell size 3 w+arch/arm/dts/imx6qp-sabresd.dtb: Warning (pwms_property): /backlight-lvds:pwms: property size (12) too small for cell size 3
Messing with all those so late in the game does not seem like too good of an idea. Therefore, I suggest reverting just that one PWM node for now. We may (and really should) properly synchronise all i.MX 6 DTs again in the next cycle.
Fixes: 8ed378ff78d1 ("ARM: dts: imx: Synchronize iMX6QDL DHCOM PDK2 DTs with Linux 5.15.12") Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com
---
arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi index bf6b3a5ce0..9dcb37ec7e 100644 --- a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi +++ b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi @@ -25,7 +25,7 @@ compatible = "pwm-backlight"; default-brightness-level = <8>; enable-gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; /* GPIO G */ - pwms = <&pwm1 0 50000 PWM_POLARITY_INVERTED>; + pwms = <&pwm1 0 50000>; status = "okay"; };

On 4/27/22 00:29, Marcel Ziswiler wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Currently, compiling any i.MX 6 based target results in the following warning:
Oh no.
[...]
arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi index bf6b3a5ce0..9dcb37ec7e 100644 --- a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi +++ b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi @@ -25,7 +25,7 @@ compatible = "pwm-backlight"; default-brightness-level = <8>; enable-gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; /* GPIO G */
pwms = <&pwm1 0 50000 PWM_POLARITY_INVERTED>;
pwms = <&pwm1 0 50000>;
I think just pick Linux
fa28d8212ede ("ARM: dts: imx: default to #pwm-cells = <3> in the SoC dtsi files")
That should fix it.

On Wed, Apr 27, 2022 at 12:56:31AM +0200, Marek Vasut wrote:
On 4/27/22 00:29, Marcel Ziswiler wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Currently, compiling any i.MX 6 based target results in the following warning:
Oh no.
[...]
arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi index bf6b3a5ce0..9dcb37ec7e 100644 --- a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi +++ b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi @@ -25,7 +25,7 @@ compatible = "pwm-backlight"; default-brightness-level = <8>; enable-gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; /* GPIO G */
pwms = <&pwm1 0 50000 PWM_POLARITY_INVERTED>;
pwms = <&pwm1 0 50000>;
I think just pick Linux
fa28d8212ede ("ARM: dts: imx: default to #pwm-cells = <3> in the SoC dtsi files")
We've just done -rc1, there should be time for re-syncing things.

On Wed, 2022-04-27 at 00:56 +0200, Marek Vasut wrote:
On 4/27/22 00:29, Marcel Ziswiler wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Currently, compiling any i.MX 6 based target results in the following warning:
Oh no.
[...]
arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi index bf6b3a5ce0..9dcb37ec7e 100644 --- a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi +++ b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi @@ -25,7 +25,7 @@ compatible = "pwm-backlight"; default-brightness-level = <8>; enable-gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; /* GPIO G */ - pwms = <&pwm1 0 50000 PWM_POLARITY_INVERTED>; + pwms = <&pwm1 0 50000>;
I think just pick Linux
fa28d8212ede ("ARM: dts: imx: default to #pwm-cells = <3> in the SoC dtsi files")
That should fix it.
Yes, and breaks everything else.

On 4/27/22 01:04, Marcel Ziswiler wrote:
On Wed, 2022-04-27 at 00:56 +0200, Marek Vasut wrote:
On 4/27/22 00:29, Marcel Ziswiler wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Currently, compiling any i.MX 6 based target results in the following warning:
Oh no.
[...]
arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi index bf6b3a5ce0..9dcb37ec7e 100644 --- a/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi +++ b/arch/arm/dts/imx6qdl-dhcom-pdk2.dtsi @@ -25,7 +25,7 @@ compatible = "pwm-backlight"; default-brightness-level = <8>; enable-gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; /* GPIO G */ - pwms = <&pwm1 0 50000 PWM_POLARITY_INVERTED>; + pwms = <&pwm1 0 50000>;
I think just pick Linux
fa28d8212ede ("ARM: dts: imx: default to #pwm-cells = <3> in the SoC dtsi files")
That should fix it.
Yes, and breaks everything else.
Ouch ... so what did Linux do about that breakage ?
btw the polarity flag is correct, the PWM is really inverted.

Hi Marek,
On Tue, Apr 26, 2022 at 8:55 PM Marek Vasut marex@denx.de wrote:
Ouch ... so what did Linux do about that breakage ?
Linux treats the third pwm cell as optional.
Please see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h...
It seems we need of_pwm_xlate_with_flags() ported to U-Boot.
Thanks

Hi Marcel,
On Tue, Apr 26, 2022 at 7:29 PM Marcel Ziswiler marcel@ziswiler.com wrote:
Messing with all those so late in the game does not seem like too good of an idea. Therefore, I suggest reverting just that one PWM node for now. We may (and really should) properly synchronise all i.MX 6 DTs again in the next cycle.
I did an attempt to sync the imx6 dts with Linux and generated the attached patch.
It builds the dtb's cleanly.
Boot tested only on a imx6q-sabresd.
I can send it after 2022.07 is released.
Regards,
Fabio Estevam

On 4/27/22 04:49, Fabio Estevam wrote:
Hi Marcel,
On Tue, Apr 26, 2022 at 7:29 PM Marcel Ziswiler marcel@ziswiler.com wrote:
Messing with all those so late in the game does not seem like too good of an idea. Therefore, I suggest reverting just that one PWM node for now. We may (and really should) properly synchronise all i.MX 6 DTs again in the next cycle.
I did an attempt to sync the imx6 dts with Linux and generated the attached patch.
It builds the dtb's cleanly.
Boot tested only on a imx6q-sabresd.
I can send it after 2022.07 is released.
We're in rc1, there is still time to get things synced for 2022.07, so just send it.

On Wed, Apr 27, 2022 at 09:53:51AM +0200, Marek Vasut wrote:
On 4/27/22 04:49, Fabio Estevam wrote:
Hi Marcel,
On Tue, Apr 26, 2022 at 7:29 PM Marcel Ziswiler marcel@ziswiler.com wrote:
Messing with all those so late in the game does not seem like too good of an idea. Therefore, I suggest reverting just that one PWM node for now. We may (and really should) properly synchronise all i.MX 6 DTs again in the next cycle.
I did an attempt to sync the imx6 dts with Linux and generated the attached patch.
It builds the dtb's cleanly.
Boot tested only on a imx6q-sabresd.
I can send it after 2022.07 is released.
We're in rc1, there is still time to get things synced for 2022.07, so just send it.
Yes, please! These dts files should be getting re-synced regularly.
participants (5)
-
Fabio Estevam
-
Marcel Ziswiler
-
Marcel Ziswiler
-
Marek Vasut
-
Tom Rini