From aec8ff24ff6c03195b953d1a10fc20648edf5332 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Fri, 25 Sep 2020 11:30:24 +0800 Subject: [PATCH] soc: rockchip: pvtm: Add support for RK3568 SoCs This adds the necessary data for handling pvtm on the RK3568 SoCs. Signed-off-by: Finley Xiao Change-Id: Ie4499f613d7d3ef2edb11fd6a81d70d699317caf --- drivers/soc/rockchip/rockchip_pvtm.c | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/drivers/soc/rockchip/rockchip_pvtm.c b/drivers/soc/rockchip/rockchip_pvtm.c index 401c8de28bed..4cc6923b8eb8 100644 --- a/drivers/soc/rockchip/rockchip_pvtm.c +++ b/drivers/soc/rockchip/rockchip_pvtm.c @@ -537,6 +537,51 @@ static const struct rockchip_pvtm_data rk3399_pmupvtm = { }, }; +static const struct rockchip_pvtm_info rk3568_corepvtm_infos[] = { + PVTM(0, "core", 7, 0, 1, 0x4, 0, 0x4), +}; + +static const struct rockchip_pvtm_data rk3568_corepvtm = { + .con = 0x4, + .sta = 0x80, + .num_pvtms = ARRAY_SIZE(rk3568_corepvtm_infos), + .infos = rk3568_corepvtm_infos, + .ops = { + .get_value = rv1126_pvtm_get_value, + .set_ring_sel = rv1126_pvtm_set_ring_sel, + }, +}; + +static const struct rockchip_pvtm_info rk3568_gpupvtm_infos[] = { + PVTM(1, "gpu", 7, 0, 1, 0x4, 0, 0x4), +}; + +static const struct rockchip_pvtm_data rk3568_gpupvtm = { + .con = 0x4, + .sta = 0x80, + .num_pvtms = ARRAY_SIZE(rk3568_gpupvtm_infos), + .infos = rk3568_gpupvtm_infos, + .ops = { + .get_value = rv1126_pvtm_get_value, + .set_ring_sel = rv1126_pvtm_set_ring_sel, + }, +}; + +static const struct rockchip_pvtm_info rk3568_npupvtm_infos[] = { + PVTM(2, "npu", 7, 0, 1, 0x4, 0, 0x4), +}; + +static const struct rockchip_pvtm_data rk3568_npupvtm = { + .con = 0x4, + .sta = 0x80, + .num_pvtms = ARRAY_SIZE(rk3568_npupvtm_infos), + .infos = rk3568_npupvtm_infos, + .ops = { + .get_value = rv1126_pvtm_get_value, + .set_ring_sel = rv1126_pvtm_set_ring_sel, + }, +}; + static const struct rockchip_pvtm_info rv1126_cpupvtm_infos[] = { PVTM(0, "cpu", 7, 0, 1, 0x4, 0, 0x4), }; @@ -622,6 +667,18 @@ static const struct of_device_id rockchip_pvtm_match[] = { .compatible = "rockchip,rk3399-pmu-pvtm", .data = (void *)&rk3399_pmupvtm, }, + { + .compatible = "rockchip,rK3568-core-pvtm", + .data = (void *)&rk3568_corepvtm, + }, + { + .compatible = "rockchip,rk3568-gpu-pvtm", + .data = (void *)&rk3568_gpupvtm, + }, + { + .compatible = "rockchip,rk3568-npu-pvtm", + .data = (void *)&rk3568_npupvtm, + }, { .compatible = "rockchip,rv1126-cpu-pvtm", .data = (void *)&rv1126_cpupvtm,