summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/console/system76_ec.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/include/console/system76_ec.h b/src/include/console/system76_ec.h
new file mode 100644
index 0000000000..616e46f4a2
--- /dev/null
+++ b/src/include/console/system76_ec.h
@@ -0,0 +1,35 @@
+#ifndef CONSOLE_SYSTEM76_EC_H
+#define CONSOLE_SYSTEM76_EC_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+void system76_ec_init(void);
+void system76_ec_flush(void);
+void system76_ec_print(uint8_t byte);
+
+#define __CONSOLE_SYSTEM76_EC_ENABLE__ (CONFIG(CONSOLE_SYSTEM76_EC) && \
+ (ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE \
+ || ENV_SEPARATE_VERSTAGE || ENV_POSTCAR \
+ || (ENV_SMM && CONFIG(DEBUG_SMI))))
+
+#if __CONSOLE_SYSTEM76_EC_ENABLE__
+static inline void __system76_ec_init(void)
+{
+ system76_ec_init();
+}
+static inline void __system76_ec_tx_flush(void)
+{
+ system76_ec_flush();
+}
+static inline void __system76_ec_tx_byte(unsigned char byte)
+{
+ system76_ec_print(byte);
+}
+#else
+static inline void __system76_ec_init(void) {}
+static inline void __system76_ec_tx_flush(void) {}
+static inline void __system76_ec_tx_byte(unsigned char byte) {}
+#endif
+
+#endif