1 /******************************************************************************
2 * Copyright (c) 2007, 2012, 2013 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
13 * Definitions for EHCI Controller
25 struct ehci_cap_regs {
32 } __attribute__ ((packed));
39 uint32_t ctrldssegment;
40 uint32_t periodiclistbase;
41 uint32_t asynclistaddr;
45 } __attribute__ ((packed));
47 struct ehci_framelist {
48 uint32_t fl_ptr[FL_SIZE];
49 } __attribute__ ((packed));
52 struct ehci_cap_regs *cap_regs;
53 struct ehci_op_regs *op_regs;
54 struct usb_hcd_dev *hcidev;
55 struct ehci_qh *qh_async;
56 struct ehci_qh *qh_intr;
57 struct usb_pipe *freelist;
59 struct ehci_framelist *fl;
69 uint32_t alt_next_qtd;
72 } __attribute__ ((packed));
80 uint32_t alt_next_qtd;
83 } __attribute__ ((packed)) __attribute__((aligned(32)));
91 #define EHCI_PIPE_POOL_SIZE 4096
93 #define EHCI_TYP_ITD 0x00
94 #define EHCI_TYP_QH 0x02
95 #define EHCI_TYP_SITD 0x04
96 #define EHCI_TYP_FSTN 0x06
100 #define PID_SETUP 0x02
102 #define HCS_NPORTS_MASK 0x000f
104 #define CMD_IAAD (1 << 6)
105 #define CMD_ASE (1 << 5)
106 #define CMD_PSE (1 << 4)
107 #define CMD_FLS_MASK (3 << 2)
108 #define CMD_HCRESET (1 << 1)
109 #define CMD_RUN (1 << 0)
111 #define STS_IAA (1 << 5)
113 #define PORT_RESET (1 << 8)
114 #define PORT_PE (1 << 2)
115 #define PORT_CSC (1 << 1)
116 #define PORT_CONNECT (1 << 0)
118 #define QH_LOW_SPEED 0
119 #define QH_FULL_SPEED 1
120 #define QH_HIGH_SPEED 2
122 #define QH_RL_SHIFT 28
123 #define QH_CAP_C (1 << 27)
124 #define QH_MPS_SHIFT 16
125 #define QH_CAP_H (1 << 15)
126 #define QH_CAP_DTC (1 << 14)
127 #define QH_EPS_SHIFT 12
128 #define QH_EP_SHIFT 8
129 #define QH_CAP_I (1 << 7)
130 #define QH_DEV_ADDR_SHIFT 0
132 #define QH_PTR_TERM __builtin_bswap32(1)
133 #define QH_SMASK_SHIFT 0
134 #define QH_STS_ACTIVE (1 << 7)
135 #define QH_STS_HALTED (1 << 6)
136 #define QH_STS_DBE (1 << 5)
137 #define QH_STS_BABBLE (1 << 4)
138 #define QH_STS_XACTERR (1 << 3)
139 #define QH_STS_MMF (1 << 2)
140 #define QH_STS_SXS (1 << 1)
141 #define QH_STS_PING (1 << 0)
143 #define NUM_BULK_QTDS 4
144 #define MAX_XFER_PER_QTD (20 * 1024)
145 #define QTD_MAX_TRANSFER_LEN (NUM_BULK_QTDS * MAX_XFER_PER_QTD)
147 #define TOKEN_DT_SHIFT 31
148 #define TOKEN_TBTT_SHIFT 16
149 #define TOKEN_IOC_SHIFT 15
150 #define TOKEN_CPAGE_SHIFT 12
151 #define TOKEN_CERR_SHIFT 10
152 #define TOKEN_PID_SHIFT 8
153 #define TOKEN_STATUS_SHIFT 0
155 #endif /* USB_EHCI_H */