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:00:13 +0000
commit9ee1aaa7141418d0a3553797620646a11c90393e (patch)
tree538db6a688c5b5e6c23ec4bb1da2d3df0b31da22
parent9f610ca36fa8482f4d7b46332395974cbb4b6a2b (diff)
downloadchrome-ec-9ee1aaa7141418d0a3553797620646a11c90393e.tar.gz
CHERRY-PICK: Change PECI_TJMAX to a board config option
BUG=chrome-os-partner:24455 BRANCH=leon 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 chip/lm4/peci.c Change-Id: I853482cc34e29d71393312317ad113212bcb647b Reviewed-on: https://chromium-review.googlesource.com/180491 Reviewed-by: Alec Berg <alecaberg@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/leon/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
7 files changed, 18 insertions, 8 deletions
diff --git a/board/bolt/board.h b/board/bolt/board.h
index ebb7b33d85..786f208d20 100644
--- a/board/bolt/board.h
+++ b/board/bolt/board.h
@@ -40,6 +40,7 @@
/* External Charger maximum current. */
#define CONFIG_CHARGER_INPUT_CURRENT 5000
#define CONFIG_PWM_FAN
+#define CONFIG_PECI_TJMAX 100
#define CONFIG_PWM_KBLIGHT
#define CONFIG_TEMP_SENSOR
#define CONFIG_UART_HOST 2
diff --git a/board/falco/board.h b/board/falco/board.h
index 21f67f2376..68daf76952 100644
--- a/board/falco/board.h
+++ b/board/falco/board.h
@@ -26,6 +26,7 @@
#define CONFIG_KEYBOARD_PROTOCOL_8042
#endif
#define CONFIG_LOW_POWER_IDLE
+#define CONFIG_PECI_TJMAX 100
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
diff --git a/board/leon/board.h b/board/leon/board.h
index b674c4ed1b..3bb6c3b86f 100644
--- a/board/leon/board.h
+++ b/board/leon/board.h
@@ -26,6 +26,7 @@
#define CONFIG_KEYBOARD_PROTOCOL_8042
#endif
#define CONFIG_LOW_POWER_IDLE
+#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 67bd323aee..442524e5cf 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 acb09e5c19..019aebf823 100644
--- a/board/peppy/board.h
+++ b/board/peppy/board.h
@@ -27,6 +27,7 @@
#define CONFIG_KEYBOARD_PROTOCOL_8042
#endif
#define CONFIG_LOW_POWER_IDLE
+#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 0ec8e155e0..780ecd40b6 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
@@ -70,9 +66,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;
@@ -108,7 +104,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 6ee78526f6..497bbc0315 100644
--- a/include/config.h
+++ b/include/config.h
@@ -428,6 +428,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 */