drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / src / console / console.c
blobbb9d3747d3515a0f83c4762c5daec22bd8ea6870
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>
15 #include <types.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)
21 __cbmemc_init();
22 __spkmodem_init();
23 __qemu_debugcon_init();
25 __uart_init();
26 __ne2k_init();
27 __usbdebug_init();
28 __spiconsole_init();
29 __flashconsole_init();
30 __system76_ec_init();
31 __i2c_smbus_console_init();
32 __simnow_console_init();
35 void console_interactive_tx_byte(unsigned char byte, void *data_unused)
37 if (byte == '\n') {
38 /* Some consoles want newline conversion to keep terminals happy. */
39 __uart_tx_byte('\r');
40 __usb_tx_byte('\r');
41 __i2c_smbus_console_tx_byte('\r');
44 __spkmodem_tx_byte(byte);
45 __qemu_debugcon_tx_byte(byte);
46 __uart_tx_byte(byte);
47 __ne2k_tx_byte(byte);
48 __usb_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)
69 __uart_tx_flush();
70 __ne2k_tx_flush();
71 __usb_tx_flush();
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) {
80 console_tx_flush();
81 return;
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)
92 __gdb_hw_init();
95 void gdb_tx_byte(unsigned char byte)
97 __gdb_tx_byte(byte);
100 void gdb_tx_flush(void)
102 __gdb_tx_flush();
105 unsigned char gdb_rx_byte(void)
107 return __gdb_rx_byte();
109 #endif