Skip to contentSkip to conversation

drm/amdgpu/soc15: fix using ip discovery tables on renoir

PATCH In review Alex Deucher 1 participant 2 messages Jun 5, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/soc15: fix using ip discovery tables on renoir

The PWR block moved into SMUIO, so the ip discovery table doesn't have an entry for PWR, but the register has the same absolute offset, so just patch up the offsets after updating the offsets from the IP discovery table.

---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +5 -1
index 623745b2d8b3..21f29685f158 100644
@@ -670,7 +670,7 @@ static uint32_t soc15_get_rev_id(struct amdgpu_device *adev)
 
 int soc15_set_ip_blocks(struct amdgpu_device *adev)
 {
-	int r;
+	int r, i;
 
 	/* Set IP register base before any HW register access */
 	switch (adev->asic_type) {
@@ -686,6 +686,10 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 				DRM_WARN("failed to init reg base from ip discovery table, "
 					 "fallback to legacy init method\n");
 				vega10_reg_base_init(adev);
+			} else {
+				/* PWR block was merged into SMUIO on renoir */
+				for (i = 0 ; i < HWIP_MAX_INSTANCE; ++i)
+					adev->reg_offset[PWR_HWIP][i] = adev->reg_offset[SMUIO_HWIP][i];
 			}
 		}
 		break;
Signature · 6 lines
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 7 lines · Alex Deucher

The PWR block moved into SMUIO, so the ip discovery table doesn't have an entry for PWR, but the register has the same absolute offset, so just patch up the offsets after updating the offsets from the IP discovery table.

Nevermind. this won't work.

Quoted 29 lines
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +5 -2
index 623745b2d8b3..21f29685f158 100644
@@ -670,7 +670,7 @@ static uint32_t soc15_get_rev_id(struct amdgpu_device *adev)
 
 int soc15_set_ip_blocks(struct amdgpu_device *adev)
 {
-       int r;
+       int r, i;
 
        /* Set IP register base before any HW register access */
        switch (adev->asic_type) {
@@ -686,6 +686,10 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
                                DRM_WARN("failed to init reg base from ip discovery table, "
                                         "fallback to legacy init method\n");
                                vega10_reg_base_init(adev);
+                       } else {
+                               /* PWR block was merged into SMUIO on renoir */
+                               for (i = 0 ; i < HWIP_MAX_INSTANCE; ++i)
+                                       adev->reg_offset[PWR_HWIP][i] = adev->reg_offset[SMUIO_HWIP][i];
                        }
                }
                break;
--
Quoted 2 lines

2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx