MALI: bifrost: Add opp data for rk3576s

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

View File

@@ -508,6 +508,58 @@ static void kbase_platform_rk_remove_sysfs_files(struct device *dev)
device_remove_file(dev, &dev_attr_utilisation);
}
static int rk3576_gpu_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_gpu_set_read_margin(struct device *dev,
struct rockchip_opp_info *opp_info,
u32 rm)
@@ -648,6 +700,7 @@ static int gpu_opp_config_clks(struct device *dev, struct opp_table *opp_table,
}
static const struct rockchip_opp_data rk3576_gpu_opp_data = {
.get_soc_info = rk3576_gpu_get_soc_info,
.set_read_margin = rk3576_gpu_set_read_margin,
.set_soc_info = rockchip_opp_set_low_length,
.config_regulators = gpu_opp_config_regulators,
@@ -671,6 +724,10 @@ static const struct of_device_id rockchip_mali_of_match[] = {
.compatible = "rockchip,rk3576",
.data = (void *)&rk3576_gpu_opp_data,
},
{
.compatible = "rockchip,rk3576s",
.data = (void *)&rk3576_gpu_opp_data,
},
{
.compatible = "rockchip,rk3588",
.data = (void *)&rk3588_gpu_opp_data,