|
2 | 2 | /*
|
3 | 3 | * Rockchip Generic power domain support.
|
4 | 4 | *
|
5 |
| - * Copyright (c) 2015 ROCKCHIP, Co. Ltd. |
| 5 | + * Copyright (c) 2015 Rockchip Electronics Co., Ltd. |
6 | 6 | */
|
7 | 7 |
|
8 | 8 | #include <linux/arm-smccc.h>
|
|
35 | 35 | #include <dt-bindings/power/rk3366-power.h>
|
36 | 36 | #include <dt-bindings/power/rk3368-power.h>
|
37 | 37 | #include <dt-bindings/power/rk3399-power.h>
|
| 38 | +#include <dt-bindings/power/rockchip,rk3562-power.h> |
38 | 39 | #include <dt-bindings/power/rk3568-power.h>
|
39 | 40 | #include <dt-bindings/power/rockchip,rk3576-power.h>
|
40 | 41 | #include <dt-bindings/power/rk3588-power.h>
|
@@ -135,6 +136,20 @@ struct rockchip_pmu {
|
135 | 136 | .active_wakeup = wakeup, \
|
136 | 137 | }
|
137 | 138 |
|
| 139 | +#define DOMAIN_M_G_SD(_name, pwr, status, req, idle, ack, g_mask, mem, wakeup, keepon) \ |
| 140 | +{ \ |
| 141 | + .name = _name, \ |
| 142 | + .pwr_w_mask = (pwr) << 16, \ |
| 143 | + .pwr_mask = (pwr), \ |
| 144 | + .status_mask = (status), \ |
| 145 | + .req_w_mask = (req) << 16, \ |
| 146 | + .req_mask = (req), \ |
| 147 | + .idle_mask = (idle), \ |
| 148 | + .ack_mask = (ack), \ |
| 149 | + .clk_ungate_mask = (g_mask), \ |
| 150 | + .active_wakeup = wakeup, \ |
| 151 | +} |
| 152 | + |
138 | 153 | #define DOMAIN_M_O_R(_name, p_offset, pwr, status, m_offset, m_status, r_status, r_offset, req, idle, ack, wakeup, regulator) \
|
139 | 154 | { \
|
140 | 155 | .name = _name, \
|
@@ -201,6 +216,9 @@ struct rockchip_pmu {
|
201 | 216 | #define DOMAIN_RK3399(name, pwr, status, req, wakeup) \
|
202 | 217 | DOMAIN(name, pwr, status, req, req, req, wakeup)
|
203 | 218 |
|
| 219 | +#define DOMAIN_RK3562(name, pwr, req, g_mask, mem, wakeup) \ |
| 220 | + DOMAIN_M_G_SD(name, pwr, pwr, req, req, req, g_mask, mem, wakeup, false) |
| 221 | + |
204 | 222 | #define DOMAIN_RK3568(name, pwr, req, wakeup) \
|
205 | 223 | DOMAIN_M(name, pwr, pwr, req, req, req, wakeup)
|
206 | 224 |
|
@@ -1197,6 +1215,18 @@ static const struct rockchip_domain_info rk3399_pm_domains[] = {
|
1197 | 1215 | [RK3399_PD_SDIOAUDIO] = DOMAIN_RK3399("sdioaudio", BIT(31), BIT(31), BIT(29), true),
|
1198 | 1216 | };
|
1199 | 1217 |
|
| 1218 | +static const struct rockchip_domain_info rk3562_pm_domains[] = { |
| 1219 | + /* name pwr req g_mask mem wakeup */ |
| 1220 | + [RK3562_PD_GPU] = DOMAIN_RK3562("gpu", BIT(0), BIT(1), BIT(1), 0, false), |
| 1221 | + [RK3562_PD_NPU] = DOMAIN_RK3562("npu", BIT(1), BIT(2), BIT(2), 0, false), |
| 1222 | + [RK3562_PD_VDPU] = DOMAIN_RK3562("vdpu", BIT(2), BIT(6), BIT(6), 0, false), |
| 1223 | + [RK3562_PD_VEPU] = DOMAIN_RK3562("vepu", BIT(3), BIT(7), BIT(7) | BIT(3), 0, false), |
| 1224 | + [RK3562_PD_RGA] = DOMAIN_RK3562("rga", BIT(4), BIT(5), BIT(5) | BIT(4), 0, false), |
| 1225 | + [RK3562_PD_VI] = DOMAIN_RK3562("vi", BIT(5), BIT(3), BIT(3), 0, false), |
| 1226 | + [RK3562_PD_VO] = DOMAIN_RK3562("vo", BIT(6), BIT(4), BIT(4), 16, false), |
| 1227 | + [RK3562_PD_PHP] = DOMAIN_RK3562("php", BIT(7), BIT(8), BIT(8), 0, false), |
| 1228 | +}; |
| 1229 | + |
1200 | 1230 | static const struct rockchip_domain_info rk3568_pm_domains[] = {
|
1201 | 1231 | [RK3568_PD_NPU] = DOMAIN_RK3568("npu", BIT(1), BIT(2), false),
|
1202 | 1232 | [RK3568_PD_GPU] = DOMAIN_RK3568("gpu", BIT(0), BIT(1), false),
|
@@ -1398,6 +1428,18 @@ static const struct rockchip_pmu_info rk3399_pmu = {
|
1398 | 1428 | .domain_info = rk3399_pm_domains,
|
1399 | 1429 | };
|
1400 | 1430 |
|
| 1431 | +static const struct rockchip_pmu_info rk3562_pmu = { |
| 1432 | + .pwr_offset = 0x210, |
| 1433 | + .status_offset = 0x230, |
| 1434 | + .req_offset = 0x110, |
| 1435 | + .idle_offset = 0x128, |
| 1436 | + .ack_offset = 0x120, |
| 1437 | + .clk_ungate_offset = 0x140, |
| 1438 | + |
| 1439 | + .num_domains = ARRAY_SIZE(rk3562_pm_domains), |
| 1440 | + .domain_info = rk3562_pm_domains, |
| 1441 | +}; |
| 1442 | + |
1401 | 1443 | static const struct rockchip_pmu_info rk3568_pmu = {
|
1402 | 1444 | .pwr_offset = 0xa0,
|
1403 | 1445 | .status_offset = 0x98,
|
@@ -1496,6 +1538,10 @@ static const struct of_device_id rockchip_pm_domain_dt_match[] = {
|
1496 | 1538 | .compatible = "rockchip,rk3399-power-controller",
|
1497 | 1539 | .data = (void *)&rk3399_pmu,
|
1498 | 1540 | },
|
| 1541 | + { |
| 1542 | + .compatible = "rockchip,rk3562-power-controller", |
| 1543 | + .data = (void *)&rk3562_pmu, |
| 1544 | + }, |
1499 | 1545 | {
|
1500 | 1546 | .compatible = "rockchip,rk3568-power-controller",
|
1501 | 1547 | .data = (void *)&rk3568_pmu,
|
|
0 commit comments