From ddfb1316eeb916fffd2d8be876f0be9de5a2da58 Mon Sep 17 00:00:00 2001 From: Diwakar C Date: Mon, 15 Feb 2021 20:45:31 +0530 Subject: [PATCH] driver: peci: Add supported peci response codes Add supported peci response codes 0x80 (Out of resources timeout) and 0x81 (Resources required to service the command are in low power state). Signed-off-by: Diwakar C --- include/drivers/peci.h | 8 +++++--- samples/drivers/peci/src/main.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/drivers/peci.h b/include/drivers/peci.h index c8155da1ff0..b4d134b95e5 100644 --- a/include/drivers/peci.h +++ b/include/drivers/peci.h @@ -65,9 +65,11 @@ enum peci_command_code { }; /** PECI read/write supported responses */ -#define PECI_RW_PKG_CFG_RSP_PASS (0x40U) -#define PECI_RW_PKG_CFG_RSP_TIMEOUT (0x80U) -#define PECI_RW_PKG_CFG_RSP_ILLEGAL (0x90U) +#define PECI_CC_RSP_SUCCESS (0x40U) +#define PECI_CC_RSP_TIMEOUT (0x80U) +#define PECI_CC_OUT_OF_RESOURCES_TIMEOUT (0x81U) +#define PECI_CC_RESOURCES_LOWPWR_TIMEOUT (0x82U) +#define PECI_CC_ILLEGAL_REQUEST (0x90U) /** Ping command format. */ #define PECI_PING_WR_LEN (0U) diff --git a/samples/drivers/peci/src/main.c b/samples/drivers/peci/src/main.c index eacfff6ef4f..5f7e5c1257b 100644 --- a/samples/drivers/peci/src/main.c +++ b/samples/drivers/peci/src/main.c @@ -90,7 +90,7 @@ int peci_get_tjmax(uint8_t *tjmax) k_sleep(K_MSEC(1)); printk("\npeci_resp %x\n", peci_resp); retries--; - } while ((peci_resp != PECI_RW_PKG_CFG_RSP_PASS) && (retries > 0)); + } while ((peci_resp != PECI_CC_RSP_SUCCESS) && (retries > 0)); *tjmax = packet.rx_buffer.buf[3];