summaryrefslogtreecommitdiff
path: root/chip/lm4/peci.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/lm4/peci.c')
-rw-r--r--chip/lm4/peci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/lm4/peci.c b/chip/lm4/peci.c
index 1ea876fbcd..4091ee8640 100644
--- a/chip/lm4/peci.c
+++ b/chip/lm4/peci.c
@@ -139,6 +139,7 @@ DECLARE_CONSOLE_COMMAND(pecitemp, command_peci_temp,
static int peci_init(void)
{
volatile uint32_t scratch __attribute__((unused));
+ int i;
/* Enable the PECI module and delay a few clocks */
LM4_SYSTEM_RCGCPECI = 1;
@@ -150,6 +151,10 @@ static int peci_init(void)
/* Set initial clock frequency */
peci_freq_changed();
+ /* Initialize temperature reading buffer to a sane value. */
+ for (i = 0; i < TEMP_AVG_LENGTH; ++i)
+ temp_vals[i] = 300; /* 27 C */
+
return EC_SUCCESS;
}
DECLARE_HOOK(HOOK_INIT, peci_init, HOOK_PRIO_DEFAULT);