Files
OpenCellular/include/peci.h
Randall Spangler e9328ac4f6 Support dynamically changing the system clock
Add nopll command to turn off the PLL, reducing the system clock to 16Mhz.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:8798
TEST=manual

boot system
press power button to boot x86
temps   // should print all temperatures
timerinfo
timerinfo
timerinfo  // convince yourself this is counting up at about 1MHz
nopll  // this drops the system clock to 16MHz
temps   // should still print all temperatures
timerinfo
timerinfo
timerinfo  // should still be counting up at about 1MHz

Change-Id: Ie29ceb17af348148bffadf63d60c1b731f4c3f6d
2012-04-09 10:33:35 -07:00

36 lines
1009 B
C

/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* PECI module for Chrome EC */
#ifndef __CROS_EC_PECI_H
#define __CROS_EC_PECI_H
#include "common.h"
struct temp_sensor_t;
/* Initializes the module. */
int peci_init(void);
/* Notifies the module the system clock frequency has changed to <freq>. */
void peci_clock_changed(int freq);
/* Returns the current CPU temperature in degrees K, or -1 if error.
*
* Note that the PECI interface is currently a little flaky; if you get an
* error, retry a bit later. */
int peci_get_cpu_temp(void);
/* Reads the CPU temperature sensor via PECI. This interface is for the
* temperature sensor module. Returns the temperature in degrees K, or -1 if
* error. */
int peci_temp_sensor_get_val(int idx);
/* Temperature polling of CPU temperature sensor via PECI. */
int peci_temp_sensor_poll(void);
#endif /* __CROS_EC_PECI_H */