From d07f377872d1d229a8a9cc1d4a2c66f535e95fe3 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Thu, 7 Sep 2017 19:16:27 +0300 Subject: usbdebug: Fix init and add support for postcar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/21443 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/drivers/usb/pci_ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/drivers/usb/pci_ehci.c') diff --git a/src/drivers/usb/pci_ehci.c b/src/drivers/usb/pci_ehci.c index 73c709cdd8..3bdeeebadc 100644 --- a/src/drivers/usb/pci_ehci.c +++ b/src/drivers/usb/pci_ehci.c @@ -25,7 +25,7 @@ #include "ehci_debug.h" #include "ehci.h" -#if !defined(__PRE_RAM__) && !defined(__SMM__) +#if ENV_RAMSTAGE static struct device_operations *ehci_drv_ops; static struct device_operations ehci_dbg_ops; #endif @@ -81,7 +81,7 @@ void ehci_debug_select_port(unsigned int port) pci_ehci_dbg_set_port(dbg_dev, port); } -#if !defined(__PRE_RAM__) && !defined(__SMM__) +#if ENV_RAMSTAGE static void pci_ehci_set_resources(struct device *dev) { struct resource *res; -- cgit v1.2.3