Jump to content

Rock-5b PWM


lurk101

Recommended Posts

With

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
1

How do I figure out its header pin assignment?

 

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

Edited by lurk101
spelling
Link to comment
Share on other sites

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
verbosity=1
bootlogo=true
overlay_prefix=rockchip-rk3588
fdtfile=rockchip/rk3588-rock-5b.dtb
rootdev=UUID=e267943c-66ea-4d3c-b857-3a7208b48df4
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

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

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.

Guest
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.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines