Skip to contentSkip to conversation

drm/amdgpu/psp11: simplify the ucode register logic

PATCH In review Alex Deucher 2 participants 2 messages Jul 6, 2019 1 message not in the archive

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

PATCH 1/1 drm/amdgpu/psp11: simplify the ucode register logic

Split it between navi10 and newer and everything before navi10.

---
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +4 -8
index 9abf611cc2ed..1b6c20ca3589 100644
@@ -538,12 +538,10 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
 
 	case AMDGPU_UCODE_ID_RLC_G:
 		*sram_offset = 0x2000;
-		if (adev->asic_type != CHIP_NAVI10 &&
-		    adev->asic_type != CHIP_NAVI14) {
+		if (adev->asic_type < CHIP_NAVI10) {
 			*sram_addr_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_ADDR);
 			*sram_data_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_DATA);
-		}
-		else {
+		} else {
 			*sram_addr_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmRLC_GPM_UCODE_ADDR_NV10;
 			*sram_data_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmRLC_GPM_UCODE_DATA_NV10;
 		}
@@ -551,12 +549,10 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
 
 	case AMDGPU_UCODE_ID_SDMA0:
 		*sram_offset = 0x0;
-		if (adev->asic_type != CHIP_NAVI10 &&
-		    adev->asic_type != CHIP_NAVI14) {
+		if (adev->asic_type < CHIP_NAVI10) {
 			*sram_addr_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_ADDR);
 			*sram_data_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_DATA);
-		}
-		else {
+		} else {
 			*sram_addr_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmSDMA0_UCODE_ADDR_NV10;
 			*sram_data_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmSDMA0_UCODE_DATA_NV10;
 		}
Signature · 6 lines
2.20.1

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

A message that is not in the archive (sent off-list or not yet received): 20190706061313.28385-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Xiaojie Yuan
#2 lore raw

BR,
Xiaojie

________________________________________
From: amd-gfx <[email protected]> on behalf of Alex Deucher <[email protected]>
Sent: Saturday, July 6, 2019 2:13 PM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH] drm/amdgpu/psp11: simplify the ucode register logic

Split it between navi10 and newer and everything before navi10.

---
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +4 -8
index 9abf611cc2ed..1b6c20ca3589 100644
@@ -538,12 +538,10 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
 
        case AMDGPU_UCODE_ID_RLC_G:
                *sram_offset = 0x2000;
-               if (adev->asic_type != CHIP_NAVI10 &&
-                   adev->asic_type != CHIP_NAVI14) {
+               if (adev->asic_type < CHIP_NAVI10) {
                        *sram_addr_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_ADDR);
                        *sram_data_reg_offset = SOC15_REG_OFFSET(GC, 0, mmRLC_GPM_UCODE_DATA);
-               }
-               else {
+               } else {
                        *sram_addr_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmRLC_GPM_UCODE_ADDR_NV10;
                        *sram_data_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmRLC_GPM_UCODE_DATA_NV10;
                }
@@ -551,12 +549,10 @@ psp_v11_0_sram_map(struct amdgpu_device *adev,
 
        case AMDGPU_UCODE_ID_SDMA0:
                *sram_offset = 0x0;
-               if (adev->asic_type != CHIP_NAVI10 &&
-                   adev->asic_type != CHIP_NAVI14) {
+               if (adev->asic_type < CHIP_NAVI10) {
                        *sram_addr_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_ADDR);
                        *sram_data_reg_offset = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA0_UCODE_DATA);
-               }
-               else {
+               } else {
                        *sram_addr_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmSDMA0_UCODE_ADDR_NV10;
                        *sram_data_reg_offset = adev->reg_offset[GC_HWIP][0][1] + mmSDMA0_UCODE_DATA_NV10;
                }

--
2.20.1

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