From 3eaa5e6e0669d6afade40c2943ef2c159381aaad Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Wed, 15 Mar 2023 09:43:14 -0600 Subject: [PATCH] Only use PECI over eSPI on oryp11 Make all boards except oryp11 use the legacy PECI implementation. The oryp11 removed the legacy pin (H_PECI) and must use PECI over eSPI. All boards that use eSPI should switch to using PECI over eSPI once the implementation is working correctly. Signed-off-by: Tim Crawford --- src/board/system76/common/common.mk | 5 +++++ src/board/system76/common/peci.c | 9 ++++++--- src/board/system76/oryp11/board.mk | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/board/system76/common/common.mk b/src/board/system76/common/common.mk index bbb55b0..b4c76ba 100644 --- a/src/board/system76/common/common.mk +++ b/src/board/system76/common/common.mk @@ -52,6 +52,11 @@ PROGRAMMER=$(wildcard /dev/serial/by-id/usb-Arduino*) ifeq ($(CONFIG_BUS_ESPI),y) CFLAGS += -DCONFIG_BUS_ESPI=1 + +# TODO: Use PECI over eSPI on all boards using eSPI +ifeq ($(CONFIG_PECI_OVER_ESPI),y) +CFLAGS += -DCONFIG_PECI_OVER_ESPI=1 +endif endif # Include system76 common source diff --git a/src/board/system76/common/peci.c b/src/board/system76/common/peci.c index ad796dd..3748bc9 100644 --- a/src/board/system76/common/peci.c +++ b/src/board/system76/common/peci.c @@ -60,7 +60,7 @@ static struct Fan __code FAN = { .interpolate = SMOOTH_FANS != 0, }; -#if CONFIG_BUS_ESPI +#if CONFIG_PECI_OVER_ESPI // Maximum OOB channel response time in ms #define PECI_ESPI_TIMEOUT 10 @@ -254,7 +254,10 @@ int16_t peci_wr_pkg_config(uint8_t index, uint16_t param, uint32_t data) { } } -#else // CONFIG_BUS_ESPI +#else // CONFIG_PECI_OVER_ESPI + +// Legacy PECI implementation; requires a dedicated PECI pin connected to the +// PCH and EC (H_PECI). void peci_init(void) { // Allow PECI pin to be used @@ -380,7 +383,7 @@ int16_t peci_wr_pkg_config(uint8_t index, uint16_t param, uint32_t data) { return -((int16_t)cc); } -#endif // CONFIG_BUS_ESPI +#endif // CONFIG_PECI_OVER_ESPI // PECI information can be found here: https://www.intel.com/content/dam/www/public/us/en/documents/design-guides/core-i7-lga-2011-guide.pdf uint8_t peci_get_fan_duty(void) { diff --git a/src/board/system76/oryp11/board.mk b/src/board/system76/oryp11/board.mk index 8cd0c42..5622e1f 100644 --- a/src/board/system76/oryp11/board.mk +++ b/src/board/system76/oryp11/board.mk @@ -8,6 +8,8 @@ CONFIG_EC_ITE_IT5570E=y # Enable eSPI CONFIG_BUS_ESPI=y +# Use PECI over eSPI +CONFIG_PECI_OVER_ESPI=y # Enable firmware security CONFIG_SECURITY=y