imxusbreg.h revision 1.3 1 1.3 skrll /* $NetBSD: imxusbreg.h,v 1.3 2015/09/04 07:34:32 skrll Exp $ */
2 1.1 bsh /*
3 1.1 bsh * Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved.
4 1.1 bsh * Written by Hashimoto Kenichi for Genetec Corporation.
5 1.1 bsh *
6 1.1 bsh * Redistribution and use in source and binary forms, with or without
7 1.1 bsh * modification, are permitted provided that the following conditions
8 1.1 bsh * are met:
9 1.1 bsh * 1. Redistributions of source code must retain the above copyright
10 1.1 bsh * notice, this list of conditions and the following disclaimer.
11 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 bsh * notice, this list of conditions and the following disclaimer in the
13 1.1 bsh * documentation and/or other materials provided with the distribution.
14 1.1 bsh *
15 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
16 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
19 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 1.1 bsh * POSSIBILITY OF SUCH DAMAGE.
26 1.1 bsh */
27 1.1 bsh
28 1.1 bsh #ifndef _ARM_IMX_IMXUSBREG_H
29 1.1 bsh #define _ARM_IMX_IMXUSBREG_H
30 1.1 bsh
31 1.1 bsh #define IMXUSB_ID 0x0000
32 1.2 hkenken #define IMXUSB_ID_ID __BITS(5,0)
33 1.2 hkenken #define IMXUSB_ID_REVISION __BITS(23,16)
34 1.1 bsh #define IMXUSB_HWGENERAL 0x0004
35 1.1 bsh #define IMXUSB_HWHOST 0x0008
36 1.2 hkenken #define HWHOST_HC __BIT(0)
37 1.2 hkenken #define HWHOST_NPORT __BITS(3,1)
38 1.1 bsh #define IMXUSB_HWDEVICE 0x000c
39 1.2 hkenken #define HWDEVICE_DC __BIT(0)
40 1.2 hkenken #define HWDEVICE_DEVEP __BITS(5,1)
41 1.1 bsh #define IMXUSB_HWTXBUF 0x0010
42 1.1 bsh #define IMXUSB_HWRXBUF 0x0014
43 1.1 bsh
44 1.1 bsh #define IMXUSB_EHCIREGS 0x0100
45 1.1 bsh
46 1.1 bsh #define IMXUSB_ULPIVIEW 0x0170
47 1.1 bsh #define ULPI_WU __BIT(31)
48 1.1 bsh #define ULPI_RUN __BIT(30)
49 1.1 bsh #define ULPI_RW __BIT(29)
50 1.1 bsh #define ULPI_SS __BIT(27)
51 1.2 hkenken #define ULPI_PORT __BITS(26,24)
52 1.2 hkenken #define ULPI_ADDR __BITS(23,16)
53 1.2 hkenken #define ULPI_DATRD __BITS(15,8)
54 1.2 hkenken #define ULPI_DATWR __BITS(7,0)
55 1.1 bsh
56 1.1 bsh #define IMXUSB_OTGSC 0x01A4
57 1.1 bsh #define OTGSC_DPIE __BIT(30)
58 1.1 bsh #define OTGSC_1MSE __BIT(29)
59 1.1 bsh #define OTGSC_BSEIE __BIT(28)
60 1.1 bsh #define OTGSC_BSVIE __BIT(27)
61 1.1 bsh #define OTGSC_ASVIE __BIT(26)
62 1.1 bsh #define OTGSC_AVVIE __BIT(25)
63 1.1 bsh #define OTGSC_IDIE __BIT(24)
64 1.1 bsh #define OTGSC_DPIS __BIT(22)
65 1.1 bsh #define OTGSC_1MSS __BIT(21)
66 1.1 bsh #define OTGSC_BSEIS __BIT(20)
67 1.1 bsh #define OTGSC_BSVIS __BIT(19)
68 1.1 bsh #define OTGSC_ASVIS __BIT(18)
69 1.1 bsh #define OTGSC_AVVIS __BIT(17)
70 1.1 bsh #define OTGSC_IDIS __BIT(16)
71 1.1 bsh #define OTGSC_DPS __BIT(14)
72 1.1 bsh #define OTGSC_1MST __BIT(13)
73 1.1 bsh #define OTGSC_BSE __BIT(12)
74 1.1 bsh #define OTGSC_BSV __BIT(11)
75 1.1 bsh #define OTGSC_ASV __BIT(10)
76 1.1 bsh #define OTGSC_AVV __BIT( 9)
77 1.1 bsh #define OTGSC_ID __BIT( 8)
78 1.1 bsh #define OTGSC_IDPU __BIT( 5)
79 1.1 bsh #define OTGSC_DP __BIT( 4)
80 1.1 bsh #define OTGSC_OT __BIT( 3)
81 1.1 bsh #define OTGSC_VC __BIT( 1)
82 1.1 bsh #define OTGSC_VD __BIT( 0)
83 1.3 skrll #define IMXUSB_USBMODE 0x01A8
84 1.2 hkenken #define USBMODE_CM __BITS(1,0)
85 1.2 hkenken #define USBMODE_CM_IDLE __SHIFTIN(0,USBMODE_CM)
86 1.2 hkenken #define USBMODE_CM_DEVICE __SHIFTIN(2,USBMODE_CM)
87 1.2 hkenken #define USBMODE_CM_HOST __SHIFTIN(3,USBMODE_CM)
88 1.1 bsh
89 1.1 bsh #define IMXUSB_EHCI_SIZE 0x200
90 1.1 bsh
91 1.1 bsh
92 1.1 bsh /* extension to PORTSCx register of EHCI. */
93 1.2 hkenken #define PORTSC_PTS __BITS(31,30)
94 1.2 hkenken #define PORTSC_PTS_UTMI __SHIFTIN(0,PORTSC_PTS)
95 1.2 hkenken #define PORTSC_PTS_PHILIPS __SHIFTIN(1,PORTSC_PTS) /* not in i.MX51*/
96 1.2 hkenken #define PORTSC_PTS_ULPI __SHIFTIN(2,PORTSC_PTS)
97 1.2 hkenken #define PORTSC_PTS_SERIAL __SHIFTIN(3,PORTSC_PTS)
98 1.1 bsh
99 1.1 bsh #define PORTSC_STS __BIT(29) /* serial transeiver select */
100 1.1 bsh #define PORTSC_PTW __BIT(28) /* parallel transceiver width */
101 1.1 bsh #define PORTSC_PTW_8 0
102 1.2 hkenken #define PORTSC_PTW_16 PORTSC_PTW
103 1.1 bsh #define PORTSC_PSPD __BITS(26,27) /* port speed (RO) */
104 1.1 bsh #define PORTSC_PFSC __BIT(24) /* port force full speed */
105 1.1 bsh #define PORTSC_PHCD __BIT(23) /* PHY low power suspend */
106 1.1 bsh
107 1.1 bsh #endif /* _ARM_IMX_IMXUSBREG_H */
108