summaryrefslogtreecommitdiff
path: root/common/port80.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/port80.c')
-rw-r--r--common/port80.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/common/port80.c b/common/port80.c
index 52264cc446..c2ad87f38f 100644
--- a/common/port80.c
+++ b/common/port80.c
@@ -17,9 +17,14 @@
#define CPRINTF(format, args...) cprintf(CC_PORT80, format, ## args)
-static uint16_t __bss_slow history[CONFIG_PORT80_HISTORY_LEN];
+#ifdef CONFIG_PORT80_4_BYTE
+typedef uint32_t port80_code_t;
+#else
+typedef uint16_t port80_code_t;
+#endif
+static port80_code_t __bss_slow history[CONFIG_PORT80_HISTORY_LEN];
static int __bss_slow writes; /* Number of port 80 writes so far */
-static int last_boot; /* Last code from previous boot */
+static port80_code_t last_boot; /* Last code from previous boot */
static int __bss_slow scroll;
#ifdef CONFIG_BRINGUP
@@ -55,15 +60,15 @@ void port_80_write(int data)
if (print_in_int)
CPRINTF("%c[%pT Port 80: 0x%02x]",
scroll ? '\n' : '\r', PRINTF_TIMESTAMP_NOW, data);
- else if (data < 0x100)
+ else if (data < 0x100 || IS_ENABLED(CONFIG_PORT80_4_BYTE))
hook_call_deferred(&port80_dump_buffer_data, 4 * SECOND);
/* Save current port80 code if system is resetting */
if (data == PORT_80_EVENT_RESET && writes) {
- int prev = history[(writes-1) % ARRAY_SIZE(history)];
+ port80_code_t prev = history[(writes-1) % ARRAY_SIZE(history)];
/* Ignore special event codes */
- if (prev < 0x100)
+ if (prev < 0x100 || IS_ENABLED(CONFIG_PORT80_4_BYTE))
last_boot = prev;
}