History

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.

Rob Clark committed 3 years ago

Commit 8559da81 parent 8ead9671 file · +8 −10Browse files

Unified · Split

drivers/gpu/drm/msm/adreno/a6xx_gmu.c+8−10
@@ -621,6 +621,8 @@ setup_pdc: · 620 unmodified lines
621621 /* ensure no writes happen before the uCode is fully written */
622622 wmb();
623623
624+ a6xx_rpmh_stop(gmu);
625+
624626 err:
625627 if (!IS_ERR_OR_NULL(pdcptr))
626628 iounmap(pdcptr);
@@ -753,7 +755,6 @@ static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu) · 126 unmodified lines
753755
754756 static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state)
755757 {
756− static bool rpmh_init;
757758 struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu);
758759 struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
759760 int ret;
@@ -776,15 +777,9 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) · 16 unmodified lines
776777 /* Turn on register retention */
777778 gmu_write(gmu, REG_A6XX_GMU_GENERAL_7, 1);
778779
779− /* We only need to load the RPMh microcode once */
780− if (!rpmh_init) {
781− a6xx_gmu_rpmh_init(gmu);
782− rpmh_init = true;
783− } else {
784− ret = a6xx_rpmh_start(gmu);
785− if (ret)
786− return ret;
787− }
780+ ret = a6xx_rpmh_start(gmu);
781+ if (ret)
782+ return ret;
788783
789784 ret = a6xx_gmu_fw_load(gmu);
790785 if (ret)
@@ -1670,6 +1665,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) · 879 unmodified lines
16701665 /* Set up the HFI queues */
16711666 a6xx_hfi_init(gmu);
16721667
1668+ /* Initialize RPMh */
1669+ a6xx_gmu_rpmh_init(gmu);
1670+
16731671 gmu->initialized = true;
16741672
16751673 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t