From: Yuanshen Cao Date: Sun, 10 May 2026 05:25:35 +0000 (+0000) Subject: pmdomain: sunxi: support power domain flags for pck600 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b462a227d8547d62b1f654bf80b3505a84746b54;p=thirdparty%2Fkernel%2Flinux.git pmdomain: sunxi: support power domain flags for pck600 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 Signed-off-by: Ulf Hansson --- diff --git a/drivers/pmdomain/sunxi/sun55i-pck600.c b/drivers/pmdomain/sunxi/sun55i-pck600.c index 1d47bbd35ced2..8a37d11b65a24 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 @@ err_remove_pds: 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,