|
29 | 29 | #include <linux/slab.h> |
30 | 30 | #include <linux/soc/rockchip/pvtm.h> |
31 | 31 |
|
| 32 | +#define PX30_PVTM_CORE 0 |
| 33 | +#define PX30_PVTM_PMU 1 |
| 34 | + |
32 | 35 | #define RK3288_PVTM_CORE 0 |
33 | 36 | #define RK3288_PVTM_GPU 1 |
34 | 37 |
|
@@ -233,6 +236,15 @@ static void rockchip_pvtm_delay(unsigned int delay) |
233 | 236 | udelay(us); |
234 | 237 | } |
235 | 238 |
|
| 239 | +static void px30_pvtm_set_ring_sel(struct rockchip_pvtm *pvtm, |
| 240 | + unsigned int sub_ch) |
| 241 | +{ |
| 242 | + unsigned int ch = pvtm->channel->ch; |
| 243 | + |
| 244 | + regmap_write(pvtm->grf, pvtm->con, |
| 245 | + wr_mask_bit(sub_ch, (ch * 0x4 + 0x2), 0x3)); |
| 246 | +} |
| 247 | + |
236 | 248 | static void rk3399_pvtm_set_ring_sel(struct rockchip_pvtm *pvtm, |
237 | 249 | unsigned int sub_ch) |
238 | 250 | { |
@@ -312,6 +324,31 @@ static u32 rockchip_pvtm_get_value(struct rockchip_pvtm *pvtm, |
312 | 324 | return val; |
313 | 325 | } |
314 | 326 |
|
| 327 | +static const struct rockchip_pvtm_channel px30_pvtm_channels[] = { |
| 328 | + PVTM(PX30_PVTM_CORE, "core", 4, 0, 1, 0x4, 0, 0x4), |
| 329 | +}; |
| 330 | + |
| 331 | +static const struct rockchip_pvtm_info px30_pvtm = { |
| 332 | + .con = 0x80, |
| 333 | + .sta = 0x88, |
| 334 | + .num_channels = ARRAY_SIZE(px30_pvtm_channels), |
| 335 | + .channels = px30_pvtm_channels, |
| 336 | + .get_value = rockchip_pvtm_get_value, |
| 337 | + .set_ring_sel = px30_pvtm_set_ring_sel, |
| 338 | +}; |
| 339 | + |
| 340 | +static const struct rockchip_pvtm_channel px30_pmupvtm_channels[] = { |
| 341 | + PVTM(PX30_PVTM_PMU, "pmu", 1, 0, 1, 0x4, 0, 0x4), |
| 342 | +}; |
| 343 | + |
| 344 | +static const struct rockchip_pvtm_info px30_pmupvtm = { |
| 345 | + .con = 0x180, |
| 346 | + .sta = 0x190, |
| 347 | + .num_channels = ARRAY_SIZE(px30_pmupvtm_channels), |
| 348 | + .channels = px30_pmupvtm_channels, |
| 349 | + .get_value = rockchip_pvtm_get_value, |
| 350 | +}; |
| 351 | + |
315 | 352 | static const struct rockchip_pvtm_channel rk3288_pvtm_channels[] = { |
316 | 353 | PVTM(RK3288_PVTM_CORE, "core", 1, 0, 1, 0x4, 0, 0x4), |
317 | 354 | PVTM(RK3288_PVTM_GPU, "gpu", 1, 8, 9, 0x8, 1, 0x8), |
@@ -379,6 +416,14 @@ static const struct rockchip_pvtm_info rk3399_pmupvtm = { |
379 | 416 | }; |
380 | 417 |
|
381 | 418 | static const struct of_device_id rockchip_pvtm_match[] = { |
| 419 | + { |
| 420 | + .compatible = "rockchip,px30-pvtm", |
| 421 | + .data = (void *)&px30_pvtm, |
| 422 | + }, |
| 423 | + { |
| 424 | + .compatible = "rockchip,px30-pmu-pvtm", |
| 425 | + .data = (void *)&px30_pmupvtm, |
| 426 | + }, |
382 | 427 | { |
383 | 428 | .compatible = "rockchip,rk3288-pvtm", |
384 | 429 | .data = (void *)&rk3288_pvtm, |
|
0 commit comments