pmdomain: sunxi: Add support for A733 to Allwinner PCK600 driver

The Allwinner A733 PCK600, similar to A523 PCK600, is likely a
customized version of ARM PCK-600 power controller. It shares the same
BSP driver with A523. According to the BSP provided by Radxa, unlike
A523, it doesn't require reset, as well as a different pair of delay
values.

Make reset optional in the sunxi pck600 driver and add support
for A733.

Signed-off-by: Yuanshen Cao <alex.caoys@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org> # matched against BSP driver
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Yuanshen Cao
2026-03-05 03:34:08 +00:00
committed by Ulf Hansson
parent f387ecdd49
commit a46e905cd1

View File

@@ -52,6 +52,7 @@ struct sunxi_pck600_desc {
u32 logic_power_switch0_delay;
u32 logic_power_switch1_delay;
u32 off2on_delay;
bool has_rst_clk;
};
struct sunxi_pck600_pd {
@@ -151,9 +152,11 @@ static int sunxi_pck600_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
rst = devm_reset_control_get_exclusive_released(dev, NULL);
if (IS_ERR(rst))
return dev_err_probe(dev, PTR_ERR(rst), "failed to get reset control\n");
if (desc->has_rst_clk) {
rst = devm_reset_control_get_exclusive_released(dev, NULL);
if (IS_ERR(rst))
return dev_err_probe(dev, PTR_ERR(rst), "failed to get reset control\n");
}
clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(clk))
@@ -206,7 +209,27 @@ static const struct sunxi_pck600_desc sun55i_a523_pck600_desc = {
.device_ctrl1_delay = 0xffff,
.logic_power_switch0_delay = 0x8080808,
.logic_power_switch1_delay = 0x808,
.off2on_delay = 0x8
.off2on_delay = 0x8,
.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_desc sun60i_a733_pck600_desc = {
.pd_names = sun60i_a733_pck600_pd_names,
.num_domains = ARRAY_SIZE(sun60i_a733_pck600_pd_names),
.logic_power_switch0_delay_offset = 0xc00,
.logic_power_switch1_delay_offset = 0xc04,
.off2on_delay_offset = 0xc10,
.device_ctrl0_delay = 0x1f1f1f,
.device_ctrl1_delay = 0x1f1f,
.logic_power_switch0_delay = 0x8080808,
.logic_power_switch1_delay = 0x808,
.off2on_delay = 0x8,
.has_rst_clk = false,
};
static const struct of_device_id sunxi_pck600_of_match[] = {
@@ -214,6 +237,10 @@ static const struct of_device_id sunxi_pck600_of_match[] = {
.compatible = "allwinner,sun55i-a523-pck-600",
.data = &sun55i_a523_pck600_desc,
},
{
.compatible = "allwinner,sun60i-a733-pck-600",
.data = &sun60i_a733_pck600_desc,
},
{}
};
MODULE_DEVICE_TABLE(of, sunxi_pck600_of_match);