AnsweredAssumed Answered

IMX6ULL pwm clock configuration missing in official device tree

Question asked by Arnout Diels on Dec 13, 2017
Latest reply on Dec 18, 2017 by Arnout Diels

Hi,

The imx6ull.dtsi file in the linux kernel, there exists the following section:

 

pwm5: pwm@020f0000 {
compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";
reg = <0x020f0000 0x4000>;
interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_DUMMY>,
<&clks IMX6UL_CLK_DUMMY>;
clock-names = "ipg", "per";
#pwm-cells = <2>;
};


While in the imx6ul.dtsi, this looks like this:

 

pwm5: pwm@020f0000 {
compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";
reg = <0x020f0000 0x4000>;
interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_PWM5>,
<&clks IMX6UL_CLK_PWM5>;
clock-names = "ipg", "per";
#pwm-cells = <2>;
status = "disabled";
};

 


I do not understand why many pwm clocks are missing in the ULL device tree.
As can be seen on the datasheet from the ULL (https://www.nxp.com/docs/en/data-sheet/IMX6ULLCEC.pdf), there are versions that have to support the 8 PWM's.


Note that the effect of not putting this in the imx6ull.dtsi, is that without explicitly configuring them in the upper device tree:

- The relevant PWM clock will be disabled by linux at the end of the boot process (disable_unused_clocks) (unless the clk_ignore_unused flag in the cmdline is passed)
- If the pwm was activated at boot, any subsequent change (e.g. through sysfs, or even at reboot) will cause a read from the hardware control register of the unclocked periperhal. This completely freezes the CPU.


The current workaround I have to use in my own board's dts file is:

 

&pwm5 {
pinctrl-names = "default";
clocks = <&clks IMX6UL_CLK_PWM5>,
<&clks IMX6UL_CLK_PWM5>;
clock-names = "ipg", "per";
pinctrl-0 = <&pinctrl_pwm5>;
status = "okay";
};

 

I hope this gets fixed soon, so that nobody else bumps into this unexpected issue

Outcomes