diff --git a/src/board/system76/common/include/board/power.h b/src/board/system76/common/include/board/power.h index 8a6b771..d6771b2 100644 --- a/src/board/system76/common/include/board/power.h +++ b/src/board/system76/common/include/board/power.h @@ -12,6 +12,7 @@ enum PowerState { extern enum PowerState power_state; +void power_init(void); void power_on(void); void power_off(void); void power_set_limit(void); diff --git a/src/board/system76/common/main.c b/src/board/system76/common/main.c index e1e9ef9..5733ad8 100644 --- a/src/board/system76/common/main.c +++ b/src/board/system76/common/main.c @@ -81,6 +81,7 @@ void init(void) { //TODO: INTC // Must happen last + power_init(); board_init(); } diff --git a/src/board/system76/common/power.c b/src/board/system76/common/power.c index ed63790..4de7a46 100644 --- a/src/board/system76/common/power.c +++ b/src/board/system76/common/power.c @@ -159,6 +159,18 @@ void update_power_state(void) { } } +void power_init(void) { + // See Figure 12-19 in Whiskey Lake Platform Design Guide + // | VCCRTC | RTCRST# | VccPRIM | + // | tPCH01---------- | | + // | tPCH04-------------------- | + + // tPCH04 is the ideal delay + tPCH04; + + update_power_state(); +} + void power_on(void) { DEBUG("%02X: power_on\n", main_cycle);