Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154942026
D16855.id47144.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
949 B
Referenced Files
None
Subscribers
None
D16855.id47144.diff
View Options
Index: sys/dev/amdtemp/amdtemp.c
===================================================================
--- sys/dev/amdtemp/amdtemp.c
+++ sys/dev/amdtemp/amdtemp.c
@@ -132,6 +132,12 @@
*/
#define AMDTEMP_CPUID 0xfc
+/*
+ * AMD Family 17h range select mask
+ */
+#define AMDTEMP_17H_RANGE_SEL (1 << 19)
+#define AMDTEMP_17H_OFFSET_VAL 490
+
/*
* Device methods.
*/
@@ -591,14 +597,16 @@
amdtemp_gettemp17h(device_t dev, amdsensor_t sensor)
{
struct amdtemp_softc *sc = device_get_softc(dev);
- uint32_t temp;
+ uint32_t temp, val;
int error;
- error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &temp);
+ error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, &val);
KASSERT(error == 0, ("amdsmn_read"));
- temp = ((temp >> 21) & 0x7ff) * 5 / 4;
+ temp = ((val >> 21) & 0x7ff) * 5 / 4;
temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10;
+ if (val & AMDTEMP_17H_RANGE_SEL)
+ temp -= AMDTEMP_17H_OFFSET_VAL;
return (temp);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 5:30 AM (13 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32556557
Default Alt Text
D16855.id47144.diff (949 B)
Attached To
Mode
D16855: Fix temperature reporting on AMD 2990WX
Attached
Detach File
Event Timeline
Log In to Comment