From 4cc9b6c78d334bdf3f3e27227eb2ce5bba8b4ef5 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Fri, 28 Dec 2018 17:53:36 +0100 Subject: usbdebug: Initialize the HW once in CAR stages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EHCI hardware needs to be initialized only once during CAR stages. Some exception need to be made when a blob messes with the EHCI hardware. To achieve this add a fixed location in the car.ld linker script such that the ehci debug information can be shared across CAR stages. Currently this means only romstage and bootblock, but verstage can also be hooked up later on. Tested on google/peppy: Both the bootblock and the romstage properly output console. Change-Id: I78e20a172fd5cc81f366d580f3cce57b9545d7a2 Signed-off-by: Arthur Heymans Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/30481 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/drivers/usb/ehci_debug.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/drivers') diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c index 2020888189..4987523f78 100644 --- a/src/drivers/usb/ehci_debug.c +++ b/src/drivers/usb/ehci_debug.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,10 @@ static struct ehci_debug_info * glob_dbg_info_p CAR_GLOBAL; static inline struct ehci_debug_info *dbgp_ehci_info(void) { + if (IS_ENABLED(CONFIG_USBDEBUG_IN_PRE_RAM) + && (ENV_ROMSTAGE || ENV_BOOTBLOCK || ENV_VERSTAGE)) + glob_dbg_info_p = + (struct ehci_debug_info *)_car_ehci_dbg_info_start; if (car_get_var(glob_dbg_info_p) == NULL) car_set_var(glob_dbg_info_p, &glob_dbg_info); -- cgit v1.2.3