@@ -612,15 +612,26 @@ static void a6xx_set_hwcg(struct msm_gpu *gpu, bool state)
612612
613613 if (adreno_is_a630 (adreno_gpu ))
614614 clock_cntl_on = 0x8aa8aa02 ;
615- else if (adreno_is_a610 (adreno_gpu ))
615+ else if (adreno_is_a610 (adreno_gpu ) || adreno_is_a612 ( adreno_gpu ) )
616616 clock_cntl_on = 0xaaa8aa82 ;
617617 else if (adreno_is_a702 (adreno_gpu ))
618618 clock_cntl_on = 0xaaaaaa82 ;
619619 else
620620 clock_cntl_on = 0x8aa8aa82 ;
621621
622- cgc_delay = adreno_is_a615_family (adreno_gpu ) ? 0x111 : 0x10111 ;
623- cgc_hyst = adreno_is_a615_family (adreno_gpu ) ? 0x555 : 0x5555 ;
622+ if (adreno_is_a612 (adreno_gpu ))
623+ cgc_delay = 0x11 ;
624+ else if (adreno_is_a615_family (adreno_gpu ))
625+ cgc_delay = 0x111 ;
626+ else
627+ cgc_delay = 0x10111 ;
628+
629+ if (adreno_is_a612 (adreno_gpu ))
630+ cgc_hyst = 0x55 ;
631+ else if (adreno_is_a615_family (adreno_gpu ))
632+ cgc_hyst = 0x555 ;
633+ else
634+ cgc_hyst = 0x5555 ;
624635
625636 gmu_write (& a6xx_gpu -> gmu , REG_A6XX_GPU_GMU_AO_GMU_CGC_MODE_CNTL ,
626637 state ? adreno_gpu -> info -> a6xx -> gmu_cgc_mode : 0 );
@@ -714,6 +725,9 @@ static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
714725 cfg -> ubwc_swizzle = 0x7 ;
715726 }
716727
728+ if (adreno_is_a612 (gpu ))
729+ cfg -> highest_bank_bit = 14 ;
730+
717731 if (adreno_is_a618 (gpu ))
718732 cfg -> highest_bank_bit = 14 ;
719733
@@ -1288,7 +1302,7 @@ static int hw_init(struct msm_gpu *gpu)
12881302 gpu_write (gpu , REG_A6XX_CP_LPAC_PROG_FIFO_SIZE , 0x00000020 );
12891303
12901304 /* Setting the mem pool size */
1291- if (adreno_is_a610 (adreno_gpu )) {
1305+ if (adreno_is_a610 (adreno_gpu ) || adreno_is_a612 ( adreno_gpu ) ) {
12921306 gpu_write (gpu , REG_A6XX_CP_MEM_POOL_SIZE , 48 );
12931307 gpu_write (gpu , REG_A6XX_CP_MEM_POOL_DBG_ADDR , 47 );
12941308 } else if (adreno_is_a702 (adreno_gpu )) {
@@ -1321,7 +1335,8 @@ static int hw_init(struct msm_gpu *gpu)
13211335 a6xx_set_ubwc_config (gpu );
13221336
13231337 /* Enable fault detection */
1324- if (adreno_is_a730 (adreno_gpu ) ||
1338+ if (adreno_is_a612 (adreno_gpu ) ||
1339+ adreno_is_a730 (adreno_gpu ) ||
13251340 adreno_is_a740_family (adreno_gpu ))
13261341 gpu_write (gpu , REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL , (1 << 30 ) | 0xcfffff );
13271342 else if (adreno_is_a690 (adreno_gpu ))
@@ -1576,7 +1591,7 @@ static void a6xx_recover(struct msm_gpu *gpu)
15761591 */
15771592 gpu -> active_submits = 0 ;
15781593
1579- if (adreno_has_gmu_wrapper (adreno_gpu )) {
1594+ if (adreno_has_gmu_wrapper (adreno_gpu ) || adreno_has_rgmu ( adreno_gpu ) ) {
15801595 /* Drain the outstanding traffic on memory buses */
15811596 a6xx_bus_clear_pending_transactions (adreno_gpu , true);
15821597
@@ -2229,6 +2244,12 @@ static int a6xx_pm_resume(struct msm_gpu *gpu)
22292244 if (ret )
22302245 goto err_bulk_clk ;
22312246
2247+ ret = clk_bulk_prepare_enable (gmu -> nr_clocks , gmu -> clocks );
2248+ if (ret ) {
2249+ clk_bulk_disable_unprepare (gpu -> nr_clocks , gpu -> grp_clks );
2250+ goto err_bulk_clk ;
2251+ }
2252+
22322253 if (adreno_is_a619_holi (adreno_gpu ))
22332254 a6xx_sptprac_enable (gmu );
22342255
@@ -2242,8 +2263,10 @@ static int a6xx_pm_resume(struct msm_gpu *gpu)
22422263err_set_opp :
22432264 mutex_unlock (& a6xx_gpu -> gmu .lock );
22442265
2245- if (!ret )
2266+ if (!ret ) {
22462267 msm_devfreq_resume (gpu );
2268+ a6xx_llc_activate (a6xx_gpu );
2269+ }
22472270
22482271 return ret ;
22492272}
@@ -2284,6 +2307,8 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu)
22842307
22852308 trace_msm_gpu_suspend (0 );
22862309
2310+ a6xx_llc_deactivate (a6xx_gpu );
2311+
22872312 msm_devfreq_suspend (gpu );
22882313
22892314 mutex_lock (& a6xx_gpu -> gmu .lock );
@@ -2295,6 +2320,7 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu)
22952320 a6xx_sptprac_disable (gmu );
22962321
22972322 clk_bulk_disable_unprepare (gpu -> nr_clocks , gpu -> grp_clks );
2323+ clk_bulk_disable_unprepare (gmu -> nr_clocks , gmu -> clocks );
22982324
22992325 pm_runtime_put_sync (gmu -> gxpd );
23002326 dev_pm_opp_set_opp (& gpu -> pdev -> dev , NULL );
@@ -2673,7 +2699,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
26732699 ret = adreno_gpu_init (dev , pdev , adreno_gpu , & funcs_a7xx , 4 );
26742700 else if (is_a7xx )
26752701 ret = adreno_gpu_init (dev , pdev , adreno_gpu , & funcs_a7xx , 1 );
2676- else if (adreno_has_gmu_wrapper (adreno_gpu ))
2702+ else if (adreno_has_gmu_wrapper (adreno_gpu ) ||
2703+ of_device_is_compatible (node , "qcom,adreno-rgmu" ))
26772704 ret = adreno_gpu_init (dev , pdev , adreno_gpu , & funcs_gmuwrapper , 1 );
26782705 else
26792706 ret = adreno_gpu_init (dev , pdev , adreno_gpu , & funcs , 1 );
@@ -2689,7 +2716,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
26892716 if (adreno_is_a618 (adreno_gpu ) || adreno_is_7c3 (adreno_gpu ))
26902717 priv -> gpu_clamp_to_idle = true;
26912718
2692- if (adreno_has_gmu_wrapper (adreno_gpu ))
2719+ if (adreno_has_gmu_wrapper (adreno_gpu ) || adreno_has_rgmu ( adreno_gpu ) )
26932720 ret = a6xx_gmu_wrapper_init (a6xx_gpu , node );
26942721 else
26952722 ret = a6xx_gmu_init (a6xx_gpu , node );
0 commit comments