Merge git://git.denx.de/u-boot into x1
[platform/kernel/u-boot.git] / board / mpl / common / usb_uhci.c
index 83624a9..a009437 100644 (file)
@@ -1,6 +1,25 @@
 /*
- * (C) Copyright 2001
- * Denis Peter, MPL AG Switzerland
+ * Part of this code has been derived from linux:
+ * Universal Host Controller Interface driver for USB (take II).
+ *
+ * (c) 1999-2001 Georg Acher, acher@in.tum.de (executive slave) (base guitar)
+ *               Deti Fliegl, deti@fliegl.de (executive slave) (lead voice)
+ *               Thomas Sailer, sailer@ife.ee.ethz.ch (chief consultant) (cheer leader)
+ *               Roman Weissgaerber, weissg@vienna.at (virt root hub) (studio porter)
+ * (c) 2000      Yggdrasil Computing, Inc. (port of new PCI interface support
+ *               from usb-ohci.c by Adam Richter, adam@yggdrasil.com).
+ * (C) 2000      David Brownell, david-b@pacbell.net (usb-ohci.c)
+ *
+ * HW-initalization based on material of
+ *
+ * (C) Copyright 1999 Linus Torvalds
+ * (C) Copyright 1999 Johannes Erdfelt
+ * (C) Copyright 1999 Randy Dunlap
+ * (C) Copyright 1999 Gregory P. Smith
+ *
+ *
+ * Adapted for U-Boot:
+ * (C) Copyright 2001 Denis Peter, MPL AG Switzerland
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -20,7 +39,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  *
- * Note: Part of this code has been derived from linux
  *
  */
 
@@ -518,11 +536,11 @@ void usb_check_int_chain(void)
        uhci_td_t *td,*prevtd;
 
        for(i=0;i<8;i++) {
-               prevtd=&td_int[i]; /* the first previous td is the skeleton td */
+               prevtd = &td_int[i]; /* the first previous td is the skeleton td */
                link=swap_32(td_int[i].link) & 0xfffffff0; /* next in chain */
                td=(uhci_td_t *)link; /* assign it */
                /* all interrupt TDs are finally linked to the td_int[0].
-                * so we process all until we find the td_int[0].
+                * so we process all until we find the td_int[0].
                 * if int0 chain points to a QH, we're also done
           */
                while(((i>0) && (link != (unsigned long)&td_int[0])) ||
@@ -603,7 +621,7 @@ int usb_lowlevel_init(void)
        pci_read_config_dword(busdevfunc,PCI_BASE_ADDRESS_4,&usb_base_addr);
        USB_UHCI_PRINTF("IO Base Address = 0x%lx\n",usb_base_addr);
        usb_base_addr&=0xFFFFFFF0;
-       usb_base_addr+=CFG_ISA_IO_BASE_ADDRESS;
+       usb_base_addr+=CONFIG_SYS_ISA_IO_BASE_ADDRESS;
        rh.devnum = 0;
        usb_init_skel();
        reset_hc();
@@ -620,7 +638,7 @@ int usb_lowlevel_stop(void)
                return 1;
        irq_free_handler(irqvec);
        reset_hc();
-       irqvec=-1;
+       irqvec = -1;
        return 0;
 }
 
@@ -774,7 +792,7 @@ int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        unsigned short wIndex;
        unsigned short wLength;
 
-       if ((pipe & PIPE_INTERRUPT) == PIPE_INTERRUPT) {
+       if (usb_pipeint(pipe)) {
                printf("Root-Hub submit IRQ: NOT implemented\n");
 #if 0
                uhci->rh.urb = urb;
@@ -1088,7 +1106,6 @@ static void usb_display_wValue(unsigned short wValue,unsigned short wIndex)
 #endif
 
 
-
 #ifdef USB_UHCI_DEBUG
 
 static int usb_display_td(uhci_td_t *td)