This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] TDA4VM: DRA829V: J721E: How to enable EHRPWM on J7 EVM using Linux

Part Number: TDA4VM

Multiple instances of EHPWM are present on TDA4VM. How to enable them on PSDKLA?

  • diff --git a/arch/arm64/boot/dts/ti/k3-j721e-main.dtsi b/arch/arm64/boot/dts/ti/k3-j721e-main.dtsi
    index 8675a4887..619532f9e 100644
    --- a/arch/arm64/boot/dts/ti/k3-j721e-main.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-j721e-main.dtsi
    @@ -71,8 +71,74 @@
                            #mux-control-cells = <1>;
                            mux-reg-masks = <0x4000 0x8000000>, /* USB0 to SERDES0/3 mux */
                                            <0x4010 0x8000000>; /* USB1 to SERDES1/2 mux */
    -           };
    +               };
    +
    +               tbclk_ctrl: tbclk_ctrl@4140 {
    +                       compatible = "syscon";
    +                       reg = <0x4140 0x18>;
    +               };
    +       };
    +
    +       ehrpwm_tbclk: clk0 {
    +               compatible = "ti,am654-ehrpwm-tbclk";
    +               #clock-cells = <1>;
    +               ti,tbclk-syscon = <&tbclk_ctrl>;
    +       };
    +
    +       ehrpwm0: pwm@3000000 {
    +               compatible = "ti,am654-ehrpwm", "ti,am3352-ehrpwm";
    +               #pwm-cells = <3>;
    +               reg = <0x0 0x3000000 0x0 0x100>;
    +               power-domains = <&k3_pds 83 TI_SCI_PD_EXCLUSIVE>;
    +               clocks = <&ehrpwm_tbclk 0>, <&k3_clks 83 0>;
    +               clock-names = "tbclk", "fck";
    +       };
    +
    +       ehrpwm1: pwm@3010000 {
    +               compatible = "ti,am654-ehrpwm", "ti,am3352-ehrpwm";
    +               #pwm-cells = <3>;
    +               reg = <0x0 0x3010000 0x0 0x100>;
    +               power-domains = <&k3_pds 84 TI_SCI_PD_EXCLUSIVE>;
    +               clocks = <&ehrpwm_tbclk 1>, <&k3_clks 84 0>;
    +               clock-names = "tbclk", "fck";
    +       };
    +
    +       ehrpwm2: pwm@3020000 {
    +               compatible = "ti,am654-ehrpwm", "ti,am3352-ehrpwm";
    +               #pwm-cells = <3>;
    +               reg = <0x0 0x3020000 0x0 0x100>;
    +               power-domains = <&k3_pds 85 TI_SCI_PD_EXCLUSIVE>;
    +               clocks = <&ehrpwm_tbclk 2>, <&k3_clks 85 0>;
    +               clock-names = "tbclk", "fck";
    +       };
    +
    +       ehrpwm3: pwm@3030000 {
    +               compatible = "ti,am654-ehrpwm", "ti,am3352-ehrpwm";
    +               #pwm-cells = <3>;
    +               reg = <0x0 0x3030000 0x0 0x100>;
    +               power-domains = <&k3_pds 86 TI_SCI_PD_EXCLUSIVE>;
    +               clocks = <&ehrpwm_tbclk 3>, <&k3_clks 86 0>;
    +               clock-names = "tbclk", "fck";
    +       };
    +
    +       ehrpwm4: pwm@3040000 {
    +               compatible = "ti,am654-ehrpwm", "ti,am3352-ehrpwm";
    +               #pwm-cells = <3>;
    +               reg = <0x0 0x3040000 0x0 0x100>;
    +               power-domains = <&k3_pds 87 TI_SCI_PD_EXCLUSIVE>;
    +               clocks = <&ehrpwm_tbclk 4>, <&k3_clks 87 0>;
    +               clock-names = "tbclk", "fck";
    +       };
    +
    +       ehrpwm5: pwm@3050000 {
    +               compatible = "ti,am654-ehrpwm", "ti,am3352-ehrpwm";
    +               #pwm-cells = <3>;
    +               reg = <0x0 0x3050000 0x0 0x100>;
    +               power-domains = <&k3_pds 88 TI_SCI_PD_EXCLUSIVE>;
    +               clocks = <&ehrpwm_tbclk 5>, <&k3_clks 88 0>;
    +               clock-names = "tbclk", "fck";
            };
    + };

    All the 6 instances are enabled as part of the above patch.

    All the CONFIGs related to EHRPWM are already enabled. So by adding the above DT nodes
    one should be able to look at the sysfs nodes.

    Best Regards,
    Keerthy

  • The dts node representation for ehrpwm_tbclk is different on 5.10 kernel. Sent you the new dtbs, you can try with those.

    New representation should look like this,

    https://git.ti.com/gitweb?p=ti-linux-kernel/ti-linux-kernel.git;a=blob;f=arch/arm64/boot/dts/ti/k3-am65-main.dtsi;h=0b229fe9d2bc440c09447f2cea9fbc293d27aef9;hb=refs/heads/ti-linux-5.10.y#l350

    Regards,
    Keerthy