]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb_ohci.h
drivers/video : move video drivers to drivers/video
[u-boot] / drivers / usb_ohci.h
index a1b36ed83cc6b9d26ed14e4e3467788c5f17f998..380cb4c92730b676c87038c0a0d6e889a1d29b6f 100644 (file)
@@ -7,18 +7,14 @@
  * usb-ohci.h
  */
 
-/* functions for doing board specific setup/cleanup */
-#ifdef CFG_USB_BOARD_INIT
+/* functions for doing board or CPU specific setup/cleanup */
 extern int usb_board_init(void);
 extern int usb_board_stop(void);
-extern int usb_cpu_init_fail(void);
-#endif
+extern int usb_board_init_fail(void);
 
-#ifdef CFG_USB_CPU_INIT
 extern int usb_cpu_init(void);
 extern int usb_cpu_stop(void);
 extern int usb_cpu_init_fail(void);
-#endif
 
 
 static int cc_to_error[16] = {
@@ -68,7 +64,8 @@ struct ed {
        struct ed *ed_rm_list;
 
        struct usb_device *usb_dev;
-       __u32 unused[3];
+       void *purb;
+       __u32 unused[2];
 } __attribute((aligned(16)));
 typedef struct ed ed_t;
 
@@ -117,7 +114,9 @@ struct td {
        __u32 hwNextTD;         /* Next TD Pointer */
        __u32 hwBE;             /* Memory Buffer End Pointer */
 
+/* #ifndef CONFIG_MPC5200 /\* this seems wrong *\/ */
        __u16 hwPSW[MAXPSW];
+/* #endif */
        __u8 unused;
        __u8 index;
        struct ed *ed;
@@ -141,8 +140,13 @@ typedef struct td td_t;
 #define NUM_INTS 32    /* part of the OHCI standard */
 struct ohci_hcca {
        __u32   int_table[NUM_INTS];    /* Interrupt ED table */
+#if defined(CONFIG_MPC5200)
+       __u16   pad1;                   /* set to 0 on each frame_no change */
+       __u16   frame_no;               /* current frame number */
+#else
        __u16   frame_no;               /* current frame number */
        __u16   pad1;                   /* set to 0 on each frame_no change */
+#endif
        __u32   done_head;              /* info returned for an interrupt */
        u8              reserved_for_hc[116];
 } __attribute((aligned(256)));
@@ -151,7 +155,9 @@ struct ohci_hcca {
 /*
  * Maximum number of root hub ports.
  */
-#define MAX_ROOT_PORTS 3       /* maximum OHCI root hub ports */
+#ifndef CFG_USB_OHCI_MAX_ROOT_PORTS
+# error "CFG_USB_OHCI_MAX_ROOT_PORTS undefined!"
+#endif
 
 /*
  * This is the structure of the OHCI controller's memory mapped I/O
@@ -185,7 +191,7 @@ struct ohci_regs {
                __u32   a;
                __u32   b;
                __u32   status;
-               __u32   portstatus[MAX_ROOT_PORTS];
+               __u32   portstatus[CFG_USB_OHCI_MAX_ROOT_PORTS];
        } roothub;
 } __attribute((aligned(32)));
 
@@ -344,9 +350,14 @@ typedef struct
        ed_t *ed;
        __u16 length;   /* number of tds associated with this request */
        __u16 td_cnt;   /* number of tds already serviced */
+       struct usb_device *dev;
        int   state;
        unsigned long pipe;
+       void *transfer_buffer;
+       int transfer_buffer_length;
+       int interval;
        int actual_length;
+       int finished;
        td_t *td[N_URB_TD];     /* list pointer to all corresponding TDs associated with this request */
 } urb_priv_t;
 #define URB_DEL 1
@@ -370,6 +381,7 @@ typedef struct ohci {
 
        struct ohci_regs *regs; /* OHCI controller's memory */
 
+       int ohci_int_load[32];   /* load of the 32 Interrupt Chains (for load balancing)*/
        ed_t *ed_rm_list[2];     /* lists of all endpoints to be removed */
        ed_t *ed_bulktail;       /* last endpoint of bulk list */
        ed_t *ed_controltail;    /* last endpoint of control list */
@@ -392,7 +404,8 @@ struct ohci_device {
 /* endpoint */
 static int ep_link(ohci_t * ohci, ed_t * ed);
 static int ep_unlink(ohci_t * ohci, ed_t * ed);
-static ed_t * ep_add_ed(struct usb_device * usb_dev, unsigned long pipe);
+static ed_t * ep_add_ed(struct usb_device * usb_dev, unsigned long pipe,
+               int interval, int load);
 
 /*-------------------------------------------------------------------------*/