diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2011-08-01 11:41:42 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:24 -0700 |
commit | 94e9eb775fce848a47b2e5d0b40f7f0b8c3e8f3f (patch) | |
tree | 6aa843a76a17415b659e66f87e7786c4dc0251d0 /arch/powerpc | |
parent | 2ea85c0681a7e2bda2b4e357ac3cd5f30c2f55fc (diff) |
usb: update API for multiple controllers
Add the ability to have USB devices enumerated on several controllers
BUG=chrome-os-partner:5043
TEST=Compile U-Boot
Change-Id: If43d32d4dc90c15ba570e5b9f86641cbf60ce064
Reviewed-on: http://gerrit.chromium.org/gerrit/4951
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 19 | ||||
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/usb_ohci.c | 19 |
2 files changed, 18 insertions, 20 deletions
diff --git a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c index 7976e4df7d..b8aa1d0b97 100644 --- a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c +++ b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c @@ -1563,7 +1563,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +void *usb_lowlevel_init(int index) { /* Set the USB Clock */ @@ -1585,19 +1585,19 @@ int usb_lowlevel_init(void) /* align the storage */ if ((__u32)&ghcca[0] & 0xff) { err("HCCA not aligned!!"); - return -1; + return NULL; } phcca = &ghcca[0]; info("aligned ghcca %p", phcca); memset(&ohci_dev, 0, sizeof(struct ohci_device)); if ((__u32)&ohci_dev.ed[0] & 0x7) { err("EDs not aligned!!"); - return -1; + return NULL; } memset(gtd, 0, sizeof(td_t) * (NUM_TD + 1)); if ((__u32)gtd & 0x7) { err("TDs not aligned!!"); - return -1; + return NULL; } ptd = gtd; gohci.hcca = phcca; @@ -1613,13 +1613,13 @@ int usb_lowlevel_init(void) if (hc_reset (&gohci) < 0) { hc_release_ohci (&gohci); - return -1; + return NULL; } if (hc_start (&gohci) < 0) { err ("can't start usb-%s", gohci.slot_name); hc_release_ohci (&gohci); - return -1; + return NULL; } #ifdef DEBUG @@ -1628,19 +1628,18 @@ int usb_lowlevel_init(void) ohci_inited = 1; urb_finished = 1; - return 0; + return &gohci; } -int usb_lowlevel_stop(void) +void usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ if (!ohci_inited) - return 0; + return; /* TODO release any interrupts, etc. */ /* call hc_release_ohci() here ? */ hc_reset (&gohci); - return 0; } #endif /* CONFIG_USB_OHCI */ diff --git a/arch/powerpc/cpu/ppc4xx/usb_ohci.c b/arch/powerpc/cpu/ppc4xx/usb_ohci.c index a9edacd330..d39d04a7db 100644 --- a/arch/powerpc/cpu/ppc4xx/usb_ohci.c +++ b/arch/powerpc/cpu/ppc4xx/usb_ohci.c @@ -1570,7 +1570,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +void *usb_lowlevel_init(int index) { memset (&gohci, 0, sizeof (ohci_t)); memset (&urb_priv, 0, sizeof (urb_priv_t)); @@ -1578,19 +1578,19 @@ int usb_lowlevel_init(void) /* align the storage */ if ((__u32)&ghcca[0] & 0xff) { err("HCCA not aligned!!"); - return -1; + return NULL; } phcca = &ghcca[0]; info("aligned ghcca %p", phcca); memset(&ohci_dev, 0, sizeof(struct ohci_device)); if ((__u32)&ohci_dev.ed[0] & 0x7) { err("EDs not aligned!!"); - return -1; + return NULL; } memset(gtd, 0, sizeof(td_t) * (NUM_TD + 1)); if ((__u32)gtd & 0x7) { err("TDs not aligned!!"); - return -1; + return NULL; } ptd = gtd; gohci.hcca = phcca; @@ -1610,13 +1610,13 @@ int usb_lowlevel_init(void) if (hc_reset (&gohci) < 0) { hc_release_ohci (&gohci); - return -1; + return NULL; } if (hc_start (&gohci) < 0) { err ("can't start usb-%s", gohci.slot_name); hc_release_ohci (&gohci); - return -1; + return NULL; } #ifdef DEBUG @@ -1630,19 +1630,18 @@ int usb_lowlevel_init(void) usb_dev_init(); #endif - return 0; + return &gohci; } -int usb_lowlevel_stop(void) +void usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ if (!ohci_inited) - return 0; + return; /* TODO release any interrupts, etc. */ /* call hc_release_ohci() here ? */ hc_reset (&gohci); - return 0; } #endif /* CONFIG_USB_OHCI */ |