falco: Enable EC controlled throttling
When the EC requests the host to throttle (for charging or thermal related reasons) the package power consumption will be limited. Right now this is set at 12W but that is somewhat arbitrary and may need tuning. 1) define the THRT method in \_TZ scope for EC to call 2) enable SCI events for throttle start and stop 3) define the power limit at 12W and set it in NVS 1) Enable CONFIG_ACPI_DEBUG=y in the kernel 2) Enable the Debug object event in acpi module acpi.debug_layer=0x7f acpi.debug_level=0x2f 3) Using EC console generate host event for throttle start > hostevent set 0x20000 4) Check dmesg for throttle start events ACPI: Execute Method [\_SB_.PCI0.LPCB.EC0_._Q12] (Node ffff8801002c5988) [ACPI Debug] String [0x12] "EC: THROTTLE START" [ACPI Debug] String [0x10] "Enable PL1 Limit" 5) Using EC console generate host event for throttle stop > hostevent set 0x40000 6) Check dmesg for throttle stop events ACPI: Execute Method [\_SB_.PCI0.LPCB.EC0_._Q13] (Node ffff8801002c59b0) [ACPI Debug] String [0x11] "EC: THROTTLE STOP" [ACPI Debug] String [0x11] "Disable PL1 Limit" Change-Id: I39b53a5e8abc2892846bcd214a333fe204c6da9b Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/63989 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/4416 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
parent
d338b46504
commit
5fcfece756
|
@ -21,6 +21,20 @@
|
|||
|
||||
Scope (\_TZ)
|
||||
{
|
||||
// Handler for throttle requests on this platform
|
||||
// 0 = Stop throttling
|
||||
// 1 = Start throttling
|
||||
Method (THRT, 1, Serialized)
|
||||
{
|
||||
If (LEqual (Arg0, 0)) {
|
||||
/* Disable Power Limit */
|
||||
\_SB.PCI0.MCHC.CTLD ()
|
||||
} Else {
|
||||
/* Enable Power Limit */
|
||||
\_SB.PCI0.MCHC.CTLE (\F0PW)
|
||||
}
|
||||
}
|
||||
|
||||
ThermalZone (THRM)
|
||||
{
|
||||
Name (_TC1, 0x02)
|
||||
|
|
|
@ -48,6 +48,7 @@ static void acpi_update_thermal_table(global_nvs_t *gnvs)
|
|||
gnvs->tcrt = CRITICAL_TEMPERATURE;
|
||||
gnvs->tpsv = PASSIVE_TEMPERATURE;
|
||||
gnvs->tmax = MAX_TEMPERATURE;
|
||||
gnvs->f0pw = EC_THROTTLE_POWER_LIMIT;
|
||||
gnvs->flvl = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY) |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_THRESHOLD) |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD) |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_START) |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_THROTTLE_STOP) |\
|
||||
EC_HOST_EVENT_MASK(EC_HOST_EVENT_USB_CHARGER))
|
||||
|
||||
#define MAINBOARD_EC_SMI_EVENTS \
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
|
||||
#define TEMPERATURE_SENSOR_ID 0 /* PECI */
|
||||
|
||||
/* Power level to set when EC requests throttle */
|
||||
#define EC_THROTTLE_POWER_LIMIT 12 /* 12W */
|
||||
|
||||
/* Temperature which OS will shutdown at */
|
||||
#define CRITICAL_TEMPERATURE 104
|
||||
|
||||
|
|
Loading…
Reference in New Issue