Jump to content

Rock-5b PWM


Recommended Posts


Linux rock-5b 5.10.72-rockchip-rk3588 #trunk.0102 SMP Sat Nov 5 07:56:18 UTC 2022 aarch64 GNU/Linux

I see only one PWM controller

pi@rock-5b:~$ ls /sys/class/pwm/pwmchip1/
device  export  npwm  power  subsystem  uevent  unexport
pi@rock-5b:~$ cat /sys/class/pwm/pwmchip1/npwm

How do I figure out its header pin assignment?


Is there a device tree overlay to expose all 4 PWM controllers?

Edited by lurk101
Link to comment
Share on other sites

Search Before Posting!

Ok, looking at available overlays

pi@rock-5b:~$ ls /boot/dtb/rockchip/overlay/*pwm*
/boot/dtb/rockchip/overlay/rk3588-pwm12-m0.dtbo  /boot/dtb/rockchip/overlay/rk3588-pwm15-m3.dtbo
/boot/dtb/rockchip/overlay/rk3588-pwm13-m0.dtbo  /boot/dtb/rockchip/overlay/rk3588-pwm2-m1.dtbo
/boot/dtb/rockchip/overlay/rk3588-pwm13-m2.dtbo  /boot/dtb/rockchip/overlay/rk3588-pwm3-m1.dtbo
/boot/dtb/rockchip/overlay/rk3588-pwm14-m0.dtbo  /boot/dtb/rockchip/overlay/rk3588-pwm5-m2.dtbo
/boot/dtb/rockchip/overlay/rk3588-pwm14-m1.dtbo  /boot/dtb/rockchip/overlay/rk3588-pwm6-m2.dtbo
/boot/dtb/rockchip/overlay/rk3588-pwm15-m0.dtbo  /boot/dtb/rockchip/overlay/rk3588-pwm7-m3.dtbo
/boot/dtb/rockchip/overlay/rk3588-pwm15-m1.dtbo  /boot/dtb/rockchip/overlay/rk3588-pwm8-m0.dtbo

These seem to match the pin functions identified in the raxda rock-5b gpio pinout.


Looking at the armbianEnv file

pi@rock-5b:~$ cat /boot/armbianEnv.txt

If the overlay prefix 'rockchip-rk3588' is a prefix to dtbo files named in overlays= statement then how is it possible to add these dtbo files as overlay.


Or, are these not compatible?

Edited by lurk101
Link to comment
Share on other sites

Here's what helped me with getting UARTs working. I haven't tried PWMs, but hope it should work for you as well.


sudo mkdir /boot/overlay-user/
sudo cp /boot/dtb-5.10.110-rockchip-rk3588/rockchip/overlay/rk3588-*.dtbo /boot/overlay-user/


And then add name(s) of the needed *.dtbo file(s) to the `/boot/armbianEnv.txt` and reboot.


user_overlays=rk3588-uart2-m0 rk3588-uart7-m2


Link to comment
Share on other sites

In the mean time I had to rename the DTBO files from rock3588-....dtbo to rockchip-rk3588-....dtbo so that they could be used in arbianEnv.txt in the overlays= specification. Works fine for UART and PWM.

Link to comment
Share on other sites

@Efe Çetin How does you PR finally resolve the issue? Rename all the .dtbo files, or change the overlay-prefix?


BTW, the pd-max-voltage-12v.dtbo for forcing a PD supply negotiation to 12V instead of a default 20V also works well when renamed appropriately.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...