Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) Kernel driver k8temp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)   * AMD Athlon64/FX or Opteron CPUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)     Prefix: 'k8temp'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)     Addresses scanned: PCI space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)     Datasheet: https://www.amd.com/system/files/TechDocs/32559.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) Author: Rudolf Marek
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Contact: Rudolf Marek <r.marek@assembler.cz>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) This driver permits reading temperature sensor(s) embedded inside AMD K8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) family CPUs (Athlon64/FX, Opteron). Official documentation says that it works
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) from revision F of K8 core, but in fact it seems to be implemented for all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) revisions of K8 except the first two revisions (SH-B0 and SH-B3).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) Please note that you will need at least lm-sensors 2.10.1 for proper userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) There can be up to four temperature sensors inside single CPU. The driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) will auto-detect the sensors and will display only temperatures from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) implemented sensors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Mapping of /sys files is as follows:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) ============= ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) temp1_input   temperature of Core 0 and "place" 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) temp2_input   temperature of Core 0 and "place" 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) temp3_input   temperature of Core 1 and "place" 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) temp4_input   temperature of Core 1 and "place" 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) ============= ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Temperatures are measured in degrees Celsius and measurement resolution is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 1 degree C. It is expected that future CPU will have better resolution. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) temperature is updated once a second. Valid temperatures are from -49 to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 206 degrees C.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) Temperature known as TCaseMax was specified for processors up to revision E.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) This temperature is defined as temperature between heat-spreader and CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) case, so the internal CPU temperature supplied by this driver can be higher.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) There is no easy way how to measure the temperature which will correlate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) with TCaseMax temperature.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) For newer revisions of CPU (rev F, socket AM2) there is a mathematically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) computed temperature called TControl, which must be lower than TControlMax.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) The relationship is following:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	temp1_input - TjOffset*2 < TControlMax,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) TjOffset is not yet exported by the driver, TControlMax is usually
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 70 degrees C. The rule of the thumb -> CPU temperature should not cross
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 60 degrees C too much.