diff options
author | Alistair Popple <alistair@popple.id.au> | 2019-05-30 16:05:15 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-06-03 10:28:57 +1000 |
commit | 20a3b69bd1b4088152faeb6c93a5b9cf86774652 (patch) | |
tree | 5ff96a42b5b4510a1a3de424f3d27f314ad33dd4 | |
parent | c6eca76efb2e01ccdc618140a555e7f37e6ef959 (diff) | |
download | skiboot-20a3b69bd1b4088152faeb6c93a5b9cf86774652.zip skiboot-20a3b69bd1b4088152faeb6c93a5b9cf86774652.tar.gz skiboot-20a3b69bd1b4088152faeb6c93a5b9cf86774652.tar.bz2 |
lpc-port80h: Don't write port 80h when running under Simics
Simics doesn't model LPC port 80h. Writing to it terminates the
simulation due to an invalid LPC memory access. This patch adds a
check to ensure port 80h isn't accessed if we are running under
Simics.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
[stewart: fixup run-port80h test]
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | hw/lpc-port80h.c | 4 | ||||
-rw-r--r-- | hw/test/run-port80h.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/hw/lpc-port80h.c b/hw/lpc-port80h.c index 60bde92..caff0fd 100644 --- a/hw/lpc-port80h.c +++ b/hw/lpc-port80h.c @@ -18,6 +18,7 @@ #include <lpc.h> #include <op-panel.h> +#include <chip.h> /* * Convert our detailed op_display() call into 1 byte for LPC port 80h @@ -168,6 +169,9 @@ void op_display_lpc(enum op_severity s, enum op_module m, uint16_t c) static uint8_t port80_val = 0x80; static uint16_t port8x_val = 0x8000; + if (chip_quirk(QUIRK_SIMICS)) + 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); diff --git a/hw/test/run-port80h.c b/hw/test/run-port80h.c index 6a9ec31..e0d9437 100644 --- a/hw/test/run-port80h.c +++ b/hw/test/run-port80h.c @@ -42,6 +42,8 @@ void op_display_lpc(enum op_severity s, enum op_module m, uint16_t c); #include "../lpc-port80h.c" #include "../../core/test/stubs.c" +enum proc_chip_quirks proc_chip_quirks; + int main(void) { op_display_lpc(OP_LOG, OP_MOD_INIT, 0x00); |