diff options
author | Dave Frodin <dave.frodin@se-eng.com> | 2012-12-11 13:08:07 -0700 |
---|---|---|
committer | Anton Kochkov <anton.kochkov@gmail.com> | 2012-12-18 19:59:22 +0100 |
commit | 6bf11cf50c2b682f8c09a53af774588123b250b6 (patch) | |
tree | 8b6b43411f551cff98623c3606c74e7a1a3413b9 /payloads/libpayload/drivers/usb | |
parent | 8024b655507441646b2158fc61532364cbe65972 (diff) | |
download | coreboot-6bf11cf50c2b682f8c09a53af774588123b250b6.tar.xz |
libpayload: Use usb_debug() to show USB messages
Previously printf()'s were used to show USB messages
which results in lots of USB information being shown
when it isn't needed. This will now use the usb_debug()
printing funtion that already exists in usb.h.
Change-Id: I2199814de3327417417eb2e26a660f4a5557cb9f
Signed-off-by: Dave Frodin <dave.frodin@se-eng.com>
Reviewed-on: http://review.coreboot.org/2044
Tested-by: build bot (Jenkins)
Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
Diffstat (limited to 'payloads/libpayload/drivers/usb')
-rw-r--r-- | payloads/libpayload/drivers/usb/ehci.c | 8 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/ehci_rh.c | 2 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/ohci.c | 6 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/uhci.c | 2 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/usb.c | 40 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/usbhid.c | 4 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/usbinit.c | 20 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/usbmsc.c | 22 | ||||
-rw-r--r-- | payloads/libpayload/drivers/usb/xhci.c | 4 |
9 files changed, 54 insertions, 54 deletions
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c index 6a1cfb5791..f27658dc0e 100644 --- a/payloads/libpayload/drivers/usb/ehci.c +++ b/payloads/libpayload/drivers/usb/ehci.c @@ -206,7 +206,7 @@ static int wait_for_tds(qtd_t *head) && timeout--) udelay(50); if (timeout < 0) { - printf("Error: ehci: queue transfer " + usb_debug("Error: ehci: queue transfer " "processing timed out.\n"); return 1; } @@ -362,7 +362,7 @@ static int ehci_control (usbdev_t *dev, direction_t dir, int drlen, void *devreq (EHCI_SETUP << QTD_PID_SHIFT) | (3 << QTD_CERR_SHIFT); if (fill_td(cur, devreq, drlen) != drlen) { - printf("ERROR: couldn't send the entire device request\n"); + usb_debug("ERROR: couldn't send the entire device request\n"); } qtd_t *next = memalign(32, sizeof(qtd_t)); cur->next_qtd = virt_to_phys(next); @@ -379,7 +379,7 @@ static int ehci_control (usbdev_t *dev, direction_t dir, int drlen, void *devreq (((dir == OUT)?EHCI_OUT:EHCI_IN) << QTD_PID_SHIFT) | (3 << QTD_CERR_SHIFT); if (fill_td(cur, data, dalen) != dalen) { - printf("ERROR: couldn't send the entire control payload\n"); + usb_debug("ERROR: couldn't send the entire control payload\n"); } next = memalign(32, sizeof(qtd_t)); cur->next_qtd = virt_to_phys(next); @@ -556,7 +556,7 @@ static void *ehci_create_intr_queue( } } if (nothing_placed) { - printf("Error: Failed to place ehci interrupt queue head " + usb_debug("Error: Failed to place ehci interrupt queue head " "into periodic schedule: no space left\n"); ehci_destroy_intr_queue(ep, intrq); return NULL; diff --git a/payloads/libpayload/drivers/usb/ehci_rh.c b/payloads/libpayload/drivers/usb/ehci_rh.c index f58e1cf36c..89828040d1 100644 --- a/payloads/libpayload/drivers/usb/ehci_rh.c +++ b/payloads/libpayload/drivers/usb/ehci_rh.c @@ -107,7 +107,7 @@ ehci_rh_scanport (usbdev_t *dev, int port) while ((RH_INST(dev)->ports[port] & P_PORT_RESET) && timeout--) udelay(100); if (RH_INST(dev)->ports[port] & P_PORT_RESET) { - printf("Error: ehci_rh: port reset timed out.\n"); + usb_debug("Error: ehci_rh: port reset timed out.\n"); return; } diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c index 7db3141f81..ece31e443e 100644 --- a/payloads/libpayload/drivers/usb/ohci.c +++ b/payloads/libpayload/drivers/usb/ohci.c @@ -130,7 +130,7 @@ ohci_init (pcidev_t addr) * BASE ADDRESS only [31-12] bits. All other usually 0, but not all */ controller->reg_base = pci_read_config32 (controller->bus_address, 0x10) & 0xfffff000; // OHCI mandates MMIO, so bit 0 is clear OHCI_INST (controller)->opreg = (opreg_t*)phys_to_virt(controller->reg_base); - printf("OHCI Version %x.%x\n", (OHCI_INST (controller)->opreg->HcRevision >> 4) & 0xf, OHCI_INST (controller)->opreg->HcRevision & 0xf); + usb_debug("OHCI Version %x.%x\n", (OHCI_INST (controller)->opreg->HcRevision >> 4) & 0xf, OHCI_INST (controller)->opreg->HcRevision & 0xf); if ((OHCI_INST (controller)->opreg->HcControl & HostControllerFunctionalStateMask) == USBReset) { /* cold boot */ @@ -245,7 +245,7 @@ wait_for_ed(usbdev_t *dev, ed_t *head, int pages) mdelay(1); } if (timeout < 0) - printf("Error: ohci: endpoint " + usb_debug("Error: ohci: endpoint " "descriptor processing timed out.\n"); /* Clear the done queue. */ ohci_process_done_queue(OHCI_INST(dev->controller), 1); @@ -609,7 +609,7 @@ ohci_create_intr_queue(endpoint_t *const ep, const int reqsize, } } if (nothing_placed) { - printf("Error: Failed to place ohci interrupt endpoint " + usb_debug("Error: Failed to place ohci interrupt endpoint " "descriptor into periodic table: no space left\n"); ohci_destroy_intr_queue(ep, intrq); return NULL; diff --git a/payloads/libpayload/drivers/usb/uhci.c b/payloads/libpayload/drivers/usb/uhci.c index bf611d2613..b4ccb980a0 100644 --- a/payloads/libpayload/drivers/usb/uhci.c +++ b/payloads/libpayload/drivers/usb/uhci.c @@ -532,7 +532,7 @@ uhci_create_intr_queue (endpoint_t *ep, int reqsize, int reqcount, int reqtiming } } if (nothing_placed) { - printf("Error: Failed to place UHCI interrupt queue " + usb_debug("Error: Failed to place UHCI interrupt queue " "head into framelist: no space left\n"); uhci_destroy_intr_queue(ep, q); return NULL; diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c index e51adaca7f..ff67e0c5cd 100644 --- a/payloads/libpayload/drivers/usb/usb.c +++ b/payloads/libpayload/drivers/usb/usb.c @@ -286,7 +286,7 @@ set_address (hci_t *controller, int speed, int hubport, int hubaddr) (device_to_host, standard_type, dev_recp), 1, 0, 0); dd = (device_descriptor_t *) dev->descriptor; - printf ("* found device (0x%04x:0x%04x, USB %x.%x)", + usb_debug ("* found device (0x%04x:0x%04x, USB %x.%x)", dd->idVendor, dd->idProduct, dd->bcdUSB >> 8, dd->bcdUSB & 0xff); dev->quirks = usb_quirk_check(dd->idVendor, dd->idProduct); @@ -294,7 +294,7 @@ set_address (hci_t *controller, int speed, int hubport, int hubaddr) usb_debug ("\ndevice has %x configurations\n", dd->bNumConfigurations); if (dd->bNumConfigurations == 0) { /* device isn't usable */ - printf ("... no usable configuration!\n"); + usb_debug ("... no usable configuration!\n"); dev->address = 0; return -1; } @@ -317,7 +317,7 @@ set_address (hci_t *controller, int speed, int hubport, int hubaddr) num = interfaces; } else { - printf ("\nNOTICE: This driver defaults to using the first interface.\n" + usb_debug ("\nNOTICE: This driver defaults to using the first interface.\n" "This might be the wrong choice and lead to limited functionality\n" "of the device. Please report such a case to coreboot@coreboot.org\n" "as you might be the first.\n"); @@ -390,16 +390,16 @@ set_address (hci_t *controller, int speed, int hubport, int hubaddr) wireless_device = 0xe0, misc_device = 0xef, }; - printf(", class: "); + usb_debug(", class: "); switch (class) { case audio_device: - printf("audio\n"); + usb_debug("audio\n"); break; case comm_device: - printf("communication\n"); + usb_debug("communication\n"); break; case hid_device: - printf ("HID\n"); + usb_debug ("HID\n"); #ifdef CONFIG_USB_HID controller->devices[adr]->init = usb_hid_init; #else @@ -407,16 +407,16 @@ set_address (hci_t *controller, int speed, int hubport, int hubaddr) #endif break; case physical_device: - printf("physical\n"); + usb_debug("physical\n"); break; case imaging_device: - printf("camera\n"); + usb_debug("camera\n"); break; case printer_device: - printf("printer\n"); + usb_debug("printer\n"); break; case msc_device: - printf ("MSC\n"); + usb_debug ("MSC\n"); #ifdef CONFIG_USB_MSC controller->devices[adr]->init = usb_msc_init; #else @@ -424,7 +424,7 @@ set_address (hci_t *controller, int speed, int hubport, int hubaddr) #endif break; case hub_device: - printf ("hub\n"); + usb_debug ("hub\n"); #ifdef CONFIG_USB_HUB controller->devices[adr]->init = usb_hub_init; #else @@ -432,28 +432,28 @@ set_address (hci_t *controller, int speed, int hubport, int hubaddr) #endif break; case cdc_device: - printf("CDC\n"); + usb_debug("CDC\n"); break; case ccid_device: - printf("smartcard / CCID\n"); + usb_debug("smartcard / CCID\n"); break; case security_device: - printf("content security\n"); + usb_debug("content security\n"); break; case video_device: - printf("video\n"); + usb_debug("video\n"); break; case healthcare_device: - printf("healthcare\n"); + usb_debug("healthcare\n"); break; case diagnostic_device: - printf("diagnostic\n"); + usb_debug("diagnostic\n"); break; case wireless_device: - printf("wireless\n"); + usb_debug("wireless\n"); break; default: - printf("unsupported class %x\n", class); + usb_debug("unsupported class %x\n", class); break; } return adr; diff --git a/payloads/libpayload/drivers/usb/usbhid.c b/payloads/libpayload/drivers/usb/usbhid.c index 6af25680bc..ee8ba63842 100644 --- a/payloads/libpayload/drivers/usb/usbhid.c +++ b/payloads/libpayload/drivers/usb/usbhid.c @@ -407,11 +407,11 @@ static int usb_hid_set_layout (const char *country) /* Found, changing keyboard layout */ map = &keyboard_layouts[i]; - printf(" Keyboard layout '%s'\n", map->country); + usb_debug(" Keyboard layout '%s'\n", map->country); return 0; } - printf(" Keyboard layout '%s' not found, using '%s'\n", + usb_debug(" Keyboard layout '%s' not found, using '%s'\n", country, map->country); /* Nothing found, not changed */ diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c index f95e9c180b..2e466d307d 100644 --- a/payloads/libpayload/drivers/usb/usbinit.c +++ b/payloads/libpayload/drivers/usb/usbinit.c @@ -67,47 +67,47 @@ static int usb_controller_initialize(int bus, int dev, int func) pci_command |= PCI_COMMAND_MASTER; pci_write_config32(addr, PCI_COMMAND, pci_command); - printf("%02x:%02x.%x %04x:%04x.%d ", bus, dev, func, + usb_debug("%02x:%02x.%x %04x:%04x.%d ", bus, dev, func, pciid >> 16, pciid & 0xFFFF, func); switch (prog_if) { case 0x00: #ifdef CONFIG_USB_UHCI - printf("UHCI controller\n"); + usb_debug("UHCI controller\n"); uhci_init (addr); #else - printf("UHCI controller (not supported)\n"); + usb_debug("UHCI controller (not supported)\n"); #endif break; case 0x10: #ifdef CONFIG_USB_OHCI - printf("OHCI controller\n"); + usb_debug("OHCI controller\n"); ohci_init(addr); #else - printf("OHCI controller (not supported)\n"); + usb_debug("OHCI controller (not supported)\n"); #endif break; case 0x20: #ifdef CONFIG_USB_EHCI - printf("EHCI controller\n"); + usb_debug("EHCI controller\n"); ehci_init(addr); #else - printf("EHCI controller (not supported)\n"); + usb_debug("EHCI controller (not supported)\n"); #endif break; case 0x30: #ifdef CONFIG_USB_XHCI - printf("xHCI controller\n"); + usb_debug("xHCI controller\n"); xhci_init(addr); #else - printf("xHCI controller (not supported)\n"); + usb_debug("xHCI controller (not supported)\n"); #endif break; default: - printf("unknown controller %x not supported\n", + usb_debug("unknown controller %x not supported\n", prog_if); break; } diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c index 7e8b360758..0032f581bb 100644 --- a/payloads/libpayload/drivers/usb/usbmsc.c +++ b/payloads/libpayload/drivers/usb/usbmsc.c @@ -143,7 +143,7 @@ reset_transport (usbdev_t *dev) if (dev->controller->control (dev, OUT, sizeof (dr), &dr, 0, 0) || clear_stall (MSC_INST (dev)->bulk_in) || clear_stall (MSC_INST (dev)->bulk_out)) { - printf ("Detaching unresponsive device.\n"); + usb_debug ("Detaching unresponsive device.\n"); usb_detach_device (dev->controller, dev->address); return MSC_COMMAND_DETACHED; } @@ -394,14 +394,14 @@ read_capacity (usbdev_t *dev) } if (count >= 20) { // still not successful, assume 2tb in 512byte sectors, which is just the same garbage as any other number, but probably more usable. - printf (" assuming 2 TB with 512-byte sectors as READ CAPACITY didn't answer.\n"); + usb_debug (" assuming 2 TB with 512-byte sectors as READ CAPACITY didn't answer.\n"); MSC_INST (dev)->numblocks = 0xffffffff; MSC_INST (dev)->blocksize = 512; } else { MSC_INST (dev)->numblocks = ntohl (*(u32 *) buf) + 1; MSC_INST (dev)->blocksize = ntohl (*(u32 *) (buf + 4)); } - printf (" %d %d-byte sectors (%d MB)\n", MSC_INST (dev)->numblocks, + usb_debug (" %d %d-byte sectors (%d MB)\n", MSC_INST (dev)->numblocks, MSC_INST (dev)->blocksize, /* round down high block counts to avoid integer overflow */ MSC_INST (dev)->numblocks > 1000000 @@ -433,7 +433,7 @@ usb_msc_init (usbdev_t *dev) if (interface->bInterfaceProtocol != 0x50) { - printf (" Protocol not supported.\n"); + usb_debug (" Protocol not supported.\n"); return; } @@ -441,7 +441,7 @@ usb_msc_init (usbdev_t *dev) (interface->bInterfaceSubClass != 5) && // ATAPI 8070 (interface->bInterfaceSubClass != 6)) { // SCSI /* Other protocols, such as ATAPI don't seem to be very popular. looks like ATAPI would be really easy to add, if necessary. */ - printf (" Interface SubClass not supported.\n"); + usb_debug (" Interface SubClass not supported.\n"); return; } @@ -468,11 +468,11 @@ usb_msc_init (usbdev_t *dev) } if (MSC_INST (dev)->bulk_in == 0) { - printf("couldn't find bulk-in endpoint"); + usb_debug("couldn't find bulk-in endpoint"); return; } if (MSC_INST (dev)->bulk_out == 0) { - printf("couldn't find bulk-out endpoint"); + usb_debug("couldn't find bulk-out endpoint"); return; } usb_debug (" using endpoint %x as in, %x as out\n", @@ -481,7 +481,7 @@ usb_msc_init (usbdev_t *dev) usb_debug (" has %d luns\n", get_max_luns (dev) + 1); - printf (" Waiting for device to become ready..."); + usb_debug (" Waiting for device to become ready..."); timeout = 30 * 10; /* SCSI/ATA specs say we have to wait up to 30s. Ugh */ while (timeout--) { switch (test_unit_ready (dev)) { @@ -490,7 +490,7 @@ usb_msc_init (usbdev_t *dev) case MSC_COMMAND_FAIL: mdelay (100); if (!(timeout % 10)) - printf ("."); + usb_debug ("."); continue; default: /* if it's worse return */ return; @@ -498,9 +498,9 @@ usb_msc_init (usbdev_t *dev) break; } if (timeout < 0) { - printf ("timeout. Device not ready. Still trying...\n"); + usb_debug ("timeout. Device not ready. Still trying...\n"); } else { - printf ("ok.\n"); + usb_debug ("ok.\n"); } usb_debug (" spin up"); diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c index 2a8bcb448e..083b331548 100644 --- a/payloads/libpayload/drivers/usb/xhci.c +++ b/payloads/libpayload/drivers/usb/xhci.c @@ -120,9 +120,9 @@ xhci_init (pcidev_t addr) XHCI_INST (controller)->opreg->dcbaap_lo = virt_to_phys(XHCI_INST (controller)->dcbaa); XHCI_INST (controller)->opreg->dcbaap_hi = 0; - printf("waiting for controller to be ready - "); + usb_debug("waiting for controller to be ready - "); while ((XHCI_INST (controller)->opreg->usbsts & USBSTS_CNR) != 0) mdelay(1); - printf("ok.\n"); + usb_debug("ok.\n"); usb_debug("ERST Max: %lx -> %lx entries\n", XHCI_INST (controller)->capreg->ERST_Max, 1<<(XHCI_INST (controller)->capreg->ERST_Max)); |