]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - cpu/mips/au1x00_usb_ohci.c
imported Ka-Ro specific additions to U-Boot 2009.08 for TX28
[karo-tx-uboot.git] / cpu / mips / au1x00_usb_ohci.c
index dbf72dc6f8c9fb9b5d50cd8aff23c861b1613517..0bc2305d8786cfc4c87876bfba785f362aa0b9aa 100755 (executable)
@@ -2,7 +2,7 @@
  * URB OHCI HCD (Host Controller Driver) for USB on the AU1x00.
  *
  * (C) Copyright 2003
- * Gary Jennejohn, DENX Software Engineering <gj@denx.de>
+ * Gary Jennejohn, DENX Software Engineering <garyj@denx.de>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  */
 /*
  * IMPORTANT NOTES
- * 1 - you MUST define LITTLEENDIAN in the configuration file for the
- *     board or this driver will NOT work!
- * 2 - this driver is intended for use with USB Mass Storage Devices
+ * 1 - this driver is intended for use with USB Mass Storage Devices
  *     (BBB) ONLY. There is NO support for Interrupt or Isochronous pipes!
  */
 
 #include <config.h>
 
-#if defined(CONFIG_AU1X00) && defined(CONFIG_USB_OHCI)
+#ifdef CONFIG_USB_OHCI
 
 /* #include <pci.h> no PCI on the AU1x00 */
 
@@ -56,7 +54,7 @@
 #define USBH_ENABLE_CE (1<<3)
 #define USBH_ENABLE_RD (1<<4)
 
-#ifdef LITTLEENDIAN
+#ifdef __LITTLE_ENDIAN
 #define USBH_ENABLE_INIT (USBH_ENABLE_CE | USBH_ENABLE_E | USBH_ENABLE_C)
 #else
 #define USBH_ENABLE_INIT (USBH_ENABLE_CE | USBH_ENABLE_E | USBH_ENABLE_C | USBH_ENABLE_BE)
@@ -654,7 +652,8 @@ static void td_fill (ohci_t *ohci, unsigned int info,
        td->index = index;
        td->data = (__u32)data;
 #ifdef OHCI_FILL_TRACE
-       if (1 || ((usb_pipetype(urb_priv->pipe) == PIPE_BULK) && usb_pipeout(urb_priv->pipe))) {
+       if (1 || (usb_pipebulk(urb_priv->pipe) &&
+                               usb_pipeout(urb_priv->pipe))) {
                for (i = 0; i < len; i++)
                printf("td->data[%d] %#2x\n",i, ((unsigned char *)(td->data+0x80000000))[i]);
        }
@@ -758,7 +757,7 @@ static void dl_transfer_length(td_t * td)
        tdCBP  = m32_swap (td->hwCBP);
 
 
-       if (!(usb_pipetype (lurb_priv->pipe) == PIPE_CONTROL &&
+       if (!(usb_pipecontrol(lurb_priv->pipe) &&
            ((td->index == 0) || (td->index == lurb_priv->length - 1)))) {
                if (tdBE != 0) {
                        if (td->hwCBP == 0)
@@ -1015,7 +1014,7 @@ pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
 #else
        wait_ms(1);
 #endif
-       if ((pipe & PIPE_INTERRUPT) == PIPE_INTERRUPT) {
+       if (usb_pipeint(pipe)) {
                info("Root-Hub submit IRQ: NOT implemented");
                return 0;
        }
@@ -1249,7 +1248,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
        /* allow more time for a BULK device to react - some are slow */
 #define BULK_TO         5000   /* timeout in milliseconds */
-       if (usb_pipetype (pipe) == PIPE_BULK)
+       if (usb_pipebulk(pipe))
                timeout = BULK_TO;
        else
                timeout = 100;