Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/a6xx: Add A610 speedbin support

A610 is implemented on at least three SoCs: SM6115 (bengal), SM6125
(trinket) and SM6225 (khaje). Trinket does not support speed binning
(only a single SKU exists) and we don't yet support khaje upstream.
Hence, add a fuse mapping table for bengal to allow for per-chip
frequency limiting.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/542780/
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Konrad Dybcio and committed by
Rob Clark
cd036d54 20c8e399

+27
+27
drivers/gpu/drm/msm/adreno/a6xx_gpu.c
··· 2204 2204 return progress; 2205 2205 } 2206 2206 2207 + static u32 a610_get_speed_bin(u32 fuse) 2208 + { 2209 + /* 2210 + * There are (at least) three SoCs implementing A610: SM6125 (trinket), 2211 + * SM6115 (bengal) and SM6225 (khaje). Trinket does not have speedbinning, 2212 + * as only a single SKU exists and we don't support khaje upstream yet. 2213 + * Hence, this matching table is only valid for bengal and can be easily 2214 + * expanded if need be. 2215 + */ 2216 + 2217 + if (fuse == 0) 2218 + return 0; 2219 + else if (fuse == 206) 2220 + return 1; 2221 + else if (fuse == 200) 2222 + return 2; 2223 + else if (fuse == 157) 2224 + return 3; 2225 + else if (fuse == 127) 2226 + return 4; 2227 + 2228 + return UINT_MAX; 2229 + } 2230 + 2207 2231 static u32 a618_get_speed_bin(u32 fuse) 2208 2232 { 2209 2233 if (fuse == 0) ··· 2324 2300 static u32 fuse_to_supp_hw(struct device *dev, struct adreno_gpu *adreno_gpu, u32 fuse) 2325 2301 { 2326 2302 u32 val = UINT_MAX; 2303 + 2304 + if (adreno_is_a610(adreno_gpu)) 2305 + val = a610_get_speed_bin(fuse); 2327 2306 2328 2307 if (adreno_is_a618(adreno_gpu)) 2329 2308 val = a618_get_speed_bin(fuse);