]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/usb.h
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / include / usb.h
index ba3d169ea8cbf977aaaeb8f95e9cf331537d1d58..d7b082d9f4609e10e03f45e5816d68a9ead2101d 100644 (file)
@@ -27,7 +27,7 @@
 #define _USB_H_
 
 #include <usb_defs.h>
-#include <usbdescriptors.h>
+#include <linux/usb/ch9.h>
 
 /*
  * The EHCI spec says that we must align to at least 32 bytes.  However,
@@ -67,12 +67,6 @@ struct devrequest {
        unsigned short  length;
 } __attribute__ ((packed));
 
-/* All standard descriptors have these 2 fields in common */
-struct usb_descriptor_header {
-       unsigned char   bLength;
-       unsigned char   bDescriptorType;
-} __attribute__ ((packed));
-
 /* Interface */
 struct usb_interface {
        struct usb_interface_descriptor desc;
@@ -82,11 +76,17 @@ struct usb_interface {
        unsigned char   act_altsetting;
 
        struct usb_endpoint_descriptor ep_desc[USB_MAXENDPOINTS];
+       /*
+        * Super Speed Device will have Super Speed Endpoint
+        * Companion Descriptor  (section 9.6.7 of usb 3.0 spec)
+        * Revision 1.0 June 6th 2011
+        */
+       struct usb_ss_ep_comp_descriptor ss_ep_comp_desc[USB_MAXENDPOINTS];
 } __attribute__ ((packed));
 
 /* Configuration information.. */
 struct usb_config {
-       struct usb_configuration_descriptor desc;
+       struct usb_config_descriptor desc;
 
        unsigned char   no_of_if;       /* number of interfaces */
        struct usb_interface if_desc[USB_MAXINTERFACES];
@@ -140,6 +140,8 @@ struct usb_device {
        int portnr;
        struct usb_device *parent;
        struct usb_device *children[USB_MAXCHILDREN];
+
+       void *controller;               /* hardware controller private data */
 };
 
 /**********************************************************************
@@ -151,10 +153,13 @@ struct usb_device {
        defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
        defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
        defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
-       defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)
+       defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X) || \
+       defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
+       defined(CONFIG_USB_MUSB_OMAP2PLUS)
+
+int usb_lowlevel_init(int index, void **controller);
+int usb_lowlevel_stop(int index);
 
-int usb_lowlevel_init(void);
-int usb_lowlevel_stop(void);
 int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
                        void *buffer, int transfer_len);
 int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
@@ -166,6 +171,17 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 #define USB_UHCI_VEND_ID       0x8086
 #define USB_UHCI_DEV_ID                0x7112
 
+/*
+ * PXA25x can only act as USB device. There are drivers
+ * which works with USB CDC gadgets implementations.
+ * Some of them have common routines which can be used
+ * in boards init functions e.g. udc_disconnect() used for
+ * forced device disconnection from host.
+ */
+#elif defined(CONFIG_USB_GADGET_PXA2XX)
+
+extern void udc_disconnect(void);
+
 #else
 #error USB Lowlevel not defined
 #endif
@@ -271,7 +287,6 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
  *  - device:          bits 8-14
  *  - endpoint:                bits 15-18
  *  - Data0/1:         bit 19
- *  - speed:           bit 26          (0 = Full, 1 = Low Speed, 2 = High)
  *  - pipe type:       bits 30-31      (00 = isochronous, 01 = interrupt,
  *                                      10 = control, 11 = bulk)
  *
@@ -283,7 +298,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
 /* Create various pipes... */
 #define create_pipe(dev,endpoint) \
                (((dev)->devnum << 8) | ((endpoint) << 15) | \
-               ((dev)->speed << 26) | (dev)->maxpacketsize)
+               (dev)->maxpacketsize)
 #define default_pipe(dev) ((dev)->speed << 26)
 
 #define usb_sndctrlpipe(dev, endpoint) ((PIPE_CONTROL << 30) | \
@@ -334,8 +349,6 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
 #define usb_pipe_endpdev(pipe) (((pipe) >> 8) & 0x7ff)
 #define usb_pipeendpoint(pipe) (((pipe) >> 15) & 0xf)
 #define usb_pipedata(pipe)     (((pipe) >> 19) & 1)
-#define usb_pipespeed(pipe)    (((pipe) >> 26) & 3)
-#define usb_pipeslow(pipe)     (usb_pipespeed(pipe) == USB_SPEED_LOW)
 #define usb_pipetype(pipe)     (((pipe) >> 30) & 3)
 #define usb_pipeisoc(pipe)     (usb_pipetype((pipe)) == PIPE_ISOCHRONOUS)
 #define usb_pipeint(pipe)      (usb_pipetype((pipe)) == PIPE_INTERRUPT)
@@ -382,7 +395,9 @@ void usb_hub_reset(void);
 int hub_port_reset(struct usb_device *dev, int port,
                          unsigned short *portstat);
 
-struct usb_device *usb_alloc_new_device(void);
+struct usb_device *usb_alloc_new_device(void *controller);
+
 int usb_new_device(struct usb_device *dev);
+void usb_free_device(void);
 
 #endif /*_USB_H_ */