@@ -154,10 +154,7 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
154
154
a6xx_flush (gpu , ring );
155
155
}
156
156
157
- static const struct {
158
- u32 offset ;
159
- u32 value ;
160
- } a6xx_hwcg [] = {
157
+ const struct adreno_reglist a630_hwcg [] = {
161
158
{REG_A6XX_RBBM_CLOCK_CNTL_SP0 , 0x22222222 },
162
159
{REG_A6XX_RBBM_CLOCK_CNTL_SP1 , 0x22222222 },
163
160
{REG_A6XX_RBBM_CLOCK_CNTL_SP2 , 0x22222222 },
@@ -262,17 +259,22 @@ static const struct {
262
259
{REG_A6XX_RBBM_CLOCK_MODE_HLSQ , 0x00002222 },
263
260
{REG_A6XX_RBBM_CLOCK_CNTL_GMU_GX , 0x00000222 },
264
261
{REG_A6XX_RBBM_CLOCK_DELAY_GMU_GX , 0x00000111 },
265
- {REG_A6XX_RBBM_CLOCK_HYST_GMU_GX , 0x00000555 }
262
+ {REG_A6XX_RBBM_CLOCK_HYST_GMU_GX , 0x00000555 },
263
+ {},
266
264
};
267
265
268
266
static void a6xx_set_hwcg (struct msm_gpu * gpu , bool state )
269
267
{
270
268
struct adreno_gpu * adreno_gpu = to_adreno_gpu (gpu );
271
269
struct a6xx_gpu * a6xx_gpu = to_a6xx_gpu (adreno_gpu );
272
270
struct a6xx_gmu * gmu = & a6xx_gpu -> gmu ;
271
+ const struct adreno_reglist * reg ;
273
272
unsigned int i ;
274
273
u32 val ;
275
274
275
+ if (!adreno_gpu -> info -> hwcg )
276
+ return ;
277
+
276
278
val = gpu_read (gpu , REG_A6XX_RBBM_CLOCK_CNTL );
277
279
278
280
/* Don't re-program the registers if they are already correct */
@@ -282,9 +284,8 @@ static void a6xx_set_hwcg(struct msm_gpu *gpu, bool state)
282
284
/* Disable SP clock before programming HWCG registers */
283
285
gmu_rmw (gmu , REG_A6XX_GPU_GMU_GX_SPTPRAC_CLOCK_CONTROL , 1 , 0 );
284
286
285
- for (i = 0 ; i < ARRAY_SIZE (a6xx_hwcg ); i ++ )
286
- gpu_write (gpu , a6xx_hwcg [i ].offset ,
287
- state ? a6xx_hwcg [i ].value : 0 );
287
+ for (i = 0 ; (reg = & adreno_gpu -> info -> hwcg [i ], reg -> offset ); i ++ )
288
+ gpu_write (gpu , reg -> offset , state ? reg -> value : 0 );
288
289
289
290
/* Enable SP clock */
290
291
gmu_rmw (gmu , REG_A6XX_GPU_GMU_GX_SPTPRAC_CLOCK_CONTROL , 0 , 1 );
@@ -440,12 +441,8 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
440
441
gpu_write (gpu , REG_A6XX_TPL1_ADDR_MODE_CNTL , 0x1 );
441
442
gpu_write (gpu , REG_A6XX_RBBM_SECVID_TSB_ADDR_MODE_CNTL , 0x1 );
442
443
443
- /*
444
- * enable hardware clockgating
445
- * For now enable clock gating only for a630
446
- */
447
- if (adreno_is_a630 (adreno_gpu ))
448
- a6xx_set_hwcg (gpu , true);
444
+ /* enable hardware clockgating */
445
+ a6xx_set_hwcg (gpu , true);
449
446
450
447
/* VBIF/GBIF start*/
451
448
if (adreno_is_a640 (adreno_gpu ) || adreno_is_a650 (adreno_gpu )) {
0 commit comments