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.

Linux/AM3352: PWM driver in U-boot

Part Number: AM3352

Tool/software: Linux

We are using Beaglbone black based custom board. We have LEDs connected on the PWM lines.

We are updating our U-Boot from version 2013 to 2017.01. In general there is PWM driver support in U-Boot.

Why pwm driver is not available for am335x in U-Boot code ? Is there a specific reason for same ?

Any future plans for adding pwm driver in U-Boot ?

Thanks,

Regards,

Ankur

  • Hi Ankur,

    I see we have Timer driver in u-boot, and AM335x Timer module can be used for PWM:

    u-boot-2017.01/arch/arm/dts/am33xx.dtsi

    u-boot-2017.01/drivers/timer/omap-timer.c

    Also I see AM335x eCAP module is used in PWM mode for AM335x EVM and SK boards:

    u-boot-2017.01/arch/arm/dts/am335x-evm.dts
    u-boot-2017.01/arch/arm/dts/am335x-evmsk.dts

    u-boot-2017.01/drivers/video/pwm_backlight.c

    &epwmss2 {
    status = "okay";

    ecap2: ecap@48304100 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&ecap2_pins>;
    };
    };

    backlight {
    compatible = "pwm-backlight";
    pwms = <&ecap2 0 50000 PWM_POLARITY_INVERTED>;
    brightness-levels = <0 58 61 66 75 90 125 170 255>;
    default-brightness-level = <8>;
    };

    ecap2_pins: backlight_pins {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x99c, MUX_MODE4) /* mcasp0_ahclkr.ecap2_in_pwm2_out */
    >;
    };


    Regards,
    Pavel
  • You can also explore how pxm2 AM335x board is using eCAP module for PWM:

    u-boot-2017.01/arch/arm/include/asm/arch-am33xx/cpu.h
    u-boot-2017.01/board/siemens/pxm2/board.c

    See also below e2e threads:




    Regards,
    Pavel