Re: [PATCH v5 2/2] pmdomain: rockchip: Add RK3572 power domains

From: Cunhao Lu

Date: Fri Nov 20 2026 - 08:54:16 EST


Hi Heiko,

> I guess the first question is, why do you need that?
> The TRMs of both RK3572 and RK3588 have the voltage-domain power-control
> registers, but why do you need to control them now?
>
> Side-question, how are voltage-domains handled on the other SoCs.
> The RK3588 also has the PMU_VOL_GATE_CONx registers, so I guess
> they could also be turned off?

In his v3 review [1], Finley Xiao, an engineer at Rockchip, asked me
to include Rockchip's voltage-domain handshake when adding RK3572 NPU
support. Specifically, he asked me to call rockchip_pmu_vd_on() to
request VD_NPU before asking the PMU to power up PD_NPU.

So far I've only tested basic NPU power management on RK3572. I haven't
run a compute workload, so I can't say which NPU functions, if any,
would be affected by omitting the VD request.

I compared the upstream and Rockchip drivers for RK3588. Both switch
the top-level NPU domain using bit 1 of PMU_PWR_GATE_SFTCON0 [2].
Neither writes PMU_VOL_GATE_CON0 during normal NPU domain transitions.

Should I keep the VD_NPU request before powering up PD_NPU on RK3572
in v6?

> But in general, if you need to enable the voltage-domain to enable the
> power-domain inside it, this really sounds more like a power-domain of
> a different type - because the wiggling inside the power-domain
> handling below looks strange, and we already are handling domain
> trees.

I checked Rockchip's kernel and the RK3572 documentation, but I couldn't
find a separate status bit for VD_NPU. If I model it as a parent
domain, would it make sense to track its state in software?

>> - int clk_ungate_w_mask = pd_info->clk_ungate_mask << 16;
>> + u32 clk_ungate_w_mask = (u32)pd_info->clk_ungate_mask << 16;
>
> why does it need to be u32 now?
> Yes, the mask should probably be u32, but why not change simply change
> the global type then?

I'll make clk_ungate_mask itself u32 in v6 and drop the cast.

> both the clk_ungate_offset + status_offset addition should probably be
> separate patches, as they should get a descriptive commit message on
> why they are needed.
>
>> + if (pmu->info->chain_status_inverted)
>> + return !(val & pd->info->mem_status_mask);
>
> again, introducing this new parameter should get its own commit and
> descriptive message on what this does.

I'll split these.

>> + return regmap_read_poll_timeout(pmu->grf, pmu->info->fw_status_offset,
>> + val, (val & mask) == mask, 0, 10000);
>> +}
>
> this definitly also needs way more explanation

Understood.

[1] https://lore.kernel.org/all/18fcfe7a-e25a-4516-810f-d787b779914d@xxxxxxxxxxxxxx/
[2] RK3588 TRM, Part 1, v1.1, chapter 7, especially section 7.5.5:
https://dl.namtso.com/products/a10/a10-3588/datasheets/rockchip-rk3588-trm-v1.1-part1.pdf

Best regards,
Cunhao Lu

pw-bot: cr