Skip to contentSkip to conversation

drm/amd: Fix initialization for nbio 4.3.0

PATCH In review Mario Limonciello 2 participants 2 messages Jan 30, 2023

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

PATCH 1/1 drm/amd: Fix initialization for nbio 4.3.0

A mistake has been made on some boards with NBIO 4.3.0 where some NBIO registers aren't properly set by the hardware.

Ensure that they're set during initialization.

---
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +7 -0
index 15eb3658d70e6..4b1c6946a60f3 100644
@@ -337,6 +337,13 @@ const struct nbio_hdp_flush_reg nbio_v4_3_hdp_flush_reg = {
 
 static void nbio_v4_3_init_registers(struct amdgpu_device *adev)
 {
+	if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(4, 3, 0)) {
+		uint32_t data;
+
+		data = RREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2);
+		data &= ~RCC_DEV0_EPF2_STRAP2__STRAP_NO_SOFT_RESET_DEV0_F2_MASK;
+		WREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2, data);
+	}
 	return;
 }
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Mario Limonciello

A mistake has been made on some boards with NBIO 4.3.0 where some NBIO registers aren't properly set by the hardware.

Ensure that they're set during initialization.

---
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +0 -0
index 15eb3658d70e6..4b1c6946a60f3 100644
@@ -337,6 +337,13 @@ const struct nbio_hdp_flush_reg nbio_v4_3_hdp_flush_reg = {
 

drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c const struct nbio_hdp_flush_reg nbio_v4_3_hdp_flush_reg = { · line 347

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +7 -0
 static void nbio_v4_3_init_registers(struct amdgpu_device *adev)
 {
+       if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(4, 3, 0)) {
+               uint32_t data;
+
+               data = RREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2);
+               data &= ~RCC_DEV0_EPF2_STRAP2__STRAP_NO_SOFT_RESET_DEV0_F2_MASK;
+               WREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF2_STRAP2, data);
+       }
        return;

You can drop the return here. With that, the patch is:

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +0 -1
 }
 
--

2.34.1