Skip to content

Commit 20c8e39

Browse files
konradybciorobclark
authored andcommitted
drm/msm/a6xx: Add A619_holi speedbin support
A619_holi is implemented on at least two SoCs: SM4350 (holi) and SM6375 (blair). This is what seems to be a first occurrence of this happening, but it's easy to overcome by guarding the SoC-specific fuse values with of_machine_is_compatible(). Do just that to enable frequency limiting on these SoCs. Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Akhil P Oommen <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/542772/ Signed-off-by: Rob Clark <[email protected]>
1 parent b3bcd58 commit 20c8e39

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,6 +2216,34 @@ static u32 a618_get_speed_bin(u32 fuse)
22162216
return UINT_MAX;
22172217
}
22182218

2219+
static u32 a619_holi_get_speed_bin(u32 fuse)
2220+
{
2221+
/*
2222+
* There are (at least) two SoCs implementing A619_holi: SM4350 (holi)
2223+
* and SM6375 (blair). Limit the fuse matching to the corresponding
2224+
* SoC to prevent bogus frequency setting (as improbable as it may be,
2225+
* given unexpected fuse values are.. unexpected! But still possible.)
2226+
*/
2227+
2228+
if (fuse == 0)
2229+
return 0;
2230+
2231+
if (of_machine_is_compatible("qcom,sm4350")) {
2232+
if (fuse == 138)
2233+
return 1;
2234+
else if (fuse == 92)
2235+
return 2;
2236+
} else if (of_machine_is_compatible("qcom,sm6375")) {
2237+
if (fuse == 190)
2238+
return 1;
2239+
else if (fuse == 177)
2240+
return 2;
2241+
} else
2242+
pr_warn("Unknown SoC implementing A619_holi!\n");
2243+
2244+
return UINT_MAX;
2245+
}
2246+
22192247
static u32 a619_get_speed_bin(u32 fuse)
22202248
{
22212249
if (fuse == 0)
@@ -2276,6 +2304,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_gpu *adreno_gpu, u3
22762304
if (adreno_is_a618(adreno_gpu))
22772305
val = a618_get_speed_bin(fuse);
22782306

2307+
else if (adreno_is_a619_holi(adreno_gpu))
2308+
val = a619_holi_get_speed_bin(fuse);
2309+
22792310
else if (adreno_is_a619(adreno_gpu))
22802311
val = a619_get_speed_bin(fuse);
22812312

0 commit comments

Comments
 (0)