1 1.1 matt /* $Id: imx23_usbphyreg.h,v 1.1 2013/10/07 17:36:40 matt Exp $ */ 2 1.1 matt 3 1.1 matt /* 4 1.1 matt * Copyright (c) 2013 The NetBSD Foundation, Inc. 5 1.1 matt * All rights reserved. 6 1.1 matt * 7 1.1 matt * This code is derived from software contributed to The NetBSD Foundation 8 1.1 matt * by Petri Laakso. 9 1.1 matt * 10 1.1 matt * Redistribution and use in source and binary forms, with or without 11 1.1 matt * modification, are permitted provided that the following conditions 12 1.1 matt * are met: 13 1.1 matt * 1. Redistributions of source code must retain the above copyright 14 1.1 matt * notice, this list of conditions and the following disclaimer. 15 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 matt * notice, this list of conditions and the following disclaimer in the 17 1.1 matt * documentation and/or other materials provided with the distribution. 18 1.1 matt * 19 1.1 matt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.1 matt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.1 matt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.1 matt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.1 matt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.1 matt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.1 matt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.1 matt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.1 matt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.1 matt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.1 matt * POSSIBILITY OF SUCH DAMAGE. 30 1.1 matt */ 31 1.1 matt 32 1.1 matt #ifndef _ARM_IMX_IMX23_USBPHYREG_H_ 33 1.1 matt #define _ARM_IMX_IMX23_USBPHYREG_H_ 34 1.1 matt 35 1.1 matt #include <sys/cdefs.h> 36 1.1 matt 37 1.1 matt #define HW_USBPHY_BASE 0x8007C000 38 1.1 matt #define HW_USBPHY_SIZE 0x2000 /* 8 kB */ 39 1.1 matt 40 1.1 matt /* 41 1.1 matt * USB PHY Power-Down Register. 42 1.1 matt */ 43 1.1 matt #define HW_USBPHY_PWD 0x000 44 1.1 matt #define HW_USBPHY_PWD_SET 0x004 45 1.1 matt #define HW_USBPHY_PWD_CLR 0x008 46 1.1 matt #define HW_USBPHY_PWD_TOG 0x00c 47 1.1 matt 48 1.1 matt #define HW_USBPHY_PWD_RSVD2 __BITS(31, 21) 49 1.1 matt #define HW_USBPHY_PWD_RXPWDRX __BIT(20) 50 1.1 matt #define HW_USBPHY_PWD_RXPWDDIFF __BIT(19) 51 1.1 matt #define HW_USBPHY_PWD_RXPWD1PT1 __BIT(18) 52 1.1 matt #define HW_USBPHY_PWD_RXPWDENV __BIT(17) 53 1.1 matt #define HW_USBPHY_PWD_RSVD1 __BITS(16, 13) 54 1.1 matt #define HW_USBPHY_PWD_TXPWDV2I __BIT(12) 55 1.1 matt #define HW_USBPHY_PWD_TXPWDIBIAS __BIT(11) 56 1.1 matt #define HW_USBPHY_PWD_TXPWDFS __BIT(10) 57 1.1 matt #define HW_USBPHY_PWD_RSVD0 __BITS(9, 0) 58 1.1 matt 59 1.1 matt /* 60 1.1 matt * USB PHY Transmitter Control Register. 61 1.1 matt */ 62 1.1 matt #define HW_USBPHY_TX 0x010 63 1.1 matt #define HW_USBPHY_TX_SET 0x014 64 1.1 matt #define HW_USBPHY_TX_CLR 0x018 65 1.1 matt #define HW_USBPHY_TX_TOG 0x01c 66 1.1 matt 67 1.1 matt #define HW_USBPHY_TX_RSVD5 __BITS(31, 29) 68 1.1 matt #define HW_USBPHY_TX_USBPHY_TX_EDGECTRL __BITS(28, 26) 69 1.1 matt #define HW_USBPHY_TX_USBPHY_TX_SYNC_INVERT __BIT(25) 70 1.1 matt #define HW_USBPHY_TX_USBPHY_TX_SYNC_MUX __BIT(24) 71 1.1 matt #define HW_USBPHY_TX_RSVD4 __BITS(23, 22) 72 1.1 matt #define HW_USBPHY_TX_TXENCAL45DP __BIT(21) 73 1.1 matt #define HW_USBPHY_TX_RSVD3 __BIT(20) 74 1.1 matt #define HW_USBPHY_TX_TXCAL45DP __BITS(19, 16) 75 1.1 matt #define HW_USBPHY_TX_RSVD2 __BITS(15, 14) 76 1.1 matt #define HW_USBPHY_TX_TXENCAL45DN __BIT(13) 77 1.1 matt #define HW_USBPHY_TX_RSVD1 __BIT(12) 78 1.1 matt #define HW_USBPHY_TX_TXCAL45DN __BITS(11, 8) 79 1.1 matt #define HW_USBPHY_TX_RSVD0 __BITS(7, 3) 80 1.1 matt #define HW_USBPHY_TX_D_CAL __BITS(3, 0) 81 1.1 matt 82 1.1 matt /* 83 1.1 matt * USB PHY Receiver Control Register. 84 1.1 matt */ 85 1.1 matt #define HW_USBPHY_RX 0x020 86 1.1 matt #define HW_USBPHY_RX_SET 0x024 87 1.1 matt #define HW_USBPHY_RX_CLR 0x028 88 1.1 matt #define HW_USBPHY_RX_TOG 0x02c 89 1.1 matt 90 1.1 matt #define HW_USBPHY_RX_RSVD2 __BITS(31, 23) 91 1.1 matt #define HW_USBPHY_RX_RXDBYPASS __BIT(22) 92 1.1 matt #define HW_USBPHY_RX_RSVD1 __BITS(21, 7) 93 1.1 matt #define HW_USBPHY_RX_DISCONADJ __BITS(6, 4) 94 1.1 matt #define HW_USBPHY_RX_RSVD0 __BIT(3) 95 1.1 matt #define HW_USBPHY_RX_ENVADJ __BITS(2, 0) 96 1.1 matt 97 1.1 matt /* 98 1.1 matt * USB PHY General Control Register. 99 1.1 matt */ 100 1.1 matt #define HW_USBPHY_CTRL 0x030 101 1.1 matt #define HW_USBPHY_CTRL_SET 0x034 102 1.1 matt #define HW_USBPHY_CTRL_CLR 0x038 103 1.1 matt #define HW_USBPHY_CTRL_TOG 0x03c 104 1.1 matt 105 1.1 matt #define HW_USBPHY_CTRL_SFTRST __BIT(31) 106 1.1 matt #define HW_USBPHY_CTRL_CLKGATE __BIT(30) 107 1.1 matt #define HW_USBPHY_CTRL_UTMI_SUSPENDM __BIT(29) 108 1.1 matt #define HW_USBPHY_CTRL_HOST_FORCE_LS_SE0 __BIT(28) 109 1.1 matt #define HW_USBPHY_CTRL_RSVD3 _ _BITS(27, 14) 110 1.1 matt #define HW_USBPHY_CTRL_DATA_ON_LRADC __BIT(13) 111 1.1 matt #define HW_USBPHY_CTRL_DEVPLUGIN_IRQ __BIT(12) 112 1.1 matt #define HW_USBPHY_CTRL_ENIRQDEVPLUGIN __BIT(11) 113 1.1 matt #define HW_USBPHY_CTRL_RESUME_IRQ __BIT(10) 114 1.1 matt #define HW_USBPHY_CTRL_ENIRQRESUMEDETECT __BIT(9) 115 1.1 matt #define HW_USBPHY_CTRL_RSVD2 __BIT(8) 116 1.1 matt #define HW_USBPHY_CTRL_ENOTGIDDETECT __BIT(7) 117 1.1 matt #define HW_USBPHY_CTRL_RSVD1 __BIT(6) 118 1.1 matt #define HW_USBPHY_CTRL_DEVPLUGIN_POLARITY __BIT(5) 119 1.1 matt #define HW_USBPHY_CTRL_ENDEVPLUGINDETECT __BIT(4) 120 1.1 matt #define HW_USBPHY_CTRL_HOSTDISCONDETECT_IRQ __BIT(3) 121 1.1 matt #define HW_USBPHY_CTRL_ENIRQHOSTDISCON __BIT(2) 122 1.1 matt #define HW_USBPHY_CTRL_ENHOSTDISCONDETECT __BIT(1) 123 1.1 matt #define HW_USBPHY_CTRL_RSVD0 __BIT(0) 124 1.1 matt 125 1.1 matt /* 126 1.1 matt * USB PHY Status Register. 127 1.1 matt */ 128 1.1 matt #define HW_USBPHY_STATUS 0x040 129 1.1 matt 130 1.1 matt #define HW_USBPHY_STATUS_RSVD4 __BITS(31, 11) 131 1.1 matt #define HW_USBPHY_STATUS_RESUME_STATUS __BIT(10) 132 1.1 matt #define HW_USBPHY_STATUS_RSVD3 __BIT(9) 133 1.1 matt #define HW_USBPHY_STATUS_OTGID_STATUS __BIT(8) 134 1.1 matt #define HW_USBPHY_STATUS_RSVD2 __BIT(7) 135 1.1 matt #define HW_USBPHY_STATUS_DEVPLUGIN_STATUS __BIT(6) 136 1.1 matt #define HW_USBPHY_STATUS_RSVD1 __BITS(5, 4) 137 1.1 matt #define HW_USBPHY_STATUS_HOSTDISCONDETECT_STATUS __BIT(3) 138 1.1 matt #define HW_USBPHY_STATUS_RSVD0 __BITS(2, 0) 139 1.1 matt 140 1.1 matt /* 141 1.1 matt * USB PHY Debug Register. 142 1.1 matt */ 143 1.1 matt #define HW_USBPHY_DEBUG 0x050 144 1.1 matt #define HW_USBPHY_DEBUG_SET 0x054 145 1.1 matt #define HW_USBPHY_DEBUG_CLR 0x058 146 1.1 matt #define HW_USBPHY_DEBUG_TOG 0x05c 147 1.1 matt 148 1.1 matt #define HW_USBPHY_DEBUG_RSVD3 __BIT(31) 149 1.1 matt #define HW_USBPHY_DEBUG_CLKGATE __BIT(30) 150 1.1 matt #define HW_USBPHY_DEBUG_HOST_RESUME_DEBUG __BIT(29) 151 1.1 matt #define HW_USBPHY_DEBUG_SQUELCHRESETLENGTH __BITS(28, 25) 152 1.1 matt #define HW_USBPHY_DEBUG_ENSQUELCHRESET __BIT(24) 153 1.1 matt #define HW_USBPHY_DEBUG_RSVD2 __BITS(23, 21) 154 1.1 matt #define HW_USBPHY_DEBUG_SQUELCHRESETCOUNT __BITS(20, 16) 155 1.1 matt #define HW_USBPHY_DEBUG_RSVD1 __BITS(15, 13) 156 1.1 matt #define HW_USBPHY_DEBUG_ENTX2RXCOUNT __BIT(12) 157 1.1 matt #define HW_USBPHY_DEBUG_TX2RXCOUNT __BITS(11, 8) 158 1.1 matt #define HW_USBPHY_DEBUG_RSVD0 __BITS(7, 6) 159 1.1 matt #define HW_USBPHY_DEBUG_ENHSTPULLDOWN __BITS(5, 4) 160 1.1 matt #define HW_USBPHY_DEBUG_HSTPULLDOWN __BITS(3, 2) 161 1.1 matt #define HW_USBPHY_DEBUG_DEBUG_INTERFACE_HOLD __BIT(1) 162 1.1 matt #define HW_USBPHY_DEBUG_OTGIDPIOLOCK __BIT(0) 163 1.1 matt 164 1.1 matt /* 165 1.1 matt * UTMI Debug Status Register 0. 166 1.1 matt */ 167 1.1 matt #define HW_USBPHY_DEBUG0_STATUS 0x060 168 1.1 matt 169 1.1 matt #define HW_USBPHY_DEBUG0_STATUS_SQUELCH_COUNT __BITS(31, 26) 170 1.1 matt #define HW_USBPHY_DEBUG0_STATUS_UTMI_RXERROR_FAIL_COUNT __BITS(25, 16) 171 1.1 matt #define HW_USBPHY_DEBUG0_STATUS_LOOP_BACK_FAIL_COUNT __BITS(15, 0) 172 1.1 matt 173 1.1 matt /* 174 1.1 matt * UTMI Debug Status Register 1. 175 1.1 matt */ 176 1.1 matt #define HW_USBPHY_DEBUG1 0x070 177 1.1 matt #define HW_USBPHY_DEBUG1_SET 0x074 178 1.1 matt #define HW_USBPHY_DEBUG1_CLR 0x078 179 1.1 matt #define HW_USBPHY_DEBUG1_TOG 0x07c 180 1.1 matt 181 1.1 matt #define HW_USBPHY_DEBUG1_RSVD1 __BITS(31, 15) 182 1.1 matt #define HW_USBPHY_DEBUG1_ENTAILADJVD __BITS(14, 13) 183 1.1 matt #define HW_USBPHY_DEBUG1_ENTX2TX __BIT(12) 184 1.1 matt #define HW_USBPHY_DEBUG1_RSVD0 __BITS(11, 4) 185 1.1 matt #define HW_USBPHY_DEBUG1_DBG_ADDRESS __BITS(3, 0) 186 1.1 matt 187 1.1 matt /* 188 1.1 matt * UTMI RTL Version. 189 1.1 matt */ 190 1.1 matt #define HW_USBPHY_VERSION 0x080 191 1.1 matt 192 1.1 matt #define HW_USBPHY_VERSION_MAJOR __BITS(31, 24) 193 1.1 matt #define HW_USBPHY_VERSION_MINOR __BITS(23, 16) 194 1.1 matt #define HW_USBPHY_VERSION_STEP __BITS(15, 0) 195 1.1 matt 196 1.1 matt /* 197 1.1 matt * USB PHY IP Block Register. 198 1.1 matt */ 199 1.1 matt #define HW_USBPHY_IP 0x090 200 1.1 matt #define HW_USBPHY_IP_SET 0x094 201 1.1 matt #define HW_USBPHY_IP_CLR 0x098 202 1.1 matt #define HW_USBPHY_IP_TOG 0x09c 203 1.1 matt 204 1.1 matt #define HW_USBPHY_IP_RSVD1 __BITS(31, 25) 205 1.1 matt #define HW_USBPHY_IP_DIV_SEL __BITS(24, 23) 206 1.1 matt #define HW_USBPHY_IP_LFR_SEL __BITS(22, 21) 207 1.1 matt #define HW_USBPHY_IP_CP_SEL __BITS(20, 19) 208 1.1 matt #define HW_USBPHY_IP_TSTI_TX_DP __BIT(18) 209 1.1 matt #define HW_USBPHY_IP_TSTI_TX_DM __BIT(17) 210 1.1 matt #define HW_USBPHY_IP_ANALOG_TESTMODE __BIT(16) 211 1.1 matt #define HW_USBPHY_IP_RSVD0 __BITS(15, 3) 212 1.1 matt #define HW_USBPHY_IP_EN_USB_CLKS __BIT(2) 213 1.1 matt #define HW_USBPHY_IP_PLL_LOCKED __BIT(1) 214 1.1 matt #define HW_USBPHY_IP_PLL_POWER __BIT(0) 215 1.1 matt 216 1.1 matt #endif /* !_ARM_IMX_IMX23_USBPHYREG_H_ */ 217