usbdebug: Improve solving EHCI debug port problems

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 <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/3382
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
Kyösti Mälkki 2013-06-06 10:28:22 +03:00 committed by Ronald G. Minnich
parent 8351243e4a
commit 1b7fd08ca1
1 changed files with 9 additions and 2 deletions

View File

@ -27,7 +27,11 @@
#include <ehci.h> #include <ehci.h>
#include <usbdebug.h> #include <usbdebug.h>
// 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 #define DBGP_DEBUG 0
#if DBGP_DEBUG #if DBGP_DEBUG
# define dbgp_printk(fmt_arg...) printk(BIOS_DEBUG, fmt_arg) # 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) void usbdebug_tx_byte(struct ehci_debug_info *dbg_info, unsigned char data)
{ {
#if DBGP_DEBUG == 0
if (!dbg_info) { if (!dbg_info) {
/* "Find" dbg_info structure in Cache */ /* "Find" dbg_info structure in Cache */
dbg_info = (struct ehci_debug_info *) 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; dbg_info->bufidx = 0;
} }
} }
#endif
} }
void usbdebug_tx_flush(struct ehci_debug_info *dbg_info) void usbdebug_tx_flush(struct ehci_debug_info *dbg_info)
{ {
#if DBGP_DEBUG == 0
if (!dbg_info) { if (!dbg_info) {
/* "Find" dbg_info structure in Cache */ /* "Find" dbg_info structure in Cache */
dbg_info = (struct ehci_debug_info *) 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); dbgp_bulk_write_x(dbg_info, dbg_info->buf, dbg_info->bufidx);
dbg_info->bufidx = 0; dbg_info->bufidx = 0;
} }
#endif
} }