diff --git a/src/board/system76/common/pnp.c b/src/board/system76/common/pnp.c index abdf6635a..5cad32ac5 100644 --- a/src/board/system76/common/pnp.c +++ b/src/board/system76/common/pnp.c @@ -5,6 +5,7 @@ #include #include #include +#include #include volatile uint8_t __xdata __at(0x1200) IHIOA; @@ -80,4 +81,14 @@ void pnp_enable(void) { // Enable SWUC pnp_write(0x07, 0x04); pnp_write(0x30, 0x01); + +#ifdef POST_CODE_RING_BUFFER + // Set up ring-buffer for POST codes + for (uint8_t i = 0x80; i <= 0xBF; i++) { + BRAM[i] = 0; + } + pnp_write(0x07, 0x10); + pnp_write(0xF3, 0x00); + pnp_write(0xF4, 0x3F); +#endif // POST_CODE_RING_BUFFER } diff --git a/src/ec/ite/ec.c b/src/ec/ite/ec.c index 4553e97b4..937dcf940 100644 --- a/src/ec/ite/ec.c +++ b/src/ec/ite/ec.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only +#include #include #include #include @@ -23,7 +24,17 @@ void ec_read_post_codes(void) { uint8_t p81h = P81HD; P80H81HS |= 1; +#ifdef POST_CODE_RING_BUFFER + DEBUG("POST %02X%02X:", p81h, p80h); + + // Also dump ring-buffer + for (uint8_t i = 0x80; i <= 0xBF; i += 2) { + DEBUG(" %02X%02X", BRAM[i + 1], BRAM[i]); + } + DEBUG("\n"); +#else // POST_CODE_RING_BUFFER DEBUG("POST %02X%02X\n", p81h, p80h); +#endif // POST_CODE_RING_BUFFER } #endif }