soc: rockchip: pvtm: Add support for RV1106 SoCs

This adds the necessary data for handling pvtm on the RV1106.

Change-Id: I72c1cb38141cf246738d3a592cb7c8a9f4192815
Signed-off-by: Liang Chen <cl@rock-chips.com>
This commit is contained in:
Liang Chen
2022-03-22 20:37:23 +08:00
committed by Tao Huang
parent e6567a9d42
commit 83d275132c

View File

@@ -353,6 +353,12 @@ disable_clks:
return val;
}
static void rv1106_core_pvtm_set_ring_sel(struct rockchip_pvtm *pvtm,
unsigned int ring_sel)
{
writel_relaxed(wr_mask_bit(ring_sel + 4, 0x2, 0x7), pvtm->base + pvtm->con);
}
static void rv1126_pvtm_set_ring_sel(struct rockchip_pvtm *pvtm,
unsigned int ring_sel)
{
@@ -690,6 +696,35 @@ static const struct rockchip_pvtm_data rk3588_pmu_pvtm = {
},
};
static const struct rockchip_pvtm_info rv1106_corepvtm_infos[] = {
PVTM(0, "core", 2, 0, 1, 0x4, 0, 0x4),
};
static const struct rockchip_pvtm_data rv1106_corepvtm = {
.con = 0x4,
.sta = 0x80,
.num_pvtms = ARRAY_SIZE(rv1106_corepvtm_infos),
.infos = rv1106_corepvtm_infos,
.ops = {
.get_value = rv1126_pvtm_get_value,
.set_ring_sel = rv1106_core_pvtm_set_ring_sel,
},
};
static const struct rockchip_pvtm_info rv1106_pmupvtm_infos[] = {
PVTM(1, "pmu", 1, 0, 1, 0x4, 0, 0x4),
};
static const struct rockchip_pvtm_data rv1106_pmupvtm = {
.con = 0x4,
.sta = 0x80,
.num_pvtms = ARRAY_SIZE(rv1106_pmupvtm_infos),
.infos = rv1106_pmupvtm_infos,
.ops = {
.get_value = rv1126_pvtm_get_value,
},
};
static const struct rockchip_pvtm_info rv1126_cpupvtm_infos[] = {
PVTM(0, "cpu", 7, 0, 1, 0x4, 0, 0x4),
};
@@ -825,6 +860,16 @@ static const struct of_device_id rockchip_pvtm_match[] = {
.data = (void *)&rk3588_pmu_pvtm,
},
#endif
#ifdef CONFIG_CPU_RV1106
{
.compatible = "rockchip,rv1106-core-pvtm",
.data = (void *)&rv1106_corepvtm,
},
{
.compatible = "rockchip,rv1106-pmu-pvtm",
.data = (void *)&rv1106_pmupvtm,
},
#endif
#ifdef CONFIG_CPU_RV1126
{
.compatible = "rockchip,rv1126-cpu-pvtm",