[coreboot-gerrit] Change in coreboot[master]: superio/ite/common: Add temperature limits

Vagiz Tarkhanov (Code Review) gerrit at coreboot.org
Mon Oct 2 17:18:35 CEST 2017


Vagiz Tarkhanov has uploaded this change for review. ( https://review.coreboot.org/21844


Change subject: superio/ite/common: Add temperature limits
......................................................................

superio/ite/common: Add temperature limits

Add devicetree options to set temperature limits that are used to alarm
user when temperature exceeds defined values.

Audio alerts by superio are not implemented yet, but since limits are
visible to userland, some software might use them as is. For instance,
lm-sensors displays "ALERT" when temperature exceeds limits.

Change-Id: I56e041fb78f518d6a9640dc2b3985459991242b9
Signed-off-by: Vagiz Tarkhanov <rakkin at autistici.org>
---
M src/superio/ite/common/env_ctrl.c
M src/superio/ite/common/env_ctrl.h
M src/superio/ite/common/env_ctrl_chip.h
3 files changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/21844/1

diff --git a/src/superio/ite/common/env_ctrl.c b/src/superio/ite/common/env_ctrl.c
index 5f216c1..696285f 100644
--- a/src/superio/ite/common/env_ctrl.c
+++ b/src/superio/ite/common/env_ctrl.c
@@ -127,6 +127,12 @@
 	ite_ec_write(base, ITE_EC_BEEP_ENABLE, reg);
 	ite_ec_write(base, ITE_EC_TEMP_ADJUST[tmpin-1], conf->offset);
 
+	/* Set temperature limits */
+	u8 max = conf->max;
+	ite_ec_write(base, ITE_EC_HIGH_TEMP_LIMIT(tmpin),
+		     max ? max : 127);
+	ite_ec_write(base, ITE_EC_LOW_TEMP_LIMIT(tmpin), conf->min);
+
 	/* Enable the startup of monitoring operation */
 	reg = ite_ec_read(base, ITE_EC_CONFIGURATION);
 	reg |= ITE_EC_CONFIGURATION_START;
diff --git a/src/superio/ite/common/env_ctrl.h b/src/superio/ite/common/env_ctrl.h
index 1be6436..64603c6 100644
--- a/src/superio/ite/common/env_ctrl.h
+++ b/src/superio/ite/common/env_ctrl.h
@@ -86,6 +86,9 @@
 #define   ITE_EC_FAN_CTL_TEMPIN_MASK		(3 << 0)
 #define   ITE_EC_FAN_CTL_TEMPIN(x)		(((x)-1) & 3)
 
+#define ITE_EC_HIGH_TEMP_LIMIT(x)		(0x40 + ((x-1) * 2))
+#define ITE_EC_LOW_TEMP_LIMIT(x)		(0x41 + ((x-1) * 2))
+
 #define ITE_EC_ADC_VOLTAGE_CHANNEL_ENABLE	0x50
 #define ITE_EC_ADC_TEMP_CHANNEL_ENABLE		0x51
 #define   ITE_EC_ADC_TEMP_EXT_REPORTS_TO(x)	(((x) & 3) << 6)
diff --git a/src/superio/ite/common/env_ctrl_chip.h b/src/superio/ite/common/env_ctrl_chip.h
index a1bb89d..e4c4eaa 100644
--- a/src/superio/ite/common/env_ctrl_chip.h
+++ b/src/superio/ite/common/env_ctrl_chip.h
@@ -32,6 +32,9 @@
 	enum ite_ec_thermal_mode mode;
 	/* Offset is used for diode sensors and PECI */
 	u8 offset;
+	/* Limits */
+	u8 min;
+	u8 max;
 };
 
 /* Bit mask for voltage pins VINx */

-- 
To view, visit https://review.coreboot.org/21844
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I56e041fb78f518d6a9640dc2b3985459991242b9
Gerrit-Change-Number: 21844
Gerrit-PatchSet: 1
Gerrit-Owner: Vagiz Tarkhanov <rakkin at autistici.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171002/70325fa0/attachment-0001.html>


More information about the coreboot-gerrit mailing list