cpufreq: rockchip: Add opp data for rk3576s

Change-Id: I45021b6dc0226ec75ef8ec713406ee7c460a98cc
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
Finley Xiao
2025-05-22 10:12:52 +08:00
committed by Tao Huang
parent 89b28a5b1e
commit 2f9efcb0d9

View File

@@ -189,6 +189,58 @@ out:
return ret;
}
static int rk3576_cpu_get_soc_info(struct device *dev, struct device_node *np,
int *bin, int *process)
{
int ret = 0;
u8 spec = 0, test_version = 0;
if (!bin)
return 0;
if (of_property_match_string(np, "nvmem-cell-names",
"specification_serial_number") >= 0) {
ret = rockchip_nvmem_cell_read_u8(np,
"specification_serial_number",
&spec);
if (ret) {
dev_err(dev,
"Failed to get specification_serial_number\n");
return ret;
}
}
if (of_property_match_string(np, "nvmem-cell-names", "test_version") >= 0) {
ret = rockchip_nvmem_cell_read_u8(np, "test_version", &test_version);
if (ret) {
dev_err(dev, "Failed to get test_version\n");
return ret;
}
}
/* RK3576M */
if (spec == 0xd) {
*bin = 1;
/* RK3576J */
} else if (spec == 0xa) {
*bin = 2;
/* RK3576S */
} else if (spec == 0x13) {
if (test_version == 0) {
*bin = 3;
} else {
*bin = 0;
dev_info(dev, "bin=%d (3)\n", *bin);
return 0;
}
}
if (*bin < 0)
*bin = 0;
dev_info(dev, "bin=%d\n", *bin);
return ret;
}
static int rk3576_cpu_set_read_margin(struct device *dev,
struct rockchip_opp_info *opp_info,
u32 rm)
@@ -416,6 +468,7 @@ static const struct rockchip_opp_data rk3588_cpu_opp_data = {
};
static const struct rockchip_opp_data rk3576_cpu_opp_data = {
.get_soc_info = rk3576_cpu_get_soc_info,
.set_read_margin = rk3576_cpu_set_read_margin,
.set_soc_info = rockchip_opp_set_low_length,
.config_regulators = cpu_opp_config_regulators,
@@ -450,6 +503,10 @@ static const struct of_device_id rockchip_cpufreq_of_match[] = {
.compatible = "rockchip,rk3576",
.data = (void *)&rk3576_cpu_opp_data,
},
{
.compatible = "rockchip,rk3576s",
.data = (void *)&rk3576_cpu_opp_data,
},
{
.compatible = "rockchip,rk3588",
.data = (void *)&rk3588_cpu_opp_data,