From f8d81a1e1bef39c6010f3b5140b3e06313004705 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Wed, 9 Jun 2021 09:40:38 -0600 Subject: [PATCH] ec/it5570e: Add function to read POST codes Logic for reading port 0x80/0x81 is common to the IT5570E. Signed-off-by: Tim Crawford --- src/ec/it5570e/ec.c | 11 +++++++++++ src/ec/it5570e/include/ec/ec.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/ec/it5570e/ec.c b/src/ec/it5570e/ec.c index 22f5484..16e9d0b 100644 --- a/src/ec/it5570e/ec.c +++ b/src/ec/it5570e/ec.c @@ -2,7 +2,18 @@ #include #include +#include void ec_init(void) { RSTS = 0x44; } + +void ec_read_post_codes(void) { + while (P80H81HS & 1) { + uint8_t p80h = P80HD; + uint8_t p81h = P81HD; + P80H81HS |= 1; + + DEBUG("POST %02X%02X\n", p81h, p80h); + } +} diff --git a/src/ec/it5570e/include/ec/ec.h b/src/ec/it5570e/include/ec/ec.h index 0183336..9b95a20 100644 --- a/src/ec/it5570e/include/ec/ec.h +++ b/src/ec/it5570e/include/ec/ec.h @@ -4,5 +4,6 @@ #define _EC_EC_H void ec_init(void); +void ec_read_post_codes(void); #endif // _EC_EC_H