From: "Cunhao Lu" <1579567540@qq.com>
To: "Heiko Stübner" <heiko@sntech.de>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Elaine Zhang" <zhangqing@rock-chips.com>,
"Ulf Hansson" <ulfh@kernel.org>
Cc: devicetree <devicetree@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-rockchip <linux-rockchip@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-pm <linux-pm@vger.kernel.org>,
"Sebastian Reichel" <sebastian.reichel@collabora.com>
Subject: Re: [PATCH v5 2/2] pmdomain: rockchip: Add RK3572 power domains
Date: Fri, 20 Nov 2026 21:53:58 +0800 [thread overview]
Message-ID: <tencent_DFB6F95537CDD14CC97C26B08CE407F4210A@qq.com> (raw)
In-Reply-To: <z4ZFdDPMSaWK2zh19ZM7pA@sntech.de>
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@rock-chips.com/
[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
prev parent reply other threads:[~2026-11-20 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 9:11 [PATCH v5 0/2] " Cunhao Lu via B4 Relay
2026-11-18 9:11 ` [PATCH v5 1/2] dt-bindings: power: " Cunhao Lu via B4 Relay
2026-11-19 12:26 ` Heiko Stübner
2026-11-18 9:11 ` [PATCH v5 2/2] pmdomain: " Cunhao Lu via B4 Relay
2026-11-19 18:08 ` Heiko Stübner
2026-11-20 13:53 ` Cunhao Lu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_DFB6F95537CDD14CC97C26B08CE407F4210A@qq.com \
--to=1579567540@qq.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=ulfh@kernel.org \
--cc=zhangqing@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®