Commit 1062ddb6 authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Alex Deucher

drm/amd/amdgpu: Enabling Power Gating for Stoney platform

Removed condition checks to skip the power gating feature for
stoney platform.
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarVijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent be2d6aa5
...@@ -301,7 +301,7 @@ static int acp_hw_init(void *handle) ...@@ -301,7 +301,7 @@ static int acp_hw_init(void *handle)
acp_base = adev->rmmio_base; acp_base = adev->rmmio_base;
if (adev->asic_type != CHIP_STONEY) {
adev->acp.acp_genpd = kzalloc(sizeof(struct acp_pm_domain), GFP_KERNEL); adev->acp.acp_genpd = kzalloc(sizeof(struct acp_pm_domain), GFP_KERNEL);
if (adev->acp.acp_genpd == NULL) if (adev->acp.acp_genpd == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -314,7 +314,6 @@ static int acp_hw_init(void *handle) ...@@ -314,7 +314,6 @@ static int acp_hw_init(void *handle)
adev->acp.acp_genpd->cgs_dev = adev->acp.cgs_device; adev->acp.acp_genpd->cgs_dev = adev->acp.cgs_device;
pm_genpd_init(&adev->acp.acp_genpd->gpd, NULL, false); pm_genpd_init(&adev->acp.acp_genpd->gpd, NULL, false);
}
adev->acp.acp_cell = kcalloc(ACP_DEVS, sizeof(struct mfd_cell), adev->acp.acp_cell = kcalloc(ACP_DEVS, sizeof(struct mfd_cell),
GFP_KERNEL); GFP_KERNEL);
...@@ -431,7 +430,7 @@ static int acp_hw_init(void *handle) ...@@ -431,7 +430,7 @@ static int acp_hw_init(void *handle)
if (r) if (r)
return r; return r;
if (adev->asic_type != CHIP_STONEY) {
for (i = 0; i < ACP_DEVS ; i++) { for (i = 0; i < ACP_DEVS ; i++) {
dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i);
r = pm_genpd_add_device(&adev->acp.acp_genpd->gpd, dev); r = pm_genpd_add_device(&adev->acp.acp_genpd->gpd, dev);
...@@ -440,7 +439,7 @@ static int acp_hw_init(void *handle) ...@@ -440,7 +439,7 @@ static int acp_hw_init(void *handle)
return r; return r;
} }
} }
}
/* Assert Soft reset of ACP */ /* Assert Soft reset of ACP */
val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET);
...@@ -499,7 +498,7 @@ static int acp_hw_fini(void *handle) ...@@ -499,7 +498,7 @@ static int acp_hw_fini(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
/* return early if no ACP */ /* return early if no ACP */
if (!adev->acp.acp_cell) { if (!adev->acp.acp_genpd) {
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false); amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false);
return 0; return 0;
} }
...@@ -540,7 +539,6 @@ static int acp_hw_fini(void *handle) ...@@ -540,7 +539,6 @@ static int acp_hw_fini(void *handle)
udelay(100); udelay(100);
} }
if (adev->acp.acp_genpd) {
for (i = 0; i < ACP_DEVS ; i++) { for (i = 0; i < ACP_DEVS ; i++) {
dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i);
ret = pm_genpd_remove_device(dev); ret = pm_genpd_remove_device(dev);
...@@ -548,11 +546,10 @@ static int acp_hw_fini(void *handle) ...@@ -548,11 +546,10 @@ static int acp_hw_fini(void *handle)
if (ret) if (ret)
dev_err(dev, "remove dev from genpd failed\n"); dev_err(dev, "remove dev from genpd failed\n");
} }
kfree(adev->acp.acp_genpd);
}
mfd_remove_devices(adev->acp.parent); mfd_remove_devices(adev->acp.parent);
kfree(adev->acp.acp_res); kfree(adev->acp.acp_res);
kfree(adev->acp.acp_genpd);
kfree(adev->acp.acp_cell); kfree(adev->acp.acp_cell);
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