/pwmleds/pwm1: arguments longer than property

We work with a Demo Image and added our own layers.
In the layer “meta-cobra-apalis-imx6” there is the recipe “linux-toradex” where we have the file “imx6q-apalis-cobra.dts”.
Appended you find from bitbake the “console-latest.log”.
Then we can install with “Toradex Easy Installer”.
When booting the installed image we see that the DeviceTree could not be correct loaded. The whole booting output is attached.

console-latest.log (29.3 KB)
DeviceTreeError.txt (25.4 KB)
MyYoctoLayers.tar.xz (10.5 KB)

There you can see:

[    2.172180] OF: /pwmleds/pwm1: arguments longer than property
[    2.178023] of_pwm_get(): can't parse "pwms" property
[    2.183122] leds_pwm pwmleds: unable to request PWM for cobra::pwm1: -22
[    2.189883] leds_pwm: probe of pwmleds failed with error -22

What is wrong with my layer

Regards
ah4711

Hi @ah4711 ,

thanks for using our community.

We are looking into your question.

Best Regards
Kevin

Hi @ah4711 ,

I noticed a conflict in assigning the pins to the corresponding functions.

[    5.829428] imx6q-pinctrl 20e0000.iomuxc: pin MX6Q_PAD_NANDF_D4 already requested by 20e0000.iomuxc; cannot claim for spi0.0
[    5.840838] imx6q-pinctrl 20e0000.iomuxc: pin-195 (spi0.0) status -22
[    5.847385] imx6q-pinctrl 20e0000.iomuxc: could not request pin 195 (MX6Q_PAD_NANDF_D4) from group gpio2io04grp  on device 20e0000.iomuxc
[    5.859811] mcp251x spi0.0: Error applying setting, reverse things back
[    5.866597] mcp251x: probe of spi0.0 failed with error -22

Are you planning to use the SPI interface in your application? If not, then you might consider disabling the Interface to prevent the conflict.

Best Regards
Kevin

Hi Kevin

Yes that is true with this conflict, but that is not really the problem. It is as above mentioned the “/pwmleds/pwm1: arguments longer than property”.
Is it possible, that the used linux-kernel is not compatible with this configuration in the DeviceTree?

Regards
ah4711

Hi @ah4711 ,

could you please provide the kernel configuration you have been using?

BR
Kevin

What exactly do you need?
In the attached MyYoctoLayers you see our changes on top of your toradex-linux-kernel layers.

Hi @ah4711 ,

could you do the changes to the kernel branch outside the openembedded build, and check if you still see the issue? If the issue is present please provide a git diff to the kernel branch.

Best Regards
Kevin

Hi Kevin

All changes are already outside the openembedded build. For that reason we made our own layers (see the attached MyYoctoLayers.tar.gz). The original layers are untouched.

I think that’s the way to go.

Regards
ah4711

Hi @ah4711

It looks like that there is a typo in your devicetree. According to Documentation (leds-pwm.txt), there should be three entries and not 4 as you wrote

LED sub-node properties:

  • pwms : PWM property to point to the PWM device (phandle)/port (id) and to
    specify the period time to be used: <&phandle id period_ns>;

Your devicetree:
led1 {
label = “PWM1”;
pwms = <&pwm1 1 50000 0>;
max-brightness = <255>;
};

It should be:

led1 {
label = “PWM1”;
pwms = <&pwm1 1 500000>;
max-brightness = <255>;
};

Best regards,
Jaski

Hi Jaski

Thank you for your hint.
But I tried that already and it did not function.

Regards
ah4711

Hi @ah4711

I tested with these changes in devicetree and it is working.

diff --git a/arch/arm/boot/dts/imx6q-apalis-eval.dts b/arch/arm/boot/dts/imx6q-apalis-eval.dts
index 3ac59ca1d061..dcffcfa7a3ca 100644
--- a/arch/arm/boot/dts/imx6q-apalis-eval.dts
+++ b/arch/arm/boot/dts/imx6q-apalis-eval.dts
@@ -64,6 +64,15 @@
                regulator-always-on;
        };
 
+       pwmleds {
+               compatible = "pwm-leds";
+               led1 {
+                       label = "PWM1";
+                       pwms = <&pwm1 0 5000000 0>;
+                       max-brightness = <255>;
+               };
+       };
+
 };
 
 &can1 {

Did you build it with Poky zeus or dunfell?
Because of QT we are stuck on zeus,

I tested this with Dunfell, I can also check with Bsp 3.0.4.
Best regards,
Jaski