summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChromeOS Developer <dparker@chromium.org>2013-12-11 14:40:30 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-12-18 22:25:44 +0000
commitfebbf8d64e0bf3143e33548b4cc1b9ed2cf90245 (patch)
tree54ac347524cdf8b4d332af67c398e6c61af0070a
parentfa3d347c4cce46f5e1c54d2336a5c07880f1b65d (diff)
downloadchrome-ec-febbf8d64e0bf3143e33548b4cc1b9ed2cf90245.tar.gz
CHERRY-PICK: Change PECI_TJMAX to a board config option
BUG=chrome-os-partner:24455 BRANCH=none TEST=Manual: Verify that CONIFG_PECI_TJMAX set per-board matches the value queried over the PECI bus with the restricted "peciprobe" command. Original-Change-Id: I8e99a23a66f26d6101e01cc751d0a8ca79686321 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179682 Reviewed-by: Alec Berg <alecaberg@chromium.org> Conflicts: board/bolt/board.h board/falco/board.h board/peppy/board.h chip/lm4/peci.c Change-Id: Ia0e8c1c7ef1204c09c57bc6581bbccbee06161cf Reviewed-on: https://chromium-review.googlesource.com/180554 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Dave Parker <dparker@chromium.org> Tested-by: Dave Parker <dparker@chromium.org>
-rw-r--r--board/bolt/board.h1
-rw-r--r--board/falco/board.h1
-rw-r--r--board/link/board.h1
-rw-r--r--board/peppy/board.h1
-rw-r--r--chip/lm4/peci.c12
-rw-r--r--include/config.h9
6 files changed, 17 insertions, 8 deletions
diff --git a/board/bolt/board.h b/board/bolt/board.h
index d10a45aaf7..006381ece1 100644
--- a/board/bolt/board.h
+++ b/board/bolt/board.h
@@ -39,6 +39,7 @@
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
/* External Charger maximum current. */
#define CONFIG_CHARGER_INPUT_CURRENT 5000
+#define CONFIG_PECI_TJMAX 100
#define CONFIG_PWM_FAN
#define CONFIG_PWM_KBLIGHT
#define CONFIG_TEMP_SENSOR
diff --git a/board/falco/board.h b/board/falco/board.h
index d016c73c44..4f51adff4d 100644
--- a/board/falco/board.h
+++ b/board/falco/board.h
@@ -25,6 +25,7 @@
#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
#endif
+#define CONFIG_PECI_TJMAX 100
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
diff --git a/board/link/board.h b/board/link/board.h
index b69f1046df..171b975c65 100644
--- a/board/link/board.h
+++ b/board/link/board.h
@@ -27,6 +27,7 @@
#endif
#define CONFIG_LED_DRIVER_DS2413
#define CONFIG_ONEWIRE
+#define CONFIG_PECI_TJMAX 105
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
diff --git a/board/peppy/board.h b/board/peppy/board.h
index 857f7aab65..7d0b538fd7 100644
--- a/board/peppy/board.h
+++ b/board/peppy/board.h
@@ -26,6 +26,7 @@
#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
#endif
+#define CONFIG_PECI_TJMAX 100
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
diff --git a/chip/lm4/peci.c b/chip/lm4/peci.c
index a28fa31880..99d1f733ae 100644
--- a/chip/lm4/peci.c
+++ b/chip/lm4/peci.c
@@ -16,10 +16,6 @@
#include "temp_sensor.h"
#include "util.h"
-/* Max junction temperature for processor in degrees C */
-/* TODO: read TjMax from processor via PECI */
-#define PECI_TJMAX 105
-
/* Initial PECI baud rate */
#define PECI_BAUD_RATE 100000
@@ -82,9 +78,9 @@ int peci_temp_sensor_get_val(int idx, int *temp_ptr)
* Require at least two valid samples. When the AP transitions into S0,
* it is possible, depending on the timing of the PECI sample, to read
* an invalid temperature. This is very rare, but when it does happen
- * the temperature returned is PECI_TJMAX. Requiring two valid samples
- * here assures us that one bad maximum temperature reading when
- * entering S0 won't cause us to trigger an over temperature.
+ * the temperature returned is CONFIG_PECI_TJMAX. Requiring two valid
+ * samples here assures us that one bad maximum temperature reading
+ * when entering S0 won't cause us to trigger an over temperature.
*/
if (success_cnt < 2)
return EC_ERROR_UNKNOWN;
@@ -120,7 +116,7 @@ static void peci_freq_changed(void)
(PECI_POLL_INTERVAL_MS * (freq / 1000 / 4096));
/* Set up temperature monitoring to report in degrees K */
- LM4_PECI_CTL = ((PECI_TJMAX + 273) << 22) | 0x0001 |
+ LM4_PECI_CTL = ((CONFIG_PECI_TJMAX + 273) << 22) | 0x0001 |
(PECI_RETRY_COUNT << 12) |
(PECI_ERROR_BYPASS << 11);
}
diff --git a/include/config.h b/include/config.h
index 86c61c9c53..affb3d6aca 100644
--- a/include/config.h
+++ b/include/config.h
@@ -419,6 +419,15 @@
/* Compile support for PECI interface to x86 processor */
#undef CONFIG_PECI
+/*
+ * Maximum operating temperature in degrees Celcius used on some x86
+ * processors. CPU chip temperature is reported relative to this value and
+ * is never reported greater than this value. Processor asserts PROCHOT#
+ * and starts throttling frequency and voltage at this temp. Operation may
+ * become unreliable if temperature exceeds this limit.
+ */
+#undef CONFIG_PECI_TJMAX
+
/*****************************************************************************/
/* PMU config */