aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2019-10-18 15:30:00 +1100
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2019-12-05 14:18:59 +0530
commit85ffc8f21f3b608a3c20d2e9afc1d846694a2960 (patch)
treec4372936a8669655fdda813b27927ebeb54eae28 /hw
parentaff9301bb341b5387228e82036a7d72e519d8855 (diff)
downloadskiboot-85ffc8f21f3b608a3c20d2e9afc1d846694a2960.zip
skiboot-85ffc8f21f3b608a3c20d2e9afc1d846694a2960.tar.gz
skiboot-85ffc8f21f3b608a3c20d2e9afc1d846694a2960.tar.bz2
hw/port80: Squash No SYNC error
[ Upstream commit 6cf9ace9d69dcb5c37b328625132bc5c9624b778 ] 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 <stewart@flamingspork.com> Cc: Andrew Jeffery <andrew@aj.id.au> Acked-by: Andrew Jeffery <andrew@aj.id.au> [oliver: fixed the test] Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/lpc-port80h.c7
-rw-r--r--hw/test/run-port80h.c7
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 <stdint.h>
#include <assert.h>
+#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"