Skip to content

Commit cfee1b5

Browse files
finley1226storulf
authored andcommitted
pmdomain: rockchip: Add support for RK3576 SoC
Add configuration for RK3576 SoC and list the power domains. Signed-off-by: Finley Xiao <[email protected]> Signed-off-by: Detlev Casanova <[email protected]> Reviewed-by: Elaine Zhang<[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 8565c44 commit cfee1b5

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

drivers/pmdomain/rockchip/pm-domains.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <dt-bindings/power/rk3368-power.h>
3434
#include <dt-bindings/power/rk3399-power.h>
3535
#include <dt-bindings/power/rk3568-power.h>
36+
#include <dt-bindings/power/rockchip,rk3576-power.h>
3637
#include <dt-bindings/power/rk3588-power.h>
3738

3839
struct rockchip_domain_info {
@@ -175,6 +176,9 @@ struct rockchip_pmu {
175176
#define DOMAIN_RK3568(name, pwr, req, wakeup) \
176177
DOMAIN_M(name, pwr, pwr, req, req, req, wakeup)
177178

179+
#define DOMAIN_RK3576(name, p_offset, pwr, status, r_status, r_offset, req, idle, wakeup) \
180+
DOMAIN_M_O_R(name, p_offset, pwr, status, 0, r_status, r_status, r_offset, req, idle, idle, wakeup)
181+
178182
/*
179183
* Dynamic Memory Controller may need to coordinate with us -- see
180184
* rockchip_pmu_block().
@@ -1106,6 +1110,28 @@ static const struct rockchip_domain_info rk3568_pm_domains[] = {
11061110
[RK3568_PD_PIPE] = DOMAIN_RK3568("pipe", BIT(8), BIT(11), false),
11071111
};
11081112

1113+
static const struct rockchip_domain_info rk3576_pm_domains[] = {
1114+
[RK3576_PD_NPU] = DOMAIN_RK3576("npu", 0x0, BIT(0), BIT(0), 0, 0x0, 0, 0, false),
1115+
[RK3576_PD_NVM] = DOMAIN_RK3576("nvm", 0x0, BIT(6), 0, BIT(6), 0x4, BIT(2), BIT(18), false),
1116+
[RK3576_PD_SDGMAC] = DOMAIN_RK3576("sdgmac", 0x0, BIT(7), 0, BIT(7), 0x4, BIT(1), BIT(17), false),
1117+
[RK3576_PD_AUDIO] = DOMAIN_RK3576("audio", 0x0, BIT(8), 0, BIT(8), 0x4, BIT(0), BIT(16), false),
1118+
[RK3576_PD_PHP] = DOMAIN_RK3576("php", 0x0, BIT(9), 0, BIT(9), 0x0, BIT(15), BIT(15), false),
1119+
[RK3576_PD_SUBPHP] = DOMAIN_RK3576("subphp", 0x0, BIT(10), 0, BIT(10), 0x0, 0, 0, false),
1120+
[RK3576_PD_VOP] = DOMAIN_RK3576("vop", 0x0, BIT(11), 0, BIT(11), 0x0, 0x6000, 0x6000, false),
1121+
[RK3576_PD_VO1] = DOMAIN_RK3576("vo1", 0x0, BIT(14), 0, BIT(14), 0x0, BIT(12), BIT(12), false),
1122+
[RK3576_PD_VO0] = DOMAIN_RK3576("vo0", 0x0, BIT(15), 0, BIT(15), 0x0, BIT(11), BIT(11), false),
1123+
[RK3576_PD_USB] = DOMAIN_RK3576("usb", 0x4, BIT(0), 0, BIT(16), 0x0, BIT(10), BIT(10), true),
1124+
[RK3576_PD_VI] = DOMAIN_RK3576("vi", 0x4, BIT(1), 0, BIT(17), 0x0, BIT(9), BIT(9), false),
1125+
[RK3576_PD_VEPU0] = DOMAIN_RK3576("vepu0", 0x4, BIT(2), 0, BIT(18), 0x0, BIT(7), BIT(7), false),
1126+
[RK3576_PD_VEPU1] = DOMAIN_RK3576("vepu1", 0x4, BIT(3), 0, BIT(19), 0x0, BIT(8), BIT(8), false),
1127+
[RK3576_PD_VDEC] = DOMAIN_RK3576("vdec", 0x4, BIT(4), 0, BIT(20), 0x0, BIT(6), BIT(6), false),
1128+
[RK3576_PD_VPU] = DOMAIN_RK3576("vpu", 0x4, BIT(5), 0, BIT(21), 0x0, BIT(5), BIT(5), false),
1129+
[RK3576_PD_NPUTOP] = DOMAIN_RK3576("nputop", 0x4, BIT(6), 0, BIT(22), 0x0, 0x18, 0x18, false),
1130+
[RK3576_PD_NPU0] = DOMAIN_RK3576("npu0", 0x4, BIT(7), 0, BIT(23), 0x0, BIT(1), BIT(1), false),
1131+
[RK3576_PD_NPU1] = DOMAIN_RK3576("npu1", 0x4, BIT(8), 0, BIT(24), 0x0, BIT(2), BIT(2), false),
1132+
[RK3576_PD_GPU] = DOMAIN_RK3576("gpu", 0x4, BIT(9), 0, BIT(25), 0x0, BIT(0), BIT(0), false),
1133+
};
1134+
11091135
static const struct rockchip_domain_info rk3588_pm_domains[] = {
11101136
[RK3588_PD_GPU] = DOMAIN_RK3588("gpu", 0x0, BIT(0), 0, 0x0, 0, BIT(1), 0x0, BIT(0), BIT(0), false),
11111137
[RK3588_PD_NPU] = DOMAIN_RK3588("npu", 0x0, BIT(1), BIT(1), 0x0, 0, 0, 0x0, 0, 0, false),
@@ -1284,6 +1310,21 @@ static const struct rockchip_pmu_info rk3568_pmu = {
12841310
.domain_info = rk3568_pm_domains,
12851311
};
12861312

1313+
static const struct rockchip_pmu_info rk3576_pmu = {
1314+
.pwr_offset = 0x210,
1315+
.status_offset = 0x230,
1316+
.chain_status_offset = 0x248,
1317+
.mem_status_offset = 0x250,
1318+
.mem_pwr_offset = 0x300,
1319+
.req_offset = 0x110,
1320+
.idle_offset = 0x128,
1321+
.ack_offset = 0x120,
1322+
.repair_status_offset = 0x570,
1323+
1324+
.num_domains = ARRAY_SIZE(rk3576_pm_domains),
1325+
.domain_info = rk3576_pm_domains,
1326+
};
1327+
12871328
static const struct rockchip_pmu_info rk3588_pmu = {
12881329
.pwr_offset = 0x14c,
12891330
.status_offset = 0x180,
@@ -1359,6 +1400,10 @@ static const struct of_device_id rockchip_pm_domain_dt_match[] = {
13591400
.compatible = "rockchip,rk3568-power-controller",
13601401
.data = (void *)&rk3568_pmu,
13611402
},
1403+
{
1404+
.compatible = "rockchip,rk3576-power-controller",
1405+
.data = (void *)&rk3576_pmu,
1406+
},
13621407
{
13631408
.compatible = "rockchip,rk3588-power-controller",
13641409
.data = (void *)&rk3588_pmu,

0 commit comments

Comments
 (0)