Commit 29a15221 authored by Alex Deucher's avatar Alex Deucher

drm/radeon: add support for thermal sensor on tn

Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6bd1c385
...@@ -692,6 +692,14 @@ int ni_init_microcode(struct radeon_device *rdev) ...@@ -692,6 +692,14 @@ int ni_init_microcode(struct radeon_device *rdev)
return err; return err;
} }
int tn_get_temp(struct radeon_device *rdev)
{
u32 temp = RREG32_SMC(TN_CURRENT_GNB_TEMP) & 0x7ff;
int actual_temp = (temp / 8) - 49;
return actual_temp * 1000;
}
/* /*
* Core functions * Core functions
*/ */
......
...@@ -489,6 +489,9 @@ ...@@ -489,6 +489,9 @@
# define CACHE_FLUSH_AND_INV_EVENT_TS (0x14 << 0) # define CACHE_FLUSH_AND_INV_EVENT_TS (0x14 << 0)
# define CACHE_FLUSH_AND_INV_EVENT (0x16 << 0) # define CACHE_FLUSH_AND_INV_EVENT (0x16 << 0)
/* TN SMU registers */
#define TN_CURRENT_GNB_TEMP 0x1F390
/* /*
* UVD * UVD
*/ */
......
...@@ -1897,6 +1897,7 @@ static struct radeon_asic trinity_asic = { ...@@ -1897,6 +1897,7 @@ static struct radeon_asic trinity_asic = {
.set_pcie_lanes = NULL, .set_pcie_lanes = NULL,
.set_clock_gating = NULL, .set_clock_gating = NULL,
.set_uvd_clocks = &sumo_set_uvd_clocks, .set_uvd_clocks = &sumo_set_uvd_clocks,
.get_temperature = &tn_get_temp,
}, },
.pflip = { .pflip = {
.pre_page_flip = &evergreen_pre_page_flip, .pre_page_flip = &evergreen_pre_page_flip,
......
...@@ -492,6 +492,7 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable); ...@@ -492,6 +492,7 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable);
void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode); void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode);
int evergreen_get_temp(struct radeon_device *rdev); int evergreen_get_temp(struct radeon_device *rdev);
int sumo_get_temp(struct radeon_device *rdev); int sumo_get_temp(struct radeon_device *rdev);
int tn_get_temp(struct radeon_device *rdev);
/* /*
* cayman * cayman
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment