]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/musb/musb_hcd.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / drivers / usb / musb / musb_hcd.c
index 799bd30e22740336f78e2660de96748f88aca1df..2ee0f23b7ed6134e5bb6e12f9fc89439958f18b5 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Mentor USB OTG Core host controller driver.
  *
  * Copyright (c) 2008 Texas Instruments
  *
- * SPDX-License-Identifier:    GPL-2.0+
- *
  * Author: Thomas Abraham t-abraham@ti.com, Texas Instruments
  */
 
@@ -28,99 +27,8 @@ static const struct musb_epinfo epinfo[3] = {
 static int rh_devnum;
 static u32 port_status;
 
-/* Device descriptor */
-static const u8 root_hub_dev_des[] = {
-       0x12,                   /*  __u8  bLength; */
-       0x01,                   /*  __u8  bDescriptorType; Device */
-       0x00,                   /*  __u16 bcdUSB; v1.1 */
-       0x02,
-       0x09,                   /*  __u8  bDeviceClass; HUB_CLASSCODE */
-       0x00,                   /*  __u8  bDeviceSubClass; */
-       0x00,                   /*  __u8  bDeviceProtocol; */
-       0x08,                   /*  __u8  bMaxPacketSize0; 8 Bytes */
-       0x00,                   /*  __u16 idVendor; */
-       0x00,
-       0x00,                   /*  __u16 idProduct; */
-       0x00,
-       0x00,                   /*  __u16 bcdDevice; */
-       0x00,
-       0x00,                   /*  __u8  iManufacturer; */
-       0x01,                   /*  __u8  iProduct; */
-       0x00,                   /*  __u8  iSerialNumber; */
-       0x01                    /*  __u8  bNumConfigurations; */
-};
+#include <usbroothubdes.h>
 
-/* Configuration descriptor */
-static const u8 root_hub_config_des[] = {
-       0x09,                   /*  __u8  bLength; */
-       0x02,                   /*  __u8  bDescriptorType; Configuration */
-       0x19,                   /*  __u16 wTotalLength; */
-       0x00,
-       0x01,                   /*  __u8  bNumInterfaces; */
-       0x01,                   /*  __u8  bConfigurationValue; */
-       0x00,                   /*  __u8  iConfiguration; */
-       0x40,                   /*  __u8  bmAttributes;
-                                  Bit 7: Bus-powered, 6: Self-powered, 5 Remote-wakwup, 4..0: resvd */
-       0x00,                   /*  __u8  MaxPower; */
-
-       /* interface */
-       0x09,                   /*  __u8  if_bLength; */
-       0x04,                   /*  __u8  if_bDescriptorType; Interface */
-       0x00,                   /*  __u8  if_bInterfaceNumber; */
-       0x00,                   /*  __u8  if_bAlternateSetting; */
-       0x01,                   /*  __u8  if_bNumEndpoints; */
-       0x09,                   /*  __u8  if_bInterfaceClass; HUB_CLASSCODE */
-       0x00,                   /*  __u8  if_bInterfaceSubClass; */
-       0x00,                   /*  __u8  if_bInterfaceProtocol; */
-       0x00,                   /*  __u8  if_iInterface; */
-
-       /* endpoint */
-       0x07,                   /*  __u8  ep_bLength; */
-       0x05,                   /*  __u8  ep_bDescriptorType; Endpoint */
-       0x81,                   /*  __u8  ep_bEndpointAddress; IN Endpoint 1 */
-       0x03,                   /*  __u8  ep_bmAttributes; Interrupt */
-       0x00,                   /*  __u16 ep_wMaxPacketSize; ((MAX_ROOT_PORTS + 1) / 8 */
-       0x02,
-       0xff                    /*  __u8  ep_bInterval; 255 ms */
-};
-
-static const unsigned char root_hub_str_index0[] = {
-       0x04,                   /*  __u8  bLength; */
-       0x03,                   /*  __u8  bDescriptorType; String-descriptor */
-       0x09,                   /*  __u8  lang ID */
-       0x04,                   /*  __u8  lang ID */
-};
-
-static const unsigned char root_hub_str_index1[] = {
-       0x1c,                   /*  __u8  bLength; */
-       0x03,                   /*  __u8  bDescriptorType; String-descriptor */
-       'M',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'U',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'S',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'B',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       ' ',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'R',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'o',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'o',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       't',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       ' ',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'H',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'u',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-       'b',                    /*  __u8  Unicode */
-       0,                      /*  __u8  Unicode */
-};
 #endif
 
 /*
@@ -164,9 +72,9 @@ static void write_toggle(struct usb_device *dev, u8 ep, u8 dir_out)
 }
 
 /*
- * This function checks if RxStall has occured on the endpoint. If a RxStall
- * has occured, the RxStall is cleared and 1 is returned. If RxStall has
- * not occured, 0 is returned.
+ * This function checks if RxStall has occurred on the endpoint. If a RxStall
+ * has occurred, the RxStall is cleared and 1 is returned. If RxStall has
+ * not occurred, 0 is returned.
  */
 static u8 check_stall(u8 ep, u8 dir_out)
 {
@@ -208,7 +116,7 @@ static int wait_until_ep0_ready(struct usb_device *dev, u32 bit_mask)
 {
        u16 csr;
        int result = 1;
-       int timeout = CONFIG_MUSB_TIMEOUT;
+       int timeout = CONFIG_USB_MUSB_TIMEOUT;
 
        while (result > 0) {
                csr = readw(&musbr->txcsr);
@@ -270,7 +178,7 @@ static int wait_until_ep0_ready(struct usb_device *dev, u32 bit_mask)
 static int wait_until_txep_ready(struct usb_device *dev, u8 ep)
 {
        u16 csr;
-       int timeout = CONFIG_MUSB_TIMEOUT;
+       int timeout = CONFIG_USB_MUSB_TIMEOUT;
 
        do {
                if (check_stall(ep, 1)) {
@@ -302,7 +210,7 @@ static int wait_until_txep_ready(struct usb_device *dev, u8 ep)
 static int wait_until_rxep_ready(struct usb_device *dev, u8 ep)
 {
        u16 csr;
-       int timeout = CONFIG_MUSB_TIMEOUT;
+       int timeout = CONFIG_USB_MUSB_TIMEOUT;
 
        do {
                if (check_stall(ep, 0)) {
@@ -1004,11 +912,6 @@ int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
                        nextlen = ((len-txlen) < dev->epmaxpacketout[ep]) ?
                                        (len-txlen) : dev->epmaxpacketout[ep];
 
-#ifdef CONFIG_USB_BLACKFIN
-                       /* Set the transfer data size */
-                       writew(nextlen, &musbr->txcount);
-#endif
-
                        /* Write the data to the FIFO */
                        write_fifo(MUSB_BULK_EP, nextlen,
                                        (void *)(((u8 *)buffer) + txlen));