dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: airlied@gmail.com, dri-devel@lists.freedesktop.org
Subject: [PATCH 15/20] drm/radeon/kms: add thermal sensor support for fusion APUs
Date: Mon, 22 Nov 2010 17:56:32 -0500	[thread overview]
Message-ID: <1290466597-30596-15-git-send-email-alexdeucher@gmail.com> (raw)
In-Reply-To: <1290466597-30596-1-git-send-email-alexdeucher@gmail.com>

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/radeon/evergreen.c  |    8 ++++++++
 drivers/gpu/drm/radeon/evergreend.h |    4 +++-
 drivers/gpu/drm/radeon/radeon.h     |    2 ++
 drivers/gpu/drm/radeon/radeon_pm.c  |    4 ++++
 4 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 7f859ff..075d6c1 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -57,6 +57,14 @@ u32 evergreen_get_temp(struct radeon_device *rdev)
 	return actual_temp * 1000;
 }
 
+u32 sumo_get_temp(struct radeon_device *rdev)
+{
+	u32 temp = RREG32(CG_THERMAL_STATUS) & 0xff;
+	u32 actual_temp = (temp >> 1) & 0xff;
+
+	return actual_temp * 1000;
+}
+
 void evergreen_pm_misc(struct radeon_device *rdev)
 {
 	int req_ps_idx = rdev->pm.requested_power_state_index;
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h
index 9644b1c..87fcaba 100644
--- a/drivers/gpu/drm/radeon/evergreend.h
+++ b/drivers/gpu/drm/radeon/evergreend.h
@@ -164,11 +164,13 @@
 #define		SE_SC_BUSY					(1 << 29)
 #define		SE_DB_BUSY					(1 << 30)
 #define		SE_CB_BUSY					(1 << 31)
-
+/* evergreen */
 #define	CG_MULT_THERMAL_STATUS				0x740
 #define		ASIC_T(x)			        ((x) << 16)
 #define		ASIC_T_MASK			        0x7FF0000
 #define		ASIC_T_SHIFT			        16
+/* APU */
+#define	CG_THERMAL_STATUS			        0x678
 
 #define	HDP_HOST_PATH_CNTL				0x2C00
 #define	HDP_NONSURFACE_BASE				0x2C04
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index bf3a4fc..0507ee7 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -180,6 +180,7 @@ void rs690_pm_info(struct radeon_device *rdev);
 extern u32 rv6xx_get_temp(struct radeon_device *rdev);
 extern u32 rv770_get_temp(struct radeon_device *rdev);
 extern u32 evergreen_get_temp(struct radeon_device *rdev);
+extern u32 sumo_get_temp(struct radeon_device *rdev);
 
 /*
  * Fences.
@@ -687,6 +688,7 @@ enum radeon_int_thermal_type {
 	THERMAL_TYPE_RV6XX,
 	THERMAL_TYPE_RV770,
 	THERMAL_TYPE_EVERGREEN,
+	THERMAL_TYPE_SUMO,
 };
 
 struct radeon_voltage {
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 8c9b2ef..ac4efb0 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -449,6 +449,9 @@ static ssize_t radeon_hwmon_show_temp(struct device *dev,
 	case THERMAL_TYPE_EVERGREEN:
 		temp = evergreen_get_temp(rdev);
 		break;
+	case THERMAL_TYPE_SUMO:
+		temp = sumo_get_temp(rdev);
+		break;
 	default:
 		temp = 0;
 		break;
@@ -487,6 +490,7 @@ static int radeon_hwmon_init(struct radeon_device *rdev)
 	case THERMAL_TYPE_RV6XX:
 	case THERMAL_TYPE_RV770:
 	case THERMAL_TYPE_EVERGREEN:
+	case THERMAL_TYPE_SUMO:
 		rdev->pm.int_hwmon_dev = hwmon_device_register(rdev->dev);
 		if (IS_ERR(rdev->pm.int_hwmon_dev)) {
 			err = PTR_ERR(rdev->pm.int_hwmon_dev);
-- 
1.7.1.1

  parent reply	other threads:[~2010-11-22 22:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 22:56 [PATCH 01/20] drm/radeon/kms: setup mc chremap properly on r7xx/evergreen Alex Deucher
2010-11-22 22:56 ` [PATCH 02/20] drm/radeon/kms: upstream ObjectID.h updates Alex Deucher
2010-11-22 22:56 ` [PATCH 03/20] drm/radeon/kms: upstream atombios.h updates Alex Deucher
2010-11-22 22:56 ` [PATCH 04/20] drm/radeon/kms: upstream power table updates Alex Deucher
2010-11-22 22:56 ` [PATCH 05/20] drm/radeon/kms: add new family id for AMD Ontario APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 06/20] drm/radeon/kms: atom changes for DCE4.1 devices Alex Deucher
2010-11-22 22:56 ` [PATCH 07/20] drm/radeon/kms: Add support for external encoders on fusion APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 08/20] drm/radeon/kms: add support for ss overrides on Fusion APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 09/20] drm/radeon/kms: move r7xx/evergreen to its own vram_gtt setup function Alex Deucher
2010-11-22 22:56 ` [PATCH 10/20] drm/radeon/kms: MC setup changes for fusion APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 11/20] drm/radeon/kms: evergreen.c updates for fusion Alex Deucher
2010-11-22 22:56 ` [PATCH 12/20] drm/radeon/kms: fill in GPU init for AMD Ontario Fusion APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 13/20] drm/radeon/kms: add radeon_asic struct for AMD Ontario fusion APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 14/20] drm/radeon/kms: add Ontario APU ucode loading support Alex Deucher
2010-11-22 22:56 ` Alex Deucher [this message]
2010-11-22 22:56 ` [PATCH 16/20] drm/radeon/kms: add bo blit support for Ontario fusion APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 17/20] drm/radeon/kms: refactor atombios power state fetching Alex Deucher
2010-11-22 22:56 ` [PATCH 18/20] drm/radeon/kms: add power table parsing support for Ontario fusion APUs Alex Deucher
2010-11-22 22:56 ` [PATCH 19/20] drm/radeon/kms: enable MSIs on " Alex Deucher
2010-11-22 22:56 ` [PATCH 20/20] drm/radeon/kms: add Ontario Fusion APU pci ids Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290466597-30596-15-git-send-email-alexdeucher@gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox