[PATCH v4 6/6] powercap: dtpm: Add RK3588 hierarchy
Lukasz Luba
lukasz.luba at arm.com
Fri Oct 30 07:09:08 PDT 2026
On 10/29/26 16:56, Daniel Lezcano wrote:
> The RK3588 has three CPU frequency domains, with CPUs grouped into
> three cpufreq policies.
>
> Add a DTPM hierarchy for the RK3588 with one CPU node per cpufreq
> policy, represented by cpu at 0, cpu at 400 and cpu at 600. Group the three CPU
> domains under a virtual package node attached to the RK3588 root node.
>
> Add the RK3588 compatible to the Rockchip DTPM match table to select
> the new hierarchy.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano at oss.qualcomm.com>
> ---
> Changes in v4 (since v3):
> - Rebase on v7.3; no code or commit-description changes.
>
> Changes in v3 (since v2):
> - Rebase on v7.3-rc7.
> - Fix __initdata placement and the RK3588 match-entry indentation.
> - No functional changes.
>
> drivers/soc/rockchip/dtpm.c | 48 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
>
> diff --git a/drivers/soc/rockchip/dtpm.c b/drivers/soc/rockchip/dtpm.c
> index 5ae00680602f..664764f4b460 100644
> --- a/drivers/soc/rockchip/dtpm.c
> +++ b/drivers/soc/rockchip/dtpm.c
> @@ -62,8 +62,56 @@ static struct powercap_hierarchy rk3399_hierarchy __initdata = {
> .nr_nodes = ARRAY_SIZE(rk3399_nodes),
> };
>
> +static struct dtpm_node rk3588_cpu0 = {
> + .type = DTPM_NODE_DT,
> + .path = "/cpus/cpu at 0",
> +};
> +
> +static struct dtpm_node rk3588_cpu4 = {
> + .type = DTPM_NODE_DT,
> + .path = "/cpus/cpu at 400",
> +};
> +
> +static struct dtpm_node rk3588_cpu6 = {
> + .type = DTPM_NODE_DT,
> + .path = "/cpus/cpu at 600",
> +};
> +
> +static struct powercap_node rk3588_nodes[] __initdata = {
> + [0] = {
> + .name = "rk3588",
> + .data = &rockchip_virtual,
> + },
> + [1] = {
> + .name = "package",
> + .parent = &rk3588_nodes[0],
> + .data = &rockchip_virtual,
> + },
> + [2] = {
> + .name = "cpu0-cpufreq",
> + .parent = &rk3588_nodes[1],
> + .data = &rk3588_cpu0,
> + },
> + [3] = {
> + .name = "cpu4-cpufreq",
> + .parent = &rk3588_nodes[1],
> + .data = &rk3588_cpu4,
> + },
> + [4] = {
> + .name = "cpu6-cpufreq",
> + .parent = &rk3588_nodes[1],
> + .data = &rk3588_cpu6,
> + },
> +};
> +
> +static struct powercap_hierarchy rk3588_hierarchy __initdata = {
> + .nodes = rk3588_nodes,
> + .nr_nodes = ARRAY_SIZE(rk3588_nodes),
> +};
> +
> static struct of_device_id __initdata rockchip_dtpm_match_table[] = {
> { .compatible = "rockchip,rk3399", .data = &rk3399_hierarchy },
> + { .compatible = "rockchip,rk3588", .data = &rk3588_hierarchy },
> {},
> };
>
Reviewed-by: Lukasz Luba <lukasz.luba at arm.com>
More information about the linux-arm-kernel
mailing list