Do not try to use peci between VW_HOST_RST_WARN and VW_PLTRST_N
This commit is contained in:
@ -40,6 +40,8 @@
|
||||
vw_set(&W, V); \
|
||||
}
|
||||
|
||||
bool espi_host_reset = false;
|
||||
|
||||
void espi_init(void) {
|
||||
if (PLLFREQ != 0b0111) {
|
||||
// Workarounds to allow changing PLL
|
||||
@ -144,6 +146,9 @@ void espi_event(void) {
|
||||
VW_SET_DEBUG(VW_RCIN_N, VWS_HIGH);
|
||||
|
||||
power_cpu_reset();
|
||||
|
||||
// Host reset complete
|
||||
espi_host_reset = false;
|
||||
}
|
||||
last_pltrst_n = wire;
|
||||
}
|
||||
@ -154,6 +159,11 @@ void espi_event(void) {
|
||||
// Set HOST_RST_ACK to HOST_RST_WARN
|
||||
wire = vw_get(&VW_HOST_RST_WARN);
|
||||
if (wire != vw_get(&VW_HOST_RST_ACK)) {
|
||||
if (wire == VWS_HIGH) {
|
||||
// Host reset started
|
||||
espi_host_reset = true;
|
||||
}
|
||||
|
||||
VW_SET_DEBUG(VW_HOST_RST_ACK, wire);
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,12 @@
|
||||
#ifndef _BOARD_ESPI_H
|
||||
#define _BOARD_ESPI_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <ec/espi.h>
|
||||
|
||||
extern bool espi_host_reset;
|
||||
|
||||
void espi_init(void);
|
||||
void espi_reset(void);
|
||||
void espi_event(void);
|
||||
|
@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include <arch/time.h>
|
||||
#include <board/espi.h>
|
||||
#include <board/fan.h>
|
||||
#include <board/gpio.h>
|
||||
#include <board/peci.h>
|
||||
#include <board/power.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/macro.h>
|
||||
#include <ec/espi.h>
|
||||
#include <ec/gpio.h>
|
||||
#include <ec/pwm.h>
|
||||
|
||||
@ -76,6 +76,10 @@ bool peci_available(void) {
|
||||
if (power_state != POWER_STATE_S0)
|
||||
return false;
|
||||
|
||||
// Currently waiting for host reset, PECI is not available
|
||||
if (espi_host_reset)
|
||||
return false;
|
||||
|
||||
// If VW_PLTRST_N virtual wire is not VWS_HIGH, PECI is not available
|
||||
// This is because the CPU has not yet exited reset
|
||||
if (vw_get(&VW_PLTRST_N) != VWS_HIGH)
|
||||
|
Reference in New Issue
Block a user