]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/powerplay: implement check_fw_status function for smu11
authorKevin Wang <Kevin1.Wang@amd.com>
Mon, 10 Dec 2018 05:31:56 +0000 (13:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:03:55 +0000 (15:03 -0500)
Add function of check firmware status funtions for smu11

Signed-off-by: Kevin Wang <Kevin1.Wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h
drivers/gpu/drm/amd/powerplay/smu_v11_0.c

index b5c5bca59d309cbe55a4529e7b544ad8c0bcc72b..6ba5bde134a02cf3a6923adaa5c8318f5fee4aa9 100644 (file)
 
 #include "amdgpu_smu.h"
 
+/* MP Apertures */
+#define MP0_Public                     0x03800000
+#define MP0_SRAM                       0x03900000
+#define MP1_Public                     0x03b00000
+#define MP1_SRAM                       0x03c00004
+
+/* address block */
+#define smnMP1_FIRMWARE_FLAGS          0x3010024
+#define smnMP0_FW_INTF                 0x30101c0
+#define smnMP1_PUB_CTRL                        0x3010b14
+
 void smu_v11_0_set_smu_funcs(struct smu_context *smu);
 
 #endif
index feee3e8329fc2248b8a688c5396c1dd361f59cc9..142ad1da5690f6a453ee444ec52554e85c3b1e6c 100644 (file)
@@ -168,7 +168,18 @@ static int smu_v11_0_load_microcode(struct smu_context *smu)
 
 static int smu_v11_0_check_fw_status(struct smu_context *smu)
 {
-       return 0;
+       struct amdgpu_device *adev = smu->adev;
+       uint32_t mp1_fw_flags;
+
+       WREG32_SOC15(NBIF, 0, mmPCIE_INDEX2,
+                    (MP1_Public | (smnMP1_FIRMWARE_FLAGS & 0xffffffff)));
+
+       mp1_fw_flags = RREG32_SOC15(NBIF, 0, mmPCIE_DATA2);
+
+       if ((mp1_fw_flags & MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED_MASK) >>
+           MP1_FIRMWARE_FLAGS__INTERRUPTS_ENABLED__SHIFT)
+               return 0;
+       return -EIO;
 }
 
 static const struct smu_funcs smu_v11_0_funcs = {