Device Tree Configuration

The PWM device tree source code is stored under the ptc node in the file of jh7110.dts.

The following code block provides more detail.
        ptc: pwm@120d0000 {
            compatible = "starfive,pwm";
            reg = <0x0 0x120d0000 0x0 0x10000>;
            reg-names = "control";
            clocks = <&clkgen JH7110_PWM_CLK_APB>;
            resets = <&rstgen RSTN_U0_PWM_8CH_APB>;
            starfive,approx-freq = <2000000>;
            #pwm-cells=<3>;
            starfive,npwm = <8>;
            status = "disabled";
        };
The following list provides more descriptions for the configuration bits.
  • compatible: Compatibility information, used to associate the driver and its target device.
  • reg: Register base address "0x120d0000" and range "0x10000".
  • reg-names: The names of the registers used by the PWM module.
  • clocks: The clocks used by the PWM module.
  • resets: The reset signals used by the PWM module.
  • interrupts: Hardware interrupt ID.
  • approx-frequency: Edit this bit to configure the approximate frequency of PWM.
  • status: The work status of the PWM module. To enable the module, set this bit as "okay" or to disable the module, set this bit as "disabled".