xref: /openbmc/linux/Documentation/driver-api/thermal/x86_pkg_temperature_thermal.rst (revision 976e3645923bdd2fe7893aae33fd7a21098bfb28)
1*eaf7b460SMauro Carvalho Chehab===================================
2*eaf7b460SMauro Carvalho ChehabKernel driver: x86_pkg_temp_thermal
3*eaf7b460SMauro Carvalho Chehab===================================
4*eaf7b460SMauro Carvalho Chehab
5*eaf7b460SMauro Carvalho ChehabSupported chips:
6*eaf7b460SMauro Carvalho Chehab
7*eaf7b460SMauro Carvalho Chehab* x86: with package level thermal management
8*eaf7b460SMauro Carvalho Chehab
9*eaf7b460SMauro Carvalho Chehab(Verify using: CPUID.06H:EAX[bit 6] =1)
10*eaf7b460SMauro Carvalho Chehab
11*eaf7b460SMauro Carvalho ChehabAuthors: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
12*eaf7b460SMauro Carvalho Chehab
13*eaf7b460SMauro Carvalho ChehabReference
14*eaf7b460SMauro Carvalho Chehab---------
15*eaf7b460SMauro Carvalho Chehab
16*eaf7b460SMauro Carvalho ChehabIntel® 64 and IA-32 Architectures Software Developer’s Manual (Jan, 2013):
17*eaf7b460SMauro Carvalho ChehabChapter 14.6: PACKAGE LEVEL THERMAL MANAGEMENT
18*eaf7b460SMauro Carvalho Chehab
19*eaf7b460SMauro Carvalho ChehabDescription
20*eaf7b460SMauro Carvalho Chehab-----------
21*eaf7b460SMauro Carvalho Chehab
22*eaf7b460SMauro Carvalho ChehabThis driver register CPU digital temperature package level sensor as a thermal
23*eaf7b460SMauro Carvalho Chehabzone with maximum two user mode configurable trip points. Number of trip points
24*eaf7b460SMauro Carvalho Chehabdepends on the capability of the package. Once the trip point is violated,
25*eaf7b460SMauro Carvalho Chehabuser mode can receive notification via thermal notification mechanism and can
26*eaf7b460SMauro Carvalho Chehabtake any action to control temperature.
27*eaf7b460SMauro Carvalho Chehab
28*eaf7b460SMauro Carvalho Chehab
29*eaf7b460SMauro Carvalho ChehabThreshold management
30*eaf7b460SMauro Carvalho Chehab--------------------
31*eaf7b460SMauro Carvalho ChehabEach package will register as a thermal zone under /sys/class/thermal.
32*eaf7b460SMauro Carvalho Chehab
33*eaf7b460SMauro Carvalho ChehabExample::
34*eaf7b460SMauro Carvalho Chehab
35*eaf7b460SMauro Carvalho Chehab	/sys/class/thermal/thermal_zone1
36*eaf7b460SMauro Carvalho Chehab
37*eaf7b460SMauro Carvalho ChehabThis contains two trip points:
38*eaf7b460SMauro Carvalho Chehab
39*eaf7b460SMauro Carvalho Chehab- trip_point_0_temp
40*eaf7b460SMauro Carvalho Chehab- trip_point_1_temp
41*eaf7b460SMauro Carvalho Chehab
42*eaf7b460SMauro Carvalho ChehabUser can set any temperature between 0 to TJ-Max temperature. Temperature units
43*eaf7b460SMauro Carvalho Chehabare in milli-degree Celsius. Refer to "Documentation/driver-api/thermal/sysfs-api.rst" for
44*eaf7b460SMauro Carvalho Chehabthermal sys-fs details.
45*eaf7b460SMauro Carvalho Chehab
46*eaf7b460SMauro Carvalho ChehabAny value other than 0 in these trip points, can trigger thermal notifications.
47*eaf7b460SMauro Carvalho ChehabSetting 0, stops sending thermal notifications.
48*eaf7b460SMauro Carvalho Chehab
49*eaf7b460SMauro Carvalho ChehabThermal notifications:
50*eaf7b460SMauro Carvalho ChehabTo get kobject-uevent notifications, set the thermal zone
51*eaf7b460SMauro Carvalho Chehabpolicy to "user_space".
52*eaf7b460SMauro Carvalho Chehab
53*eaf7b460SMauro Carvalho ChehabFor example::
54*eaf7b460SMauro Carvalho Chehab
55*eaf7b460SMauro Carvalho Chehab	echo -n "user_space" > policy
56