ubuntu-rockchip icon indicating copy to clipboard operation
ubuntu-rockchip copied to clipboard

[RK3566] Correct DT Overlay for PWM in Radxa 3W

Open eshcheglov opened this issue 8 months ago • 4 comments

Hello, Mr. Joshua,

I have been trying to understand how the Device Tree Overlay for PWM works on the Radxa 3W board in recent days.

I know it works correctly in the official Radxa distribution called radxa-zero3_debian_bullseye_xfce_b6.img.xz. For this, I simply need to enable the DT Overlay named rk3568-pwm9-m0.dtbo and a directory named pwmchip9 appears in /sys/class/pwm.

I see that in your distribution, all PWM DTO's for the rk3568 chip are disabled (just not present) (I checked here: https://github.com/Joshua-Riek/linux-rockchip/blob/noble/arch/arm64/boot/dts/rockchip/overlay/Makefile).

I have tried the following approaches:

  1. I took the official DTS from Radxa, compiled it into .dtbo, and enabled it. As a result, the PWM works, but it has an incorrect name (pwmchip0 instead of pwmchip9). If I enable PWM9 and PWM8 simultaneously, they appear with incorrect names pwmchip0 and pwmchip1, respectively. However, the PWM functions themselves work correctly.

  2. I tried taking the .dtbo from the Radxa distribution and connecting it to your distribution. The result is the same.

  3. I tried decompiling the DTBO into DTS in the Radxa distribution and then compiling it back from that DTS into DTBO in your distribution. The result is the same.

I also noticed that in all cases, the binary diff does not see any differences between these DTBOs. So, I can assume that the problem lies elsewhere.

I would like to make a merge request to your kernel that adds all PWMs for the Radxa 3W, but until I resolve the issue with incorrect naming, I cannot do so.

Do you have any ideas about what might be causing the incorrect directory naming?

Thank you.

eshcheglov avatar Jun 14 '24 09:06 eshcheglov