pwm1 didn't work

Hi,

I’ve tried to use pwm1 but fail, our carrier board use the same pin (H52) as pwm1 function too.

In our devicetree, I simply set &tegra_pwm1 { status = okay; }; and I can find it at /sys/class/devices.

The following steps for testing pwm1:

  1. cd /sys/class/pwm/pwmchip0
  2. echo 0 > export
  3. cd pwm0
  4. echo 1000000 > period
  5. echo 500000 > duty_clock
  6. echo 1 > enable
    After that, I still don’t see any signals at my Oscilloscope(monitoring pin H52), please help us.

thanks,

hello evanic.chen,

according to NVIDIA Jetson AGX Xavier GPIO Header Pinout, you’re using GPIO27_PWM2.
could you please have an alternative way to control it as GPIO pin.
thanks

$ cd /sys/class/gpio
$ echo 393 > export
$ cd gpio393

Hi Jerry,

Do I need to set H52 back to gpio function ?

thanks,

Hi Jerry,

I didn’t set H52 back to gpio and I follow your step, I set direction as output and when I echo 1 to value,
it at low, when I echo 0 to value, it at high(3.3v)

thanks,

Hi,

I tried the pwm-fan on demo carrier board, when the temperature rises to 50 degrees then fan start to run. So I check the register value of pwm4 by cat /sys/kernel/debug/tegra_pinctrl_reg | grep pwm4, I found the value of it was 0x00000400 but the value of soc_gpio54_pn1 was 0x00000054. Does it mean that pin H52 didn’t set to pwm function ?

I install busybox and use the following command to try to make the value of register of pwm1 as same as pwm4.

busybox devmem 0x02440020 32 0x00000400

And then I test the pwmchip0 as I describe before again, but I still can’t get any signals at my Oscilloscope.

Any update ?

thanks

hello evanic.chen,

please apply below two kernel patches in the attachment, Topic1049335_Apr17.tar.gz
thanks
Topic1049335_Apr17.tar.gz (1.51 KB)

evanic.chen,

I also wonder if you need to change the pinmux of soc_gpio54_pn1. It seems being set to rsvd in jetpack release.

pinmux.0x02440020 = 0x00000414; # soc_gpio54_pn1: rsvd0, pull-down, tristate-enable, input-disable

Hi,

I’ve tried the new patch, it didn’t work.

Recent finds that if I set register 0x02440020 to 0x00000402, pwm function works. But if I modified the value of 0x02440020 at tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg. When kernel boot, the system will crash, I guess this pin can’t be set to pwm before kernel boot, maybe some driver use it as gpio ?

Thanks