Commit 8559da8f authored by Rob Clark's avatar Rob Clark

drm/msm/a6xx: Move ioremap out of hw_init path

Move the one-time RPMh setup to a6xx_gmu_init().  To get rid of the hack
for one-time init vs start, add in an extra a6xx_rpmh_stop() at the end
of the init sequence.
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/527854/
Link: https://lore.kernel.org/r/20230320144356.803762-15-robdclark@gmail.com
parent 8ead9678
...@@ -621,6 +621,8 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu) ...@@ -621,6 +621,8 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
/* ensure no writes happen before the uCode is fully written */ /* ensure no writes happen before the uCode is fully written */
wmb(); wmb();
a6xx_rpmh_stop(gmu);
err: err:
if (!IS_ERR_OR_NULL(pdcptr)) if (!IS_ERR_OR_NULL(pdcptr))
iounmap(pdcptr); iounmap(pdcptr);
...@@ -753,7 +755,6 @@ static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu) ...@@ -753,7 +755,6 @@ static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu)
static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
{ {
static bool rpmh_init;
struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu); struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu);
struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
int ret; int ret;
...@@ -776,15 +777,9 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) ...@@ -776,15 +777,9 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
/* Turn on register retention */ /* Turn on register retention */
gmu_write(gmu, REG_A6XX_GMU_GENERAL_7, 1); gmu_write(gmu, REG_A6XX_GMU_GENERAL_7, 1);
/* We only need to load the RPMh microcode once */ ret = a6xx_rpmh_start(gmu);
if (!rpmh_init) { if (ret)
a6xx_gmu_rpmh_init(gmu); return ret;
rpmh_init = true;
} else {
ret = a6xx_rpmh_start(gmu);
if (ret)
return ret;
}
ret = a6xx_gmu_fw_load(gmu); ret = a6xx_gmu_fw_load(gmu);
if (ret) if (ret)
...@@ -1670,6 +1665,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) ...@@ -1670,6 +1665,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
/* Set up the HFI queues */ /* Set up the HFI queues */
a6xx_hfi_init(gmu); a6xx_hfi_init(gmu);
/* Initialize RPMh */
a6xx_gmu_rpmh_init(gmu);
gmu->initialized = true; gmu->initialized = true;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment