mbox series

[0/2] arm64: dts: rockchip: Add pwm nodes for RK3528

Message ID 20250307120004.959980-1-amadeus@jmu.edu.cn (mailing list archive)
Headers show
Series arm64: dts: rockchip: Add pwm nodes for RK3528 | expand

Message

Chukun Pan March 7, 2025, noon UTC
Add pwm nodes for RK3528. Most rk3528 boards use pwm-regulator to
supply to CPU, add node to enable them. The PWM core on RK3528 is
the same as RK3328, but the driver doesn't support interrupts yet.

Unlike other SoCs, pinctrl-names need to be in "active" state,
I'm not sure about this, but otherwise the pwm-regulator will
not work properly.

---
vdd_arm: regulator-vdd-arm {
	compatible = "pwm-regulator";
	pwms = <&pwm1 0 5000 1>;
	pwm-supply = <&vcc5v0_sys>;
	regulator-name = "vdd_arm";
	regulator-min-microvolt = <746000>;
	regulator-max-microvolt = <1201000>;
	regulator-always-on;
	regulator-boot-on;
	regulator-settling-time-up-us = <250>;
};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&pwm1 {
	status = "okay";
};
---

Chukun Pan (2):
  dt-bindings: pwm: rockchip: Add rockchip,rk3528-pwm
  arm64: dts: rockchip: Add pwm nodes for RK3528

 .../devicetree/bindings/pwm/pwm-rockchip.yaml |  1 +
 arch/arm64/boot/dts/rockchip/rk3528.dtsi      | 88 +++++++++++++++++++
 2 files changed, 89 insertions(+)

Comments

Heiko Stuebner March 12, 2025, 7:45 a.m. UTC | #1
On Fri, 07 Mar 2025 20:00:02 +0800, Chukun Pan wrote:
> Add pwm nodes for RK3528. Most rk3528 boards use pwm-regulator to
> supply to CPU, add node to enable them. The PWM core on RK3528 is
> the same as RK3328, but the driver doesn't support interrupts yet.
> 
> Unlike other SoCs, pinctrl-names need to be in "active" state,
> I'm not sure about this, but otherwise the pwm-regulator will
> not work properly.
> 
> [...]

Applied, thanks!

[2/2] arm64: dts: rockchip: Add pwm nodes for RK3528
      commit: 2973d077aedfc114affab96c3b2c7286163cc8c9

Best regards,
Jonas Karlman March 12, 2025, 2 p.m. UTC | #2
Hi Heiko,

On 2025-03-12 08:45, Heiko Stuebner wrote:
> 
> On Fri, 07 Mar 2025 20:00:02 +0800, Chukun Pan wrote:
>> Add pwm nodes for RK3528. Most rk3528 boards use pwm-regulator to
>> supply to CPU, add node to enable them. The PWM core on RK3528 is
>> the same as RK3328, but the driver doesn't support interrupts yet.
>>
>> Unlike other SoCs, pinctrl-names need to be in "active" state,
>> I'm not sure about this, but otherwise the pwm-regulator will
>> not work properly.
>>
>> [...]
> 
> Applied, thanks!

The pinctrl-names should be changed to "default" and not "active",
something you can fixup or do you want a patch?

In commit 96d8d3253246 ("arm64: dts: rockchip: Fix PWM pinctrl names")
similar issue was corrected for current rockchip boards.

Regards,
Jonas

> 
> [2/2] arm64: dts: rockchip: Add pwm nodes for RK3528
>       commit: 2973d077aedfc114affab96c3b2c7286163cc8c9
> 
> Best regards,
Heiko Stuebner March 12, 2025, 7:38 p.m. UTC | #3
Am Mittwoch, 12. März 2025, 16:00:00 MEZ schrieb Jonas Karlman:
> Hi Chukun,
> 
> On 2025-03-12 15:35, Chukun Pan wrote:
> > Hi,
> > 
> >> The pinctrl-names should be changed to "default" and not "active",
> >> something you can fixup or do you want a patch?

so yes of course the pinctrl needs to be default - simply because
that's the only pinctrl state mainline supports.

But judging by the fact that you're discussing working vs. non-working
below, can you please check if we should drop the patch for 6.15 till
that is solved?

Thanks a lot
Heiko

> > Sorry I've been a bit busy this week and forgot to send the v2 patch.
> > In rk3528.dtsi, the uart and upcoming i2c nodes do not have pinctrl,
> > so I prefer to remove them.
> > 
> >>> Unlike other SoCs, pinctrl-names need to be in "active" state,
> >>> I'm not sure about this, but otherwise the pwm-regulator will
> >>> not work properly.
> > 
> > BTW, setting the pinctrl of pwm corresponding to pwm-regulator
> > to "default" will cause kernel boot suspended.
> > Sorry but do you know why?
> 
> Not an issue I have seen, do you have any more logs or details? E.g.
> what board you use, full regulator node, do you have operating points
> defined etc.
> 
> I have runtime tested a branch at [1], that use pinctrl-names = default,
> have vdd_arm and vdd_logic defined, also an opp table for cpu and gpu.
> 
> For E20C there is a commit to enable the vdd_logic, however without gpu
> enabled and a mali-supply the pwm-regulator is initialized to
> max-microvolt by Linux. Have instead updated U-Boot to initialize the
> pwm-regulator's:
> 
> ```
> &vdd_arm {
> 	regulator-init-microvolt = <953000>;
> };
> 
> &vdd_logic {
> 	regulator-init-microvolt = <900000>;
> };
> ```
> 
> [1] https://github.com/Kwiboo/linux-rockchip/commits/next-20250311-rk3528/
> 
> Regards,
> Jonas
> 
> > 
> > e.g.
> > ```
> > vdd_arm: regulator-vdd-arm {
> > 	compatible = "pwm-regulator";
> > 	pwms = <&pwm1 0 5000 1>;
> > 	...
> > };
> > 
> > &pwm1 {
> > 	pinctrl-0 = <&pwm1m0_pins>;
> > 	pinctrl-names = "default";
> > 	status = "okay";
> > };
> > ```
> > 
> > Thanks,
> > Chukun
> > 
> > --
> > 2.25.1
> > 
> 
>