xref: /openbmc/u-boot/arch/arm/include/asm/arch-mxs/regs-usb.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
23a0398d7SOtavio Salvador /*
33a0398d7SOtavio Salvador  * Freescale i.MX28 USB OTG Register Definitions
43a0398d7SOtavio Salvador  *
53a0398d7SOtavio Salvador  * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
63a0398d7SOtavio Salvador  * on behalf of DENX Software Engineering GmbH
73a0398d7SOtavio Salvador  */
83a0398d7SOtavio Salvador 
93a0398d7SOtavio Salvador #ifndef __REGS_USB_H__
103a0398d7SOtavio Salvador #define __REGS_USB_H__
113a0398d7SOtavio Salvador 
129c471142SOtavio Salvador struct mxs_usb_regs {
133a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_id;			/* 0x000 */
143a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_hwgeneral;		/* 0x004 */
153a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_hwhost;		/* 0x008 */
163a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_hwdevice;		/* 0x00c */
173a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_hwtxbuf;		/* 0x010 */
183a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_hwrxbuf;		/* 0x014 */
193a0398d7SOtavio Salvador 
203a0398d7SOtavio Salvador 	uint32_t		reserved1[26];
213a0398d7SOtavio Salvador 
223a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_gptimer0ld;		/* 0x080 */
233a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_gptimer0ctrl;	/* 0x084 */
243a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_gptimer1ld;		/* 0x088 */
253a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_gptimer1ctrl;	/* 0x08c */
263a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_sbuscfg;		/* 0x090 */
273a0398d7SOtavio Salvador 
283a0398d7SOtavio Salvador 	uint32_t		reserved2[27];
293a0398d7SOtavio Salvador 
303a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_caplength;		/* 0x100 */
313a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_hcsparams;		/* 0x104 */
323a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_hccparams;		/* 0x108 */
333a0398d7SOtavio Salvador 
343a0398d7SOtavio Salvador 	uint32_t		reserved3[5];
353a0398d7SOtavio Salvador 
363a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_dciversion;		/* 0x120 */
373a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_dccparams;		/* 0x124 */
383a0398d7SOtavio Salvador 
393a0398d7SOtavio Salvador 	uint32_t		reserved4[6];
403a0398d7SOtavio Salvador 
413a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_usbcmd;		/* 0x140 */
423a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_usbsts;		/* 0x144 */
433a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_usbintr;		/* 0x148 */
443a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_frindex;		/* 0x14c */
453a0398d7SOtavio Salvador 
463a0398d7SOtavio Salvador 	uint32_t		reserved5;
473a0398d7SOtavio Salvador 
483a0398d7SOtavio Salvador 	union {
493a0398d7SOtavio Salvador 		uint32_t	hw_usbctrl_periodiclistbase;	/* 0x154 */
503a0398d7SOtavio Salvador 		uint32_t	hw_usbctrl_deviceaddr;		/* 0x154 */
513a0398d7SOtavio Salvador 	};
523a0398d7SOtavio Salvador 	union {
533a0398d7SOtavio Salvador 		uint32_t	hw_usbctrl_asynclistaddr;	/* 0x158 */
543a0398d7SOtavio Salvador 		uint32_t	hw_usbctrl_endpointlistaddr;	/* 0x158 */
553a0398d7SOtavio Salvador 	};
563a0398d7SOtavio Salvador 
573a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_ttctrl;		/* 0x15c */
583a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_burstsize;		/* 0x160 */
593a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_txfilltuning;	/* 0x164 */
603a0398d7SOtavio Salvador 
613a0398d7SOtavio Salvador 	uint32_t		reserved6;
623a0398d7SOtavio Salvador 
633a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_ic_usb;		/* 0x16c */
643a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_ulpi;		/* 0x170 */
653a0398d7SOtavio Salvador 
663a0398d7SOtavio Salvador 	uint32_t		reserved7;
673a0398d7SOtavio Salvador 
683a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptnak;		/* 0x178 */
693a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptnaken;		/* 0x17c */
703a0398d7SOtavio Salvador 
713a0398d7SOtavio Salvador 	uint32_t		reserved8;
723a0398d7SOtavio Salvador 
733a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_portsc1;		/* 0x184 */
743a0398d7SOtavio Salvador 
753a0398d7SOtavio Salvador 	uint32_t		reserved9[7];
763a0398d7SOtavio Salvador 
773a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_otgsc;		/* 0x1a4 */
783a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_usbmode;		/* 0x1a8 */
793a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptsetupstat;	/* 0x1ac */
803a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptprime;		/* 0x1b0 */
813a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptflush;		/* 0x1b4 */
823a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptstat;		/* 0x1b8 */
833a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptcomplete;	/* 0x1bc */
843a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl0;		/* 0x1c0 */
853a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl1;		/* 0x1c4 */
863a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl2;		/* 0x1c8 */
873a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl3;		/* 0x1cc */
883a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl4;		/* 0x1d0 */
893a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl5;		/* 0x1d4 */
903a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl6;		/* 0x1d8 */
913a0398d7SOtavio Salvador 	uint32_t		hw_usbctrl_endptctrl7;		/* 0x1dc */
923a0398d7SOtavio Salvador };
933a0398d7SOtavio Salvador 
943a0398d7SOtavio Salvador #define	CLKCTRL_PLL0CTRL0_LFR_SEL_MASK		(0x3 << 28)
953a0398d7SOtavio Salvador 
963a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_CIVERSION_OFFSET		29
973a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_CIVERSION_MASK		(0x7 << 29)
983a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_VERSION_OFFSET		25
993a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_VERSION_MASK		(0xf << 25)
1003a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_REVISION_OFFSET		21
1013a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_REVISION_MASK		(0xf << 21)
1023a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_TAG_OFFSET		16
1033a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_TAG_MASK			(0x1f << 16)
1043a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_NID_OFFSET		8
1053a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_NID_MASK			(0x3f << 8)
1063a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_ID_OFFSET			0
1073a0398d7SOtavio Salvador #define	HW_USBCTRL_ID_ID_MASK			(0x3f << 0)
1083a0398d7SOtavio Salvador 
1093a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_SM_OFFSET		9
1103a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_SM_MASK		(0x3 << 9)
1113a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_PHYM_OFFSET	6
1123a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_PHYM_MASK		(0x7 << 6)
1133a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_PHYW_OFFSET	4
1143a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_PHYW_MASK		(0x3 << 4)
1153a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_BWT		(1 << 3)
1163a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_CLKC_OFFSET	1
1173a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_CLKC_MASK		(0x3 << 1)
1183a0398d7SOtavio Salvador #define	HW_USBCTRL_HWGENERAL_RT			(1 << 0)
1193a0398d7SOtavio Salvador 
1203a0398d7SOtavio Salvador #define	HW_USBCTRL_HWHOST_TTPER_OFFSET		24
1213a0398d7SOtavio Salvador #define	HW_USBCTRL_HWHOST_TTPER_MASK		(0xff << 24)
1223a0398d7SOtavio Salvador #define	HW_USBCTRL_HWHOST_TTASY_OFFSET		16
1233a0398d7SOtavio Salvador #define	HW_USBCTRL_HWHOST_TTASY_MASK		(0xff << 19)
1243a0398d7SOtavio Salvador #define	HW_USBCTRL_HWHOST_NPORT_OFFSET		1
1253a0398d7SOtavio Salvador #define	HW_USBCTRL_HWHOST_NPORT_MASK		(0x7 << 1)
1263a0398d7SOtavio Salvador #define	HW_USBCTRL_HWHOST_HC			(1 << 0)
1273a0398d7SOtavio Salvador 
1283a0398d7SOtavio Salvador #define	HW_USBCTRL_HWDEVICE_DEVEP_OFFSET	1
1293a0398d7SOtavio Salvador #define	HW_USBCTRL_HWDEVICE_DEVEP_MASK		(0x1f << 1)
1303a0398d7SOtavio Salvador #define	HW_USBCTRL_HWDEVICE_DC			(1 << 0)
1313a0398d7SOtavio Salvador 
1323a0398d7SOtavio Salvador #define	HW_USBCTRL_HWTXBUF_TXLCR		(1 << 31)
1333a0398d7SOtavio Salvador #define	HW_USBCTRL_HWTXBUF_TXCHANADD_OFFSET	16
1343a0398d7SOtavio Salvador #define	HW_USBCTRL_HWTXBUF_TXCHANADD_MASK	(0xff << 16)
1353a0398d7SOtavio Salvador #define	HW_USBCTRL_HWTXBUF_TXADD_OFFSET		8
1363a0398d7SOtavio Salvador #define	HW_USBCTRL_HWTXBUF_TXADD_MASK		(0xff << 8)
1373a0398d7SOtavio Salvador #define	HW_USBCTRL_HWTXBUF_TXBURST_OFFSET	0
1383a0398d7SOtavio Salvador #define	HW_USBCTRL_HWTXBUF_TXBURST_MASK		0xff
1393a0398d7SOtavio Salvador 
1403a0398d7SOtavio Salvador #define	HW_USBCTRL_HWRXBUF_RXADD_OFFSET		8
1413a0398d7SOtavio Salvador #define	HW_USBCTRL_HWRXBUF_RXADD_MASK		(0xff << 8)
1423a0398d7SOtavio Salvador #define	HW_USBCTRL_HWRXBUF_RXBURST_OFFSET	0
1433a0398d7SOtavio Salvador #define	HW_USBCTRL_HWRXBUF_RXBURST_MASK		0xff
1443a0398d7SOtavio Salvador 
1453a0398d7SOtavio Salvador #define	HW_USBCTRL_GPTIMERLD_GPTLD_OFFSET	0
1463a0398d7SOtavio Salvador #define	HW_USBCTRL_GPTIMERLD_GPTLD_MASK		0xffffff
1473a0398d7SOtavio Salvador 
1483a0398d7SOtavio Salvador #define	HW_USBCTRL_GPTIMERCTRL_GPTRUN		(1 << 31)
1493a0398d7SOtavio Salvador #define	HW_USBCTRL_GPTIMERCTRL_GPTRST		(1 << 30)
1503a0398d7SOtavio Salvador #define	HW_USBCTRL_GPTIMERCTRL_GPTMODE		(1 << 24)
1513a0398d7SOtavio Salvador #define	HW_USBCTRL_GPTIMERCTRL_GPTCNT_OFFSET	0
1523a0398d7SOtavio Salvador #define	HW_USBCTRL_GPTIMERCTRL_GPTCNT_MASK	0xffffff
1533a0398d7SOtavio Salvador 
1543a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_OFFSET	0
1553a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_MASK	0x7
1563a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR	0x0
1573a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_S_INCR4	0x1
1583a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_S_INCR8	0x2
1593a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_S_INCR16	0x3
1603a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR4	0x5
1613a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR8	0x6
1623a0398d7SOtavio Salvador #define	HW_USBCTRL_SBUSCFG_AHBBURST_U_INCR16	0x7
1633a0398d7SOtavio Salvador 
1643a0398d7SOtavio Salvador #endif	/* __REGS_USB_H__ */
165