Skip to contentSkip to conversation

drm/amdgpu: set ih chicken bit for IH 4.4.2

PATCH New Alex Deucher 1 participant 3 messages Mar 1, 2023

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/3 drm/amdgpu: set ih chicken bit for IH 4.4.2

From: Le Ma <[email protected]>

Share same register address with IH 4.4.0.

---
 drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vega20_ih.c +2 -1
index 1706081d054d..44bfa233487a 100644
@@ -321,7 +321,8 @@ static int vega20_ih_irq_init(struct amdgpu_device *adev)
 	/* psp firmware won't program IH_CHICKEN for aldebaran
 	 * driver needs to program it properly according to
 	 * MC_SPACE type in IH_RB_CNTL */
-	if (adev->ip_versions[OSSSYS_HWIP][0] == IP_VERSION(4, 4, 0)) {
+	if ((adev->ip_versions[OSSSYS_HWIP][0] == IP_VERSION(4, 4, 0)) ||
+	    (adev->ip_versions[OSSSYS_HWIP][0] == IP_VERSION(4, 4, 2))) {
 		ih_chicken = RREG32_SOC15(OSSSYS, 0, mmIH_CHICKEN_ALDEBARAN);
 		if (adev->irq.ih.use_bus_addr) {
 			ih_chicken = REG_SET_FIELD(ih_chicken, IH_CHICKEN,
Signature · 1 line
2.39.2
author maintainer
#1 lore raw

PATCH 2/3 drm/amdgpu: skip ih2 rb allocation for IH 4.4.2

From: Le Ma <[email protected]>

No ih2 hardware on IH 4.4.2.

---
 drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/vega20_ih.c +7 -5
index 44bfa233487a..827e2768f867 100644
@@ -552,12 +552,14 @@ static int vega20_ih_sw_init(void *handle)
 	adev->irq.ih1.use_doorbell = true;
 	adev->irq.ih1.doorbell_index = (adev->doorbell_index.ih + 1) << 1;
 
-	r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);
-	if (r)
-		return r;
+	if (adev->ip_versions[OSSSYS_HWIP][0] != IP_VERSION(4, 4, 2)) {
+		r = amdgpu_ih_ring_init(adev, &adev->irq.ih2, PAGE_SIZE, true);
+		if (r)
+			return r;
 
-	adev->irq.ih2.use_doorbell = true;
-	adev->irq.ih2.doorbell_index = (adev->doorbell_index.ih + 2) << 1;
+		adev->irq.ih2.use_doorbell = true;
+		adev->irq.ih2.doorbell_index = (adev->doorbell_index.ih + 2) << 1;
+	}
 
 	/* initialize ih control registers offset */
 	vega20_ih_init_register_offset(adev);
Signature · 1 line
2.39.2
author maintainer
#2 lore raw

PATCH 3/3 drm/amdgpu: add IH ip block for IH 4.4.2

In reply to Alex Deucher

From: Hawking Zhang <[email protected]>

Add IH IP handling for IH 4.4.2

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
index ea040adb1f15..a610fc922df1 100644
@@ -1583,6 +1583,7 @@ static int amdgpu_discovery_set_ih_ip_blocks(struct amdgpu_device *adev)
 	case IP_VERSION(4, 2, 0):
 	case IP_VERSION(4, 2, 1):
 	case IP_VERSION(4, 4, 0):
+	case IP_VERSION(4, 4, 2):
 		amdgpu_device_ip_block_add(adev, &vega20_ih_ip_block);
 		break;
 	case IP_VERSION(5, 0, 0):
Signature · 1 line
2.39.2