xref: /openbmc/linux/drivers/usb/gadget/udc/fusb300_udc.h (revision 664b0bae0b87f69bc9deb098f5e0158b9cf18e04)
1*5fd54aceSGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
290fccb52SAndrzej Pietrasiewicz /*
390fccb52SAndrzej Pietrasiewicz  * Fusb300 UDC (USB gadget)
490fccb52SAndrzej Pietrasiewicz  *
590fccb52SAndrzej Pietrasiewicz  * Copyright (C) 2010 Faraday Technology Corp.
690fccb52SAndrzej Pietrasiewicz  *
790fccb52SAndrzej Pietrasiewicz  * Author : Yuan-hsin Chen <yhchen@faraday-tech.com>
890fccb52SAndrzej Pietrasiewicz  */
990fccb52SAndrzej Pietrasiewicz 
1090fccb52SAndrzej Pietrasiewicz 
1190fccb52SAndrzej Pietrasiewicz #ifndef __FUSB300_UDC_H__
12f0798d6aSRasmus Villemoes #define __FUSB300_UDC_H__
1390fccb52SAndrzej Pietrasiewicz 
1490fccb52SAndrzej Pietrasiewicz #include <linux/kernel.h>
1590fccb52SAndrzej Pietrasiewicz 
1690fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_GCR		0x00
1790fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_GTM		0x04
1890fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_DAR		0x08
1990fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_CSR		0x0C
2090fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_CXPORT		0x10
2190fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPSET0(n)	(0x20 + (n - 1) * 0x30)
2290fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPSET1(n)	(0x24 + (n - 1) * 0x30)
2390fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPSET2(n)	(0x28 + (n - 1) * 0x30)
2490fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPFFR(n)		(0x2c + (n - 1) * 0x30)
2590fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPSTRID(n)	(0x40 + (n - 1) * 0x30)
2690fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_HSPTM		0x300
2790fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_HSCR		0x304
2890fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_SSCR0		0x308
2990fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_SSCR1		0x30C
3090fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_TT		0x310
3190fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_DEVNOTF		0x314
3290fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_DNC1		0x318
3390fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_CS		0x31C
3490fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_SOF		0x324
3590fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EFCS		0x328
3690fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGR0		0x400
3790fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGR1		0x404
3890fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGR2		0x408
3990fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGR3		0x40C
4090fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGR4		0x410
4190fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGR5		0x414
4290fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGER0		0x420
4390fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGER1		0x424
4490fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGER2		0x428
4590fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGER3		0x42C
4690fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGER4		0x430
4790fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_IGER5		0x434
4890fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_DMAHMER		0x500
4990fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPPRDRDY		0x504
5090fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_DMAEPMR		0x508
5190fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_DMAENR		0x50C
5290fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_DMAAPR		0x510
5390fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_AHBCR		0x514
5490fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPPRD_W0(n)	(0x520 + (n - 1) * 0x10)
5590fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPPRD_W1(n)	(0x524 + (n - 1) * 0x10)
5690fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPPRD_W2(n)	(0x528 + (n - 1) * 0x10)
5790fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPRD_PTR(n)	(0x52C + (n - 1) * 0x10)
5890fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_BUFDBG_START	0x800
5990fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_BUFDBG_END	0xBFC
6090fccb52SAndrzej Pietrasiewicz #define FUSB300_OFFSET_EPPORT(n)	(0x1010 + (n - 1) * 0x10)
6190fccb52SAndrzej Pietrasiewicz 
6290fccb52SAndrzej Pietrasiewicz /*
6390fccb52SAndrzej Pietrasiewicz  * *	Global Control Register (offset = 000H)
6490fccb52SAndrzej Pietrasiewicz  * */
6590fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_SF_RST		(1 << 8)
6690fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_VBUS_STATUS		(1 << 7)
6790fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_FORCE_HS_SUSP	(1 << 6)
6890fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_SYNC_FIFO1_CLR	(1 << 5)
6990fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_SYNC_FIFO0_CLR	(1 << 4)
7090fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_FIFOCLR		(1 << 3)
7190fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_GLINTEN		(1 << 2)
7290fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_DEVEN_FS		0x3
7390fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_DEVEN_HS		0x2
7490fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_DEVEN_SS		0x1
7590fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_DEVDIS		0x0
7690fccb52SAndrzej Pietrasiewicz #define FUSB300_GCR_DEVEN_MSK		0x3
7790fccb52SAndrzej Pietrasiewicz 
7890fccb52SAndrzej Pietrasiewicz 
7990fccb52SAndrzej Pietrasiewicz /*
8090fccb52SAndrzej Pietrasiewicz  * *Global Test Mode (offset = 004H)
8190fccb52SAndrzej Pietrasiewicz  * */
8290fccb52SAndrzej Pietrasiewicz #define FUSB300_GTM_TST_DIS_SOFGEN	(1 << 16)
8390fccb52SAndrzej Pietrasiewicz #define FUSB300_GTM_TST_CUR_EP_ENTRY(n)	((n & 0xF) << 12)
8490fccb52SAndrzej Pietrasiewicz #define FUSB300_GTM_TST_EP_ENTRY(n)	((n & 0xF) << 8)
8590fccb52SAndrzej Pietrasiewicz #define FUSB300_GTM_TST_EP_NUM(n)	((n & 0xF) << 4)
8690fccb52SAndrzej Pietrasiewicz #define FUSB300_GTM_TST_FIFO_DEG	(1 << 1)
8790fccb52SAndrzej Pietrasiewicz #define FUSB300_GTM_TSTMODE		(1 << 0)
8890fccb52SAndrzej Pietrasiewicz 
8990fccb52SAndrzej Pietrasiewicz /*
9090fccb52SAndrzej Pietrasiewicz  * * Device Address Register (offset = 008H)
9190fccb52SAndrzej Pietrasiewicz  * */
9290fccb52SAndrzej Pietrasiewicz #define FUSB300_DAR_SETCONFG	(1 << 7)
9390fccb52SAndrzej Pietrasiewicz #define FUSB300_DAR_DRVADDR(x)	(x & 0x7F)
9490fccb52SAndrzej Pietrasiewicz #define FUSB300_DAR_DRVADDR_MSK	0x7F
9590fccb52SAndrzej Pietrasiewicz 
9690fccb52SAndrzej Pietrasiewicz /*
9790fccb52SAndrzej Pietrasiewicz  * *Control Transfer Configuration and Status Register
9890fccb52SAndrzej Pietrasiewicz  * (CX_Config_Status, offset = 00CH)
9990fccb52SAndrzej Pietrasiewicz  * */
10090fccb52SAndrzej Pietrasiewicz #define FUSB300_CSR_LEN(x)	((x & 0xFFFF) << 8)
10190fccb52SAndrzej Pietrasiewicz #define FUSB300_CSR_LEN_MSK	(0xFFFF << 8)
10290fccb52SAndrzej Pietrasiewicz #define FUSB300_CSR_EMP		(1 << 4)
10390fccb52SAndrzej Pietrasiewicz #define FUSB300_CSR_FUL		(1 << 3)
10490fccb52SAndrzej Pietrasiewicz #define FUSB300_CSR_CLR		(1 << 2)
10590fccb52SAndrzej Pietrasiewicz #define FUSB300_CSR_STL		(1 << 1)
10690fccb52SAndrzej Pietrasiewicz #define FUSB300_CSR_DONE	(1 << 0)
10790fccb52SAndrzej Pietrasiewicz 
10890fccb52SAndrzej Pietrasiewicz /*
10990fccb52SAndrzej Pietrasiewicz  * * EPn Setting 0 (EPn_SET0, offset = 020H+(n-1)*30H, n=1~15 )
11090fccb52SAndrzej Pietrasiewicz  * */
11190fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET0_STL_CLR		(1 << 3)
11290fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET0_CLRSEQNUM	(1 << 2)
11390fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET0_STL		(1 << 0)
11490fccb52SAndrzej Pietrasiewicz 
11590fccb52SAndrzej Pietrasiewicz /*
11690fccb52SAndrzej Pietrasiewicz  * * EPn Setting 1 (EPn_SET1, offset = 024H+(n-1)*30H, n=1~15)
11790fccb52SAndrzej Pietrasiewicz  * */
11890fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_START_ENTRY(x)	((x & 0xFF) << 24)
11990fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_START_ENTRY_MSK	(0xFF << 24)
12090fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_FIFOENTRY(x)	((x & 0x1F) << 12)
12190fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_FIFOENTRY_MSK	(0x1f << 12)
12290fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_INTERVAL(x)	((x & 0x7) << 6)
12390fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_BWNUM(x)		((x & 0x3) << 4)
12490fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_TYPEISO		(1 << 2)
12590fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_TYPEBLK		(2 << 2)
12690fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_TYPEINT		(3 << 2)
12790fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_TYPE(x)		((x & 0x3) << 2)
12890fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_TYPE_MSK		(0x3 << 2)
12990fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_DIROUT		(0 << 1)
13090fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_DIRIN		(1 << 1)
13190fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_DIR(x)		((x & 0x1) << 1)
13290fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_DIRIN		(1 << 1)
13390fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_DIR_MSK		((0x1) << 1)
13490fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_ACTDIS		0
13590fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET1_ACTEN		1
13690fccb52SAndrzej Pietrasiewicz 
13790fccb52SAndrzej Pietrasiewicz /*
13890fccb52SAndrzej Pietrasiewicz  * *EPn Setting 2 (EPn_SET2, offset = 028H+(n-1)*30H, n=1~15)
13990fccb52SAndrzej Pietrasiewicz  * */
14090fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET2_ADDROFS(x)	((x & 0x7FFF) << 16)
14190fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET2_ADDROFS_MSK	(0x7fff << 16)
14290fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET2_MPS(x)		(x & 0x7FF)
14390fccb52SAndrzej Pietrasiewicz #define FUSB300_EPSET2_MPS_MSK		0x7FF
14490fccb52SAndrzej Pietrasiewicz 
14590fccb52SAndrzej Pietrasiewicz /*
14690fccb52SAndrzej Pietrasiewicz  * * EPn FIFO Register (offset = 2cH+(n-1)*30H)
14790fccb52SAndrzej Pietrasiewicz  * */
14890fccb52SAndrzej Pietrasiewicz #define FUSB300_FFR_RST		(1 << 31)
14990fccb52SAndrzej Pietrasiewicz #define FUSB300_FF_FUL		(1 << 30)
15090fccb52SAndrzej Pietrasiewicz #define FUSB300_FF_EMPTY	(1 << 29)
15190fccb52SAndrzej Pietrasiewicz #define FUSB300_FFR_BYCNT	0x1FFFF
15290fccb52SAndrzej Pietrasiewicz 
15390fccb52SAndrzej Pietrasiewicz /*
15490fccb52SAndrzej Pietrasiewicz  * *EPn Stream ID (EPn_STR_ID, offset = 040H+(n-1)*30H, n=1~15)
15590fccb52SAndrzej Pietrasiewicz  * */
15690fccb52SAndrzej Pietrasiewicz #define FUSB300_STRID_STREN	(1 << 16)
15790fccb52SAndrzej Pietrasiewicz #define FUSB300_STRID_STRID(x)	(x & 0xFFFF)
15890fccb52SAndrzej Pietrasiewicz 
15990fccb52SAndrzej Pietrasiewicz /*
16090fccb52SAndrzej Pietrasiewicz  * *HS PHY Test Mode (offset = 300H)
16190fccb52SAndrzej Pietrasiewicz  * */
16290fccb52SAndrzej Pietrasiewicz #define FUSB300_HSPTM_TSTPKDONE		(1 << 4)
16390fccb52SAndrzej Pietrasiewicz #define FUSB300_HSPTM_TSTPKT		(1 << 3)
16490fccb52SAndrzej Pietrasiewicz #define FUSB300_HSPTM_TSTSET0NAK	(1 << 2)
16590fccb52SAndrzej Pietrasiewicz #define FUSB300_HSPTM_TSTKSTA		(1 << 1)
16690fccb52SAndrzej Pietrasiewicz #define FUSB300_HSPTM_TSTJSTA		(1 << 0)
16790fccb52SAndrzej Pietrasiewicz 
16890fccb52SAndrzej Pietrasiewicz /*
16990fccb52SAndrzej Pietrasiewicz  * *HS Control Register (offset = 304H)
17090fccb52SAndrzej Pietrasiewicz  * */
17190fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_HS_LPM_PERMIT	(1 << 8)
17290fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_HS_LPM_RMWKUP	(1 << 7)
17390fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_CAP_LPM_RMWKUP	(1 << 6)
17490fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_HS_GOSUSP		(1 << 5)
17590fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_HS_GORMWKU		(1 << 4)
17690fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_CAP_RMWKUP		(1 << 3)
17790fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_0MS	0
17890fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_1MS	1
17990fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_2MS	2
18090fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_3MS	3
18190fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_4MS	4
18290fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_5MS	5
18390fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_6MS	6
18490fccb52SAndrzej Pietrasiewicz #define FUSB300_HSCR_IDLECNT_7MS	7
18590fccb52SAndrzej Pietrasiewicz 
18690fccb52SAndrzej Pietrasiewicz /*
18790fccb52SAndrzej Pietrasiewicz  * * SS Controller Register 0 (offset = 308H)
18890fccb52SAndrzej Pietrasiewicz  * */
18990fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR0_MAX_INTERVAL(x)	((x & 0x7) << 4)
19090fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR0_U2_FUN_EN		(1 << 1)
19190fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR0_U1_FUN_EN		(1 << 0)
19290fccb52SAndrzej Pietrasiewicz 
19390fccb52SAndrzej Pietrasiewicz /*
19490fccb52SAndrzej Pietrasiewicz  * * SS Controller Register 1 (offset = 30CH)
19590fccb52SAndrzej Pietrasiewicz  * */
19690fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_GO_U3_DONE	(1 << 8)
19790fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_TXDEEMPH_LEVEL	(1 << 7)
19890fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_DIS_SCRMB		(1 << 6)
19990fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_FORCE_RECOVERY	(1 << 5)
20090fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_U3_WAKEUP_EN	(1 << 4)
20190fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_U2_EXIT_EN	(1 << 3)
20290fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_U1_EXIT_EN	(1 << 2)
20390fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_U2_ENTRY_EN	(1 << 1)
20490fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR1_U1_ENTRY_EN	(1 << 0)
20590fccb52SAndrzej Pietrasiewicz 
20690fccb52SAndrzej Pietrasiewicz /*
20790fccb52SAndrzej Pietrasiewicz  * *SS Controller Register 2  (offset = 310H)
20890fccb52SAndrzej Pietrasiewicz  * */
20990fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR2_SS_TX_SWING		(1 << 25)
21090fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR2_FORCE_LINKPM_ACCEPT	(1 << 24)
21190fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR2_U2_INACT_TIMEOUT(x)	((x & 0xFF) << 16)
21290fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR2_U1TIMEOUT(x)		((x & 0xFF) << 8)
21390fccb52SAndrzej Pietrasiewicz #define FUSB300_SSCR2_U2TIMEOUT(x)		(x & 0xFF)
21490fccb52SAndrzej Pietrasiewicz 
21590fccb52SAndrzej Pietrasiewicz /*
21690fccb52SAndrzej Pietrasiewicz  * *SS Device Notification Control (DEV_NOTF, offset = 314H)
21790fccb52SAndrzej Pietrasiewicz  * */
21890fccb52SAndrzej Pietrasiewicz #define FUSB300_DEVNOTF_CONTEXT0(x)		((x & 0xFFFFFF) << 8)
21990fccb52SAndrzej Pietrasiewicz #define FUSB300_DEVNOTF_TYPE_DIS		0
22090fccb52SAndrzej Pietrasiewicz #define FUSB300_DEVNOTF_TYPE_FUNCWAKE		1
22190fccb52SAndrzej Pietrasiewicz #define FUSB300_DEVNOTF_TYPE_LTM		2
22290fccb52SAndrzej Pietrasiewicz #define FUSB300_DEVNOTF_TYPE_BUSINT_ADJMSG	3
22390fccb52SAndrzej Pietrasiewicz 
22490fccb52SAndrzej Pietrasiewicz /*
22590fccb52SAndrzej Pietrasiewicz  * *BFM Arbiter Priority Register (BFM_ARB offset = 31CH)
22690fccb52SAndrzej Pietrasiewicz  * */
22790fccb52SAndrzej Pietrasiewicz #define FUSB300_BFMARB_ARB_M1	(1 << 3)
22890fccb52SAndrzej Pietrasiewicz #define FUSB300_BFMARB_ARB_M0	(1 << 2)
22990fccb52SAndrzej Pietrasiewicz #define FUSB300_BFMARB_ARB_S1	(1 << 1)
23090fccb52SAndrzej Pietrasiewicz #define FUSB300_BFMARB_ARB_S0	1
23190fccb52SAndrzej Pietrasiewicz 
23290fccb52SAndrzej Pietrasiewicz /*
23390fccb52SAndrzej Pietrasiewicz  * *Vendor Specific IO Control Register (offset = 320H)
23490fccb52SAndrzej Pietrasiewicz  * */
23590fccb52SAndrzej Pietrasiewicz #define FUSB300_VSIC_VCTLOAD_N	(1 << 8)
23690fccb52SAndrzej Pietrasiewicz #define FUSB300_VSIC_VCTL(x)	(x & 0x3F)
23790fccb52SAndrzej Pietrasiewicz 
23890fccb52SAndrzej Pietrasiewicz /*
23990fccb52SAndrzej Pietrasiewicz  * *SOF Mask Timer (offset = 324H)
24090fccb52SAndrzej Pietrasiewicz  * */
24190fccb52SAndrzej Pietrasiewicz #define FUSB300_SOF_MASK_TIMER_HS	0x044c
24290fccb52SAndrzej Pietrasiewicz #define FUSB300_SOF_MASK_TIMER_FS	0x2710
24390fccb52SAndrzej Pietrasiewicz 
24490fccb52SAndrzej Pietrasiewicz /*
24590fccb52SAndrzej Pietrasiewicz  * *Error Flag and Control Status (offset = 328H)
24690fccb52SAndrzej Pietrasiewicz  * */
24790fccb52SAndrzej Pietrasiewicz #define FUSB300_EFCS_PM_STATE_U3	3
24890fccb52SAndrzej Pietrasiewicz #define FUSB300_EFCS_PM_STATE_U2	2
24990fccb52SAndrzej Pietrasiewicz #define FUSB300_EFCS_PM_STATE_U1	1
25090fccb52SAndrzej Pietrasiewicz #define FUSB300_EFCS_PM_STATE_U0	0
25190fccb52SAndrzej Pietrasiewicz 
25290fccb52SAndrzej Pietrasiewicz /*
25390fccb52SAndrzej Pietrasiewicz  * *Interrupt Group 0 Register (offset = 400H)
25490fccb52SAndrzej Pietrasiewicz  * */
25590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP15_PRD_INT	(1 << 31)
25690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP14_PRD_INT	(1 << 30)
25790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP13_PRD_INT	(1 << 29)
25890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP12_PRD_INT	(1 << 28)
25990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP11_PRD_INT	(1 << 27)
26090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP10_PRD_INT	(1 << 26)
26190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP9_PRD_INT	(1 << 25)
26290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP8_PRD_INT	(1 << 24)
26390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP7_PRD_INT	(1 << 23)
26490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP6_PRD_INT	(1 << 22)
26590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP5_PRD_INT	(1 << 21)
26690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP4_PRD_INT	(1 << 20)
26790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP3_PRD_INT	(1 << 19)
26890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP2_PRD_INT	(1 << 18)
26990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP1_PRD_INT	(1 << 17)
27090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EPn_PRD_INT(n)	(1 << (n + 16))
27190fccb52SAndrzej Pietrasiewicz 
27290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP15_FIFO_INT	(1 << 15)
27390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP14_FIFO_INT	(1 << 14)
27490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP13_FIFO_INT	(1 << 13)
27590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP12_FIFO_INT	(1 << 12)
27690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP11_FIFO_INT	(1 << 11)
27790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP10_FIFO_INT	(1 << 10)
27890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP9_FIFO_INT	(1 << 9)
27990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP8_FIFO_INT	(1 << 8)
28090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP7_FIFO_INT	(1 << 7)
28190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP6_FIFO_INT	(1 << 6)
28290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP5_FIFO_INT	(1 << 5)
28390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP4_FIFO_INT	(1 << 4)
28490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP3_FIFO_INT	(1 << 3)
28590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP2_FIFO_INT	(1 << 2)
28690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EP1_FIFO_INT	(1 << 1)
28790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR0_EPn_FIFO_INT(n)	(1 << n)
28890fccb52SAndrzej Pietrasiewicz 
28990fccb52SAndrzej Pietrasiewicz /*
29090fccb52SAndrzej Pietrasiewicz  * *Interrupt Group 1 Register (offset = 404H)
29190fccb52SAndrzej Pietrasiewicz  * */
29290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_INTGRP5		(1 << 31)
29390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_VBUS_CHG_INT	(1 << 30)
29490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_SYNF1_EMPTY_INT	(1 << 29)
29590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_SYNF0_EMPTY_INT	(1 << 28)
29690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U3_EXIT_FAIL_INT	(1 << 27)
29790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U2_EXIT_FAIL_INT	(1 << 26)
29890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U1_EXIT_FAIL_INT	(1 << 25)
29990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U2_ENTRY_FAIL_INT	(1 << 24)
30090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U1_ENTRY_FAIL_INT	(1 << 23)
30190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U3_EXIT_INT	(1 << 22)
30290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U2_EXIT_INT	(1 << 21)
30390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U1_EXIT_INT	(1 << 20)
30490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U3_ENTRY_INT	(1 << 19)
30590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U2_ENTRY_INT	(1 << 18)
30690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_U1_ENTRY_INT	(1 << 17)
30790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_HOT_RST_INT	(1 << 16)
30890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_WARM_RST_INT	(1 << 15)
30990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_RESM_INT		(1 << 14)
31090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_SUSP_INT		(1 << 13)
31190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_HS_LPM_INT		(1 << 12)
31290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_USBRST_INT		(1 << 11)
31390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_DEV_MODE_CHG_INT	(1 << 9)
31490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_CX_COMABT_INT	(1 << 8)
31590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_CX_COMFAIL_INT	(1 << 7)
31690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_CX_CMDEND_INT	(1 << 6)
31790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_CX_OUT_INT		(1 << 5)
31890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_CX_IN_INT		(1 << 4)
31990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_CX_SETUP_INT	(1 << 3)
32090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_INTGRP4		(1 << 2)
32190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_INTGRP3		(1 << 1)
32290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR1_INTGRP2		(1 << 0)
32390fccb52SAndrzej Pietrasiewicz 
32490fccb52SAndrzej Pietrasiewicz /*
32590fccb52SAndrzej Pietrasiewicz  * *Interrupt Group 2 Register (offset = 408H)
32690fccb52SAndrzej Pietrasiewicz  * */
32790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP6_STR_ACCEPT_INT		(1 << 29)
32890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP6_STR_RESUME_INT		(1 << 28)
32990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP6_STR_REQ_INT		(1 << 27)
33090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP6_STR_NOTRDY_INT		(1 << 26)
33190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP6_STR_PRIME_INT		(1 << 25)
33290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP5_STR_ACCEPT_INT		(1 << 24)
33390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP5_STR_RESUME_INT		(1 << 23)
33490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP5_STR_REQ_INT		(1 << 22)
33590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP5_STR_NOTRDY_INT		(1 << 21)
33690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP5_STR_PRIME_INT		(1 << 20)
33790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP4_STR_ACCEPT_INT		(1 << 19)
33890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP4_STR_RESUME_INT		(1 << 18)
33990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP4_STR_REQ_INT		(1 << 17)
34090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP4_STR_NOTRDY_INT		(1 << 16)
34190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP4_STR_PRIME_INT		(1 << 15)
34290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP3_STR_ACCEPT_INT		(1 << 14)
34390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP3_STR_RESUME_INT		(1 << 13)
34490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP3_STR_REQ_INT		(1 << 12)
34590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP3_STR_NOTRDY_INT		(1 << 11)
34690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP3_STR_PRIME_INT		(1 << 10)
34790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP2_STR_ACCEPT_INT		(1 << 9)
34890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP2_STR_RESUME_INT		(1 << 8)
34990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP2_STR_REQ_INT		(1 << 7)
35090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP2_STR_NOTRDY_INT		(1 << 6)
35190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP2_STR_PRIME_INT		(1 << 5)
35290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP1_STR_ACCEPT_INT		(1 << 4)
35390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP1_STR_RESUME_INT		(1 << 3)
35490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP1_STR_REQ_INT		(1 << 2)
35590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP1_STR_NOTRDY_INT		(1 << 1)
35690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP1_STR_PRIME_INT		(1 << 0)
35790fccb52SAndrzej Pietrasiewicz 
35890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP_STR_ACCEPT_INT(n)	(1 << (5 * n - 1))
35990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP_STR_RESUME_INT(n)	(1 << (5 * n - 2))
36090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP_STR_REQ_INT(n)		(1 << (5 * n - 3))
36190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP_STR_NOTRDY_INT(n)	(1 << (5 * n - 4))
36290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR2_EP_STR_PRIME_INT(n)	(1 << (5 * n - 5))
36390fccb52SAndrzej Pietrasiewicz 
36490fccb52SAndrzej Pietrasiewicz /*
36590fccb52SAndrzej Pietrasiewicz  * *Interrupt Group 3 Register (offset = 40CH)
36690fccb52SAndrzej Pietrasiewicz  * */
36790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP12_STR_ACCEPT_INT	(1 << 29)
36890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP12_STR_RESUME_INT	(1 << 28)
36990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP12_STR_REQ_INT		(1 << 27)
37090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP12_STR_NOTRDY_INT	(1 << 26)
37190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP12_STR_PRIME_INT		(1 << 25)
37290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP11_STR_ACCEPT_INT	(1 << 24)
37390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP11_STR_RESUME_INT	(1 << 23)
37490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP11_STR_REQ_INT		(1 << 22)
37590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP11_STR_NOTRDY_INT	(1 << 21)
37690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP11_STR_PRIME_INT		(1 << 20)
37790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP10_STR_ACCEPT_INT	(1 << 19)
37890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP10_STR_RESUME_INT	(1 << 18)
37990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP10_STR_REQ_INT		(1 << 17)
38090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP10_STR_NOTRDY_INT	(1 << 16)
38190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP10_STR_PRIME_INT		(1 << 15)
38290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP9_STR_ACCEPT_INT		(1 << 14)
38390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP9_STR_RESUME_INT		(1 << 13)
38490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP9_STR_REQ_INT		(1 << 12)
38590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP9_STR_NOTRDY_INT		(1 << 11)
38690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP9_STR_PRIME_INT		(1 << 10)
38790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP8_STR_ACCEPT_INT		(1 << 9)
38890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP8_STR_RESUME_INT		(1 << 8)
38990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP8_STR_REQ_INT		(1 << 7)
39090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP8_STR_NOTRDY_INT		(1 << 6)
39190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP8_STR_PRIME_INT		(1 << 5)
39290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP7_STR_ACCEPT_INT		(1 << 4)
39390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP7_STR_RESUME_INT		(1 << 3)
39490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP7_STR_REQ_INT		(1 << 2)
39590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP7_STR_NOTRDY_INT		(1 << 1)
39690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP7_STR_PRIME_INT		(1 << 0)
39790fccb52SAndrzej Pietrasiewicz 
39890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP_STR_ACCEPT_INT(n)	(1 << (5 * (n - 6) - 1))
39990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP_STR_RESUME_INT(n)	(1 << (5 * (n - 6) - 2))
40090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP_STR_REQ_INT(n)		(1 << (5 * (n - 6) - 3))
40190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP_STR_NOTRDY_INT(n)	(1 << (5 * (n - 6) - 4))
40290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR3_EP_STR_PRIME_INT(n)	(1 << (5 * (n - 6) - 5))
40390fccb52SAndrzej Pietrasiewicz 
40490fccb52SAndrzej Pietrasiewicz /*
40590fccb52SAndrzej Pietrasiewicz  * *Interrupt Group 4 Register (offset = 410H)
40690fccb52SAndrzej Pietrasiewicz  * */
40790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP15_RX0_INT		(1 << 31)
40890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP14_RX0_INT		(1 << 30)
40990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP13_RX0_INT		(1 << 29)
41090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP12_RX0_INT		(1 << 28)
41190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP11_RX0_INT		(1 << 27)
41290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP10_RX0_INT		(1 << 26)
41390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP9_RX0_INT		(1 << 25)
41490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP8_RX0_INT		(1 << 24)
41590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP7_RX0_INT		(1 << 23)
41690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP6_RX0_INT		(1 << 22)
41790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP5_RX0_INT		(1 << 21)
41890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP4_RX0_INT		(1 << 20)
41990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP3_RX0_INT		(1 << 19)
42090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP2_RX0_INT		(1 << 18)
42190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP1_RX0_INT		(1 << 17)
42290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP_RX0_INT(x)		(1 << (x + 16))
42390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP15_STR_ACCEPT_INT	(1 << 14)
42490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP15_STR_RESUME_INT	(1 << 13)
42590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP15_STR_REQ_INT		(1 << 12)
42690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP15_STR_NOTRDY_INT	(1 << 11)
42790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP15_STR_PRIME_INT		(1 << 10)
42890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP14_STR_ACCEPT_INT	(1 << 9)
42990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP14_STR_RESUME_INT	(1 << 8)
43090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP14_STR_REQ_INT		(1 << 7)
43190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP14_STR_NOTRDY_INT	(1 << 6)
43290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP14_STR_PRIME_INT		(1 << 5)
43390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP13_STR_ACCEPT_INT	(1 << 4)
43490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP13_STR_RESUME_INT	(1 << 3)
43590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP13_STR_REQ_INT		(1 << 2)
43690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP13_STR_NOTRDY_INT	(1 << 1)
43790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP13_STR_PRIME_INT		(1 << 0)
43890fccb52SAndrzej Pietrasiewicz 
43990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP_STR_ACCEPT_INT(n)	(1 << (5 * (n - 12) - 1))
44090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP_STR_RESUME_INT(n)	(1 << (5 * (n - 12) - 2))
44190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP_STR_REQ_INT(n)		(1 << (5 * (n - 12) - 3))
44290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP_STR_NOTRDY_INT(n)	(1 << (5 * (n - 12) - 4))
44390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR4_EP_STR_PRIME_INT(n)	(1 << (5 * (n - 12) - 5))
44490fccb52SAndrzej Pietrasiewicz 
44590fccb52SAndrzej Pietrasiewicz /*
44690fccb52SAndrzej Pietrasiewicz  * *Interrupt Group 5 Register (offset = 414H)
44790fccb52SAndrzej Pietrasiewicz  * */
44890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGR5_EP_STL_INT(n)	(1 << n)
44990fccb52SAndrzej Pietrasiewicz 
45090fccb52SAndrzej Pietrasiewicz /*
45190fccb52SAndrzej Pietrasiewicz  * *Interrupt Enable Group 0 Register (offset = 420H)
45290fccb52SAndrzej Pietrasiewicz  * */
45390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP15_PRD_INT	(1 << 31)
45490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP14_PRD_INT	(1 << 30)
45590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP13_PRD_INT	(1 << 29)
45690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP12_PRD_INT	(1 << 28)
45790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP11_PRD_INT	(1 << 27)
45890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP10_PRD_INT	(1 << 26)
45990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP9_PRD_INT	(1 << 25)
46090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EP8_PRD_INT	(1 << 24)
46190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP7_PRD_INT	(1 << 23)
46290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP6_PRD_INT	(1 << 22)
46390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP5_PRD_INT	(1 << 21)
46490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP4_PRD_INT	(1 << 20)
46590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP3_PRD_INT	(1 << 19)
46690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP2_PRD_INT	(1 << 18)
46790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP1_PRD_INT	(1 << 17)
46890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEPn_PRD_INT(n)	(1 << (n + 16))
46990fccb52SAndrzej Pietrasiewicz 
47090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP15_FIFO_INT	(1 << 15)
47190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP14_FIFO_INT	(1 << 14)
47290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP13_FIFO_INT	(1 << 13)
47390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP12_FIFO_INT	(1 << 12)
47490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP11_FIFO_INT	(1 << 11)
47590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP10_FIFO_INT	(1 << 10)
47690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP9_FIFO_INT	(1 << 9)
47790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP8_FIFO_INT	(1 << 8)
47890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP7_FIFO_INT	(1 << 7)
47990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP6_FIFO_INT	(1 << 6)
48090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP5_FIFO_INT	(1 << 5)
48190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP4_FIFO_INT	(1 << 4)
48290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP3_FIFO_INT	(1 << 3)
48390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP2_FIFO_INT	(1 << 2)
48490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEP1_FIFO_INT	(1 << 1)
48590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER0_EEPn_FIFO_INT(n)	(1 << n)
48690fccb52SAndrzej Pietrasiewicz 
48790fccb52SAndrzej Pietrasiewicz /*
48890fccb52SAndrzej Pietrasiewicz  * *Interrupt Enable Group 1 Register (offset = 424H)
48990fccb52SAndrzej Pietrasiewicz  * */
49090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_EINT_GRP5		(1 << 31)
49190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_VBUS_CHG_INT	(1 << 30)
49290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_SYNF1_EMPTY_INT	(1 << 29)
49390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_SYNF0_EMPTY_INT	(1 << 28)
49490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U3_EXIT_FAIL_INT	(1 << 27)
49590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U2_EXIT_FAIL_INT	(1 << 26)
49690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U1_EXIT_FAIL_INT	(1 << 25)
49790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U2_ENTRY_FAIL_INT	(1 << 24)
49890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U1_ENTRY_FAIL_INT	(1 << 23)
49990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U3_EXIT_INT	(1 << 22)
50090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U2_EXIT_INT	(1 << 21)
50190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U1_EXIT_INT	(1 << 20)
50290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U3_ENTRY_INT	(1 << 19)
50390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U2_ENTRY_INT	(1 << 18)
50490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_U1_ENTRY_INT	(1 << 17)
50590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_HOT_RST_INT	(1 << 16)
50690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_WARM_RST_INT	(1 << 15)
50790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_RESM_INT		(1 << 14)
50890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_SUSP_INT		(1 << 13)
50990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_LPM_INT		(1 << 12)
51090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_HS_RST_INT	(1 << 11)
51190fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_EDEV_MODE_CHG_INT	(1 << 9)
51290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_CX_COMABT_INT	(1 << 8)
51390fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_CX_COMFAIL_INT	(1 << 7)
51490fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_CX_CMDEND_INT	(1 << 6)
51590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_CX_OUT_INT	(1 << 5)
51690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_CX_IN_INT		(1 << 4)
51790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_CX_SETUP_INT	(1 << 3)
51890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_INTGRP4		(1 << 2)
51990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_INTGRP3		(1 << 1)
52090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER1_INTGRP2		(1 << 0)
52190fccb52SAndrzej Pietrasiewicz 
52290fccb52SAndrzej Pietrasiewicz /*
52390fccb52SAndrzej Pietrasiewicz  * *Interrupt Enable Group 2 Register (offset = 428H)
52490fccb52SAndrzej Pietrasiewicz  * */
52590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER2_EEP_STR_ACCEPT_INT(n)	(1 << (5 * n - 1))
52690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER2_EEP_STR_RESUME_INT(n)	(1 << (5 * n - 2))
52790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER2_EEP_STR_REQ_INT(n)	(1 << (5 * n - 3))
52890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER2_EEP_STR_NOTRDY_INT(n)	(1 << (5 * n - 4))
52990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER2_EEP_STR_PRIME_INT(n)	(1 << (5 * n - 5))
53090fccb52SAndrzej Pietrasiewicz 
53190fccb52SAndrzej Pietrasiewicz /*
53290fccb52SAndrzej Pietrasiewicz  * *Interrupt Enable Group 3 Register (offset = 42CH)
53390fccb52SAndrzej Pietrasiewicz  * */
53490fccb52SAndrzej Pietrasiewicz 
53590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER3_EEP_STR_ACCEPT_INT(n)	(1 << (5 * (n - 6) - 1))
53690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER3_EEP_STR_RESUME_INT(n)	(1 << (5 * (n - 6) - 2))
53790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER3_EEP_STR_REQ_INT(n)	(1 << (5 * (n - 6) - 3))
53890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER3_EEP_STR_NOTRDY_INT(n)	(1 << (5 * (n - 6) - 4))
53990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER3_EEP_STR_PRIME_INT(n)	(1 << (5 * (n - 6) - 5))
54090fccb52SAndrzej Pietrasiewicz 
54190fccb52SAndrzej Pietrasiewicz /*
54290fccb52SAndrzej Pietrasiewicz  * *Interrupt Enable Group 4 Register (offset = 430H)
54390fccb52SAndrzej Pietrasiewicz  * */
54490fccb52SAndrzej Pietrasiewicz 
54590fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER4_EEP_RX0_INT(n)		(1 << (n + 16))
54690fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER4_EEP_STR_ACCEPT_INT(n)	(1 << (5 * (n - 6) - 1))
54790fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER4_EEP_STR_RESUME_INT(n)	(1 << (5 * (n - 6) - 2))
54890fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER4_EEP_STR_REQ_INT(n)	(1 << (5 * (n - 6) - 3))
54990fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER4_EEP_STR_NOTRDY_INT(n)	(1 << (5 * (n - 6) - 4))
55090fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER4_EEP_STR_PRIME_INT(n)	(1 << (5 * (n - 6) - 5))
55190fccb52SAndrzej Pietrasiewicz 
55290fccb52SAndrzej Pietrasiewicz /* EP PRD Ready (EP_PRD_RDY, offset = 504H) */
55390fccb52SAndrzej Pietrasiewicz 
55490fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP15_PRD_RDY		(1 << 15)
55590fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP14_PRD_RDY		(1 << 14)
55690fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP13_PRD_RDY		(1 << 13)
55790fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP12_PRD_RDY		(1 << 12)
55890fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP11_PRD_RDY		(1 << 11)
55990fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP10_PRD_RDY		(1 << 10)
56090fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP9_PRD_RDY		(1 << 9)
56190fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP8_PRD_RDY		(1 << 8)
56290fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP7_PRD_RDY		(1 << 7)
56390fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP6_PRD_RDY		(1 << 6)
56490fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP5_PRD_RDY		(1 << 5)
56590fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP4_PRD_RDY		(1 << 4)
56690fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP3_PRD_RDY		(1 << 3)
56790fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP2_PRD_RDY		(1 << 2)
56890fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP1_PRD_RDY		(1 << 1)
56990fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRDR_EP_PRD_RDY(n)		(1 << n)
57090fccb52SAndrzej Pietrasiewicz 
57190fccb52SAndrzej Pietrasiewicz /* AHB Bus Control Register (offset = 514H) */
57290fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S1_SPLIT_ON		(1 << 17)
57390fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S0_SPLIT_ON		(1 << 16)
57490fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S1_1entry		(0 << 12)
57590fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S1_4entry		(3 << 12)
57690fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S1_8entry		(5 << 12)
57790fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S1_16entry		(7 << 12)
57890fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S0_1entry		(0 << 8)
57990fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S0_4entry		(3 << 8)
58090fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S0_8entry		(5 << 8)
58190fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_S0_16entry		(7 << 8)
58290fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M1_BURST_SINGLE		(0 << 4)
58390fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M1_BURST_INCR		(1 << 4)
58490fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M1_BURST_INCR4		(3 << 4)
58590fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M1_BURST_INCR8		(5 << 4)
58690fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M1_BURST_INCR16		(7 << 4)
58790fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M0_BURST_SINGLE		0
58890fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M0_BURST_INCR		1
58990fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M0_BURST_INCR4		3
59090fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M0_BURST_INCR8		5
59190fccb52SAndrzej Pietrasiewicz #define FUSB300_AHBBCR_M0_BURST_INCR16		7
59290fccb52SAndrzej Pietrasiewicz #define FUSB300_IGER5_EEP_STL_INT(n)		(1 << n)
59390fccb52SAndrzej Pietrasiewicz 
59490fccb52SAndrzej Pietrasiewicz /* WORD 0 Data Structure of PRD Table */
59590fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_M			(1 << 30)
59690fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_O			(1 << 29)
59790fccb52SAndrzej Pietrasiewicz /* The finished prd */
59890fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_F			(1 << 28)
59990fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_I			(1 << 27)
60090fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_A			(1 << 26)
60190fccb52SAndrzej Pietrasiewicz /* To decide HW point to first prd at next time */
60290fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_L			(1 << 25)
60390fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_H			(1 << 24)
60490fccb52SAndrzej Pietrasiewicz #define FUSB300_EPPRD0_BTC(n)			(n & 0xFFFFFF)
60590fccb52SAndrzej Pietrasiewicz 
60690fccb52SAndrzej Pietrasiewicz /*----------------------------------------------------------------------*/
60790fccb52SAndrzej Pietrasiewicz #define FUSB300_MAX_NUM_EP		16
60890fccb52SAndrzej Pietrasiewicz 
60990fccb52SAndrzej Pietrasiewicz #define FUSB300_FIFO_ENTRY_NUM		8
61090fccb52SAndrzej Pietrasiewicz #define FUSB300_MAX_FIFO_ENTRY		8
61190fccb52SAndrzej Pietrasiewicz 
61290fccb52SAndrzej Pietrasiewicz #define SS_CTL_MAX_PACKET_SIZE		0x200
61390fccb52SAndrzej Pietrasiewicz #define SS_BULK_MAX_PACKET_SIZE		0x400
61490fccb52SAndrzej Pietrasiewicz #define SS_INT_MAX_PACKET_SIZE		0x400
61590fccb52SAndrzej Pietrasiewicz #define SS_ISO_MAX_PACKET_SIZE		0x400
61690fccb52SAndrzej Pietrasiewicz 
61790fccb52SAndrzej Pietrasiewicz #define HS_BULK_MAX_PACKET_SIZE		0x200
61890fccb52SAndrzej Pietrasiewicz #define HS_CTL_MAX_PACKET_SIZE		0x40
61990fccb52SAndrzej Pietrasiewicz #define HS_INT_MAX_PACKET_SIZE		0x400
62090fccb52SAndrzej Pietrasiewicz #define HS_ISO_MAX_PACKET_SIZE		0x400
62190fccb52SAndrzej Pietrasiewicz 
62290fccb52SAndrzej Pietrasiewicz struct fusb300_ep_info {
62390fccb52SAndrzej Pietrasiewicz 	u8	epnum;
62490fccb52SAndrzej Pietrasiewicz 	u8	type;
62590fccb52SAndrzej Pietrasiewicz 	u8	interval;
62690fccb52SAndrzej Pietrasiewicz 	u8	dir_in;
62790fccb52SAndrzej Pietrasiewicz 	u16	maxpacket;
62890fccb52SAndrzej Pietrasiewicz 	u16	addrofs;
62990fccb52SAndrzej Pietrasiewicz 	u16	bw_num;
63090fccb52SAndrzej Pietrasiewicz };
63190fccb52SAndrzej Pietrasiewicz 
63290fccb52SAndrzej Pietrasiewicz struct fusb300_request {
63390fccb52SAndrzej Pietrasiewicz 
63490fccb52SAndrzej Pietrasiewicz 	struct usb_request	req;
63590fccb52SAndrzej Pietrasiewicz 	struct list_head	queue;
63690fccb52SAndrzej Pietrasiewicz };
63790fccb52SAndrzej Pietrasiewicz 
63890fccb52SAndrzej Pietrasiewicz 
63990fccb52SAndrzej Pietrasiewicz struct fusb300_ep {
64090fccb52SAndrzej Pietrasiewicz 	struct usb_ep		ep;
64190fccb52SAndrzej Pietrasiewicz 	struct fusb300		*fusb300;
64290fccb52SAndrzej Pietrasiewicz 
64390fccb52SAndrzej Pietrasiewicz 	struct list_head	queue;
64490fccb52SAndrzej Pietrasiewicz 	unsigned		stall:1;
64590fccb52SAndrzej Pietrasiewicz 	unsigned		wedged:1;
64690fccb52SAndrzej Pietrasiewicz 	unsigned		use_dma:1;
64790fccb52SAndrzej Pietrasiewicz 
64890fccb52SAndrzej Pietrasiewicz 	unsigned char		epnum;
64990fccb52SAndrzej Pietrasiewicz 	unsigned char		type;
65090fccb52SAndrzej Pietrasiewicz };
65190fccb52SAndrzej Pietrasiewicz 
65290fccb52SAndrzej Pietrasiewicz struct fusb300 {
65390fccb52SAndrzej Pietrasiewicz 	spinlock_t		lock;
65490fccb52SAndrzej Pietrasiewicz 	void __iomem		*reg;
65590fccb52SAndrzej Pietrasiewicz 
65690fccb52SAndrzej Pietrasiewicz 	unsigned long		irq_trigger;
65790fccb52SAndrzej Pietrasiewicz 
65890fccb52SAndrzej Pietrasiewicz 	struct usb_gadget		gadget;
65990fccb52SAndrzej Pietrasiewicz 	struct usb_gadget_driver	*driver;
66090fccb52SAndrzej Pietrasiewicz 
66190fccb52SAndrzej Pietrasiewicz 	struct fusb300_ep	*ep[FUSB300_MAX_NUM_EP];
66290fccb52SAndrzej Pietrasiewicz 
66390fccb52SAndrzej Pietrasiewicz 	struct usb_request	*ep0_req;	/* for internal request */
66490fccb52SAndrzej Pietrasiewicz 	__le16			ep0_data;
66590fccb52SAndrzej Pietrasiewicz 	u32			ep0_length;	/* for internal request */
66690fccb52SAndrzej Pietrasiewicz 	u8			ep0_dir;	/* 0/0x80  out/in */
66790fccb52SAndrzej Pietrasiewicz 
66890fccb52SAndrzej Pietrasiewicz 	u8			fifo_entry_num;	/* next start fifo entry */
66990fccb52SAndrzej Pietrasiewicz 	u32			addrofs;	/* next fifo address offset */
67090fccb52SAndrzej Pietrasiewicz 	u8			reenum;		/* if re-enumeration */
67190fccb52SAndrzej Pietrasiewicz };
67290fccb52SAndrzej Pietrasiewicz 
67390fccb52SAndrzej Pietrasiewicz #define to_fusb300(g)		(container_of((g), struct fusb300, gadget))
67490fccb52SAndrzej Pietrasiewicz 
67590fccb52SAndrzej Pietrasiewicz #endif
676