mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
MALI: bifrost: Add opp data for rk3576
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com> Change-Id: I04e9c648b2d74a7809954c143330d66a665d833c
This commit is contained in:
@@ -515,6 +515,25 @@ static void kbase_platform_rk_remove_sysfs_files(struct device *dev)
|
||||
device_remove_file(dev, &dev_attr_utilisation);
|
||||
}
|
||||
|
||||
static int rk3576_gpu_set_read_margin(struct device *dev,
|
||||
struct rockchip_opp_info *opp_info,
|
||||
u32 rm)
|
||||
{
|
||||
if (!opp_info->grf || !opp_info->volt_rm_tbl)
|
||||
return 0;
|
||||
if (rm == opp_info->current_rm || rm == UINT_MAX)
|
||||
return 0;
|
||||
|
||||
dev_dbg(dev, "set rm to %d\n", rm);
|
||||
regmap_write(opp_info->grf, 0x3c, 0x001c0000 | (rm << 2));
|
||||
regmap_write(opp_info->grf, 0x40, 0x001c0000 | (rm << 2));
|
||||
regmap_write(opp_info->grf, 0x48, 0x001c0000 | (rm << 2));
|
||||
|
||||
opp_info->current_rm = rm;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rk3588_gpu_get_soc_info(struct device *dev, struct device_node *np,
|
||||
int *bin, int *process)
|
||||
{
|
||||
@@ -626,6 +645,12 @@ static int gpu_opp_config_clks(struct device *dev, struct opp_table *opp_table,
|
||||
&kbdev->opp_info);
|
||||
}
|
||||
|
||||
static const struct rockchip_opp_data rk3576_gpu_opp_data = {
|
||||
.set_read_margin = rk3576_gpu_set_read_margin,
|
||||
.config_regulators = gpu_opp_config_regulators,
|
||||
.config_clks = gpu_opp_config_clks,
|
||||
};
|
||||
|
||||
static const struct rockchip_opp_data rk3588_gpu_opp_data = {
|
||||
.get_soc_info = rk3588_gpu_get_soc_info,
|
||||
.set_soc_info = rk3588_gpu_set_soc_info,
|
||||
@@ -639,6 +664,10 @@ static const struct rockchip_opp_data rockchip_gpu_opp_data = {
|
||||
};
|
||||
|
||||
static const struct of_device_id rockchip_mali_of_match[] = {
|
||||
{
|
||||
.compatible = "rockchip,rk3576",
|
||||
.data = (void *)&rk3576_gpu_opp_data,
|
||||
},
|
||||
{
|
||||
.compatible = "rockchip,rk3588",
|
||||
.data = (void *)&rk3588_gpu_opp_data,
|
||||
|
||||
Reference in New Issue
Block a user