Commit 4d2997ab authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: add a wrapper for atom asic_init

This allows us to add asic specific workarounds for atom
asic init while keeping the adev specifics out of the
atombios parser code.
Acked-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a7173731
...@@ -653,6 +653,20 @@ static void amdgpu_block_invalid_wreg(struct amdgpu_device *adev, ...@@ -653,6 +653,20 @@ static void amdgpu_block_invalid_wreg(struct amdgpu_device *adev,
BUG(); BUG();
} }
/**
* amdgpu_device_asic_init - Wrapper for atom asic_init
*
* @dev: drm_device pointer
*
* Does any asic specific work and then calls atom asic init.
*/
static int amdgpu_device_asic_init(struct amdgpu_device *adev)
{
amdgpu_asic_pre_asic_init(adev);
return amdgpu_atom_asic_init(adev->mode_info.atom_context);
}
/** /**
* amdgpu_device_vram_scratch_init - allocate the VRAM scratch page * amdgpu_device_vram_scratch_init - allocate the VRAM scratch page
* *
...@@ -3201,7 +3215,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -3201,7 +3215,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
goto failed; goto failed;
} }
DRM_INFO("GPU posting now...\n"); DRM_INFO("GPU posting now...\n");
r = amdgpu_atom_asic_init(adev->mode_info.atom_context); r = amdgpu_device_asic_init(adev);
if (r) { if (r) {
dev_err(adev->dev, "gpu post error!\n"); dev_err(adev->dev, "gpu post error!\n");
goto failed; goto failed;
...@@ -3549,7 +3563,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon) ...@@ -3549,7 +3563,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
/* post card */ /* post card */
if (amdgpu_device_need_post(adev)) { if (amdgpu_device_need_post(adev)) {
r = amdgpu_atom_asic_init(adev->mode_info.atom_context); r = amdgpu_device_asic_init(adev);
if (r) if (r)
dev_err(adev->dev, "amdgpu asic init failed\n"); dev_err(adev->dev, "amdgpu asic init failed\n");
} }
...@@ -4106,7 +4120,7 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive, ...@@ -4106,7 +4120,7 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive,
list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) { list_for_each_entry(tmp_adev, device_list_handle, gmc.xgmi.head) {
if (need_full_reset) { if (need_full_reset) {
/* post card */ /* post card */
if (amdgpu_atom_asic_init(tmp_adev->mode_info.atom_context)) if (amdgpu_device_asic_init(tmp_adev))
dev_warn(tmp_adev->dev, "asic atom init failed!"); dev_warn(tmp_adev->dev, "asic atom init failed!");
if (!r) { if (!r) {
......
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