drm/amdgpu:use smc_index_11 for VI
authorMonk Liu <Monk.Liu@amd.com>
Tue, 29 Mar 2016 03:01:51 +0000 (11:01 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Oct 2016 18:38:20 +0000 (14:38 -0400)
for VI smc, index_0 to index_8 are all not safe,
they may used by BIOS/FW, and index_11 is reserved
only for driver.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vi.c
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_1_d.h
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_2_d.h
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_3_d.h
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.h

index c0d9aad7126f4a16e067e19e76067d0a3248e8d9..ea3331c40391b54d216d443f2b84e146877111e6 100644 (file)
@@ -121,8 +121,8 @@ static u32 vi_smc_rreg(struct amdgpu_device *adev, u32 reg)
        u32 r;
 
        spin_lock_irqsave(&adev->smc_idx_lock, flags);
-       WREG32(mmSMC_IND_INDEX_0, (reg));
-       r = RREG32(mmSMC_IND_DATA_0);
+       WREG32(mmSMC_IND_INDEX_11, (reg));
+       r = RREG32(mmSMC_IND_DATA_11);
        spin_unlock_irqrestore(&adev->smc_idx_lock, flags);
        return r;
 }
@@ -132,8 +132,8 @@ static void vi_smc_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
        unsigned long flags;
 
        spin_lock_irqsave(&adev->smc_idx_lock, flags);
-       WREG32(mmSMC_IND_INDEX_0, (reg));
-       WREG32(mmSMC_IND_DATA_0, (v));
+       WREG32(mmSMC_IND_INDEX_11, (reg));
+       WREG32(mmSMC_IND_DATA_11, (v));
        spin_unlock_irqrestore(&adev->smc_idx_lock, flags);
 }
 
@@ -437,12 +437,12 @@ static bool vi_read_bios_from_rom(struct amdgpu_device *adev,
        /* take the smc lock since we are using the smc index */
        spin_lock_irqsave(&adev->smc_idx_lock, flags);
        /* set rom index to 0 */
-       WREG32(mmSMC_IND_INDEX_0, ixROM_INDEX);
-       WREG32(mmSMC_IND_DATA_0, 0);
+       WREG32(mmSMC_IND_INDEX_11, ixROM_INDEX);
+       WREG32(mmSMC_IND_DATA_11, 0);
        /* set index to data for continous read */
-       WREG32(mmSMC_IND_INDEX_0, ixROM_DATA);
+       WREG32(mmSMC_IND_INDEX_11, ixROM_DATA);
        for (i = 0; i < length_dw; i++)
-               dw_ptr[i] = RREG32(mmSMC_IND_DATA_0);
+               dw_ptr[i] = RREG32(mmSMC_IND_DATA_11);
        spin_unlock_irqrestore(&adev->smc_idx_lock, flags);
 
        return true;
index 3014d4a58c43a2e3c6099890239e22ee390258f7..a9ef1562f43bde57536802d3df0371e444e30672 100644 (file)
 #define mmSMU1_SMU_SMC_IND_DATA                                                 0x83
 #define mmSMU2_SMU_SMC_IND_DATA                                                 0x85
 #define mmSMU3_SMU_SMC_IND_DATA                                                 0x87
+#define mmSMC_IND_INDEX_11                                                                                                             0x1AC
+#define mmSMC_IND_DATA_11                                                                                                              0x1AD
 #define ixRCU_UC_EVENTS                                                         0xc0000004
 #define ixRCU_MISC_CTRL                                                         0xc0000010
 #define ixCC_RCU_FUSES                                                          0xc00c0000
index 93391747998591b9df6caff88cf43bf554ebff2d..22dd4c2b7290647250a7391c9a6dc42a321003c2 100644 (file)
@@ -87,6 +87,8 @@
 #define mmSMC_IND_DATA_6                                                        0x8d
 #define mmSMC_IND_INDEX_7                                                       0x8e
 #define mmSMC_IND_DATA_7                                                        0x8f
+#define mmSMC_IND_INDEX_11                                                                                                             0x1AC
+#define mmSMC_IND_DATA_11                                                                                                              0x1AD
 #define mmSMC_IND_ACCESS_CNTL                                                   0x92
 #define mmSMC_MESSAGE_0                                                         0x94
 #define mmSMC_RESP_0                                                            0x95
index 44b1855cb8df574e3eea7df650767781a005240b..eca2b851f25f78c14bb04d850feac1d15b0ff7fa 100644 (file)
@@ -90,6 +90,8 @@
 #define mmSMC_IND_DATA_6                                                        0x8d
 #define mmSMC_IND_INDEX_7                                                       0x8e
 #define mmSMC_IND_DATA_7                                                        0x8f
+#define mmSMC_IND_INDEX_11                                                                                                             0x1AC
+#define mmSMC_IND_DATA_11                                                                                                              0x1AD
 #define mmSMC_IND_ACCESS_CNTL                                                   0x92
 #define mmSMC_MESSAGE_0                                                         0x94
 #define mmSMC_RESP_0                                                            0x95
index 76352f2423aebf3780e1efeba0c5e1b108ebe651..919be435b49c890368ca0f3dc6906fb3f90ddf2f 100644 (file)
@@ -28,8 +28,6 @@
 #include <pp_endian.h>
 
 #define SMC_RAM_END 0x40000
-#define mmSMC_IND_INDEX_11                              0x01AC
-#define mmSMC_IND_DATA_11                               0x01AD
 
 struct smu7_buffer_entry {
        uint32_t data_size;