197d348ccSPhilippe Mathieu-Daudé /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) */ 23f5b312aSPaul Zimmerman /* 33f5b312aSPaul Zimmerman * Imported from the Linux kernel file drivers/usb/dwc2/hw.h, commit 43f5b312aSPaul Zimmerman * a89bae709b3492b478480a2c9734e7e9393b279c ("usb: dwc2: Move 53f5b312aSPaul Zimmerman * UTMI_PHY_DATA defines closer") 63f5b312aSPaul Zimmerman * 73f5b312aSPaul Zimmerman * hw.h - DesignWare HS OTG Controller hardware definitions 83f5b312aSPaul Zimmerman * 93f5b312aSPaul Zimmerman * Copyright 2004-2013 Synopsys, Inc. 103f5b312aSPaul Zimmerman * 113f5b312aSPaul Zimmerman * Redistribution and use in source and binary forms, with or without 123f5b312aSPaul Zimmerman * modification, are permitted provided that the following conditions 133f5b312aSPaul Zimmerman * are met: 143f5b312aSPaul Zimmerman * 1. Redistributions of source code must retain the above copyright 153f5b312aSPaul Zimmerman * notice, this list of conditions, and the following disclaimer, 163f5b312aSPaul Zimmerman * without modification. 173f5b312aSPaul Zimmerman * 2. Redistributions in binary form must reproduce the above copyright 183f5b312aSPaul Zimmerman * notice, this list of conditions and the following disclaimer in the 193f5b312aSPaul Zimmerman * documentation and/or other materials provided with the distribution. 203f5b312aSPaul Zimmerman * 3. The names of the above-listed copyright holders may not be used 213f5b312aSPaul Zimmerman * to endorse or promote products derived from this software without 223f5b312aSPaul Zimmerman * specific prior written permission. 233f5b312aSPaul Zimmerman * 243f5b312aSPaul Zimmerman * ALTERNATIVELY, this software may be distributed under the terms of the 253f5b312aSPaul Zimmerman * GNU General Public License ("GPL") as published by the Free Software 263f5b312aSPaul Zimmerman * Foundation; either version 2 of the License, or (at your option) any 273f5b312aSPaul Zimmerman * later version. 283f5b312aSPaul Zimmerman * 293f5b312aSPaul Zimmerman * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 303f5b312aSPaul Zimmerman * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 313f5b312aSPaul Zimmerman * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 323f5b312aSPaul Zimmerman * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 333f5b312aSPaul Zimmerman * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 343f5b312aSPaul Zimmerman * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 353f5b312aSPaul Zimmerman * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 363f5b312aSPaul Zimmerman * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 373f5b312aSPaul Zimmerman * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 383f5b312aSPaul Zimmerman * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 393f5b312aSPaul Zimmerman * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 403f5b312aSPaul Zimmerman */ 413f5b312aSPaul Zimmerman 4252581c71SMarkus Armbruster #ifndef DWC2_REGS_H 4352581c71SMarkus Armbruster #define DWC2_REGS_H 443f5b312aSPaul Zimmerman 453f5b312aSPaul Zimmerman #define HSOTG_REG(x) (x) 463f5b312aSPaul Zimmerman 473f5b312aSPaul Zimmerman #define GOTGCTL HSOTG_REG(0x000) 483f5b312aSPaul Zimmerman #define GOTGCTL_CHIRPEN BIT(27) 493f5b312aSPaul Zimmerman #define GOTGCTL_MULT_VALID_BC_MASK (0x1f << 22) 503f5b312aSPaul Zimmerman #define GOTGCTL_MULT_VALID_BC_SHIFT 22 513f5b312aSPaul Zimmerman #define GOTGCTL_OTGVER BIT(20) 523f5b312aSPaul Zimmerman #define GOTGCTL_BSESVLD BIT(19) 533f5b312aSPaul Zimmerman #define GOTGCTL_ASESVLD BIT(18) 543f5b312aSPaul Zimmerman #define GOTGCTL_DBNC_SHORT BIT(17) 553f5b312aSPaul Zimmerman #define GOTGCTL_CONID_B BIT(16) 563f5b312aSPaul Zimmerman #define GOTGCTL_DBNCE_FLTR_BYPASS BIT(15) 573f5b312aSPaul Zimmerman #define GOTGCTL_DEVHNPEN BIT(11) 583f5b312aSPaul Zimmerman #define GOTGCTL_HSTSETHNPEN BIT(10) 593f5b312aSPaul Zimmerman #define GOTGCTL_HNPREQ BIT(9) 603f5b312aSPaul Zimmerman #define GOTGCTL_HSTNEGSCS BIT(8) 613f5b312aSPaul Zimmerman #define GOTGCTL_SESREQ BIT(1) 623f5b312aSPaul Zimmerman #define GOTGCTL_SESREQSCS BIT(0) 633f5b312aSPaul Zimmerman 643f5b312aSPaul Zimmerman #define GOTGINT HSOTG_REG(0x004) 653f5b312aSPaul Zimmerman #define GOTGINT_DBNCE_DONE BIT(19) 663f5b312aSPaul Zimmerman #define GOTGINT_A_DEV_TOUT_CHG BIT(18) 673f5b312aSPaul Zimmerman #define GOTGINT_HST_NEG_DET BIT(17) 683f5b312aSPaul Zimmerman #define GOTGINT_HST_NEG_SUC_STS_CHNG BIT(9) 693f5b312aSPaul Zimmerman #define GOTGINT_SES_REQ_SUC_STS_CHNG BIT(8) 703f5b312aSPaul Zimmerman #define GOTGINT_SES_END_DET BIT(2) 713f5b312aSPaul Zimmerman 723f5b312aSPaul Zimmerman #define GAHBCFG HSOTG_REG(0x008) 733f5b312aSPaul Zimmerman #define GAHBCFG_AHB_SINGLE BIT(23) 743f5b312aSPaul Zimmerman #define GAHBCFG_NOTI_ALL_DMA_WRIT BIT(22) 753f5b312aSPaul Zimmerman #define GAHBCFG_REM_MEM_SUPP BIT(21) 763f5b312aSPaul Zimmerman #define GAHBCFG_P_TXF_EMP_LVL BIT(8) 773f5b312aSPaul Zimmerman #define GAHBCFG_NP_TXF_EMP_LVL BIT(7) 783f5b312aSPaul Zimmerman #define GAHBCFG_DMA_EN BIT(5) 793f5b312aSPaul Zimmerman #define GAHBCFG_HBSTLEN_MASK (0xf << 1) 803f5b312aSPaul Zimmerman #define GAHBCFG_HBSTLEN_SHIFT 1 813f5b312aSPaul Zimmerman #define GAHBCFG_HBSTLEN_SINGLE 0 823f5b312aSPaul Zimmerman #define GAHBCFG_HBSTLEN_INCR 1 833f5b312aSPaul Zimmerman #define GAHBCFG_HBSTLEN_INCR4 3 843f5b312aSPaul Zimmerman #define GAHBCFG_HBSTLEN_INCR8 5 853f5b312aSPaul Zimmerman #define GAHBCFG_HBSTLEN_INCR16 7 863f5b312aSPaul Zimmerman #define GAHBCFG_GLBL_INTR_EN BIT(0) 873f5b312aSPaul Zimmerman #define GAHBCFG_CTRL_MASK (GAHBCFG_P_TXF_EMP_LVL | \ 883f5b312aSPaul Zimmerman GAHBCFG_NP_TXF_EMP_LVL | \ 893f5b312aSPaul Zimmerman GAHBCFG_DMA_EN | \ 903f5b312aSPaul Zimmerman GAHBCFG_GLBL_INTR_EN) 913f5b312aSPaul Zimmerman 923f5b312aSPaul Zimmerman #define GUSBCFG HSOTG_REG(0x00C) 933f5b312aSPaul Zimmerman #define GUSBCFG_FORCEDEVMODE BIT(30) 943f5b312aSPaul Zimmerman #define GUSBCFG_FORCEHOSTMODE BIT(29) 953f5b312aSPaul Zimmerman #define GUSBCFG_TXENDDELAY BIT(28) 963f5b312aSPaul Zimmerman #define GUSBCFG_ICTRAFFICPULLREMOVE BIT(27) 973f5b312aSPaul Zimmerman #define GUSBCFG_ICUSBCAP BIT(26) 983f5b312aSPaul Zimmerman #define GUSBCFG_ULPI_INT_PROT_DIS BIT(25) 993f5b312aSPaul Zimmerman #define GUSBCFG_INDICATORPASSTHROUGH BIT(24) 1003f5b312aSPaul Zimmerman #define GUSBCFG_INDICATORCOMPLEMENT BIT(23) 1013f5b312aSPaul Zimmerman #define GUSBCFG_TERMSELDLPULSE BIT(22) 1023f5b312aSPaul Zimmerman #define GUSBCFG_ULPI_INT_VBUS_IND BIT(21) 1033f5b312aSPaul Zimmerman #define GUSBCFG_ULPI_EXT_VBUS_DRV BIT(20) 1043f5b312aSPaul Zimmerman #define GUSBCFG_ULPI_CLK_SUSP_M BIT(19) 1053f5b312aSPaul Zimmerman #define GUSBCFG_ULPI_AUTO_RES BIT(18) 1063f5b312aSPaul Zimmerman #define GUSBCFG_ULPI_FS_LS BIT(17) 1073f5b312aSPaul Zimmerman #define GUSBCFG_OTG_UTMI_FS_SEL BIT(16) 1083f5b312aSPaul Zimmerman #define GUSBCFG_PHY_LP_CLK_SEL BIT(15) 1093f5b312aSPaul Zimmerman #define GUSBCFG_USBTRDTIM_MASK (0xf << 10) 1103f5b312aSPaul Zimmerman #define GUSBCFG_USBTRDTIM_SHIFT 10 1113f5b312aSPaul Zimmerman #define GUSBCFG_HNPCAP BIT(9) 1123f5b312aSPaul Zimmerman #define GUSBCFG_SRPCAP BIT(8) 1133f5b312aSPaul Zimmerman #define GUSBCFG_DDRSEL BIT(7) 1143f5b312aSPaul Zimmerman #define GUSBCFG_PHYSEL BIT(6) 1153f5b312aSPaul Zimmerman #define GUSBCFG_FSINTF BIT(5) 1163f5b312aSPaul Zimmerman #define GUSBCFG_ULPI_UTMI_SEL BIT(4) 1173f5b312aSPaul Zimmerman #define GUSBCFG_PHYIF16 BIT(3) 1183f5b312aSPaul Zimmerman #define GUSBCFG_PHYIF8 (0 << 3) 1193f5b312aSPaul Zimmerman #define GUSBCFG_TOUTCAL_MASK (0x7 << 0) 1203f5b312aSPaul Zimmerman #define GUSBCFG_TOUTCAL_SHIFT 0 1213f5b312aSPaul Zimmerman #define GUSBCFG_TOUTCAL_LIMIT 0x7 1223f5b312aSPaul Zimmerman #define GUSBCFG_TOUTCAL(_x) ((_x) << 0) 1233f5b312aSPaul Zimmerman 1243f5b312aSPaul Zimmerman #define GRSTCTL HSOTG_REG(0x010) 1253f5b312aSPaul Zimmerman #define GRSTCTL_AHBIDLE BIT(31) 1263f5b312aSPaul Zimmerman #define GRSTCTL_DMAREQ BIT(30) 1273f5b312aSPaul Zimmerman #define GRSTCTL_TXFNUM_MASK (0x1f << 6) 1283f5b312aSPaul Zimmerman #define GRSTCTL_TXFNUM_SHIFT 6 1293f5b312aSPaul Zimmerman #define GRSTCTL_TXFNUM_LIMIT 0x1f 1303f5b312aSPaul Zimmerman #define GRSTCTL_TXFNUM(_x) ((_x) << 6) 1313f5b312aSPaul Zimmerman #define GRSTCTL_TXFFLSH BIT(5) 1323f5b312aSPaul Zimmerman #define GRSTCTL_RXFFLSH BIT(4) 1333f5b312aSPaul Zimmerman #define GRSTCTL_IN_TKNQ_FLSH BIT(3) 1343f5b312aSPaul Zimmerman #define GRSTCTL_FRMCNTRRST BIT(2) 1353f5b312aSPaul Zimmerman #define GRSTCTL_HSFTRST BIT(1) 1363f5b312aSPaul Zimmerman #define GRSTCTL_CSFTRST BIT(0) 1373f5b312aSPaul Zimmerman 1383f5b312aSPaul Zimmerman #define GINTSTS HSOTG_REG(0x014) 1393f5b312aSPaul Zimmerman #define GINTMSK HSOTG_REG(0x018) 1403f5b312aSPaul Zimmerman #define GINTSTS_WKUPINT BIT(31) 1413f5b312aSPaul Zimmerman #define GINTSTS_SESSREQINT BIT(30) 1423f5b312aSPaul Zimmerman #define GINTSTS_DISCONNINT BIT(29) 1433f5b312aSPaul Zimmerman #define GINTSTS_CONIDSTSCHNG BIT(28) 1443f5b312aSPaul Zimmerman #define GINTSTS_LPMTRANRCVD BIT(27) 1453f5b312aSPaul Zimmerman #define GINTSTS_PTXFEMP BIT(26) 1463f5b312aSPaul Zimmerman #define GINTSTS_HCHINT BIT(25) 1473f5b312aSPaul Zimmerman #define GINTSTS_PRTINT BIT(24) 1483f5b312aSPaul Zimmerman #define GINTSTS_RESETDET BIT(23) 1493f5b312aSPaul Zimmerman #define GINTSTS_FET_SUSP BIT(22) 1503f5b312aSPaul Zimmerman #define GINTSTS_INCOMPL_IP BIT(21) 1513f5b312aSPaul Zimmerman #define GINTSTS_INCOMPL_SOOUT BIT(21) 1523f5b312aSPaul Zimmerman #define GINTSTS_INCOMPL_SOIN BIT(20) 1533f5b312aSPaul Zimmerman #define GINTSTS_OEPINT BIT(19) 1543f5b312aSPaul Zimmerman #define GINTSTS_IEPINT BIT(18) 1553f5b312aSPaul Zimmerman #define GINTSTS_EPMIS BIT(17) 1563f5b312aSPaul Zimmerman #define GINTSTS_RESTOREDONE BIT(16) 1573f5b312aSPaul Zimmerman #define GINTSTS_EOPF BIT(15) 1583f5b312aSPaul Zimmerman #define GINTSTS_ISOUTDROP BIT(14) 1593f5b312aSPaul Zimmerman #define GINTSTS_ENUMDONE BIT(13) 1603f5b312aSPaul Zimmerman #define GINTSTS_USBRST BIT(12) 1613f5b312aSPaul Zimmerman #define GINTSTS_USBSUSP BIT(11) 1623f5b312aSPaul Zimmerman #define GINTSTS_ERLYSUSP BIT(10) 1633f5b312aSPaul Zimmerman #define GINTSTS_I2CINT BIT(9) 1643f5b312aSPaul Zimmerman #define GINTSTS_ULPI_CK_INT BIT(8) 1653f5b312aSPaul Zimmerman #define GINTSTS_GOUTNAKEFF BIT(7) 1663f5b312aSPaul Zimmerman #define GINTSTS_GINNAKEFF BIT(6) 1673f5b312aSPaul Zimmerman #define GINTSTS_NPTXFEMP BIT(5) 1683f5b312aSPaul Zimmerman #define GINTSTS_RXFLVL BIT(4) 1693f5b312aSPaul Zimmerman #define GINTSTS_SOF BIT(3) 1703f5b312aSPaul Zimmerman #define GINTSTS_OTGINT BIT(2) 1713f5b312aSPaul Zimmerman #define GINTSTS_MODEMIS BIT(1) 1723f5b312aSPaul Zimmerman #define GINTSTS_CURMODE_HOST BIT(0) 1733f5b312aSPaul Zimmerman 1743f5b312aSPaul Zimmerman #define GRXSTSR HSOTG_REG(0x01C) 1753f5b312aSPaul Zimmerman #define GRXSTSP HSOTG_REG(0x020) 1763f5b312aSPaul Zimmerman #define GRXSTS_FN_MASK (0x7f << 25) 1773f5b312aSPaul Zimmerman #define GRXSTS_FN_SHIFT 25 1783f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_MASK (0xf << 17) 1793f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_SHIFT 17 1803f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_GLOBALOUTNAK 1 1813f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_OUTRX 2 1823f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_HCHIN 2 1833f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_OUTDONE 3 1843f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_HCHIN_XFER_COMP 3 1853f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_SETUPDONE 4 1863f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_DATATOGGLEERR 5 1873f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_SETUPRX 6 1883f5b312aSPaul Zimmerman #define GRXSTS_PKTSTS_HCHHALTED 7 1893f5b312aSPaul Zimmerman #define GRXSTS_HCHNUM_MASK (0xf << 0) 1903f5b312aSPaul Zimmerman #define GRXSTS_HCHNUM_SHIFT 0 1913f5b312aSPaul Zimmerman #define GRXSTS_DPID_MASK (0x3 << 15) 1923f5b312aSPaul Zimmerman #define GRXSTS_DPID_SHIFT 15 1933f5b312aSPaul Zimmerman #define GRXSTS_BYTECNT_MASK (0x7ff << 4) 1943f5b312aSPaul Zimmerman #define GRXSTS_BYTECNT_SHIFT 4 1953f5b312aSPaul Zimmerman #define GRXSTS_EPNUM_MASK (0xf << 0) 1963f5b312aSPaul Zimmerman #define GRXSTS_EPNUM_SHIFT 0 1973f5b312aSPaul Zimmerman 1983f5b312aSPaul Zimmerman #define GRXFSIZ HSOTG_REG(0x024) 1993f5b312aSPaul Zimmerman #define GRXFSIZ_DEPTH_MASK (0xffff << 0) 2003f5b312aSPaul Zimmerman #define GRXFSIZ_DEPTH_SHIFT 0 2013f5b312aSPaul Zimmerman 2023f5b312aSPaul Zimmerman #define GNPTXFSIZ HSOTG_REG(0x028) 2033f5b312aSPaul Zimmerman /* Use FIFOSIZE_* constants to access this register */ 2043f5b312aSPaul Zimmerman 2053f5b312aSPaul Zimmerman #define GNPTXSTS HSOTG_REG(0x02C) 2063f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXQ_TOP_MASK (0x7f << 24) 2073f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXQ_TOP_SHIFT 24 2083f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXQ_SPC_AVAIL_MASK (0xff << 16) 2093f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXQ_SPC_AVAIL_SHIFT 16 2103f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXQ_SPC_AVAIL_GET(_v) (((_v) >> 16) & 0xff) 2113f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXF_SPC_AVAIL_MASK (0xffff << 0) 2123f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXF_SPC_AVAIL_SHIFT 0 2133f5b312aSPaul Zimmerman #define GNPTXSTS_NP_TXF_SPC_AVAIL_GET(_v) (((_v) >> 0) & 0xffff) 2143f5b312aSPaul Zimmerman 2153f5b312aSPaul Zimmerman #define GI2CCTL HSOTG_REG(0x0030) 2163f5b312aSPaul Zimmerman #define GI2CCTL_BSYDNE BIT(31) 2173f5b312aSPaul Zimmerman #define GI2CCTL_RW BIT(30) 2183f5b312aSPaul Zimmerman #define GI2CCTL_I2CDATSE0 BIT(28) 2193f5b312aSPaul Zimmerman #define GI2CCTL_I2CDEVADDR_MASK (0x3 << 26) 2203f5b312aSPaul Zimmerman #define GI2CCTL_I2CDEVADDR_SHIFT 26 2213f5b312aSPaul Zimmerman #define GI2CCTL_I2CSUSPCTL BIT(25) 2223f5b312aSPaul Zimmerman #define GI2CCTL_ACK BIT(24) 2233f5b312aSPaul Zimmerman #define GI2CCTL_I2CEN BIT(23) 2243f5b312aSPaul Zimmerman #define GI2CCTL_ADDR_MASK (0x7f << 16) 2253f5b312aSPaul Zimmerman #define GI2CCTL_ADDR_SHIFT 16 2263f5b312aSPaul Zimmerman #define GI2CCTL_REGADDR_MASK (0xff << 8) 2273f5b312aSPaul Zimmerman #define GI2CCTL_REGADDR_SHIFT 8 2283f5b312aSPaul Zimmerman #define GI2CCTL_RWDATA_MASK (0xff << 0) 2293f5b312aSPaul Zimmerman #define GI2CCTL_RWDATA_SHIFT 0 2303f5b312aSPaul Zimmerman 2313f5b312aSPaul Zimmerman #define GPVNDCTL HSOTG_REG(0x0034) 2323f5b312aSPaul Zimmerman #define GGPIO HSOTG_REG(0x0038) 2333f5b312aSPaul Zimmerman #define GGPIO_STM32_OTG_GCCFG_PWRDWN BIT(16) 2343f5b312aSPaul Zimmerman 2353f5b312aSPaul Zimmerman #define GUID HSOTG_REG(0x003c) 2363f5b312aSPaul Zimmerman #define GSNPSID HSOTG_REG(0x0040) 2373f5b312aSPaul Zimmerman #define GHWCFG1 HSOTG_REG(0x0044) 2383f5b312aSPaul Zimmerman #define GSNPSID_ID_MASK GENMASK(31, 16) 2393f5b312aSPaul Zimmerman 2403f5b312aSPaul Zimmerman #define GHWCFG2 HSOTG_REG(0x0048) 2413f5b312aSPaul Zimmerman #define GHWCFG2_OTG_ENABLE_IC_USB BIT(31) 2423f5b312aSPaul Zimmerman #define GHWCFG2_DEV_TOKEN_Q_DEPTH_MASK (0x1f << 26) 2433f5b312aSPaul Zimmerman #define GHWCFG2_DEV_TOKEN_Q_DEPTH_SHIFT 26 2443f5b312aSPaul Zimmerman #define GHWCFG2_HOST_PERIO_TX_Q_DEPTH_MASK (0x3 << 24) 2453f5b312aSPaul Zimmerman #define GHWCFG2_HOST_PERIO_TX_Q_DEPTH_SHIFT 24 2463f5b312aSPaul Zimmerman #define GHWCFG2_NONPERIO_TX_Q_DEPTH_MASK (0x3 << 22) 2473f5b312aSPaul Zimmerman #define GHWCFG2_NONPERIO_TX_Q_DEPTH_SHIFT 22 2483f5b312aSPaul Zimmerman #define GHWCFG2_MULTI_PROC_INT BIT(20) 2493f5b312aSPaul Zimmerman #define GHWCFG2_DYNAMIC_FIFO BIT(19) 2503f5b312aSPaul Zimmerman #define GHWCFG2_PERIO_EP_SUPPORTED BIT(18) 2513f5b312aSPaul Zimmerman #define GHWCFG2_NUM_HOST_CHAN_MASK (0xf << 14) 2523f5b312aSPaul Zimmerman #define GHWCFG2_NUM_HOST_CHAN_SHIFT 14 2533f5b312aSPaul Zimmerman #define GHWCFG2_NUM_DEV_EP_MASK (0xf << 10) 2543f5b312aSPaul Zimmerman #define GHWCFG2_NUM_DEV_EP_SHIFT 10 2553f5b312aSPaul Zimmerman #define GHWCFG2_FS_PHY_TYPE_MASK (0x3 << 8) 2563f5b312aSPaul Zimmerman #define GHWCFG2_FS_PHY_TYPE_SHIFT 8 2573f5b312aSPaul Zimmerman #define GHWCFG2_FS_PHY_TYPE_NOT_SUPPORTED 0 2583f5b312aSPaul Zimmerman #define GHWCFG2_FS_PHY_TYPE_DEDICATED 1 2593f5b312aSPaul Zimmerman #define GHWCFG2_FS_PHY_TYPE_SHARED_UTMI 2 2603f5b312aSPaul Zimmerman #define GHWCFG2_FS_PHY_TYPE_SHARED_ULPI 3 2613f5b312aSPaul Zimmerman #define GHWCFG2_HS_PHY_TYPE_MASK (0x3 << 6) 2623f5b312aSPaul Zimmerman #define GHWCFG2_HS_PHY_TYPE_SHIFT 6 2633f5b312aSPaul Zimmerman #define GHWCFG2_HS_PHY_TYPE_NOT_SUPPORTED 0 2643f5b312aSPaul Zimmerman #define GHWCFG2_HS_PHY_TYPE_UTMI 1 2653f5b312aSPaul Zimmerman #define GHWCFG2_HS_PHY_TYPE_ULPI 2 2663f5b312aSPaul Zimmerman #define GHWCFG2_HS_PHY_TYPE_UTMI_ULPI 3 2673f5b312aSPaul Zimmerman #define GHWCFG2_POINT2POINT BIT(5) 2683f5b312aSPaul Zimmerman #define GHWCFG2_ARCHITECTURE_MASK (0x3 << 3) 2693f5b312aSPaul Zimmerman #define GHWCFG2_ARCHITECTURE_SHIFT 3 2703f5b312aSPaul Zimmerman #define GHWCFG2_SLAVE_ONLY_ARCH 0 2713f5b312aSPaul Zimmerman #define GHWCFG2_EXT_DMA_ARCH 1 2723f5b312aSPaul Zimmerman #define GHWCFG2_INT_DMA_ARCH 2 2733f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_MASK (0x7 << 0) 2743f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_SHIFT 0 2753f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_HNP_SRP_CAPABLE 0 2763f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_SRP_ONLY_CAPABLE 1 2773f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_NO_HNP_SRP_CAPABLE 2 2783f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_SRP_CAPABLE_DEVICE 3 2793f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_NO_SRP_CAPABLE_DEVICE 4 2803f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_SRP_CAPABLE_HOST 5 2813f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_NO_SRP_CAPABLE_HOST 6 2823f5b312aSPaul Zimmerman #define GHWCFG2_OP_MODE_UNDEFINED 7 2833f5b312aSPaul Zimmerman 2843f5b312aSPaul Zimmerman #define GHWCFG3 HSOTG_REG(0x004c) 2853f5b312aSPaul Zimmerman #define GHWCFG3_DFIFO_DEPTH_MASK (0xffff << 16) 2863f5b312aSPaul Zimmerman #define GHWCFG3_DFIFO_DEPTH_SHIFT 16 2873f5b312aSPaul Zimmerman #define GHWCFG3_OTG_LPM_EN BIT(15) 2883f5b312aSPaul Zimmerman #define GHWCFG3_BC_SUPPORT BIT(14) 2893f5b312aSPaul Zimmerman #define GHWCFG3_OTG_ENABLE_HSIC BIT(13) 2903f5b312aSPaul Zimmerman #define GHWCFG3_ADP_SUPP BIT(12) 2913f5b312aSPaul Zimmerman #define GHWCFG3_SYNCH_RESET_TYPE BIT(11) 2923f5b312aSPaul Zimmerman #define GHWCFG3_OPTIONAL_FEATURES BIT(10) 2933f5b312aSPaul Zimmerman #define GHWCFG3_VENDOR_CTRL_IF BIT(9) 2943f5b312aSPaul Zimmerman #define GHWCFG3_I2C BIT(8) 2953f5b312aSPaul Zimmerman #define GHWCFG3_OTG_FUNC BIT(7) 2963f5b312aSPaul Zimmerman #define GHWCFG3_PACKET_SIZE_CNTR_WIDTH_MASK (0x7 << 4) 2973f5b312aSPaul Zimmerman #define GHWCFG3_PACKET_SIZE_CNTR_WIDTH_SHIFT 4 2983f5b312aSPaul Zimmerman #define GHWCFG3_XFER_SIZE_CNTR_WIDTH_MASK (0xf << 0) 2993f5b312aSPaul Zimmerman #define GHWCFG3_XFER_SIZE_CNTR_WIDTH_SHIFT 0 3003f5b312aSPaul Zimmerman 3013f5b312aSPaul Zimmerman #define GHWCFG4 HSOTG_REG(0x0050) 3023f5b312aSPaul Zimmerman #define GHWCFG4_DESC_DMA_DYN BIT(31) 3033f5b312aSPaul Zimmerman #define GHWCFG4_DESC_DMA BIT(30) 3043f5b312aSPaul Zimmerman #define GHWCFG4_NUM_IN_EPS_MASK (0xf << 26) 3053f5b312aSPaul Zimmerman #define GHWCFG4_NUM_IN_EPS_SHIFT 26 3063f5b312aSPaul Zimmerman #define GHWCFG4_DED_FIFO_EN BIT(25) 3073f5b312aSPaul Zimmerman #define GHWCFG4_DED_FIFO_SHIFT 25 3083f5b312aSPaul Zimmerman #define GHWCFG4_SESSION_END_FILT_EN BIT(24) 3093f5b312aSPaul Zimmerman #define GHWCFG4_B_VALID_FILT_EN BIT(23) 3103f5b312aSPaul Zimmerman #define GHWCFG4_A_VALID_FILT_EN BIT(22) 3113f5b312aSPaul Zimmerman #define GHWCFG4_VBUS_VALID_FILT_EN BIT(21) 3123f5b312aSPaul Zimmerman #define GHWCFG4_IDDIG_FILT_EN BIT(20) 3133f5b312aSPaul Zimmerman #define GHWCFG4_NUM_DEV_MODE_CTRL_EP_MASK (0xf << 16) 3143f5b312aSPaul Zimmerman #define GHWCFG4_NUM_DEV_MODE_CTRL_EP_SHIFT 16 3153f5b312aSPaul Zimmerman #define GHWCFG4_UTMI_PHY_DATA_WIDTH_MASK (0x3 << 14) 3163f5b312aSPaul Zimmerman #define GHWCFG4_UTMI_PHY_DATA_WIDTH_SHIFT 14 3173f5b312aSPaul Zimmerman #define GHWCFG4_UTMI_PHY_DATA_WIDTH_8 0 3183f5b312aSPaul Zimmerman #define GHWCFG4_UTMI_PHY_DATA_WIDTH_16 1 3193f5b312aSPaul Zimmerman #define GHWCFG4_UTMI_PHY_DATA_WIDTH_8_OR_16 2 3203f5b312aSPaul Zimmerman #define GHWCFG4_ACG_SUPPORTED BIT(12) 3213f5b312aSPaul Zimmerman #define GHWCFG4_IPG_ISOC_SUPPORTED BIT(11) 3223f5b312aSPaul Zimmerman #define GHWCFG4_SERVICE_INTERVAL_SUPPORTED BIT(10) 3233f5b312aSPaul Zimmerman #define GHWCFG4_XHIBER BIT(7) 3243f5b312aSPaul Zimmerman #define GHWCFG4_HIBER BIT(6) 3253f5b312aSPaul Zimmerman #define GHWCFG4_MIN_AHB_FREQ BIT(5) 3263f5b312aSPaul Zimmerman #define GHWCFG4_POWER_OPTIMIZ BIT(4) 3273f5b312aSPaul Zimmerman #define GHWCFG4_NUM_DEV_PERIO_IN_EP_MASK (0xf << 0) 3283f5b312aSPaul Zimmerman #define GHWCFG4_NUM_DEV_PERIO_IN_EP_SHIFT 0 3293f5b312aSPaul Zimmerman 3303f5b312aSPaul Zimmerman #define GLPMCFG HSOTG_REG(0x0054) 3313f5b312aSPaul Zimmerman #define GLPMCFG_INVSELHSIC BIT(31) 3323f5b312aSPaul Zimmerman #define GLPMCFG_HSICCON BIT(30) 3333f5b312aSPaul Zimmerman #define GLPMCFG_RSTRSLPSTS BIT(29) 3343f5b312aSPaul Zimmerman #define GLPMCFG_ENBESL BIT(28) 3353f5b312aSPaul Zimmerman #define GLPMCFG_LPM_RETRYCNT_STS_MASK (0x7 << 25) 3363f5b312aSPaul Zimmerman #define GLPMCFG_LPM_RETRYCNT_STS_SHIFT 25 3373f5b312aSPaul Zimmerman #define GLPMCFG_SNDLPM BIT(24) 3383f5b312aSPaul Zimmerman #define GLPMCFG_RETRY_CNT_MASK (0x7 << 21) 3393f5b312aSPaul Zimmerman #define GLPMCFG_RETRY_CNT_SHIFT 21 3403f5b312aSPaul Zimmerman #define GLPMCFG_LPM_REJECT_CTRL_CONTROL BIT(21) 3413f5b312aSPaul Zimmerman #define GLPMCFG_LPM_ACCEPT_CTRL_ISOC BIT(22) 3423f5b312aSPaul Zimmerman #define GLPMCFG_LPM_CHNL_INDX_MASK (0xf << 17) 3433f5b312aSPaul Zimmerman #define GLPMCFG_LPM_CHNL_INDX_SHIFT 17 3443f5b312aSPaul Zimmerman #define GLPMCFG_L1RESUMEOK BIT(16) 3453f5b312aSPaul Zimmerman #define GLPMCFG_SLPSTS BIT(15) 3463f5b312aSPaul Zimmerman #define GLPMCFG_COREL1RES_MASK (0x3 << 13) 3473f5b312aSPaul Zimmerman #define GLPMCFG_COREL1RES_SHIFT 13 3483f5b312aSPaul Zimmerman #define GLPMCFG_HIRD_THRES_MASK (0x1f << 8) 3493f5b312aSPaul Zimmerman #define GLPMCFG_HIRD_THRES_SHIFT 8 3503f5b312aSPaul Zimmerman #define GLPMCFG_HIRD_THRES_EN (0x10 << 8) 3513f5b312aSPaul Zimmerman #define GLPMCFG_ENBLSLPM BIT(7) 3523f5b312aSPaul Zimmerman #define GLPMCFG_BREMOTEWAKE BIT(6) 3533f5b312aSPaul Zimmerman #define GLPMCFG_HIRD_MASK (0xf << 2) 3543f5b312aSPaul Zimmerman #define GLPMCFG_HIRD_SHIFT 2 3553f5b312aSPaul Zimmerman #define GLPMCFG_APPL1RES BIT(1) 3563f5b312aSPaul Zimmerman #define GLPMCFG_LPMCAP BIT(0) 3573f5b312aSPaul Zimmerman 3583f5b312aSPaul Zimmerman #define GPWRDN HSOTG_REG(0x0058) 3593f5b312aSPaul Zimmerman #define GPWRDN_MULT_VAL_ID_BC_MASK (0x1f << 24) 3603f5b312aSPaul Zimmerman #define GPWRDN_MULT_VAL_ID_BC_SHIFT 24 3613f5b312aSPaul Zimmerman #define GPWRDN_ADP_INT BIT(23) 3623f5b312aSPaul Zimmerman #define GPWRDN_BSESSVLD BIT(22) 3633f5b312aSPaul Zimmerman #define GPWRDN_IDSTS BIT(21) 3643f5b312aSPaul Zimmerman #define GPWRDN_LINESTATE_MASK (0x3 << 19) 3653f5b312aSPaul Zimmerman #define GPWRDN_LINESTATE_SHIFT 19 3663f5b312aSPaul Zimmerman #define GPWRDN_STS_CHGINT_MSK BIT(18) 3673f5b312aSPaul Zimmerman #define GPWRDN_STS_CHGINT BIT(17) 3683f5b312aSPaul Zimmerman #define GPWRDN_SRP_DET_MSK BIT(16) 3693f5b312aSPaul Zimmerman #define GPWRDN_SRP_DET BIT(15) 3703f5b312aSPaul Zimmerman #define GPWRDN_CONNECT_DET_MSK BIT(14) 3713f5b312aSPaul Zimmerman #define GPWRDN_CONNECT_DET BIT(13) 3723f5b312aSPaul Zimmerman #define GPWRDN_DISCONN_DET_MSK BIT(12) 3733f5b312aSPaul Zimmerman #define GPWRDN_DISCONN_DET BIT(11) 3743f5b312aSPaul Zimmerman #define GPWRDN_RST_DET_MSK BIT(10) 3753f5b312aSPaul Zimmerman #define GPWRDN_RST_DET BIT(9) 3763f5b312aSPaul Zimmerman #define GPWRDN_LNSTSCHG_MSK BIT(8) 3773f5b312aSPaul Zimmerman #define GPWRDN_LNSTSCHG BIT(7) 3783f5b312aSPaul Zimmerman #define GPWRDN_DIS_VBUS BIT(6) 3793f5b312aSPaul Zimmerman #define GPWRDN_PWRDNSWTCH BIT(5) 3803f5b312aSPaul Zimmerman #define GPWRDN_PWRDNRSTN BIT(4) 3813f5b312aSPaul Zimmerman #define GPWRDN_PWRDNCLMP BIT(3) 3823f5b312aSPaul Zimmerman #define GPWRDN_RESTORE BIT(2) 3833f5b312aSPaul Zimmerman #define GPWRDN_PMUACTV BIT(1) 3843f5b312aSPaul Zimmerman #define GPWRDN_PMUINTSEL BIT(0) 3853f5b312aSPaul Zimmerman 3863f5b312aSPaul Zimmerman #define GDFIFOCFG HSOTG_REG(0x005c) 3873f5b312aSPaul Zimmerman #define GDFIFOCFG_EPINFOBASE_MASK (0xffff << 16) 3883f5b312aSPaul Zimmerman #define GDFIFOCFG_EPINFOBASE_SHIFT 16 3893f5b312aSPaul Zimmerman #define GDFIFOCFG_GDFIFOCFG_MASK (0xffff << 0) 3903f5b312aSPaul Zimmerman #define GDFIFOCFG_GDFIFOCFG_SHIFT 0 3913f5b312aSPaul Zimmerman 3923f5b312aSPaul Zimmerman #define ADPCTL HSOTG_REG(0x0060) 3933f5b312aSPaul Zimmerman #define ADPCTL_AR_MASK (0x3 << 27) 3943f5b312aSPaul Zimmerman #define ADPCTL_AR_SHIFT 27 3953f5b312aSPaul Zimmerman #define ADPCTL_ADP_TMOUT_INT_MSK BIT(26) 3963f5b312aSPaul Zimmerman #define ADPCTL_ADP_SNS_INT_MSK BIT(25) 3973f5b312aSPaul Zimmerman #define ADPCTL_ADP_PRB_INT_MSK BIT(24) 3983f5b312aSPaul Zimmerman #define ADPCTL_ADP_TMOUT_INT BIT(23) 3993f5b312aSPaul Zimmerman #define ADPCTL_ADP_SNS_INT BIT(22) 4003f5b312aSPaul Zimmerman #define ADPCTL_ADP_PRB_INT BIT(21) 4013f5b312aSPaul Zimmerman #define ADPCTL_ADPENA BIT(20) 4023f5b312aSPaul Zimmerman #define ADPCTL_ADPRES BIT(19) 4033f5b312aSPaul Zimmerman #define ADPCTL_ENASNS BIT(18) 4043f5b312aSPaul Zimmerman #define ADPCTL_ENAPRB BIT(17) 4053f5b312aSPaul Zimmerman #define ADPCTL_RTIM_MASK (0x7ff << 6) 4063f5b312aSPaul Zimmerman #define ADPCTL_RTIM_SHIFT 6 4073f5b312aSPaul Zimmerman #define ADPCTL_PRB_PER_MASK (0x3 << 4) 4083f5b312aSPaul Zimmerman #define ADPCTL_PRB_PER_SHIFT 4 4093f5b312aSPaul Zimmerman #define ADPCTL_PRB_DELTA_MASK (0x3 << 2) 4103f5b312aSPaul Zimmerman #define ADPCTL_PRB_DELTA_SHIFT 2 4113f5b312aSPaul Zimmerman #define ADPCTL_PRB_DSCHRG_MASK (0x3 << 0) 4123f5b312aSPaul Zimmerman #define ADPCTL_PRB_DSCHRG_SHIFT 0 4133f5b312aSPaul Zimmerman 4143f5b312aSPaul Zimmerman #define GREFCLK HSOTG_REG(0x0064) 4153f5b312aSPaul Zimmerman #define GREFCLK_REFCLKPER_MASK (0x1ffff << 15) 4163f5b312aSPaul Zimmerman #define GREFCLK_REFCLKPER_SHIFT 15 4173f5b312aSPaul Zimmerman #define GREFCLK_REF_CLK_MODE BIT(14) 4183f5b312aSPaul Zimmerman #define GREFCLK_SOF_CNT_WKUP_ALERT_MASK (0x3ff) 4193f5b312aSPaul Zimmerman #define GREFCLK_SOF_CNT_WKUP_ALERT_SHIFT 0 4203f5b312aSPaul Zimmerman 4213f5b312aSPaul Zimmerman #define GINTMSK2 HSOTG_REG(0x0068) 4223f5b312aSPaul Zimmerman #define GINTMSK2_WKUP_ALERT_INT_MSK BIT(0) 4233f5b312aSPaul Zimmerman 4243f5b312aSPaul Zimmerman #define GINTSTS2 HSOTG_REG(0x006c) 4253f5b312aSPaul Zimmerman #define GINTSTS2_WKUP_ALERT_INT BIT(0) 4263f5b312aSPaul Zimmerman 4273f5b312aSPaul Zimmerman #define HPTXFSIZ HSOTG_REG(0x100) 4283f5b312aSPaul Zimmerman /* Use FIFOSIZE_* constants to access this register */ 4293f5b312aSPaul Zimmerman 4303f5b312aSPaul Zimmerman #define DPTXFSIZN(_a) HSOTG_REG(0x104 + (((_a) - 1) * 4)) 4313f5b312aSPaul Zimmerman /* Use FIFOSIZE_* constants to access this register */ 4323f5b312aSPaul Zimmerman 4333f5b312aSPaul Zimmerman /* These apply to the GNPTXFSIZ, HPTXFSIZ and DPTXFSIZN registers */ 4343f5b312aSPaul Zimmerman #define FIFOSIZE_DEPTH_MASK (0xffff << 16) 4353f5b312aSPaul Zimmerman #define FIFOSIZE_DEPTH_SHIFT 16 4363f5b312aSPaul Zimmerman #define FIFOSIZE_STARTADDR_MASK (0xffff << 0) 4373f5b312aSPaul Zimmerman #define FIFOSIZE_STARTADDR_SHIFT 0 4383f5b312aSPaul Zimmerman #define FIFOSIZE_DEPTH_GET(_x) (((_x) >> 16) & 0xffff) 4393f5b312aSPaul Zimmerman 4403f5b312aSPaul Zimmerman /* Device mode registers */ 4413f5b312aSPaul Zimmerman 4423f5b312aSPaul Zimmerman #define DCFG HSOTG_REG(0x800) 4433f5b312aSPaul Zimmerman #define DCFG_DESCDMA_EN BIT(23) 4443f5b312aSPaul Zimmerman #define DCFG_EPMISCNT_MASK (0x1f << 18) 4453f5b312aSPaul Zimmerman #define DCFG_EPMISCNT_SHIFT 18 4463f5b312aSPaul Zimmerman #define DCFG_EPMISCNT_LIMIT 0x1f 4473f5b312aSPaul Zimmerman #define DCFG_EPMISCNT(_x) ((_x) << 18) 4483f5b312aSPaul Zimmerman #define DCFG_IPG_ISOC_SUPPORDED BIT(17) 4493f5b312aSPaul Zimmerman #define DCFG_PERFRINT_MASK (0x3 << 11) 4503f5b312aSPaul Zimmerman #define DCFG_PERFRINT_SHIFT 11 4513f5b312aSPaul Zimmerman #define DCFG_PERFRINT_LIMIT 0x3 4523f5b312aSPaul Zimmerman #define DCFG_PERFRINT(_x) ((_x) << 11) 4533f5b312aSPaul Zimmerman #define DCFG_DEVADDR_MASK (0x7f << 4) 4543f5b312aSPaul Zimmerman #define DCFG_DEVADDR_SHIFT 4 4553f5b312aSPaul Zimmerman #define DCFG_DEVADDR_LIMIT 0x7f 4563f5b312aSPaul Zimmerman #define DCFG_DEVADDR(_x) ((_x) << 4) 4573f5b312aSPaul Zimmerman #define DCFG_NZ_STS_OUT_HSHK BIT(2) 4583f5b312aSPaul Zimmerman #define DCFG_DEVSPD_MASK (0x3 << 0) 4593f5b312aSPaul Zimmerman #define DCFG_DEVSPD_SHIFT 0 4603f5b312aSPaul Zimmerman #define DCFG_DEVSPD_HS 0 4613f5b312aSPaul Zimmerman #define DCFG_DEVSPD_FS 1 4623f5b312aSPaul Zimmerman #define DCFG_DEVSPD_LS 2 4633f5b312aSPaul Zimmerman #define DCFG_DEVSPD_FS48 3 4643f5b312aSPaul Zimmerman 4653f5b312aSPaul Zimmerman #define DCTL HSOTG_REG(0x804) 4663f5b312aSPaul Zimmerman #define DCTL_SERVICE_INTERVAL_SUPPORTED BIT(19) 4673f5b312aSPaul Zimmerman #define DCTL_PWRONPRGDONE BIT(11) 4683f5b312aSPaul Zimmerman #define DCTL_CGOUTNAK BIT(10) 4693f5b312aSPaul Zimmerman #define DCTL_SGOUTNAK BIT(9) 4703f5b312aSPaul Zimmerman #define DCTL_CGNPINNAK BIT(8) 4713f5b312aSPaul Zimmerman #define DCTL_SGNPINNAK BIT(7) 4723f5b312aSPaul Zimmerman #define DCTL_TSTCTL_MASK (0x7 << 4) 4733f5b312aSPaul Zimmerman #define DCTL_TSTCTL_SHIFT 4 4743f5b312aSPaul Zimmerman #define DCTL_GOUTNAKSTS BIT(3) 4753f5b312aSPaul Zimmerman #define DCTL_GNPINNAKSTS BIT(2) 4763f5b312aSPaul Zimmerman #define DCTL_SFTDISCON BIT(1) 4773f5b312aSPaul Zimmerman #define DCTL_RMTWKUPSIG BIT(0) 4783f5b312aSPaul Zimmerman 4793f5b312aSPaul Zimmerman #define DSTS HSOTG_REG(0x808) 4803f5b312aSPaul Zimmerman #define DSTS_SOFFN_MASK (0x3fff << 8) 4813f5b312aSPaul Zimmerman #define DSTS_SOFFN_SHIFT 8 4823f5b312aSPaul Zimmerman #define DSTS_SOFFN_LIMIT 0x3fff 4833f5b312aSPaul Zimmerman #define DSTS_SOFFN(_x) ((_x) << 8) 4843f5b312aSPaul Zimmerman #define DSTS_ERRATICERR BIT(3) 4853f5b312aSPaul Zimmerman #define DSTS_ENUMSPD_MASK (0x3 << 1) 4863f5b312aSPaul Zimmerman #define DSTS_ENUMSPD_SHIFT 1 4873f5b312aSPaul Zimmerman #define DSTS_ENUMSPD_HS 0 4883f5b312aSPaul Zimmerman #define DSTS_ENUMSPD_FS 1 4893f5b312aSPaul Zimmerman #define DSTS_ENUMSPD_LS 2 4903f5b312aSPaul Zimmerman #define DSTS_ENUMSPD_FS48 3 4913f5b312aSPaul Zimmerman #define DSTS_SUSPSTS BIT(0) 4923f5b312aSPaul Zimmerman 4933f5b312aSPaul Zimmerman #define DIEPMSK HSOTG_REG(0x810) 4943f5b312aSPaul Zimmerman #define DIEPMSK_NAKMSK BIT(13) 4953f5b312aSPaul Zimmerman #define DIEPMSK_BNAININTRMSK BIT(9) 4963f5b312aSPaul Zimmerman #define DIEPMSK_TXFIFOUNDRNMSK BIT(8) 4973f5b312aSPaul Zimmerman #define DIEPMSK_TXFIFOEMPTY BIT(7) 4983f5b312aSPaul Zimmerman #define DIEPMSK_INEPNAKEFFMSK BIT(6) 4993f5b312aSPaul Zimmerman #define DIEPMSK_INTKNEPMISMSK BIT(5) 5003f5b312aSPaul Zimmerman #define DIEPMSK_INTKNTXFEMPMSK BIT(4) 5013f5b312aSPaul Zimmerman #define DIEPMSK_TIMEOUTMSK BIT(3) 5023f5b312aSPaul Zimmerman #define DIEPMSK_AHBERRMSK BIT(2) 5033f5b312aSPaul Zimmerman #define DIEPMSK_EPDISBLDMSK BIT(1) 5043f5b312aSPaul Zimmerman #define DIEPMSK_XFERCOMPLMSK BIT(0) 5053f5b312aSPaul Zimmerman 5063f5b312aSPaul Zimmerman #define DOEPMSK HSOTG_REG(0x814) 5073f5b312aSPaul Zimmerman #define DOEPMSK_BNAMSK BIT(9) 5083f5b312aSPaul Zimmerman #define DOEPMSK_BACK2BACKSETUP BIT(6) 5093f5b312aSPaul Zimmerman #define DOEPMSK_STSPHSERCVDMSK BIT(5) 5103f5b312aSPaul Zimmerman #define DOEPMSK_OUTTKNEPDISMSK BIT(4) 5113f5b312aSPaul Zimmerman #define DOEPMSK_SETUPMSK BIT(3) 5123f5b312aSPaul Zimmerman #define DOEPMSK_AHBERRMSK BIT(2) 5133f5b312aSPaul Zimmerman #define DOEPMSK_EPDISBLDMSK BIT(1) 5143f5b312aSPaul Zimmerman #define DOEPMSK_XFERCOMPLMSK BIT(0) 5153f5b312aSPaul Zimmerman 5163f5b312aSPaul Zimmerman #define DAINT HSOTG_REG(0x818) 5173f5b312aSPaul Zimmerman #define DAINTMSK HSOTG_REG(0x81C) 5183f5b312aSPaul Zimmerman #define DAINT_OUTEP_SHIFT 16 5193f5b312aSPaul Zimmerman #define DAINT_OUTEP(_x) (1 << ((_x) + 16)) 5203f5b312aSPaul Zimmerman #define DAINT_INEP(_x) (1 << (_x)) 5213f5b312aSPaul Zimmerman 5223f5b312aSPaul Zimmerman #define DTKNQR1 HSOTG_REG(0x820) 5233f5b312aSPaul Zimmerman #define DTKNQR2 HSOTG_REG(0x824) 5243f5b312aSPaul Zimmerman #define DTKNQR3 HSOTG_REG(0x830) 5253f5b312aSPaul Zimmerman #define DTKNQR4 HSOTG_REG(0x834) 5263f5b312aSPaul Zimmerman #define DIEPEMPMSK HSOTG_REG(0x834) 5273f5b312aSPaul Zimmerman 5283f5b312aSPaul Zimmerman #define DVBUSDIS HSOTG_REG(0x828) 5293f5b312aSPaul Zimmerman #define DVBUSPULSE HSOTG_REG(0x82C) 5303f5b312aSPaul Zimmerman 5313f5b312aSPaul Zimmerman #define DIEPCTL0 HSOTG_REG(0x900) 5323f5b312aSPaul Zimmerman #define DIEPCTL(_a) HSOTG_REG(0x900 + ((_a) * 0x20)) 5333f5b312aSPaul Zimmerman 5343f5b312aSPaul Zimmerman #define DOEPCTL0 HSOTG_REG(0xB00) 5353f5b312aSPaul Zimmerman #define DOEPCTL(_a) HSOTG_REG(0xB00 + ((_a) * 0x20)) 5363f5b312aSPaul Zimmerman 5373f5b312aSPaul Zimmerman /* EP0 specialness: 5383f5b312aSPaul Zimmerman * bits[29..28] - reserved (no SetD0PID, SetD1PID) 5393f5b312aSPaul Zimmerman * bits[25..22] - should always be zero, this isn't a periodic endpoint 5403f5b312aSPaul Zimmerman * bits[10..0] - MPS setting different for EP0 5413f5b312aSPaul Zimmerman */ 5423f5b312aSPaul Zimmerman #define D0EPCTL_MPS_MASK (0x3 << 0) 5433f5b312aSPaul Zimmerman #define D0EPCTL_MPS_SHIFT 0 5443f5b312aSPaul Zimmerman #define D0EPCTL_MPS_64 0 5453f5b312aSPaul Zimmerman #define D0EPCTL_MPS_32 1 5463f5b312aSPaul Zimmerman #define D0EPCTL_MPS_16 2 5473f5b312aSPaul Zimmerman #define D0EPCTL_MPS_8 3 5483f5b312aSPaul Zimmerman 5493f5b312aSPaul Zimmerman #define DXEPCTL_EPENA BIT(31) 5503f5b312aSPaul Zimmerman #define DXEPCTL_EPDIS BIT(30) 5513f5b312aSPaul Zimmerman #define DXEPCTL_SETD1PID BIT(29) 5523f5b312aSPaul Zimmerman #define DXEPCTL_SETODDFR BIT(29) 5533f5b312aSPaul Zimmerman #define DXEPCTL_SETD0PID BIT(28) 5543f5b312aSPaul Zimmerman #define DXEPCTL_SETEVENFR BIT(28) 5553f5b312aSPaul Zimmerman #define DXEPCTL_SNAK BIT(27) 5563f5b312aSPaul Zimmerman #define DXEPCTL_CNAK BIT(26) 5573f5b312aSPaul Zimmerman #define DXEPCTL_TXFNUM_MASK (0xf << 22) 5583f5b312aSPaul Zimmerman #define DXEPCTL_TXFNUM_SHIFT 22 5593f5b312aSPaul Zimmerman #define DXEPCTL_TXFNUM_LIMIT 0xf 5603f5b312aSPaul Zimmerman #define DXEPCTL_TXFNUM(_x) ((_x) << 22) 5613f5b312aSPaul Zimmerman #define DXEPCTL_STALL BIT(21) 5623f5b312aSPaul Zimmerman #define DXEPCTL_SNP BIT(20) 5633f5b312aSPaul Zimmerman #define DXEPCTL_EPTYPE_MASK (0x3 << 18) 5643f5b312aSPaul Zimmerman #define DXEPCTL_EPTYPE_CONTROL (0x0 << 18) 5653f5b312aSPaul Zimmerman #define DXEPCTL_EPTYPE_ISO (0x1 << 18) 5663f5b312aSPaul Zimmerman #define DXEPCTL_EPTYPE_BULK (0x2 << 18) 5673f5b312aSPaul Zimmerman #define DXEPCTL_EPTYPE_INTERRUPT (0x3 << 18) 5683f5b312aSPaul Zimmerman 5693f5b312aSPaul Zimmerman #define DXEPCTL_NAKSTS BIT(17) 5703f5b312aSPaul Zimmerman #define DXEPCTL_DPID BIT(16) 5713f5b312aSPaul Zimmerman #define DXEPCTL_EOFRNUM BIT(16) 5723f5b312aSPaul Zimmerman #define DXEPCTL_USBACTEP BIT(15) 5733f5b312aSPaul Zimmerman #define DXEPCTL_NEXTEP_MASK (0xf << 11) 5743f5b312aSPaul Zimmerman #define DXEPCTL_NEXTEP_SHIFT 11 5753f5b312aSPaul Zimmerman #define DXEPCTL_NEXTEP_LIMIT 0xf 5763f5b312aSPaul Zimmerman #define DXEPCTL_NEXTEP(_x) ((_x) << 11) 5773f5b312aSPaul Zimmerman #define DXEPCTL_MPS_MASK (0x7ff << 0) 5783f5b312aSPaul Zimmerman #define DXEPCTL_MPS_SHIFT 0 5793f5b312aSPaul Zimmerman #define DXEPCTL_MPS_LIMIT 0x7ff 5803f5b312aSPaul Zimmerman #define DXEPCTL_MPS(_x) ((_x) << 0) 5813f5b312aSPaul Zimmerman 5823f5b312aSPaul Zimmerman #define DIEPINT(_a) HSOTG_REG(0x908 + ((_a) * 0x20)) 5833f5b312aSPaul Zimmerman #define DOEPINT(_a) HSOTG_REG(0xB08 + ((_a) * 0x20)) 5843f5b312aSPaul Zimmerman #define DXEPINT_SETUP_RCVD BIT(15) 5853f5b312aSPaul Zimmerman #define DXEPINT_NYETINTRPT BIT(14) 5863f5b312aSPaul Zimmerman #define DXEPINT_NAKINTRPT BIT(13) 5873f5b312aSPaul Zimmerman #define DXEPINT_BBLEERRINTRPT BIT(12) 5883f5b312aSPaul Zimmerman #define DXEPINT_PKTDRPSTS BIT(11) 5893f5b312aSPaul Zimmerman #define DXEPINT_BNAINTR BIT(9) 5903f5b312aSPaul Zimmerman #define DXEPINT_TXFIFOUNDRN BIT(8) 5913f5b312aSPaul Zimmerman #define DXEPINT_OUTPKTERR BIT(8) 5923f5b312aSPaul Zimmerman #define DXEPINT_TXFEMP BIT(7) 5933f5b312aSPaul Zimmerman #define DXEPINT_INEPNAKEFF BIT(6) 5943f5b312aSPaul Zimmerman #define DXEPINT_BACK2BACKSETUP BIT(6) 5953f5b312aSPaul Zimmerman #define DXEPINT_INTKNEPMIS BIT(5) 5963f5b312aSPaul Zimmerman #define DXEPINT_STSPHSERCVD BIT(5) 5973f5b312aSPaul Zimmerman #define DXEPINT_INTKNTXFEMP BIT(4) 5983f5b312aSPaul Zimmerman #define DXEPINT_OUTTKNEPDIS BIT(4) 5993f5b312aSPaul Zimmerman #define DXEPINT_TIMEOUT BIT(3) 6003f5b312aSPaul Zimmerman #define DXEPINT_SETUP BIT(3) 6013f5b312aSPaul Zimmerman #define DXEPINT_AHBERR BIT(2) 6023f5b312aSPaul Zimmerman #define DXEPINT_EPDISBLD BIT(1) 6033f5b312aSPaul Zimmerman #define DXEPINT_XFERCOMPL BIT(0) 6043f5b312aSPaul Zimmerman 6053f5b312aSPaul Zimmerman #define DIEPTSIZ0 HSOTG_REG(0x910) 6063f5b312aSPaul Zimmerman #define DIEPTSIZ0_PKTCNT_MASK (0x3 << 19) 6073f5b312aSPaul Zimmerman #define DIEPTSIZ0_PKTCNT_SHIFT 19 6083f5b312aSPaul Zimmerman #define DIEPTSIZ0_PKTCNT_LIMIT 0x3 6093f5b312aSPaul Zimmerman #define DIEPTSIZ0_PKTCNT(_x) ((_x) << 19) 6103f5b312aSPaul Zimmerman #define DIEPTSIZ0_XFERSIZE_MASK (0x7f << 0) 6113f5b312aSPaul Zimmerman #define DIEPTSIZ0_XFERSIZE_SHIFT 0 6123f5b312aSPaul Zimmerman #define DIEPTSIZ0_XFERSIZE_LIMIT 0x7f 6133f5b312aSPaul Zimmerman #define DIEPTSIZ0_XFERSIZE(_x) ((_x) << 0) 6143f5b312aSPaul Zimmerman 6153f5b312aSPaul Zimmerman #define DOEPTSIZ0 HSOTG_REG(0xB10) 6163f5b312aSPaul Zimmerman #define DOEPTSIZ0_SUPCNT_MASK (0x3 << 29) 6173f5b312aSPaul Zimmerman #define DOEPTSIZ0_SUPCNT_SHIFT 29 6183f5b312aSPaul Zimmerman #define DOEPTSIZ0_SUPCNT_LIMIT 0x3 6193f5b312aSPaul Zimmerman #define DOEPTSIZ0_SUPCNT(_x) ((_x) << 29) 6203f5b312aSPaul Zimmerman #define DOEPTSIZ0_PKTCNT BIT(19) 6213f5b312aSPaul Zimmerman #define DOEPTSIZ0_XFERSIZE_MASK (0x7f << 0) 6223f5b312aSPaul Zimmerman #define DOEPTSIZ0_XFERSIZE_SHIFT 0 6233f5b312aSPaul Zimmerman 6243f5b312aSPaul Zimmerman #define DIEPTSIZ(_a) HSOTG_REG(0x910 + ((_a) * 0x20)) 6253f5b312aSPaul Zimmerman #define DOEPTSIZ(_a) HSOTG_REG(0xB10 + ((_a) * 0x20)) 6263f5b312aSPaul Zimmerman #define DXEPTSIZ_MC_MASK (0x3 << 29) 6273f5b312aSPaul Zimmerman #define DXEPTSIZ_MC_SHIFT 29 6283f5b312aSPaul Zimmerman #define DXEPTSIZ_MC_LIMIT 0x3 6293f5b312aSPaul Zimmerman #define DXEPTSIZ_MC(_x) ((_x) << 29) 6303f5b312aSPaul Zimmerman #define DXEPTSIZ_PKTCNT_MASK (0x3ff << 19) 6313f5b312aSPaul Zimmerman #define DXEPTSIZ_PKTCNT_SHIFT 19 6323f5b312aSPaul Zimmerman #define DXEPTSIZ_PKTCNT_LIMIT 0x3ff 6333f5b312aSPaul Zimmerman #define DXEPTSIZ_PKTCNT_GET(_v) (((_v) >> 19) & 0x3ff) 6343f5b312aSPaul Zimmerman #define DXEPTSIZ_PKTCNT(_x) ((_x) << 19) 6353f5b312aSPaul Zimmerman #define DXEPTSIZ_XFERSIZE_MASK (0x7ffff << 0) 6363f5b312aSPaul Zimmerman #define DXEPTSIZ_XFERSIZE_SHIFT 0 6373f5b312aSPaul Zimmerman #define DXEPTSIZ_XFERSIZE_LIMIT 0x7ffff 6383f5b312aSPaul Zimmerman #define DXEPTSIZ_XFERSIZE_GET(_v) (((_v) >> 0) & 0x7ffff) 6393f5b312aSPaul Zimmerman #define DXEPTSIZ_XFERSIZE(_x) ((_x) << 0) 6403f5b312aSPaul Zimmerman 6413f5b312aSPaul Zimmerman #define DIEPDMA(_a) HSOTG_REG(0x914 + ((_a) * 0x20)) 6423f5b312aSPaul Zimmerman #define DOEPDMA(_a) HSOTG_REG(0xB14 + ((_a) * 0x20)) 6433f5b312aSPaul Zimmerman 6443f5b312aSPaul Zimmerman #define DTXFSTS(_a) HSOTG_REG(0x918 + ((_a) * 0x20)) 6453f5b312aSPaul Zimmerman 6463f5b312aSPaul Zimmerman #define PCGCTL HSOTG_REG(0x0e00) 6473f5b312aSPaul Zimmerman #define PCGCTL_IF_DEV_MODE BIT(31) 6483f5b312aSPaul Zimmerman #define PCGCTL_P2HD_PRT_SPD_MASK (0x3 << 29) 6493f5b312aSPaul Zimmerman #define PCGCTL_P2HD_PRT_SPD_SHIFT 29 6503f5b312aSPaul Zimmerman #define PCGCTL_P2HD_DEV_ENUM_SPD_MASK (0x3 << 27) 6513f5b312aSPaul Zimmerman #define PCGCTL_P2HD_DEV_ENUM_SPD_SHIFT 27 6523f5b312aSPaul Zimmerman #define PCGCTL_MAC_DEV_ADDR_MASK (0x7f << 20) 6533f5b312aSPaul Zimmerman #define PCGCTL_MAC_DEV_ADDR_SHIFT 20 6543f5b312aSPaul Zimmerman #define PCGCTL_MAX_TERMSEL BIT(19) 6553f5b312aSPaul Zimmerman #define PCGCTL_MAX_XCVRSELECT_MASK (0x3 << 17) 6563f5b312aSPaul Zimmerman #define PCGCTL_MAX_XCVRSELECT_SHIFT 17 6573f5b312aSPaul Zimmerman #define PCGCTL_PORT_POWER BIT(16) 6583f5b312aSPaul Zimmerman #define PCGCTL_PRT_CLK_SEL_MASK (0x3 << 14) 6593f5b312aSPaul Zimmerman #define PCGCTL_PRT_CLK_SEL_SHIFT 14 6603f5b312aSPaul Zimmerman #define PCGCTL_ESS_REG_RESTORED BIT(13) 6613f5b312aSPaul Zimmerman #define PCGCTL_EXTND_HIBER_SWITCH BIT(12) 6623f5b312aSPaul Zimmerman #define PCGCTL_EXTND_HIBER_PWRCLMP BIT(11) 6633f5b312aSPaul Zimmerman #define PCGCTL_ENBL_EXTND_HIBER BIT(10) 6643f5b312aSPaul Zimmerman #define PCGCTL_RESTOREMODE BIT(9) 6653f5b312aSPaul Zimmerman #define PCGCTL_RESETAFTSUSP BIT(8) 6663f5b312aSPaul Zimmerman #define PCGCTL_DEEP_SLEEP BIT(7) 6673f5b312aSPaul Zimmerman #define PCGCTL_PHY_IN_SLEEP BIT(6) 6683f5b312aSPaul Zimmerman #define PCGCTL_ENBL_SLEEP_GATING BIT(5) 6693f5b312aSPaul Zimmerman #define PCGCTL_RSTPDWNMODULE BIT(3) 6703f5b312aSPaul Zimmerman #define PCGCTL_PWRCLMP BIT(2) 6713f5b312aSPaul Zimmerman #define PCGCTL_GATEHCLK BIT(1) 6723f5b312aSPaul Zimmerman #define PCGCTL_STOPPCLK BIT(0) 6733f5b312aSPaul Zimmerman 6743f5b312aSPaul Zimmerman #define PCGCCTL1 HSOTG_REG(0xe04) 6753f5b312aSPaul Zimmerman #define PCGCCTL1_TIMER (0x3 << 1) 6763f5b312aSPaul Zimmerman #define PCGCCTL1_GATEEN BIT(0) 6773f5b312aSPaul Zimmerman 6783f5b312aSPaul Zimmerman #define EPFIFO(_a) HSOTG_REG(0x1000 + ((_a) * 0x1000)) 6793f5b312aSPaul Zimmerman 6803f5b312aSPaul Zimmerman /* Host Mode Registers */ 6813f5b312aSPaul Zimmerman 6823f5b312aSPaul Zimmerman #define HCFG HSOTG_REG(0x0400) 6833f5b312aSPaul Zimmerman #define HCFG_MODECHTIMEN BIT(31) 6843f5b312aSPaul Zimmerman #define HCFG_PERSCHEDENA BIT(26) 6853f5b312aSPaul Zimmerman #define HCFG_FRLISTEN_MASK (0x3 << 24) 6863f5b312aSPaul Zimmerman #define HCFG_FRLISTEN_SHIFT 24 6873f5b312aSPaul Zimmerman #define HCFG_FRLISTEN_8 (0 << 24) 6883f5b312aSPaul Zimmerman #define FRLISTEN_8_SIZE 8 6893f5b312aSPaul Zimmerman #define HCFG_FRLISTEN_16 BIT(24) 6903f5b312aSPaul Zimmerman #define FRLISTEN_16_SIZE 16 6913f5b312aSPaul Zimmerman #define HCFG_FRLISTEN_32 (2 << 24) 6923f5b312aSPaul Zimmerman #define FRLISTEN_32_SIZE 32 6933f5b312aSPaul Zimmerman #define HCFG_FRLISTEN_64 (3 << 24) 6943f5b312aSPaul Zimmerman #define FRLISTEN_64_SIZE 64 6953f5b312aSPaul Zimmerman #define HCFG_DESCDMA BIT(23) 6963f5b312aSPaul Zimmerman #define HCFG_RESVALID_MASK (0xff << 8) 6973f5b312aSPaul Zimmerman #define HCFG_RESVALID_SHIFT 8 6983f5b312aSPaul Zimmerman #define HCFG_ENA32KHZ BIT(7) 6993f5b312aSPaul Zimmerman #define HCFG_FSLSSUPP BIT(2) 7003f5b312aSPaul Zimmerman #define HCFG_FSLSPCLKSEL_MASK (0x3 << 0) 7013f5b312aSPaul Zimmerman #define HCFG_FSLSPCLKSEL_SHIFT 0 7023f5b312aSPaul Zimmerman #define HCFG_FSLSPCLKSEL_30_60_MHZ 0 7033f5b312aSPaul Zimmerman #define HCFG_FSLSPCLKSEL_48_MHZ 1 7043f5b312aSPaul Zimmerman #define HCFG_FSLSPCLKSEL_6_MHZ 2 7053f5b312aSPaul Zimmerman 7063f5b312aSPaul Zimmerman #define HFIR HSOTG_REG(0x0404) 7073f5b312aSPaul Zimmerman #define HFIR_FRINT_MASK (0xffff << 0) 7083f5b312aSPaul Zimmerman #define HFIR_FRINT_SHIFT 0 7093f5b312aSPaul Zimmerman #define HFIR_RLDCTRL BIT(16) 7103f5b312aSPaul Zimmerman 7113f5b312aSPaul Zimmerman #define HFNUM HSOTG_REG(0x0408) 7123f5b312aSPaul Zimmerman #define HFNUM_FRREM_MASK (0xffff << 16) 7133f5b312aSPaul Zimmerman #define HFNUM_FRREM_SHIFT 16 7143f5b312aSPaul Zimmerman #define HFNUM_FRNUM_MASK (0xffff << 0) 7153f5b312aSPaul Zimmerman #define HFNUM_FRNUM_SHIFT 0 7163f5b312aSPaul Zimmerman #define HFNUM_MAX_FRNUM 0x3fff 7173f5b312aSPaul Zimmerman 7183f5b312aSPaul Zimmerman #define HPTXSTS HSOTG_REG(0x0410) 7193f5b312aSPaul Zimmerman #define TXSTS_QTOP_ODD BIT(31) 7203f5b312aSPaul Zimmerman #define TXSTS_QTOP_CHNEP_MASK (0xf << 27) 7213f5b312aSPaul Zimmerman #define TXSTS_QTOP_CHNEP_SHIFT 27 7223f5b312aSPaul Zimmerman #define TXSTS_QTOP_TOKEN_MASK (0x3 << 25) 7233f5b312aSPaul Zimmerman #define TXSTS_QTOP_TOKEN_SHIFT 25 7243f5b312aSPaul Zimmerman #define TXSTS_QTOP_TERMINATE BIT(24) 7253f5b312aSPaul Zimmerman #define TXSTS_QSPCAVAIL_MASK (0xff << 16) 7263f5b312aSPaul Zimmerman #define TXSTS_QSPCAVAIL_SHIFT 16 7273f5b312aSPaul Zimmerman #define TXSTS_FSPCAVAIL_MASK (0xffff << 0) 7283f5b312aSPaul Zimmerman #define TXSTS_FSPCAVAIL_SHIFT 0 7293f5b312aSPaul Zimmerman 7303f5b312aSPaul Zimmerman #define HAINT HSOTG_REG(0x0414) 7313f5b312aSPaul Zimmerman #define HAINTMSK HSOTG_REG(0x0418) 7323f5b312aSPaul Zimmerman #define HFLBADDR HSOTG_REG(0x041c) 7333f5b312aSPaul Zimmerman 7343f5b312aSPaul Zimmerman #define HPRT0 HSOTG_REG(0x0440) 7353f5b312aSPaul Zimmerman #define HPRT0_SPD_MASK (0x3 << 17) 7363f5b312aSPaul Zimmerman #define HPRT0_SPD_SHIFT 17 7373f5b312aSPaul Zimmerman #define HPRT0_SPD_HIGH_SPEED 0 7383f5b312aSPaul Zimmerman #define HPRT0_SPD_FULL_SPEED 1 7393f5b312aSPaul Zimmerman #define HPRT0_SPD_LOW_SPEED 2 7403f5b312aSPaul Zimmerman #define HPRT0_TSTCTL_MASK (0xf << 13) 7413f5b312aSPaul Zimmerman #define HPRT0_TSTCTL_SHIFT 13 7423f5b312aSPaul Zimmerman #define HPRT0_PWR BIT(12) 7433f5b312aSPaul Zimmerman #define HPRT0_LNSTS_MASK (0x3 << 10) 7443f5b312aSPaul Zimmerman #define HPRT0_LNSTS_SHIFT 10 7453f5b312aSPaul Zimmerman #define HPRT0_RST BIT(8) 7463f5b312aSPaul Zimmerman #define HPRT0_SUSP BIT(7) 7473f5b312aSPaul Zimmerman #define HPRT0_RES BIT(6) 7483f5b312aSPaul Zimmerman #define HPRT0_OVRCURRCHG BIT(5) 7493f5b312aSPaul Zimmerman #define HPRT0_OVRCURRACT BIT(4) 7503f5b312aSPaul Zimmerman #define HPRT0_ENACHG BIT(3) 7513f5b312aSPaul Zimmerman #define HPRT0_ENA BIT(2) 7523f5b312aSPaul Zimmerman #define HPRT0_CONNDET BIT(1) 7533f5b312aSPaul Zimmerman #define HPRT0_CONNSTS BIT(0) 7543f5b312aSPaul Zimmerman 7553f5b312aSPaul Zimmerman #define HCCHAR(_ch) HSOTG_REG(0x0500 + 0x20 * (_ch)) 7563f5b312aSPaul Zimmerman #define HCCHAR_CHENA BIT(31) 7573f5b312aSPaul Zimmerman #define HCCHAR_CHDIS BIT(30) 7583f5b312aSPaul Zimmerman #define HCCHAR_ODDFRM BIT(29) 7593f5b312aSPaul Zimmerman #define HCCHAR_DEVADDR_MASK (0x7f << 22) 7603f5b312aSPaul Zimmerman #define HCCHAR_DEVADDR_SHIFT 22 7613f5b312aSPaul Zimmerman #define HCCHAR_MULTICNT_MASK (0x3 << 20) 7623f5b312aSPaul Zimmerman #define HCCHAR_MULTICNT_SHIFT 20 7633f5b312aSPaul Zimmerman #define HCCHAR_EPTYPE_MASK (0x3 << 18) 7643f5b312aSPaul Zimmerman #define HCCHAR_EPTYPE_SHIFT 18 7653f5b312aSPaul Zimmerman #define HCCHAR_LSPDDEV BIT(17) 7663f5b312aSPaul Zimmerman #define HCCHAR_EPDIR BIT(15) 7673f5b312aSPaul Zimmerman #define HCCHAR_EPNUM_MASK (0xf << 11) 7683f5b312aSPaul Zimmerman #define HCCHAR_EPNUM_SHIFT 11 7693f5b312aSPaul Zimmerman #define HCCHAR_MPS_MASK (0x7ff << 0) 7703f5b312aSPaul Zimmerman #define HCCHAR_MPS_SHIFT 0 7713f5b312aSPaul Zimmerman 7723f5b312aSPaul Zimmerman #define HCSPLT(_ch) HSOTG_REG(0x0504 + 0x20 * (_ch)) 7733f5b312aSPaul Zimmerman #define HCSPLT_SPLTENA BIT(31) 7743f5b312aSPaul Zimmerman #define HCSPLT_COMPSPLT BIT(16) 7753f5b312aSPaul Zimmerman #define HCSPLT_XACTPOS_MASK (0x3 << 14) 7763f5b312aSPaul Zimmerman #define HCSPLT_XACTPOS_SHIFT 14 7773f5b312aSPaul Zimmerman #define HCSPLT_XACTPOS_MID 0 7783f5b312aSPaul Zimmerman #define HCSPLT_XACTPOS_END 1 7793f5b312aSPaul Zimmerman #define HCSPLT_XACTPOS_BEGIN 2 7803f5b312aSPaul Zimmerman #define HCSPLT_XACTPOS_ALL 3 7813f5b312aSPaul Zimmerman #define HCSPLT_HUBADDR_MASK (0x7f << 7) 7823f5b312aSPaul Zimmerman #define HCSPLT_HUBADDR_SHIFT 7 7833f5b312aSPaul Zimmerman #define HCSPLT_PRTADDR_MASK (0x7f << 0) 7843f5b312aSPaul Zimmerman #define HCSPLT_PRTADDR_SHIFT 0 7853f5b312aSPaul Zimmerman 7863f5b312aSPaul Zimmerman #define HCINT(_ch) HSOTG_REG(0x0508 + 0x20 * (_ch)) 7873f5b312aSPaul Zimmerman #define HCINTMSK(_ch) HSOTG_REG(0x050c + 0x20 * (_ch)) 7883f5b312aSPaul Zimmerman #define HCINTMSK_RESERVED14_31 (0x3ffff << 14) 7893f5b312aSPaul Zimmerman #define HCINTMSK_FRM_LIST_ROLL BIT(13) 7903f5b312aSPaul Zimmerman #define HCINTMSK_XCS_XACT BIT(12) 7913f5b312aSPaul Zimmerman #define HCINTMSK_BNA BIT(11) 7923f5b312aSPaul Zimmerman #define HCINTMSK_DATATGLERR BIT(10) 7933f5b312aSPaul Zimmerman #define HCINTMSK_FRMOVRUN BIT(9) 7943f5b312aSPaul Zimmerman #define HCINTMSK_BBLERR BIT(8) 7953f5b312aSPaul Zimmerman #define HCINTMSK_XACTERR BIT(7) 7963f5b312aSPaul Zimmerman #define HCINTMSK_NYET BIT(6) 7973f5b312aSPaul Zimmerman #define HCINTMSK_ACK BIT(5) 7983f5b312aSPaul Zimmerman #define HCINTMSK_NAK BIT(4) 7993f5b312aSPaul Zimmerman #define HCINTMSK_STALL BIT(3) 8003f5b312aSPaul Zimmerman #define HCINTMSK_AHBERR BIT(2) 8013f5b312aSPaul Zimmerman #define HCINTMSK_CHHLTD BIT(1) 8023f5b312aSPaul Zimmerman #define HCINTMSK_XFERCOMPL BIT(0) 8033f5b312aSPaul Zimmerman 8043f5b312aSPaul Zimmerman #define HCTSIZ(_ch) HSOTG_REG(0x0510 + 0x20 * (_ch)) 8053f5b312aSPaul Zimmerman #define TSIZ_DOPNG BIT(31) 8063f5b312aSPaul Zimmerman #define TSIZ_SC_MC_PID_MASK (0x3 << 29) 8073f5b312aSPaul Zimmerman #define TSIZ_SC_MC_PID_SHIFT 29 8083f5b312aSPaul Zimmerman #define TSIZ_SC_MC_PID_DATA0 0 8093f5b312aSPaul Zimmerman #define TSIZ_SC_MC_PID_DATA2 1 8103f5b312aSPaul Zimmerman #define TSIZ_SC_MC_PID_DATA1 2 8113f5b312aSPaul Zimmerman #define TSIZ_SC_MC_PID_MDATA 3 8123f5b312aSPaul Zimmerman #define TSIZ_SC_MC_PID_SETUP 3 8133f5b312aSPaul Zimmerman #define TSIZ_PKTCNT_MASK (0x3ff << 19) 8143f5b312aSPaul Zimmerman #define TSIZ_PKTCNT_SHIFT 19 8153f5b312aSPaul Zimmerman #define TSIZ_NTD_MASK (0xff << 8) 8163f5b312aSPaul Zimmerman #define TSIZ_NTD_SHIFT 8 8173f5b312aSPaul Zimmerman #define TSIZ_SCHINFO_MASK (0xff << 0) 8183f5b312aSPaul Zimmerman #define TSIZ_SCHINFO_SHIFT 0 8193f5b312aSPaul Zimmerman #define TSIZ_XFERSIZE_MASK (0x7ffff << 0) 8203f5b312aSPaul Zimmerman #define TSIZ_XFERSIZE_SHIFT 0 8213f5b312aSPaul Zimmerman 8223f5b312aSPaul Zimmerman #define HCDMA(_ch) HSOTG_REG(0x0514 + 0x20 * (_ch)) 8233f5b312aSPaul Zimmerman 8243f5b312aSPaul Zimmerman #define HCDMAB(_ch) HSOTG_REG(0x051c + 0x20 * (_ch)) 8253f5b312aSPaul Zimmerman 8263f5b312aSPaul Zimmerman #define HCFIFO(_ch) HSOTG_REG(0x1000 + 0x1000 * (_ch)) 8273f5b312aSPaul Zimmerman 8283f5b312aSPaul Zimmerman /** 8293f5b312aSPaul Zimmerman * struct dwc2_dma_desc - DMA descriptor structure, 8303f5b312aSPaul Zimmerman * used for both host and gadget modes 8313f5b312aSPaul Zimmerman * 8323f5b312aSPaul Zimmerman * @status: DMA descriptor status quadlet 8333f5b312aSPaul Zimmerman * @buf: DMA descriptor data buffer pointer 8343f5b312aSPaul Zimmerman * 8353f5b312aSPaul Zimmerman * DMA Descriptor structure contains two quadlets: 8363f5b312aSPaul Zimmerman * Status quadlet and Data buffer pointer. 8373f5b312aSPaul Zimmerman */ 8383f5b312aSPaul Zimmerman struct dwc2_dma_desc { 8393f5b312aSPaul Zimmerman uint32_t status; 8403f5b312aSPaul Zimmerman uint32_t buf; 841*80c80346SRoque Arcudia Hernandez } QEMU_PACKED; 8423f5b312aSPaul Zimmerman 8433f5b312aSPaul Zimmerman /* Host Mode DMA descriptor status quadlet */ 8443f5b312aSPaul Zimmerman 8453f5b312aSPaul Zimmerman #define HOST_DMA_A BIT(31) 8463f5b312aSPaul Zimmerman #define HOST_DMA_STS_MASK (0x3 << 28) 8473f5b312aSPaul Zimmerman #define HOST_DMA_STS_SHIFT 28 8483f5b312aSPaul Zimmerman #define HOST_DMA_STS_PKTERR BIT(28) 8493f5b312aSPaul Zimmerman #define HOST_DMA_EOL BIT(26) 8503f5b312aSPaul Zimmerman #define HOST_DMA_IOC BIT(25) 8513f5b312aSPaul Zimmerman #define HOST_DMA_SUP BIT(24) 8523f5b312aSPaul Zimmerman #define HOST_DMA_ALT_QTD BIT(23) 8533f5b312aSPaul Zimmerman #define HOST_DMA_QTD_OFFSET_MASK (0x3f << 17) 8543f5b312aSPaul Zimmerman #define HOST_DMA_QTD_OFFSET_SHIFT 17 8553f5b312aSPaul Zimmerman #define HOST_DMA_ISOC_NBYTES_MASK (0xfff << 0) 8563f5b312aSPaul Zimmerman #define HOST_DMA_ISOC_NBYTES_SHIFT 0 8573f5b312aSPaul Zimmerman #define HOST_DMA_NBYTES_MASK (0x1ffff << 0) 8583f5b312aSPaul Zimmerman #define HOST_DMA_NBYTES_SHIFT 0 8593f5b312aSPaul Zimmerman #define HOST_DMA_NBYTES_LIMIT 131071 8603f5b312aSPaul Zimmerman 8613f5b312aSPaul Zimmerman /* Device Mode DMA descriptor status quadlet */ 8623f5b312aSPaul Zimmerman 8633f5b312aSPaul Zimmerman #define DEV_DMA_BUFF_STS_MASK (0x3 << 30) 8643f5b312aSPaul Zimmerman #define DEV_DMA_BUFF_STS_SHIFT 30 8653f5b312aSPaul Zimmerman #define DEV_DMA_BUFF_STS_HREADY 0 8663f5b312aSPaul Zimmerman #define DEV_DMA_BUFF_STS_DMABUSY 1 8673f5b312aSPaul Zimmerman #define DEV_DMA_BUFF_STS_DMADONE 2 8683f5b312aSPaul Zimmerman #define DEV_DMA_BUFF_STS_HBUSY 3 8693f5b312aSPaul Zimmerman #define DEV_DMA_STS_MASK (0x3 << 28) 8703f5b312aSPaul Zimmerman #define DEV_DMA_STS_SHIFT 28 8713f5b312aSPaul Zimmerman #define DEV_DMA_STS_SUCC 0 8723f5b312aSPaul Zimmerman #define DEV_DMA_STS_BUFF_FLUSH 1 8733f5b312aSPaul Zimmerman #define DEV_DMA_STS_BUFF_ERR 3 8743f5b312aSPaul Zimmerman #define DEV_DMA_L BIT(27) 8753f5b312aSPaul Zimmerman #define DEV_DMA_SHORT BIT(26) 8763f5b312aSPaul Zimmerman #define DEV_DMA_IOC BIT(25) 8773f5b312aSPaul Zimmerman #define DEV_DMA_SR BIT(24) 8783f5b312aSPaul Zimmerman #define DEV_DMA_MTRF BIT(23) 8793f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_PID_MASK (0x3 << 23) 8803f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_PID_SHIFT 23 8813f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_PID_DATA0 0 8823f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_PID_DATA2 1 8833f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_PID_DATA1 2 8843f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_PID_MDATA 3 8853f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_FRNUM_MASK (0x7ff << 12) 8863f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_FRNUM_SHIFT 12 8873f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_TX_NBYTES_MASK (0xfff << 0) 8883f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_TX_NBYTES_LIMIT 0xfff 8893f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_RX_NBYTES_MASK (0x7ff << 0) 8903f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_RX_NBYTES_LIMIT 0x7ff 8913f5b312aSPaul Zimmerman #define DEV_DMA_ISOC_NBYTES_SHIFT 0 8923f5b312aSPaul Zimmerman #define DEV_DMA_NBYTES_MASK (0xffff << 0) 8933f5b312aSPaul Zimmerman #define DEV_DMA_NBYTES_SHIFT 0 8943f5b312aSPaul Zimmerman #define DEV_DMA_NBYTES_LIMIT 0xffff 8953f5b312aSPaul Zimmerman 8963f5b312aSPaul Zimmerman #define MAX_DMA_DESC_NUM_GENERIC 64 8973f5b312aSPaul Zimmerman #define MAX_DMA_DESC_NUM_HS_ISOC 256 8983f5b312aSPaul Zimmerman 89952581c71SMarkus Armbruster #endif /* DWC2_REGS_H */ 900