summaryrefslogtreecommitdiff
path: root/src/include/console/usb.h
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-04-04 15:05:28 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-05-26 10:52:16 +0200
commitf2f7f03aff2df2471fce08f48bb0a6583263158e (patch)
tree45aa9e5c906b6184f9699fcc707c42f0995baa44 /src/include/console/usb.h
parentc009601f29847aa91ec2f5a89a02f46a2119c5a4 (diff)
downloadcoreboot-f2f7f03aff2df2471fce08f48bb0a6583263158e.tar.xz
console: Add console for GDB
Connection of UARTs to GDB stub got lost in the console transition process, bring it back. In theory, GDB stub should work also over usbdebug, but that solution is not really tested at all yet. Change-Id: I90e05e8132889e788b92e055ee191f35add43bbc Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5343 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/include/console/usb.h')
-rw-r--r--src/include/console/usb.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/include/console/usb.h b/src/include/console/usb.h
index 57ea4eb3df..b5aab66649 100644
--- a/src/include/console/usb.h
+++ b/src/include/console/usb.h
@@ -34,14 +34,26 @@ int usb_can_rx_byte(int idx);
#define __CONSOLE_USB_ENABLE__ CONFIG_CONSOLE_USB && \
((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE)
+#define USB_PIPE_FOR_CONSOLE 0
+#define USB_PIPE_FOR_GDB 0
+
#if __CONSOLE_USB_ENABLE__
static inline void __usbdebug_init(void) { usbdebug_init(); }
-static inline void __usb_tx_byte(u8 data) { usb_tx_byte(0, data); }
-static inline void __usb_tx_flush(void) { usb_tx_flush(0); }
+static inline void __usb_tx_byte(u8 data) { usb_tx_byte(USB_PIPE_FOR_CONSOLE, data); }
+static inline void __usb_tx_flush(void) { usb_tx_flush(USB_PIPE_FOR_CONSOLE); }
#else
static inline void __usbdebug_init(void) {}
static inline void __usb_tx_byte(u8 data) {}
static inline void __usb_tx_flush(void) {}
#endif
+/* */
+#if 0 && CONFIG_GDB_STUB && \
+ ((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE)
+static inline void __gdb_hw_init(void) { usbdebug_init(); }
+static inline void __gdb_tx_byte(u8 data) { usb_tx_byte(USB_PIPE_FOR_GDB, data); }
+static inline void __gdb_tx_flush(void) { usb_tx_flush(USB_PIPE_FOR_GDB); }
+static inline u8 __gdb_rx_byte(void) { return usb_rx_byte(USB_PIPE_FOR_GDB); }
+#endif
+
#endif /* _CONSOLE_USB_H_ */