Skip to content

Commit ad4968d

Browse files
fltorobclark
authored andcommitted
drm/msm/a6xx: enable GMU log
This is required for a650 to work. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 02ef80c commit ad4968d

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ static int a6xx_gmu_start(struct a6xx_gmu *gmu)
209209
u32 val;
210210

211211
gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1);
212+
213+
/* Set the log wptr index
214+
* note: downstream saves the value in poweroff and restores it here
215+
*/
216+
gmu_write(gmu, REG_A6XX_GPU_GMU_CX_GMU_PWR_COL_CP_RESP, 0);
217+
212218
gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 0);
213219

214220
ret = gmu_poll_timeout(gmu, REG_A6XX_GMU_CM3_FW_INIT_RESULT, val,
@@ -752,6 +758,9 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
752758

753759
gmu_write(gmu, REG_A6XX_GMU_HFI_SFR_ADDR, chipid);
754760

761+
gmu_write(gmu, REG_A6XX_GPU_GMU_CX_GMU_PWR_COL_CP_MSG,
762+
gmu->log.iova | (gmu->log.size / SZ_4K - 1));
763+
755764
/* Set up the lowest idle level on the GMU */
756765
a6xx_gmu_power_config(gmu);
757766

@@ -1057,6 +1066,7 @@ static void a6xx_gmu_memory_free(struct a6xx_gmu *gmu)
10571066
msm_gem_kernel_put(gmu->icache.obj, gmu->aspace, false);
10581067
msm_gem_kernel_put(gmu->dcache.obj, gmu->aspace, false);
10591068
msm_gem_kernel_put(gmu->dummy.obj, gmu->aspace, false);
1069+
msm_gem_kernel_put(gmu->log.obj, gmu->aspace, false);
10601070

10611071
gmu->aspace->mmu->funcs->detach(gmu->aspace->mmu);
10621072
msm_gem_address_space_put(gmu->aspace);
@@ -1461,6 +1471,11 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
14611471
if (ret)
14621472
goto err_memory;
14631473

1474+
/* Allocate memory for the GMU log region */
1475+
ret = a6xx_gmu_memory_alloc(gmu, &gmu->log, SZ_4K, 0);
1476+
if (ret)
1477+
goto err_memory;
1478+
14641479
/* Map the GMU registers */
14651480
gmu->mmio = a6xx_gmu_get_mmio(pdev, "gmu");
14661481
if (IS_ERR(gmu->mmio)) {

drivers/gpu/drm/msm/adreno/a6xx_gmu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ struct a6xx_gmu {
6161
struct a6xx_gmu_bo icache;
6262
struct a6xx_gmu_bo dcache;
6363
struct a6xx_gmu_bo dummy;
64+
struct a6xx_gmu_bo log;
6465

6566
int nr_clocks;
6667
struct clk_bulk_data *clocks;

drivers/gpu/drm/msm/adreno/a6xx_gmu.xml.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ static inline uint32_t A6XX_GMU_GPU_NAP_CTRL_SID(uint32_t val)
205205

206206
#define REG_A6XX_GPU_GMU_CX_GMU_CX_FAL_INTF 0x000050f0
207207

208+
#define REG_A6XX_GPU_GMU_CX_GMU_PWR_COL_CP_MSG 0x00005100
209+
210+
#define REG_A6XX_GPU_GMU_CX_GMU_PWR_COL_CP_RESP 0x00005101
211+
208212
#define REG_A6XX_GMU_BOOT_KMD_LM_HANDSHAKE 0x000051f0
209213

210214
#define REG_A6XX_GMU_LLM_GLM_SLEEP_CTRL 0x00005157

0 commit comments

Comments
 (0)