coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
usb.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _CONSOLE_USB_H_
4 #define _CONSOLE_USB_H_
5 
6 #include <types.h>
7 
8 void usbdebug_init(void);
9 int usbdebug_hw_init(bool force);
10 
11 void usb_tx_byte(int idx, unsigned char data);
12 void usb_tx_flush(int idx);
13 unsigned char usb_rx_byte(int idx);
14 int usb_can_rx_byte(int idx);
15 
16 #define __CONSOLE_USB_ENABLE__ (CONFIG(CONSOLE_USB) && \
17  ((ENV_BOOTBLOCK && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
18  (ENV_ROMSTAGE && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
19  (ENV_POSTCAR && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
20  (ENV_SEPARATE_VERSTAGE && CONFIG(USBDEBUG_IN_PRE_RAM)) || \
21  ENV_RAMSTAGE))
22 
23 #define USB_PIPE_FOR_CONSOLE 0
24 #define USB_PIPE_FOR_GDB 0
25 
26 #if __CONSOLE_USB_ENABLE__
27 static inline void __usbdebug_init(void) { usbdebug_init(); }
28 static inline void __usb_tx_byte(u8 data)
29 {
31 }
32 static inline void __usb_tx_flush(void) { usb_tx_flush(USB_PIPE_FOR_CONSOLE); }
33 #else
34 static inline void __usbdebug_init(void) {}
35 static inline void __usb_tx_byte(u8 data) {}
36 static inline void __usb_tx_flush(void) {}
37 #endif
38 
39 #endif /* _CONSOLE_USB_H_ */
static void __usb_tx_byte(u8 data)
Definition: usb.h:35
void usb_tx_byte(int idx, unsigned char data)
Definition: console.c:46
#define USB_PIPE_FOR_CONSOLE
Definition: usb.h:23
static void __usbdebug_init(void)
Definition: usb.h:34
int usb_can_rx_byte(int idx)
Definition: console.c:61
static void __usb_tx_flush(void)
Definition: usb.h:36
unsigned char usb_rx_byte(int idx)
Definition: console.c:56
int usbdebug_hw_init(bool force)
Definition: ehci_debug.c:658
void usb_tx_flush(int idx)
Definition: console.c:51
void usbdebug_init(void)
Definition: ehci_debug.c:729
uint8_t u8
Definition: stdint.h:45