1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/cbmem_console.h>
4 #include <console/flash.h>
5 #include <console/i2c_smbus.h>
6 #include <console/ne2k.h>
7 #include <console/qemu_debugcon.h>
8 #include <console/simnow.h>
9 #include <console/spi.h>
10 #include <console/spkmodem.h>
11 #include <console/streams.h>
12 #include <console/system76_ec.h>
13 #include <console/uart.h>
14 #include <console/usb.h>
17 /* Note: when adding a new console, make sure you update the definition of
18 HAS_ONLY_FAST_CONSOLES in <console.h>! */
19 void console_hw_init(void)
23 __qemu_debugcon_init();
29 __flashconsole_init();
31 __i2c_smbus_console_init();
32 __simnow_console_init();
35 void console_interactive_tx_byte(unsigned char byte
, void *data_unused
)
38 /* Some consoles want newline conversion to keep terminals happy. */
41 __i2c_smbus_console_tx_byte('\r');
44 __spkmodem_tx_byte(byte
);
45 __qemu_debugcon_tx_byte(byte
);
49 __spiconsole_tx_byte(byte
);
50 __system76_ec_tx_byte(byte
);
51 __i2c_smbus_console_tx_byte(byte
);
52 __simnow_console_tx_byte(byte
);
55 void console_stored_tx_byte(unsigned char byte
, void *data_unused
)
57 __flashconsole_tx_byte(byte
);
58 __cbmemc_tx_byte(byte
);
61 void console_tx_byte(unsigned char byte
)
63 console_interactive_tx_byte(byte
, NULL
);
64 console_stored_tx_byte(byte
, NULL
);
67 void console_tx_flush(void)
72 __flashconsole_tx_flush();
73 __system76_ec_tx_flush();
76 void console_write_line(uint8_t *buffer
, size_t number_of_bytes
)
78 /* Finish displaying all of the console data if requested */
79 if (number_of_bytes
== 0) {
84 /* Output the console data */
85 while (number_of_bytes
--)
86 console_tx_byte(*buffer
++);
89 #if CONFIG(GDB_STUB) && (ENV_ROMSTAGE_OR_BEFORE || ENV_RAMSTAGE)
90 void gdb_hw_init(void)
95 void gdb_tx_byte(unsigned char byte
)
100 void gdb_tx_flush(void)
105 unsigned char gdb_rx_byte(void)
107 return __gdb_rx_byte();