Reviewed-by: Xiaojie Yuan <[email protected]>

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.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 9abf611cc2ed..1b6c20ca3589 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -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

Reply via email to