18c2ecf20Sopenharmony_ci===================================
28c2ecf20Sopenharmony_ciKernel driver: x86_pkg_temp_thermal
38c2ecf20Sopenharmony_ci===================================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciSupported chips:
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci* x86: with package level thermal management
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci(Verify using: CPUID.06H:EAX[bit 6] =1)
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciAuthors: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciReference
148c2ecf20Sopenharmony_ci---------
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciIntel® 64 and IA-32 Architectures Software Developer’s Manual (Jan, 2013):
178c2ecf20Sopenharmony_ciChapter 14.6: PACKAGE LEVEL THERMAL MANAGEMENT
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciDescription
208c2ecf20Sopenharmony_ci-----------
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciThis driver register CPU digital temperature package level sensor as a thermal
238c2ecf20Sopenharmony_cizone with maximum two user mode configurable trip points. Number of trip points
248c2ecf20Sopenharmony_cidepends on the capability of the package. Once the trip point is violated,
258c2ecf20Sopenharmony_ciuser mode can receive notification via thermal notification mechanism and can
268c2ecf20Sopenharmony_citake any action to control temperature.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciThreshold management
308c2ecf20Sopenharmony_ci--------------------
318c2ecf20Sopenharmony_ciEach package will register as a thermal zone under /sys/class/thermal.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciExample::
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci	/sys/class/thermal/thermal_zone1
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciThis contains two trip points:
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci- trip_point_0_temp
408c2ecf20Sopenharmony_ci- trip_point_1_temp
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ciUser can set any temperature between 0 to TJ-Max temperature. Temperature units
438c2ecf20Sopenharmony_ciare in milli-degree Celsius. Refer to "Documentation/driver-api/thermal/sysfs-api.rst" for
448c2ecf20Sopenharmony_cithermal sys-fs details.
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciAny value other than 0 in these trip points, can trigger thermal notifications.
478c2ecf20Sopenharmony_ciSetting 0, stops sending thermal notifications.
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciThermal notifications:
508c2ecf20Sopenharmony_ciTo get kobject-uevent notifications, set the thermal zone
518c2ecf20Sopenharmony_cipolicy to "user_space".
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ciFor example::
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci	echo -n "user_space" > policy
56