1*3a0398d7SOtavio Salvador /* 2*3a0398d7SOtavio Salvador * Freescale i.MX28 USB OTG Register Definitions 3*3a0398d7SOtavio Salvador * 4*3a0398d7SOtavio Salvador * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> 5*3a0398d7SOtavio Salvador * on behalf of DENX Software Engineering GmbH 6*3a0398d7SOtavio Salvador * 7*3a0398d7SOtavio Salvador * This program is free software; you can redistribute it and/or modify 8*3a0398d7SOtavio Salvador * it under the terms of the GNU General Public License as published by 9*3a0398d7SOtavio Salvador * the Free Software Foundation; either version 2 of the License, or 10*3a0398d7SOtavio Salvador * (at your option) any later version. 11*3a0398d7SOtavio Salvador * 12*3a0398d7SOtavio Salvador * This program is distributed in the hope that it will be useful, 13*3a0398d7SOtavio Salvador * but WITHOUT ANY WARRANTY; without even the implied warranty of 14*3a0398d7SOtavio Salvador * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*3a0398d7SOtavio Salvador * GNU General Public License for more details. 16*3a0398d7SOtavio Salvador * 17*3a0398d7SOtavio Salvador * You should have received a copy of the GNU General Public License 18*3a0398d7SOtavio Salvador * along with this program; if not, write to the Free Software 19*3a0398d7SOtavio Salvador * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20*3a0398d7SOtavio Salvador * 21*3a0398d7SOtavio Salvador */ 22*3a0398d7SOtavio Salvador 23*3a0398d7SOtavio Salvador #ifndef __REGS_USB_H__ 24*3a0398d7SOtavio Salvador #define __REGS_USB_H__ 25*3a0398d7SOtavio Salvador 26*3a0398d7SOtavio Salvador struct mx28_usb_regs { 27*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_id; /* 0x000 */ 28*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_hwgeneral; /* 0x004 */ 29*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_hwhost; /* 0x008 */ 30*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_hwdevice; /* 0x00c */ 31*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_hwtxbuf; /* 0x010 */ 32*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_hwrxbuf; /* 0x014 */ 33*3a0398d7SOtavio Salvador 34*3a0398d7SOtavio Salvador uint32_t reserved1[26]; 35*3a0398d7SOtavio Salvador 36*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_gptimer0ld; /* 0x080 */ 37*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_gptimer0ctrl; /* 0x084 */ 38*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_gptimer1ld; /* 0x088 */ 39*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_gptimer1ctrl; /* 0x08c */ 40*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_sbuscfg; /* 0x090 */ 41*3a0398d7SOtavio Salvador 42*3a0398d7SOtavio Salvador uint32_t reserved2[27]; 43*3a0398d7SOtavio Salvador 44*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_caplength; /* 0x100 */ 45*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_hcsparams; /* 0x104 */ 46*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_hccparams; /* 0x108 */ 47*3a0398d7SOtavio Salvador 48*3a0398d7SOtavio Salvador uint32_t reserved3[5]; 49*3a0398d7SOtavio Salvador 50*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_dciversion; /* 0x120 */ 51*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_dccparams; /* 0x124 */ 52*3a0398d7SOtavio Salvador 53*3a0398d7SOtavio Salvador uint32_t reserved4[6]; 54*3a0398d7SOtavio Salvador 55*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_usbcmd; /* 0x140 */ 56*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_usbsts; /* 0x144 */ 57*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_usbintr; /* 0x148 */ 58*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_frindex; /* 0x14c */ 59*3a0398d7SOtavio Salvador 60*3a0398d7SOtavio Salvador uint32_t reserved5; 61*3a0398d7SOtavio Salvador 62*3a0398d7SOtavio Salvador union { 63*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_periodiclistbase; /* 0x154 */ 64*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_deviceaddr; /* 0x154 */ 65*3a0398d7SOtavio Salvador }; 66*3a0398d7SOtavio Salvador union { 67*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_asynclistaddr; /* 0x158 */ 68*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endpointlistaddr; /* 0x158 */ 69*3a0398d7SOtavio Salvador }; 70*3a0398d7SOtavio Salvador 71*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_ttctrl; /* 0x15c */ 72*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_burstsize; /* 0x160 */ 73*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_txfilltuning; /* 0x164 */ 74*3a0398d7SOtavio Salvador 75*3a0398d7SOtavio Salvador uint32_t reserved6; 76*3a0398d7SOtavio Salvador 77*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_ic_usb; /* 0x16c */ 78*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_ulpi; /* 0x170 */ 79*3a0398d7SOtavio Salvador 80*3a0398d7SOtavio Salvador uint32_t reserved7; 81*3a0398d7SOtavio Salvador 82*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptnak; /* 0x178 */ 83*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptnaken; /* 0x17c */ 84*3a0398d7SOtavio Salvador 85*3a0398d7SOtavio Salvador uint32_t reserved8; 86*3a0398d7SOtavio Salvador 87*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_portsc1; /* 0x184 */ 88*3a0398d7SOtavio Salvador 89*3a0398d7SOtavio Salvador uint32_t reserved9[7]; 90*3a0398d7SOtavio Salvador 91*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_otgsc; /* 0x1a4 */ 92*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_usbmode; /* 0x1a8 */ 93*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptsetupstat; /* 0x1ac */ 94*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptprime; /* 0x1b0 */ 95*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptflush; /* 0x1b4 */ 96*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptstat; /* 0x1b8 */ 97*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptcomplete; /* 0x1bc */ 98*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl0; /* 0x1c0 */ 99*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl1; /* 0x1c4 */ 100*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl2; /* 0x1c8 */ 101*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl3; /* 0x1cc */ 102*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl4; /* 0x1d0 */ 103*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl5; /* 0x1d4 */ 104*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl6; /* 0x1d8 */ 105*3a0398d7SOtavio Salvador uint32_t hw_usbctrl_endptctrl7; /* 0x1dc */ 106*3a0398d7SOtavio Salvador }; 107*3a0398d7SOtavio Salvador 108*3a0398d7SOtavio Salvador #define CLKCTRL_PLL0CTRL0_LFR_SEL_MASK (0x3 << 28) 109*3a0398d7SOtavio Salvador 110*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_CIVERSION_OFFSET 29 111*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_CIVERSION_MASK (0x7 << 29) 112*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_VERSION_OFFSET 25 113*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_VERSION_MASK (0xf << 25) 114*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_REVISION_OFFSET 21 115*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_REVISION_MASK (0xf << 21) 116*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_TAG_OFFSET 16 117*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_TAG_MASK (0x1f << 16) 118*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_NID_OFFSET 8 119*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_NID_MASK (0x3f << 8) 120*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_ID_OFFSET 0 121*3a0398d7SOtavio Salvador #define HW_USBCTRL_ID_ID_MASK (0x3f << 0) 122*3a0398d7SOtavio Salvador 123*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_SM_OFFSET 9 124*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_SM_MASK (0x3 << 9) 125*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_PHYM_OFFSET 6 126*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_PHYM_MASK (0x7 << 6) 127*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_PHYW_OFFSET 4 128*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_PHYW_MASK (0x3 << 4) 129*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_BWT (1 << 3) 130*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_CLKC_OFFSET 1 131*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_CLKC_MASK (0x3 << 1) 132*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWGENERAL_RT (1 << 0) 133*3a0398d7SOtavio Salvador 134*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWHOST_TTPER_OFFSET 24 135*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWHOST_TTPER_MASK (0xff << 24) 136*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWHOST_TTASY_OFFSET 16 137*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWHOST_TTASY_MASK (0xff << 19) 138*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWHOST_NPORT_OFFSET 1 139*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWHOST_NPORT_MASK (0x7 << 1) 140*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWHOST_HC (1 << 0) 141*3a0398d7SOtavio Salvador 142*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWDEVICE_DEVEP_OFFSET 1 143*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWDEVICE_DEVEP_MASK (0x1f << 1) 144*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWDEVICE_DC (1 << 0) 145*3a0398d7SOtavio Salvador 146*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWTXBUF_TXLCR (1 << 31) 147*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWTXBUF_TXCHANADD_OFFSET 16 148*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWTXBUF_TXCHANADD_MASK (0xff << 16) 149*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWTXBUF_TXADD_OFFSET 8 150*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWTXBUF_TXADD_MASK (0xff << 8) 151*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWTXBUF_TXBURST_OFFSET 0 152*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWTXBUF_TXBURST_MASK 0xff 153*3a0398d7SOtavio Salvador 154*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWRXBUF_RXADD_OFFSET 8 155*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWRXBUF_RXADD_MASK (0xff << 8) 156*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWRXBUF_RXBURST_OFFSET 0 157*3a0398d7SOtavio Salvador #define HW_USBCTRL_HWRXBUF_RXBURST_MASK 0xff 158*3a0398d7SOtavio Salvador 159*3a0398d7SOtavio Salvador #define HW_USBCTRL_GPTIMERLD_GPTLD_OFFSET 0 160*3a0398d7SOtavio Salvador #define HW_USBCTRL_GPTIMERLD_GPTLD_MASK 0xffffff 161*3a0398d7SOtavio Salvador 162*3a0398d7SOtavio Salvador #define HW_USBCTRL_GPTIMERCTRL_GPTRUN (1 << 31) 163*3a0398d7SOtavio Salvador #define HW_USBCTRL_GPTIMERCTRL_GPTRST (1 << 30) 164*3a0398d7SOtavio Salvador #define HW_USBCTRL_GPTIMERCTRL_GPTMODE (1 << 24) 165*3a0398d7SOtavio Salvador #define HW_USBCTRL_GPTIMERCTRL_GPTCNT_OFFSET 0 166*3a0398d7SOtavio Salvador #define HW_USBCTRL_GPTIMERCTRL_GPTCNT_MASK 0xffffff 167*3a0398d7SOtavio Salvador 168*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_OFFSET 0 169*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_MASK 0x7 170*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR 0x0 171*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_S_INCR4 0x1 172*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_S_INCR8 0x2 173*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_S_INCR16 0x3 174*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR4 0x5 175*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR8 0x6 176*3a0398d7SOtavio Salvador #define HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR16 0x7 177*3a0398d7SOtavio Salvador 178*3a0398d7SOtavio Salvador #endif /* __REGS_USB_H__ */ 179