aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-06-08 05:15:16 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-08-31 13:45:59 -0400
commit705e519e0ef1d1824c28ced3b1857a8608853dfb (patch)
tree2f4a44319b2f29320a231a0148fb4f2273fc815d
parent570144c6522f5f332635d20dfa278cfcc764229c (diff)
drm/amdgpu: move hw generation check into amdgpu_doorbell_init v2
This way we can safely call it on SI as well. v2: fix type in commit message Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 1c5c44acaad2..77a32b79e8f2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -403,6 +403,15 @@ void amdgpu_pci_config_reset(struct amdgpu_device *adev)
403 */ 403 */
404static int amdgpu_doorbell_init(struct amdgpu_device *adev) 404static int amdgpu_doorbell_init(struct amdgpu_device *adev)
405{ 405{
406 /* No doorbell on SI hardware generation */
407 if (adev->asic_type < CHIP_BONAIRE) {
408 adev->doorbell.base = 0;
409 adev->doorbell.size = 0;
410 adev->doorbell.num_doorbells = 0;
411 adev->doorbell.ptr = NULL;
412 return 0;
413 }
414
406 /* doorbell bar mapping */ 415 /* doorbell bar mapping */
407 adev->doorbell.base = pci_resource_start(adev->pdev, 2); 416 adev->doorbell.base = pci_resource_start(adev->pdev, 2);
408 adev->doorbell.size = pci_resource_len(adev->pdev, 2); 417 adev->doorbell.size = pci_resource_len(adev->pdev, 2);
@@ -2075,9 +2084,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
2075 DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base); 2084 DRM_INFO("register mmio base: 0x%08X\n", (uint32_t)adev->rmmio_base);
2076 DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size); 2085 DRM_INFO("register mmio size: %u\n", (unsigned)adev->rmmio_size);
2077 2086
2078 if (adev->asic_type >= CHIP_BONAIRE) 2087 /* doorbell bar mapping */
2079 /* doorbell bar mapping */ 2088 amdgpu_doorbell_init(adev);
2080 amdgpu_doorbell_init(adev);
2081 2089
2082 /* io port mapping */ 2090 /* io port mapping */
2083 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 2091 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
@@ -2304,8 +2312,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
2304 adev->rio_mem = NULL; 2312 adev->rio_mem = NULL;
2305 iounmap(adev->rmmio); 2313 iounmap(adev->rmmio);
2306 adev->rmmio = NULL; 2314 adev->rmmio = NULL;
2307 if (adev->asic_type >= CHIP_BONAIRE) 2315 amdgpu_doorbell_fini(adev);
2308 amdgpu_doorbell_fini(adev);
2309 amdgpu_debugfs_regs_cleanup(adev); 2316 amdgpu_debugfs_regs_cleanup(adev);
2310} 2317}
2311 2318