From 6cf9ace9d69dcb5c37b328625132bc5c9624b778 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Fri, 18 Oct 2019 15:30:00 +1100 Subject: hw/port80: Squash No SYNC error On Aspeed BMCs can be configured to route LPC IO address 0x80 to a GPIO port. Some systems use this to implement a boot progress indicator, but not all of them. There's no easy way to tell if this has been setup or not and if it hasn't we get an LPC SYNC no-response error from out LPC master. When we reach Linux and enable interrupts this results in this spurious error being printed: LPC[000]: Got SYNC no-response error. Error address reg: 0xd0010082 lpc_probe_write() is intended to catch situations where the peripherial being written to might not be configured, so use that instead of lpc_outb() to squash the error. Cc: Ranga Cc: Andrew Jeffery Acked-by: Andrew Jeffery [oliver: fixed the test] Signed-off-by: Oliver O'Halloran --- hw/lpc-port80h.c | 7 ++++--- hw/test/run-port80h.c | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/lpc-port80h.c b/hw/lpc-port80h.c index eb1378c..b373af7 100644 --- a/hw/lpc-port80h.c +++ b/hw/lpc-port80h.c @@ -164,9 +164,10 @@ void op_display_lpc(enum op_severity s, enum op_module m, uint16_t c) return; port80_val = op_display_to_port80(port80_val, s, m, c); - lpc_outb(port80_val, 0x80); port8x_val = op_display_to_port8x(port8x_val, s, m, c); - lpc_outb(port8x_val >> 8, 0x81); - lpc_outb(port8x_val & 0xFF, 0x82); + + lpc_probe_write(OPAL_LPC_IO, 0x80, port80_val, 1); + lpc_probe_write(OPAL_LPC_IO, 0x81, port8x_val >> 8, 1); + lpc_probe_write(OPAL_LPC_IO, 0x82, port8x_val & 0xff, 1); } diff --git a/hw/test/run-port80h.c b/hw/test/run-port80h.c index 85e8d87..a45ea46 100644 --- a/hw/test/run-port80h.c +++ b/hw/test/run-port80h.c @@ -10,20 +10,25 @@ #include #include +#define __unused __attribute__((unused)) + #define __LPC_H uint8_t port80; uint16_t port8x; -static inline void lpc_outb(uint8_t data, uint32_t addr) +static int64_t lpc_probe_write(int addr_type __unused, uint32_t addr, + uint32_t data, uint32_t sz) { assert((addr - 0x80) <= 2); + assert(sz == 1); if (addr == 0x80) port80 = data; if (addr == 0x81) port8x = data << 8 | (port8x & 0xff); if (addr == 0x82) port8x = (port8x & 0xff00) | data; + return 0; } #include "op-panel.h" -- cgit v1.1