Add PECI init
This commit is contained in:
parent
0687488ec4
commit
e9c308b789
@ -51,11 +51,9 @@ void init(void) {
|
|||||||
kbscan_init();
|
kbscan_init();
|
||||||
pwm_init();
|
pwm_init();
|
||||||
smbus_init();
|
smbus_init();
|
||||||
|
peci_init();
|
||||||
|
|
||||||
//TODO: INTC, PECI
|
//TODO: INTC
|
||||||
|
|
||||||
// Allow PECI pin to be used
|
|
||||||
GCR2 |= (1 << 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ac_adapter() {
|
void ac_adapter() {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <board/peci.h>
|
#include <board/peci.h>
|
||||||
#include <common/debug.h>
|
#include <common/debug.h>
|
||||||
|
#include <ec/gpio.h>
|
||||||
#include <ec/pwm.h>
|
#include <ec/pwm.h>
|
||||||
|
|
||||||
// Tjunction = 100C for i7-8565U (and probably the same for all WHL-U)
|
// Tjunction = 100C for i7-8565U (and probably the same for all WHL-U)
|
||||||
@ -16,6 +17,16 @@ static bool peci_config_loaded = false;
|
|||||||
|
|
||||||
#define PECI_TEMP(X) (((int16_t)(X)) << 6)
|
#define PECI_TEMP(X) (((int16_t)(X)) << 6)
|
||||||
|
|
||||||
|
void peci_init(void) {
|
||||||
|
// Allow PECI pin to be used
|
||||||
|
GCR2 |= (1 << 4);
|
||||||
|
|
||||||
|
// Set frequency to 1MHz
|
||||||
|
HOCTL2R = 0x01;
|
||||||
|
// Set VTT to 1V
|
||||||
|
PADCTLR = 0x02;
|
||||||
|
}
|
||||||
|
|
||||||
// Read tjmax using index 16 of RdPkgConfig
|
// Read tjmax using index 16 of RdPkgConfig
|
||||||
static void peci_config(void) {
|
static void peci_config(void) {
|
||||||
// Wait for completion
|
// Wait for completion
|
||||||
|
@ -13,5 +13,6 @@ static volatile uint8_t __xdata __at(0x3006) HOWRDR;
|
|||||||
static volatile uint8_t __xdata __at(0x3007) HORDDR;
|
static volatile uint8_t __xdata __at(0x3007) HORDDR;
|
||||||
static volatile uint8_t __xdata __at(0x3008) HOCTL2R;
|
static volatile uint8_t __xdata __at(0x3008) HOCTL2R;
|
||||||
static volatile uint8_t __xdata __at(0x3009) RWFCSV;
|
static volatile uint8_t __xdata __at(0x3009) RWFCSV;
|
||||||
|
static volatile uint8_t __xdata __at(0x300E) PADCTLR;
|
||||||
|
|
||||||
#endif // _EC_PECI_H
|
#endif // _EC_PECI_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user