summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
authorSteven A. Falco <sfalco@coincident.com>2011-07-13 21:59:31 -0400
committerPatrick Georgi <patrick@georgi-clan.de>2011-07-14 08:00:30 +0200
commit25f23f17bcb2bac9fb5af0f5d6d1d8c1c9ea16ff (patch)
treed5770a87f8d9cf39b4b0f43fa5730adc02b073be /payloads
parent4edbe004b8b8c97900573218974191d2a2b77f1c (diff)
downloadcoreboot-25f23f17bcb2bac9fb5af0f5d6d1d8c1c9ea16ff.tar.xz
Print a warning when an unknow USB controller type is detected.
The Intel E6XX Atom processor reports an unknown USB controller type (in addition to the standard EHCI and OHCI ones). Add a default case to print a warning when an unknown controller type is detected. Change-Id: I885d0ccec4c46fd212cceac599290e9bf85edbbb Signed-off-by: Steven A. Falco <sfalco@coincident.com> Reviewed-on: http://review.coreboot.org/100 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/drivers/usb/usbinit.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c
index f0d5a60d1e..d3cfbb75e1 100644
--- a/payloads/libpayload/drivers/usb/usbinit.c
+++ b/payloads/libpayload/drivers/usb/usbinit.c
@@ -70,40 +70,47 @@ usb_controller_initialize (int bus, int dev, int func)
printf ("%02x:%02x.%x %04x:%04x.%d ", bus, dev, func,
pciid >> 16, pciid & 0xFFFF, func);
- if (prog_if == 0) {
- printf ("UHCI controller\n");
+ switch(prog_if) {
+ case 0x00:
+ printf ("UHCI controller\n");
#ifdef CONFIG_USB_UHCI
- uhci_init (addr);
+ uhci_init (addr);
#else
- printf ("Not supported.\n");
+ printf ("Not supported.\n");
#endif
- }
- if (prog_if == 0x10) {
- printf ("OHCI controller\n");
+ break;
+
+ case 0x10:
+ printf ("OHCI controller\n");
#ifdef CONFIG_USB_OHCI
- ohci_init(addr);
+ ohci_init(addr);
#else
- printf ("Not supported.\n");
+ printf ("Not supported.\n");
#endif
+ break;
- }
- if (prog_if == 0x20) {
- printf ("EHCI controller\n");
+ case 0x20:
+ printf ("EHCI controller\n");
#ifdef CONFIG_USB_EHCI
- ehci_init(addr);
+ ehci_init(addr);
#else
- printf ("Not supported.\n");
+ printf ("Not supported.\n");
#endif
+ break;
- }
- if (prog_if == 0x30) {
- printf ("xHCI controller\n");
+ case 0x30:
+ printf ("xHCI controller\n");
#ifdef CONFIG_USB_XHCI
- xhci_init(addr);
+ xhci_init(addr);
#else
- printf ("Not supported.\n");
+ printf ("Not supported.\n");
#endif
+ break;
+ default:
+ printf ("unknown controller %x not supported\n",
+ prog_if);
+ break;
}
}