From 1b7fd08ca174e3a3d69feeb7c4105f93c5d4687a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 6 Jun 2013 10:28:22 +0300 Subject: usbdebug: Improve solving EHCI debug port problems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comment how one can debug the usbdebug hardware init. Do not send printk's to usbdebug console when one is debugging the usbdebug console initialisation itself. Change-Id: I21a285cb31cf64e853bc626f8b6a617bc5a8be19 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/3382 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Marc Jones --- src/lib/usbdebug.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/usbdebug.c b/src/lib/usbdebug.c index 24d7967127..200121ff5b 100644 --- a/src/lib/usbdebug.c +++ b/src/lib/usbdebug.c @@ -27,7 +27,11 @@ #include #include -// Does not work if we want early printk to do usb debug, too.. +/* Set this to 1 to debug the start-up of EHCI debug port hardware. You need + * to modify console_init() to initialise some other console before usbdebug + * to receive the printk lines from here. + * There will be no real usbdebug console output while DBGP_DEBUG is set. + */ #define DBGP_DEBUG 0 #if DBGP_DEBUG # define dbgp_printk(fmt_arg...) printk(BIOS_DEBUG, fmt_arg) @@ -578,7 +582,7 @@ int early_usbdebug_init(void) void usbdebug_tx_byte(struct ehci_debug_info *dbg_info, unsigned char data) { - +#if DBGP_DEBUG == 0 if (!dbg_info) { /* "Find" dbg_info structure in Cache */ dbg_info = (struct ehci_debug_info *) @@ -592,10 +596,12 @@ void usbdebug_tx_byte(struct ehci_debug_info *dbg_info, unsigned char data) dbg_info->bufidx = 0; } } +#endif } void usbdebug_tx_flush(struct ehci_debug_info *dbg_info) { +#if DBGP_DEBUG == 0 if (!dbg_info) { /* "Find" dbg_info structure in Cache */ dbg_info = (struct ehci_debug_info *) @@ -606,4 +612,5 @@ void usbdebug_tx_flush(struct ehci_debug_info *dbg_info) dbgp_bulk_write_x(dbg_info, dbg_info->buf, dbg_info->bufidx); dbg_info->bufidx = 0; } +#endif } -- cgit v1.2.3