[PATCH] pmdomain: sunxi: support power domain flags for pck600
Ulf Hansson
ulf.hansson at oss.qualcomm.com
Wed Jun 3 03:15:12 PDT 2026
On Sun, May 10, 2026 at 7:25 AM Yuanshen Cao <alex.caoys at gmail.com> wrote:
>
> Hi everyone,
>
> This patch refactors the sunxi pck600 power domain implementation to
> support individual power domain flags.
>
> While bringing up the PowerVR GPU on the A733 (Radxa Cubie A7Z), we
> found that one of the GPU power domains must be configured as "always
> on." While the Radxa BSP device tree leaves the GPU power domain nodes
> commented out, the GPU driver code contains traces indicating an "always
> on" requirement [1].
>
> Currently, sunxi_pck600_desc only supports specifying pd_names. This
> patch introduces sunxi_pck600_pd_desc, which stores both the name and
> its associated flags. This also (more or less) aligns the implementation
> with the existing sun50i PPU handling of always-on domains.
>
> With this change, individual power domains can now be configured more
> granularly. In particular, the GPU_CORE domain in sun60i_a733_pck600_pds
> can now be explicitly marked with GENPD_FLAG_ALWAYS_ON.
>
> The patch was tested on the Radxa Cubie A7Z, where the GPU now functions
> as expected.
>
> Thanks to Icenowy for her support and expertise on sunxi and PowerVR,
> and thanks to Mikhail for identifying this exact cause of the GPU
> bring-up issue.
>
> [1] https://github.com/radxa/allwinner-bsp/blob/cubie-aiot-v1.4.6/modules/gpu/img-bxm/linux/rogue_km/services/system/rogue/rgx_sunxi/sunxi_platform.c#L62
>
> Signed-off-by: Yuanshen Cao <alex.caoys at gmail.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/pmdomain/sunxi/sun55i-pck600.c | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/pmdomain/sunxi/sun55i-pck600.c b/drivers/pmdomain/sunxi/sun55i-pck600.c
> index 1d47bbd35ced..8a37d11b65a2 100644
> --- a/drivers/pmdomain/sunxi/sun55i-pck600.c
> +++ b/drivers/pmdomain/sunxi/sun55i-pck600.c
> @@ -41,8 +41,13 @@
>
> #define PPU_REG_SIZE 0x1000
>
> +struct sunxi_pck600_pd_desc {
> + const char *name;
> + unsigned int flags;
> +};
> +
> struct sunxi_pck600_desc {
> - const char * const *pd_names;
> + const struct sunxi_pck600_pd_desc *pd_descs;
> unsigned int num_domains;
> u32 logic_power_switch0_delay_offset;
> u32 logic_power_switch1_delay_offset;
> @@ -164,10 +169,12 @@ static int sunxi_pck600_probe(struct platform_device *pdev)
>
> for (i = 0; i < desc->num_domains; i++) {
> struct sunxi_pck600_pd *pd = &pck->pds[i];
> + const struct sunxi_pck600_pd_desc *pd_desc = &desc->pd_descs[i];
>
> - pd->genpd.name = desc->pd_names[i];
> + pd->genpd.name = pd_desc->name;
> pd->genpd.power_off = sunxi_pck600_power_off;
> pd->genpd.power_on = sunxi_pck600_power_on;
> + pd->genpd.flags = pd_desc->flags;
> pd->base = base + PPU_REG_SIZE * i;
>
> sunxi_pck600_pd_setup(pd, desc);
> @@ -195,13 +202,14 @@ static int sunxi_pck600_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static const char * const sun55i_a523_pck600_pd_names[] = {
> - "VE", "GPU", "VI", "VO0", "VO1", "DE", "NAND", "PCIE"
> +static const struct sunxi_pck600_pd_desc sun55i_a523_pck600_pds[] = {
> + { "VE", }, { "GPU", }, { "VI", }, { "VO0", }, { "VO1", },
> + { "DE", }, { "NAND", }, { "PCIE", },
> };
>
> static const struct sunxi_pck600_desc sun55i_a523_pck600_desc = {
> - .pd_names = sun55i_a523_pck600_pd_names,
> - .num_domains = ARRAY_SIZE(sun55i_a523_pck600_pd_names),
> + .pd_descs = sun55i_a523_pck600_pds,
> + .num_domains = ARRAY_SIZE(sun55i_a523_pck600_pds),
> .logic_power_switch0_delay_offset = 0xc00,
> .logic_power_switch1_delay_offset = 0xc04,
> .off2on_delay_offset = 0xc10,
> @@ -213,14 +221,15 @@ static const struct sunxi_pck600_desc sun55i_a523_pck600_desc = {
> .has_rst_clk = true,
> };
>
> -static const char * const sun60i_a733_pck600_pd_names[] = {
> - "VI", "DE_SYS", "VE_DEC", "VE_ENC", "NPU",
> - "GPU_TOP", "GPU_CORE", "PCIE", "USB2", "VO", "VO1"
> +static const struct sunxi_pck600_pd_desc sun60i_a733_pck600_pds[] = {
> + { "VI", }, { "DE_SYS", }, { "VE_DEC", }, { "VE_ENC", }, { "NPU", },
> + { "GPU_TOP", }, { "GPU_CORE", GENPD_FLAG_ALWAYS_ON },
> + { "PCIE", }, { "USB2", }, { "VO", }, { "VO1", },
> };
>
> static const struct sunxi_pck600_desc sun60i_a733_pck600_desc = {
> - .pd_names = sun60i_a733_pck600_pd_names,
> - .num_domains = ARRAY_SIZE(sun60i_a733_pck600_pd_names),
> + .pd_descs = sun60i_a733_pck600_pds,
> + .num_domains = ARRAY_SIZE(sun60i_a733_pck600_pds),
> .logic_power_switch0_delay_offset = 0xc00,
> .logic_power_switch1_delay_offset = 0xc04,
> .off2on_delay_offset = 0xc10,
>
> ---
> base-commit: 1bfaee9d3351b9b32a99766bbfb1f5baed60ddef
> change-id: 20260510-pck600-a733-gpu-dcbfc0c7ce99
>
> Best regards,
> --
> Yuanshen Cao <alex.caoys at gmail.com>
More information about the linux-arm-kernel
mailing list