Go to the documentation of this file.
23 #define USB_CMD_RUN_STOP (0x1<<0)
24 #define USB_CMD_CTRL_RESET (0x1<<1)
25 #define USB_CMD_PERIODIC_SCHEDULE_EN (0x1<<4)
26 #define USB_CMD_ASYNC_SCHEDULE_EN (0x1<<5)
27 #define USB_CMD_INT_AA_DOORBELL (0x1<<6)
28 #define USB_CMD_ASP (0x3<<8)
29 #define USB_CMD_ASYNC_SCH_PARK_EN (0x1<<11)
30 #define USB_CMD_SUTW (0x1<<13)
31 #define USB_CMD_ATDTW (0x1<<14)
32 #define USB_CMD_ITC (0xFF<<16)
35 #define USB_CMD_FRAME_SIZE_1024 (0x0<<15 | 0x0<<2)
36 #define USB_CMD_FRAME_SIZE_512 (0x0<<15 | 0x1<<2)
37 #define USB_CMD_FRAME_SIZE_256 (0x0<<15 | 0x2<<2)
38 #define USB_CMD_FRAME_SIZE_128 (0x0<<15 | 0x3<<2)
39 #define USB_CMD_FRAME_SIZE_64 (0x1<<15 | 0x0<<2)
40 #define USB_CMD_FRAME_SIZE_32 (0x1<<15 | 0x1<<2)
41 #define USB_CMD_FRAME_SIZE_16 (0x1<<15 | 0x2<<2)
42 #define USB_CMD_FRAME_SIZE_8 (0x1<<15 | 0x3<<2)
45 #define USB_CMD_ASP_00 (0x0<<8)
46 #define USB_CMD_ASP_01 (0x1<<8)
47 #define USB_CMD_ASP_10 (0x2<<8)
48 #define USB_CMD_ASP_11 (0x3<<8)
49 #define USB_CMD_ASP_BIT_POS (8)
52 #define USB_CMD_ITC_NO_THRESHOLD (0x00<<16)
53 #define USB_CMD_ITC_1_MICRO_FRM (0x01<<16)
54 #define USB_CMD_ITC_2_MICRO_FRM (0x02<<16)
55 #define USB_CMD_ITC_4_MICRO_FRM (0x04<<16)
56 #define USB_CMD_ITC_8_MICRO_FRM (0x08<<16)
57 #define USB_CMD_ITC_16_MICRO_FRM (0x10<<16)
58 #define USB_CMD_ITC_32_MICRO_FRM (0x20<<16)
59 #define USB_CMD_ITC_64_MICRO_FRM (0x40<<16)
60 #define USB_CMD_ITC_BIT_POS (16)
63 #define USB_STS_INT (0x1<<0)
64 #define USB_STS_ERR (0x1<<1)
65 #define USB_STS_PORT_CHANGE (0x1<<2)
66 #define USB_STS_FRM_LST_ROLL (0x1<<3)
67 #define USB_STS_SYS_ERR (0x1<<4)
68 #define USB_STS_IAA (0x1<<5)
69 #define USB_STS_RESET_RECEIVED (0x1<<6)
70 #define USB_STS_SOF (0x1<<7)
71 #define USB_STS_DCSUSPEND (0x1<<8)
72 #define USB_STS_HC_HALTED (0x1<<12)
73 #define USB_STS_RCL (0x1<<13)
74 #define USB_STS_PERIODIC_SCHEDULE (0x1<<14)
75 #define USB_STS_ASYNC_SCHEDULE (0x1<<15)
78 #define USB_INTR_INT_EN (0x1<<0)
79 #define USB_INTR_ERR_INT_EN (0x1<<1)
80 #define USB_INTR_PC_DETECT_EN (0x1<<2)
81 #define USB_INTR_FRM_LST_ROLL_EN (0x1<<3)
82 #define USB_INTR_SYS_ERR_EN (0x1<<4)
83 #define USB_INTR_ASYN_ADV_EN (0x1<<5)
84 #define USB_INTR_RESET_EN (0x1<<6)
85 #define USB_INTR_SOF_EN (0x1<<7)
86 #define USB_INTR_DEVICE_SUSPEND (0x1<<8)
89 #define USB_DEVICE_ADDRESS_MASK (0x7F<<25)
90 #define USB_DEVICE_ADDRESS_BIT_POS (25)
92 #define PORTSC_CURRENT_CONNECT_STATUS (0x1<<0)
93 #define PORTSC_CONNECT_STATUS_CHANGE (0x1<<1)
94 #define PORTSC_PORT_ENABLE (0x1<<2)
95 #define PORTSC_PORT_EN_DIS_CHANGE (0x1<<3)
96 #define PORTSC_OVER_CURRENT_ACT (0x1<<4)
97 #define PORTSC_OVER_CUURENT_CHG (0x1<<5)
98 #define PORTSC_PORT_FORCE_RESUME (0x1<<6)
99 #define PORTSC_PORT_SUSPEND (0x1<<7)
100 #define PORTSC_PORT_RESET (0x1<<8)
101 #define PORTSC_LINE_STATUS_BITS (0x3<<10)
102 #define PORTSC_PORT_POWER (0x1<<12)
103 #define PORTSC_PORT_INDICTOR_CTRL (0x3<<14)
104 #define PORTSC_PORT_TEST_CTRL (0xF<<16)
105 #define PORTSC_WAKE_ON_CONNECT_EN (0x1<<20)
106 #define PORTSC_WAKE_ON_CONNECT_DIS (0x1<<21)
107 #define PORTSC_WAKE_ON_OVER_CURRENT (0x1<<22)
108 #define PORTSC_PHY_LOW_POWER_SPD (0x1<<23)
109 #define PORTSC_PORT_FORCE_FULL_SPEED (0x1<<24)
110 #define PORTSC_PORT_SPEED_MASK (0x3<<26)
111 #define PORTSC_TRANSCEIVER_WIDTH (0x1<<28)
112 #define PORTSC_PHY_TYPE_SEL (0x3<<30)
114 #define PORTSC_LINE_STATUS_SE0 (0x0<<10)
115 #define PORTSC_LINE_STATUS_JSTATE (0x1<<10)
116 #define PORTSC_LINE_STATUS_KSTATE (0x2<<10)
117 #define PORTSC_LINE_STATUS_UNDEF (0x3<<10)
118 #define PORTSC_LINE_STATUS_BIT_POS (10)
121 #define PORTSC_PIC_OFF (0x0<<14)
122 #define PORTSC_PIC_AMBER (0x1<<14)
123 #define PORTSC_PIC_GREEN (0x2<<14)
124 #define PORTSC_PIC_UNDEF (0x3<<14)
125 #define PORTSC_PIC_BIT_POS (14)
128 #define PORTSC_PTC_DISABLE (0x0<<16)
129 #define PORTSC_PTC_JSTATE (0x1<<16)
130 #define PORTSC_PTC_KSTATE (0x2<<16)
131 #define PORTSC_PTC_SEQNAK (0x3<<16)
132 #define PORTSC_PTC_PACKET (0x4<<16)
133 #define PORTSC_PTC_FORCE_EN (0x5<<16)
134 #define PORTSC_PTC_BIT_POS (16)
137 #define PORTSC_PORT_SPEED_FULL (0x0<<26)
138 #define PORTSC_PORT_SPEED_LOW (0x1<<26)
139 #define PORTSC_PORT_SPEED_HIGH (0x2<<26)
140 #define PORTSC_PORT_SPEED_UNDEF (0x3<<26)
141 #define PORTSC_SPEED_BIT_POS (26)
144 #define PORTSC_PTW (0x1<<28)
145 #define PORTSC_PTW_8BIT (0x0<<28)
146 #define PORTSC_PTW_16BIT (0x1<<28)
149 #define PORTSC_PTS_UTMI (0x0<<30)
150 #define PORTSC_PTS_ULPI (0x2<<30)
151 #define PORTSC_PTS_FSLS_SERIAL (0x3<<30)
152 #define PORTSC_PTS_BIT_POS (30)
154 #define PORTSC_W1C_BITS \
155 (PORTSC_CONNECT_STATUS_CHANGE | \
156 PORTSC_PORT_EN_DIS_CHANGE | \
157 PORTSC_OVER_CUURENT_CHG)
160 #define OTGSC_CTRL_VBUS_DISCHARGE (0x1<<0)
161 #define OTGSC_CTRL_VBUS_CHARGE (0x1<<1)
162 #define OTGSC_CTRL_OTG_TERMINATION (0x1<<3)
163 #define OTGSC_CTRL_DATA_PULSING (0x1<<4)
164 #define OTGSC_CTRL_ID_PULL_EN (0x1<<5)
165 #define OTGSC_HA_DATA_PULSE (0x1<<6)
166 #define OTGSC_HA_BA (0x1<<7)
167 #define OTGSC_STS_USB_ID (0x1<<8)
168 #define OTGSC_STS_A_VBUS_VALID (0x1<<9)
169 #define OTGSC_STS_A_SESSION_VALID (0x1<<10)
170 #define OTGSC_STS_B_SESSION_VALID (0x1<<11)
171 #define OTGSC_STS_B_SESSION_END (0x1<<12)
172 #define OTGSC_STS_1MS_TOGGLE (0x1<<13)
173 #define OTGSC_STS_DATA_PULSING (0x1<<14)
174 #define OTGSC_INTSTS_USB_ID (0x1<<16)
175 #define OTGSC_INTSTS_A_VBUS_VALID (0x1<<17)
176 #define OTGSC_INTSTS_A_SESSION_VALID (0x1<<18)
177 #define OTGSC_INTSTS_B_SESSION_VALID (0x1<<19)
178 #define OTGSC_INTSTS_B_SESSION_END (0x1<<20)
179 #define OTGSC_INTSTS_1MS (0x1<<21)
180 #define OTGSC_INTSTS_DATA_PULSING (0x1<<22)
181 #define OTGSC_INTR_USB_ID_EN (0x1<<24)
182 #define OTGSC_INTR_A_VBUS_VALID_EN (0x1<<25)
183 #define OTGSC_INTR_A_SESSION_VALID_EN (0x1<<26)
184 #define OTGSC_INTR_B_SESSION_VALID_EN (0x1<<27)
185 #define OTGSC_INTR_B_SESSION_END_EN (0x1<<28)
186 #define OTGSC_INTR_1MS_TIMER_EN (0x1<<29)
187 #define OTGSC_INTR_DATA_PULSING_EN (0x1<<30)
188 #define OTGSC_INTSTS_MASK (0x00ff0000)
191 #define USB_MODE_CTRL_MODE_IDLE (0x0<<0)
192 #define USB_MODE_CTRL_MODE_DEVICE (0x2<<0)
193 #define USB_MODE_CTRL_MODE_HOST (0x3<<0)
194 #define USB_MODE_CTRL_MODE_RSV (0x1<<0)
195 #define USB_MODE_SETUP_LOCK_OFF (0x1<<3)
196 #define USB_MODE_STREAM_DISABLE (0x1<<4)
197 #define USB_MODE_ES (0x1<<2)
200 #define USB_CTRL_IOENB (0x1<<2)
201 #define USB_CTRL_ULPI_INT0EN (0x1<<0)
204 #define BCSR5_INT_USB (0x02)
207 #define SCCR_OFFS (0xA08)
208 #define SCCR_USB_CLK_DISABLE (0x00000000)
209 #define SCCR_USB_MPHCM_11 (0x00c00000)
210 #define SCCR_USB_MPHCM_01 (0x00400000)
211 #define SCCR_USB_MPHCM_10 (0x00800000)
212 #define SCCR_USB_DRCM_11 (0x00300000)
213 #define SCCR_USB_DRCM_01 (0x00100000)
214 #define SCCR_USB_DRCM_10 (0x00200000)
216 #define SICRL_OFFS (0x114)
217 #define SICRL_USB0 (0x40000000)
218 #define SICRL_USB1 (0x20000000)
220 #define SICRH_OFFS (0x118)
221 #define SICRH_USB_UTMI (0x00020000)
224 #define OTGSC_INTERRUPT_ENABLE_BITS_MASK \
225 (OTGSC_INTR_USB_ID_EN | \
226 OTGSC_INTR_1MS_TIMER_EN | \
227 OTGSC_INTR_A_VBUS_VALID_EN | \
228 OTGSC_INTR_A_SESSION_VALID_EN | \
229 OTGSC_INTR_B_SESSION_VALID_EN | \
230 OTGSC_INTR_B_SESSION_END_EN | \
231 OTGSC_INTR_DATA_PULSING_EN)
234 #define OTGSC_INTERRUPT_STATUS_BITS_MASK \
235 (OTGSC_INTSTS_USB_ID | \
236 OTGSC_INTR_1MS_TIMER_EN | \
237 OTGSC_INTSTS_A_VBUS_VALID | \
238 OTGSC_INTSTS_A_SESSION_VALID | \
239 OTGSC_INTSTS_B_SESSION_VALID | \
240 OTGSC_INTSTS_B_SESSION_END | \
241 OTGSC_INTSTS_DATA_PULSING)
248 #define TA_WAIT_VRISE (100)
251 #define TA_WAIT_BCON (10000)
262 #define TA_AIDL_BDIS (5000)
265 #define TA_BIDL_ADIS (12)
271 #define TB_DATA_PLS (10)
272 #define TB_DATA_PLS_MIN (5)
273 #define TB_DATA_PLS_MAX (10)
276 #define TB_SRP_INIT (100)
279 #define TB_SRP_FAIL (7000)
282 #define TB_SRP_WAIT (60)
285 #define TB_VBUS_PLS (30)
289 #define TB_VBUS_DSCHRG (8)
292 #define TB_ASE0_BRST (20)
295 #define TB_A_SUSPEND (7)
296 #define TB_BUS_RESUME (12)
299 #define TB_SE0_SRP (2)
301 #define SET_OTG_STATE(otg_ptr, newstate) ((otg_ptr)->state = newstate)
358 (
void (*
function)(
unsigned long),
unsigned long expires,
unsigned long data)
389 #define FSL_OTG_MAJOR 240
390 #define FSL_OTG_NAME "fsl-usb2-otg"
392 #define OTG_IOCTL_MAGIC FSL_OTG_MAJOR
394 #define GET_OTG_STATUS _IOR(OTG_IOCTL_MAGIC, 1, int)
395 #define SET_A_SUSPEND_REQ _IOW(OTG_IOCTL_MAGIC, 2, int)
396 #define SET_A_BUS_DROP _IOW(OTG_IOCTL_MAGIC, 3, int)
397 #define SET_A_BUS_REQ _IOW(OTG_IOCTL_MAGIC, 4, int)
398 #define SET_B_BUS_REQ _IOW(OTG_IOCTL_MAGIC, 5, int)
399 #define GET_A_SUSPEND_REQ _IOR(OTG_IOCTL_MAGIC, 6, int)
400 #define GET_A_BUS_DROP _IOR(OTG_IOCTL_MAGIC, 7, int)
401 #define GET_A_BUS_REQ _IOR(OTG_IOCTL_MAGIC, 8, int)
402 #define GET_B_BUS_REQ _IOR(OTG_IOCTL_MAGIC, 9, int)