1 /* override default macros from ../port/usb.h */
6 #define dprint if(ehcidebug)print
7 #define ddprint if(ehcidebug>1)print
8 #define deprint if(ehcidebug || ep->debug)print
9 #define ddeprint if(ehcidebug>1 || ep->debug>1)print
11 typedef struct Ctlr Ctlr;
12 typedef struct Eopio Eopio;
13 typedef struct Isoio Isoio;
14 typedef struct Poll Poll;
16 typedef struct Qtree Qtree;
18 #pragma incomplete Ctlr;
19 #pragma incomplete Eopio;
20 #pragma incomplete Isoio;
21 #pragma incomplete Poll;
22 #pragma incomplete Qh;
23 #pragma incomplete Qtree;
35 Rendez; /* for waiting to async advance doorbell */
36 Lock; /* for ilock. qh lists and basic ctlr I/O */
37 QLock portlck; /* for port resets/enable... (and doorbell) */
38 int active; /* in use or not */
39 Ecapio* capio; /* Capability i/o regs */
40 Eopio* opio; /* Operational i/o regs */
42 int nframes; /* 1024, 512, or 256 frames in the list */
43 ulong* frames; /* periodic frame list (hw) */
44 Qh* qhs; /* async Qh circular list for bulk/ctl */
45 Qtree* tree; /* tree of Qhs for the periodic list */
46 int ntree; /* number of dummy qhs in tree */
47 Qh* intrqhs; /* list of (not dummy) qhs in tree */
48 Isoio* iso; /* list of active Iso I/O */
51 int nintr; /* number of interrupts attended */
52 int ntdintr; /* number of intrs. with something to do */
53 int nqhintr; /* number of async td intrs. */
54 int nisointr; /* number of periodic td intrs. */
60 * Operational registers (hw)
64 ulong cmd; /* 00 command */
65 ulong sts; /* 04 status */
66 ulong intr; /* 08 interrupt enable */
67 ulong frno; /* 0c frame index */
68 ulong seg; /* 10 bits 63:32 of EHCI datastructs (unused) */
69 ulong frbase; /* 14 frame list base addr, 4096-byte boundary */
70 ulong link; /* 18 link for async list */
71 uchar d2c[0x40-0x1c]; /* 1c dummy */
72 ulong config; /* 40 1: all ports default-routed to this HC */
73 ulong portsc[3]; /* 44 Port status and control, one per port */
75 /* defined for omap35 ehci at least */
76 uchar _pad0[0x80 - 0x50];
77 ulong insn[6]; /* implementation-specific */
80 typedef struct Uhh Uhh;
82 ulong revision; /* ro */
83 uchar _pad0[0x10-0x4];
85 ulong sysstatus; /* ro */
87 uchar _pad1[0x40-0x18];
94 P1ulpi_bypass = 1<<0, /* utmi if set; else ulpi */
97 extern Ecapio *ehcidebugcapio;
98 extern int ehcidebugport;
100 extern int ehcidebug;
102 void ehcilinkage(Hci *hp);
103 void ehcimeminit(Ctlr *ctlr);
104 void ehcirun(Ctlr *ctlr, int on);