usbdebug: Add logging level to debugging

Increase existing level from DEBUG to INFO.

Change-Id: Ic5934aec449f921af96dd3a6524f7275f8de1304
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/3859
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Kyösti Mälkki 2013-08-12 16:11:34 +03:00
parent eabfd3a7c1
commit 8ff3d68e93

View File

@ -58,9 +58,9 @@ struct ehci_debug_info {
}; };
#if CONFIG_DEBUG_USBDEBUG #if CONFIG_DEBUG_USBDEBUG
# define dbgp_printk(fmt_arg...) printk(BIOS_DEBUG, fmt_arg) # define dprintk(LEVEL, args...) printk(LEVEL, args)
#else #else
# define dbgp_printk(fmt_arg...) do {} while(0) # define dprintk(LEVEL, args...) do {} while(0)
#endif #endif
#define USB_DEBUG_DEVNUM 127 #define USB_DEBUG_DEVNUM 127
@ -427,13 +427,13 @@ try_next_port:
debug_port = HCS_DEBUG_PORT(hcs_params); debug_port = HCS_DEBUG_PORT(hcs_params);
n_ports = HCS_N_PORTS(hcs_params); n_ports = HCS_N_PORTS(hcs_params);
dbgp_printk("ehci_bar: 0x%x\n", ehci_bar); dprintk(BIOS_INFO, "ehci_bar: 0x%x\n", ehci_bar);
dbgp_printk("debug_port: %d\n", debug_port); dprintk(BIOS_INFO, "debug_port: %d\n", debug_port);
dbgp_printk("n_ports: %d\n", n_ports); dprintk(BIOS_INFO, "n_ports: %d\n", n_ports);
for (i = 1; i <= n_ports; i++) { for (i = 1; i <= n_ports; i++) {
portsc = read32((unsigned long)&ehci_regs->port_status[i-1]); portsc = read32((unsigned long)&ehci_regs->port_status[i-1]);
dbgp_printk("PORTSC #%d: %08x\n", i, portsc); dprintk(BIOS_INFO, "PORTSC #%d: %08x\n", i, portsc);
} }
if(port_map_tried && (new_debug_port != debug_port)) { if(port_map_tried && (new_debug_port != debug_port)) {
@ -455,11 +455,11 @@ try_next_port:
} while ((cmd & CMD_RESET) && (--loop > 0)); } while ((cmd & CMD_RESET) && (--loop > 0));
if(!loop) { if(!loop) {
dbgp_printk("Could not reset EHCI controller.\n"); dprintk(BIOS_INFO, "Could not reset EHCI controller.\n");
// on some systems it works without succeeding here. // on some systems it works without succeeding here.
// return -2; // return -2;
} else { } else {
dbgp_printk("EHCI controller reset successfully.\n"); dprintk(BIOS_INFO, "EHCI controller reset successfully.\n");
} }
/* Claim ownership, but do not enable yet */ /* Claim ownership, but do not enable yet */
@ -485,18 +485,18 @@ try_next_port:
} while ((status & STS_HALT) && (--loop > 0)); } while ((status & STS_HALT) && (--loop > 0));
if(!loop) { if(!loop) {
dbgp_printk("EHCI could not be started.\n"); dprintk(BIOS_INFO, "EHCI could not be started.\n");
return -3; return -3;
} }
dbgp_printk("EHCI started.\n"); dprintk(BIOS_INFO, "EHCI started.\n");
/* Wait for a device to show up in the debug port */ /* Wait for a device to show up in the debug port */
ret = ehci_wait_for_port(ehci_regs, debug_port); ret = ehci_wait_for_port(ehci_regs, debug_port);
if (ret < 0) { if (ret < 0) {
dbgp_printk("No device found in debug port %d\n", debug_port); dprintk(BIOS_INFO, "No device found in debug port %d\n", debug_port);
goto next_debug_port; goto next_debug_port;
} }
dbgp_printk("EHCI done waiting for port.\n"); dprintk(BIOS_INFO, "EHCI done waiting for port.\n");
/* Enable the debug port */ /* Enable the debug port */
ctrl = read32((unsigned long)&ehci_debug->control); ctrl = read32((unsigned long)&ehci_debug->control);
@ -504,12 +504,12 @@ try_next_port:
write32((unsigned long)&ehci_debug->control, ctrl); write32((unsigned long)&ehci_debug->control, ctrl);
ctrl = read32((unsigned long)&ehci_debug->control); ctrl = read32((unsigned long)&ehci_debug->control);
if ((ctrl & DBGP_CLAIM) != DBGP_CLAIM) { if ((ctrl & DBGP_CLAIM) != DBGP_CLAIM) {
dbgp_printk("No device in EHCI debug port.\n"); dprintk(BIOS_INFO, "No device in EHCI debug port.\n");
write32((unsigned long)&ehci_debug->control, ctrl & ~DBGP_CLAIM); write32((unsigned long)&ehci_debug->control, ctrl & ~DBGP_CLAIM);
ret = -4; ret = -4;
goto err; goto err;
} }
dbgp_printk("EHCI debug port enabled.\n"); dprintk(BIOS_INFO, "EHCI debug port enabled.\n");
/* Completely transfer the debug device to the debug controller */ /* Completely transfer the debug device to the debug controller */
portsc = read32((unsigned long)&ehci_regs->port_status[debug_port - 1]); portsc = read32((unsigned long)&ehci_regs->port_status[debug_port - 1]);
@ -528,12 +528,12 @@ try_next_port:
break; break;
} }
if (devnum > 127) { if (devnum > 127) {
dbgp_printk("Could not find attached debug device.\n"); dprintk(BIOS_INFO, "Could not find attached debug device.\n");
ret = -5; ret = -5;
goto err; goto err;
} }
if (ret < 0) { if (ret < 0) {
dbgp_printk("Attached device is not a debug device.\n"); dprintk(BIOS_INFO, "Attached device is not a debug device.\n");
ret = -6; ret = -6;
goto err; goto err;
} }
@ -544,13 +544,13 @@ try_next_port:
USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
USB_REQ_SET_ADDRESS, USB_DEBUG_DEVNUM, 0, NULL, 0); USB_REQ_SET_ADDRESS, USB_DEBUG_DEVNUM, 0, NULL, 0);
if (ret < 0) { if (ret < 0) {
dbgp_printk("Could not move attached device to %d.\n", dprintk(BIOS_INFO, "Could not move attached device to %d.\n",
USB_DEBUG_DEVNUM); USB_DEBUG_DEVNUM);
ret = -7; ret = -7;
goto err; goto err;
} }
devnum = USB_DEBUG_DEVNUM; devnum = USB_DEBUG_DEVNUM;
dbgp_printk("EHCI debug device renamed to 127.\n"); dprintk(BIOS_INFO, "EHCI debug device renamed to 127.\n");
} }
/* Enable the debug interface */ /* Enable the debug interface */
@ -558,20 +558,20 @@ try_next_port:
USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
USB_REQ_SET_FEATURE, USB_DEVICE_DEBUG_MODE, 0, NULL, 0); USB_REQ_SET_FEATURE, USB_DEVICE_DEBUG_MODE, 0, NULL, 0);
if (ret < 0) { if (ret < 0) {
dbgp_printk("Could not enable EHCI debug device.\n"); dprintk(BIOS_INFO, "Could not enable EHCI debug device.\n");
ret = -8; ret = -8;
goto err; goto err;
} }
dbgp_printk("EHCI debug interface enabled.\n"); dprintk(BIOS_INFO, "EHCI debug interface enabled.\n");
/* Perform a small write to get the even/odd data state in sync */ /* Perform a small write to get the even/odd data state in sync */
ret = dbgp_bulk_write(ehci_debug, USB_DEBUG_DEVNUM, dbgp_desc.bDebugOutEndpoint, "USB\r\n",5); ret = dbgp_bulk_write(ehci_debug, USB_DEBUG_DEVNUM, dbgp_desc.bDebugOutEndpoint, "USB\r\n",5);
if (ret < 0) { if (ret < 0) {
dbgp_printk("dbgp_bulk_write failed: %d\n", ret); dprintk(BIOS_INFO, "dbgp_bulk_write failed: %d\n", ret);
ret = -9; ret = -9;
goto err; goto err;
} }
dbgp_printk("Test write done\n"); dprintk(BIOS_INFO, "Test write done\n");
info->ehci_caps = ehci_caps; info->ehci_caps = ehci_caps;
info->ehci_regs = ehci_regs; info->ehci_regs = ehci_regs;