Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255 OSRR, section 4.2.1:
- For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temp in the range -49..206, eg, subtract 49C
Differential D16855
Fix temperature reporting on AMD 2990WX gallatin on Aug 23 2018, 12:06 AM. Authored by Tags None Referenced Files
Subscribers
Details Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255 OSRR, section 4.2.1:
Diff Detail
Event TimelineComment Actions Change looks functionally correct to me. Some style-y nitpicks below:
Comment Actions Thank you so much for the pointer to the docs!!! It is much nicer to write from real docs, rather than crib from undocumented changes in another project. Looking at the docs, it says that the range of CUR_TEMP is: 0..225C when CUR_TEMP_RANGE_SEL is not set, and -49C ... 206C when it is. So, based on my reading of the docs, our current scaling is wrong, since it does not scale from 0..225, but from 0..255. Eg, with our current scaling, max possible value, 0x7ff, would result in a temp of 255 not 225. So I've updated the scaling to reflect this. Interestingly, when bit 19 is set, the range is again 256 wide, so we can use the old scaling there. Comment Actions Agreed!
Yeah, like I said earlier, I think that's a pretty clear typo for 255C. The temperature scale does not change between the modes and 206+49=255.
I don't believe this is correct. Comment Actions The right document for the temperature sensor is SB-TSI (40821), which you may note is dated 2010 and has not changed from earlier sensors (i.e., amdtemp_gettemp directly above uses the same math). § 2.6 SB-TSI Temperature and Threshold Encodings:
Essentially the encoding is: one byte (8 bits) for the integer portion of the value, and the remaining 3 bits specify the fractional temperature in increments of 1/8 °C. Comment Actions Thanks! Mostly looks good to me. A few quibbles:
|