<p>Vagiz Tarkhanov has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21844">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">superio/ite/common: Add temperature limits<br><br>Add devicetree options to set temperature limits that are used to alarm<br>user when temperature exceeds defined values.<br><br>Audio alerts by superio are not implemented yet, but since limits are<br>visible to userland, some software might use them as is. For instance,<br>lm-sensors displays "ALERT" when temperature exceeds limits.<br><br>Change-Id: I56e041fb78f518d6a9640dc2b3985459991242b9<br>Signed-off-by: Vagiz Tarkhanov <rakkin@autistici.org><br>---<br>M src/superio/ite/common/env_ctrl.c<br>M src/superio/ite/common/env_ctrl.h<br>M src/superio/ite/common/env_ctrl_chip.h<br>3 files changed, 12 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/21844/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/superio/ite/common/env_ctrl.c b/src/superio/ite/common/env_ctrl.c<br>index 5f216c1..696285f 100644<br>--- a/src/superio/ite/common/env_ctrl.c<br>+++ b/src/superio/ite/common/env_ctrl.c<br>@@ -127,6 +127,12 @@<br>        ite_ec_write(base, ITE_EC_BEEP_ENABLE, reg);<br>  ite_ec_write(base, ITE_EC_TEMP_ADJUST[tmpin-1], conf->offset);<br> <br>+ /* Set temperature limits */<br>+ u8 max = conf->max;<br>+       ite_ec_write(base, ITE_EC_HIGH_TEMP_LIMIT(tmpin),<br>+                 max ? max : 127);<br>+       ite_ec_write(base, ITE_EC_LOW_TEMP_LIMIT(tmpin), conf->min);<br>+<br>    /* Enable the startup of monitoring operation */<br>      reg = ite_ec_read(base, ITE_EC_CONFIGURATION);<br>        reg |= ITE_EC_CONFIGURATION_START;<br>diff --git a/src/superio/ite/common/env_ctrl.h b/src/superio/ite/common/env_ctrl.h<br>index 1be6436..64603c6 100644<br>--- a/src/superio/ite/common/env_ctrl.h<br>+++ b/src/superio/ite/common/env_ctrl.h<br>@@ -86,6 +86,9 @@<br> #define   ITE_EC_FAN_CTL_TEMPIN_MASK               (3 << 0)<br> #define   ITE_EC_FAN_CTL_TEMPIN(x)             (((x)-1) & 3)<br> <br>+#define ITE_EC_HIGH_TEMP_LIMIT(x)                (0x40 + ((x-1) * 2))<br>+#define ITE_EC_LOW_TEMP_LIMIT(x)         (0x41 + ((x-1) * 2))<br>+<br> #define ITE_EC_ADC_VOLTAGE_CHANNEL_ENABLE     0x50<br> #define ITE_EC_ADC_TEMP_CHANNEL_ENABLE           0x51<br> #define   ITE_EC_ADC_TEMP_EXT_REPORTS_TO(x)      (((x) & 3) << 6)<br>diff --git a/src/superio/ite/common/env_ctrl_chip.h b/src/superio/ite/common/env_ctrl_chip.h<br>index a1bb89d..e4c4eaa 100644<br>--- a/src/superio/ite/common/env_ctrl_chip.h<br>+++ b/src/superio/ite/common/env_ctrl_chip.h<br>@@ -32,6 +32,9 @@<br>        enum ite_ec_thermal_mode mode;<br>        /* Offset is used for diode sensors and PECI */<br>       u8 offset;<br>+   /* Limits */<br>+ u8 min;<br>+      u8 max;<br> };<br> <br> /* Bit mask for voltage pins VINx */<br></pre><p>To view, visit <a href="https://review.coreboot.org/21844">change 21844</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21844"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I56e041fb78f518d6a9640dc2b3985459991242b9 </div>
<div style="display:none"> Gerrit-Change-Number: 21844 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vagiz Tarkhanov <rakkin@autistici.org> </div>