summaryrefslogtreecommitdiff
path: root/src/include/console/usb.h
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-09-07 19:16:27 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-09-14 12:26:18 +0000
commitd07f377872d1d229a8a9cc1d4a2c66f535e95fe3 (patch)
tree622725e971f7cb800e202f601db5741da40a4a22 /src/include/console/usb.h
parent08231833232d9cf80072e77c3f039a303bd6ffbb (diff)
downloadcoreboot-d07f377872d1d229a8a9cc1d4a2c66f535e95fe3.tar.xz
usbdebug: Fix init and add support for postcar
It was originally designed such that if usbdebug_init() was called before cbmem_initialize(), it would fetch the already-initialized state from CBMEM. This changed when cbmem_find() behaviour changed to require cbmem_initialize() to be called first. As a result, ramstage had to reinitialize all of the EHCI controller and USB endpoints on entry. This was slow, specially with AMD hardware where one can scan USB ports to probe for the debug dongle. For postcar and ramstage, move usbdebug entry such that it is triggered from CBMEM_INIT_HOOK instead of console_init(). Side-effect of this is usbdebug console shows 'coreboot-xxx ... starting...' line only for romstage. Initialisation for usbdebug is never done in postcar. If you have USBDEBUG_IN_ROMSTAGE=n, postcar will not have console output on usb either. While at it, fix also some other __PRE_RAM__ cases to ENV_ROMSTAGE and alike. Change-Id: If8ab973321a801abc5529f3ff68c5dccae9512ad Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/21443 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include/console/usb.h')
-rw-r--r--src/include/console/usb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/console/usb.h b/src/include/console/usb.h
index c67144d039..78956d7936 100644
--- a/src/include/console/usb.h
+++ b/src/include/console/usb.h
@@ -20,7 +20,7 @@
#include <rules.h>
#include <stdint.h>
-int usbdebug_init(void);
+void usbdebug_init(void);
void usb_tx_byte(int idx, unsigned char data);
void usb_tx_flush(int idx);
@@ -29,6 +29,7 @@ int usb_can_rx_byte(int idx);
#define __CONSOLE_USB_ENABLE__ (IS_ENABLED(CONFIG_CONSOLE_USB) && \
((ENV_ROMSTAGE && IS_ENABLED(CONFIG_USBDEBUG_IN_ROMSTAGE)) || \
+ (ENV_POSTCAR && IS_ENABLED(CONFIG_USBDEBUG_IN_ROMSTAGE)) || \
ENV_RAMSTAGE))
#define USB_PIPE_FOR_CONSOLE 0