xref: /linux/drivers/usb/musb/tusb6010.h (revision 550a7375fe720924241f0eb76e4a5c1a3eb8c32f)
1*550a7375SFelipe Balbi /*
2*550a7375SFelipe Balbi  * Definitions for TUSB6010 USB 2.0 OTG Dual Role controller
3*550a7375SFelipe Balbi  *
4*550a7375SFelipe Balbi  * Copyright (C) 2006 Nokia Corporation
5*550a7375SFelipe Balbi  * Jarkko Nikula <jarkko.nikula@nokia.com>
6*550a7375SFelipe Balbi  * Tony Lindgren <tony@atomide.com>
7*550a7375SFelipe Balbi  *
8*550a7375SFelipe Balbi  * This program is free software; you can redistribute it and/or modify
9*550a7375SFelipe Balbi  * it under the terms of the GNU General Public License version 2 as
10*550a7375SFelipe Balbi  * published by the Free Software Foundation.
11*550a7375SFelipe Balbi  */
12*550a7375SFelipe Balbi 
13*550a7375SFelipe Balbi #ifndef __TUSB6010_H__
14*550a7375SFelipe Balbi #define __TUSB6010_H__
15*550a7375SFelipe Balbi 
16*550a7375SFelipe Balbi extern u8 tusb_get_revision(struct musb *musb);
17*550a7375SFelipe Balbi 
18*550a7375SFelipe Balbi #ifdef CONFIG_USB_TUSB6010
19*550a7375SFelipe Balbi #define musb_in_tusb()			1
20*550a7375SFelipe Balbi #else
21*550a7375SFelipe Balbi #define musb_in_tusb()			0
22*550a7375SFelipe Balbi #endif
23*550a7375SFelipe Balbi 
24*550a7375SFelipe Balbi #ifdef CONFIG_USB_TUSB_OMAP_DMA
25*550a7375SFelipe Balbi #define tusb_dma_omap()			1
26*550a7375SFelipe Balbi #else
27*550a7375SFelipe Balbi #define tusb_dma_omap()			0
28*550a7375SFelipe Balbi #endif
29*550a7375SFelipe Balbi 
30*550a7375SFelipe Balbi /* VLYNQ control register. 32-bit at offset 0x000 */
31*550a7375SFelipe Balbi #define TUSB_VLYNQ_CTRL			0x004
32*550a7375SFelipe Balbi 
33*550a7375SFelipe Balbi /* Mentor Graphics OTG core registers. 8,- 16- and 32-bit at offset 0x400 */
34*550a7375SFelipe Balbi #define TUSB_BASE_OFFSET		0x400
35*550a7375SFelipe Balbi 
36*550a7375SFelipe Balbi /* FIFO registers 32-bit at offset 0x600 */
37*550a7375SFelipe Balbi #define TUSB_FIFO_BASE			0x600
38*550a7375SFelipe Balbi 
39*550a7375SFelipe Balbi /* Device System & Control registers. 32-bit at offset 0x800 */
40*550a7375SFelipe Balbi #define TUSB_SYS_REG_BASE		0x800
41*550a7375SFelipe Balbi 
42*550a7375SFelipe Balbi #define TUSB_DEV_CONF			(TUSB_SYS_REG_BASE + 0x000)
43*550a7375SFelipe Balbi #define		TUSB_DEV_CONF_USB_HOST_MODE		(1 << 16)
44*550a7375SFelipe Balbi #define		TUSB_DEV_CONF_PROD_TEST_MODE		(1 << 15)
45*550a7375SFelipe Balbi #define		TUSB_DEV_CONF_SOFT_ID			(1 << 1)
46*550a7375SFelipe Balbi #define		TUSB_DEV_CONF_ID_SEL			(1 << 0)
47*550a7375SFelipe Balbi 
48*550a7375SFelipe Balbi #define TUSB_PHY_OTG_CTRL_ENABLE	(TUSB_SYS_REG_BASE + 0x004)
49*550a7375SFelipe Balbi #define TUSB_PHY_OTG_CTRL		(TUSB_SYS_REG_BASE + 0x008)
50*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_WRPROTECT		(0xa5 << 24)
51*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_OTG_ID_PULLUP		(1 << 23)
52*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_OTG_VBUS_DET_EN	(1 << 19)
53*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_OTG_SESS_END_EN	(1 << 18)
54*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_TESTM2		(1 << 17)
55*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_TESTM1		(1 << 16)
56*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_TESTM0		(1 << 15)
57*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_TX_DATA2		(1 << 14)
58*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_TX_GZ2		(1 << 13)
59*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_TX_ENABLE2		(1 << 12)
60*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_DM_PULLDOWN		(1 << 11)
61*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_DP_PULLDOWN		(1 << 10)
62*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_OSC_EN		(1 << 9)
63*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_PHYREF_CLKSEL(v)	(((v) & 3) << 7)
64*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_PD			(1 << 6)
65*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_PLL_ON		(1 << 5)
66*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_EXT_RPU		(1 << 4)
67*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_PWR_GOOD		(1 << 3)
68*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_RESET			(1 << 2)
69*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_SUSPENDM		(1 << 1)
70*550a7375SFelipe Balbi #define		TUSB_PHY_OTG_CTRL_CLK_MODE		(1 << 0)
71*550a7375SFelipe Balbi 
72*550a7375SFelipe Balbi /*OTG status register */
73*550a7375SFelipe Balbi #define TUSB_DEV_OTG_STAT		(TUSB_SYS_REG_BASE + 0x00c)
74*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_PWR_CLK_GOOD		(1 << 8)
75*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_SESS_END		(1 << 7)
76*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_SESS_VALID		(1 << 6)
77*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_VBUS_VALID		(1 << 5)
78*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_VBUS_SENSE		(1 << 4)
79*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_ID_STATUS		(1 << 3)
80*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_HOST_DISCON		(1 << 2)
81*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_LINE_STATE		(3 << 0)
82*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_DP_ENABLE		(1 << 1)
83*550a7375SFelipe Balbi #define		TUSB_DEV_OTG_STAT_DM_ENABLE		(1 << 0)
84*550a7375SFelipe Balbi 
85*550a7375SFelipe Balbi #define TUSB_DEV_OTG_TIMER		(TUSB_SYS_REG_BASE + 0x010)
86*550a7375SFelipe Balbi #	define TUSB_DEV_OTG_TIMER_ENABLE		(1 << 31)
87*550a7375SFelipe Balbi #	define TUSB_DEV_OTG_TIMER_VAL(v)		((v) & 0x07ffffff)
88*550a7375SFelipe Balbi #define TUSB_PRCM_REV			(TUSB_SYS_REG_BASE + 0x014)
89*550a7375SFelipe Balbi 
90*550a7375SFelipe Balbi /* PRCM configuration register */
91*550a7375SFelipe Balbi #define TUSB_PRCM_CONF			(TUSB_SYS_REG_BASE + 0x018)
92*550a7375SFelipe Balbi #define		TUSB_PRCM_CONF_SFW_CPEN		(1 << 24)
93*550a7375SFelipe Balbi #define		TUSB_PRCM_CONF_SYS_CLKSEL(v)	(((v) & 3) << 16)
94*550a7375SFelipe Balbi 
95*550a7375SFelipe Balbi /* PRCM management register */
96*550a7375SFelipe Balbi #define TUSB_PRCM_MNGMT			(TUSB_SYS_REG_BASE + 0x01c)
97*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_SRP_FIX_TIMER(v)	(((v) & 0xf) << 25)
98*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_SRP_FIX_EN		(1 << 24)
99*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_VBUS_VALID_TIMER(v)	(((v) & 0xf) << 20)
100*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_VBUS_VALID_FLT_EN	(1 << 19)
101*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_DFT_CLK_DIS		(1 << 18)
102*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_VLYNQ_CLK_DIS		(1 << 17)
103*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_OTG_SESS_END_EN		(1 << 10)
104*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_OTG_VBUS_DET_EN		(1 << 9)
105*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_OTG_ID_PULLUP		(1 << 8)
106*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_15_SW_EN		(1 << 4)
107*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_33_SW_EN		(1 << 3)
108*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_5V_CPEN			(1 << 2)
109*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_PM_IDLE			(1 << 1)
110*550a7375SFelipe Balbi #define		TUSB_PRCM_MNGMT_DEV_IDLE		(1 << 0)
111*550a7375SFelipe Balbi 
112*550a7375SFelipe Balbi /* Wake-up source clear and mask registers */
113*550a7375SFelipe Balbi #define TUSB_PRCM_WAKEUP_SOURCE		(TUSB_SYS_REG_BASE + 0x020)
114*550a7375SFelipe Balbi #define TUSB_PRCM_WAKEUP_CLEAR		(TUSB_SYS_REG_BASE + 0x028)
115*550a7375SFelipe Balbi #define TUSB_PRCM_WAKEUP_MASK		(TUSB_SYS_REG_BASE + 0x02c)
116*550a7375SFelipe Balbi #define		TUSB_PRCM_WAKEUP_RESERVED_BITS	(0xffffe << 13)
117*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_7	(1 << 12)
118*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_6	(1 << 11)
119*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_5	(1 << 10)
120*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_4	(1 << 9)
121*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_3	(1 << 8)
122*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_2	(1 << 7)
123*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_1	(1 << 6)
124*550a7375SFelipe Balbi #define		TUSB_PRCM_WGPIO_0	(1 << 5)
125*550a7375SFelipe Balbi #define		TUSB_PRCM_WHOSTDISCON	(1 << 4)	/* Host disconnect */
126*550a7375SFelipe Balbi #define		TUSB_PRCM_WBUS		(1 << 3)	/* USB bus resume */
127*550a7375SFelipe Balbi #define		TUSB_PRCM_WNORCS	(1 << 2)	/* NOR chip select */
128*550a7375SFelipe Balbi #define		TUSB_PRCM_WVBUS		(1 << 1)	/* OTG PHY VBUS */
129*550a7375SFelipe Balbi #define		TUSB_PRCM_WID		(1 << 0)	/* OTG PHY ID detect */
130*550a7375SFelipe Balbi 
131*550a7375SFelipe Balbi #define TUSB_PULLUP_1_CTRL		(TUSB_SYS_REG_BASE + 0x030)
132*550a7375SFelipe Balbi #define TUSB_PULLUP_2_CTRL		(TUSB_SYS_REG_BASE + 0x034)
133*550a7375SFelipe Balbi #define TUSB_INT_CTRL_REV		(TUSB_SYS_REG_BASE + 0x038)
134*550a7375SFelipe Balbi #define TUSB_INT_CTRL_CONF		(TUSB_SYS_REG_BASE + 0x03c)
135*550a7375SFelipe Balbi #define TUSB_USBIP_INT_SRC		(TUSB_SYS_REG_BASE + 0x040)
136*550a7375SFelipe Balbi #define TUSB_USBIP_INT_SET		(TUSB_SYS_REG_BASE + 0x044)
137*550a7375SFelipe Balbi #define TUSB_USBIP_INT_CLEAR		(TUSB_SYS_REG_BASE + 0x048)
138*550a7375SFelipe Balbi #define TUSB_USBIP_INT_MASK		(TUSB_SYS_REG_BASE + 0x04c)
139*550a7375SFelipe Balbi #define TUSB_DMA_INT_SRC		(TUSB_SYS_REG_BASE + 0x050)
140*550a7375SFelipe Balbi #define TUSB_DMA_INT_SET		(TUSB_SYS_REG_BASE + 0x054)
141*550a7375SFelipe Balbi #define TUSB_DMA_INT_CLEAR		(TUSB_SYS_REG_BASE + 0x058)
142*550a7375SFelipe Balbi #define TUSB_DMA_INT_MASK		(TUSB_SYS_REG_BASE + 0x05c)
143*550a7375SFelipe Balbi #define TUSB_GPIO_INT_SRC		(TUSB_SYS_REG_BASE + 0x060)
144*550a7375SFelipe Balbi #define TUSB_GPIO_INT_SET		(TUSB_SYS_REG_BASE + 0x064)
145*550a7375SFelipe Balbi #define TUSB_GPIO_INT_CLEAR		(TUSB_SYS_REG_BASE + 0x068)
146*550a7375SFelipe Balbi #define TUSB_GPIO_INT_MASK		(TUSB_SYS_REG_BASE + 0x06c)
147*550a7375SFelipe Balbi 
148*550a7375SFelipe Balbi /* NOR flash interrupt source registers */
149*550a7375SFelipe Balbi #define TUSB_INT_SRC			(TUSB_SYS_REG_BASE + 0x070)
150*550a7375SFelipe Balbi #define TUSB_INT_SRC_SET		(TUSB_SYS_REG_BASE + 0x074)
151*550a7375SFelipe Balbi #define TUSB_INT_SRC_CLEAR		(TUSB_SYS_REG_BASE + 0x078)
152*550a7375SFelipe Balbi #define TUSB_INT_MASK			(TUSB_SYS_REG_BASE + 0x07c)
153*550a7375SFelipe Balbi #define		TUSB_INT_SRC_TXRX_DMA_DONE		(1 << 24)
154*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_CORE		(1 << 17)
155*550a7375SFelipe Balbi #define		TUSB_INT_SRC_OTG_TIMEOUT		(1 << 16)
156*550a7375SFelipe Balbi #define		TUSB_INT_SRC_VBUS_SENSE_CHNG		(1 << 15)
157*550a7375SFelipe Balbi #define		TUSB_INT_SRC_ID_STATUS_CHNG		(1 << 14)
158*550a7375SFelipe Balbi #define		TUSB_INT_SRC_DEV_WAKEUP			(1 << 13)
159*550a7375SFelipe Balbi #define		TUSB_INT_SRC_DEV_READY			(1 << 12)
160*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_TX			(1 << 9)
161*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_RX			(1 << 8)
162*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_VBUS_ERR		(1 << 7)
163*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_VBUS_REQ		(1 << 6)
164*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_DISCON		(1 << 5)
165*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_CONN		(1 << 4)
166*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_SOF			(1 << 3)
167*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_RST_BABBLE		(1 << 2)
168*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_RESUME		(1 << 1)
169*550a7375SFelipe Balbi #define		TUSB_INT_SRC_USB_IP_SUSPEND		(1 << 0)
170*550a7375SFelipe Balbi 
171*550a7375SFelipe Balbi /* NOR flash interrupt registers reserved bits. Must be written as 0 */
172*550a7375SFelipe Balbi #define		TUSB_INT_MASK_RESERVED_17		(0x3fff << 17)
173*550a7375SFelipe Balbi #define		TUSB_INT_MASK_RESERVED_13		(1 << 13)
174*550a7375SFelipe Balbi #define		TUSB_INT_MASK_RESERVED_8		(0xf << 8)
175*550a7375SFelipe Balbi #define		TUSB_INT_SRC_RESERVED_26		(0x1f << 26)
176*550a7375SFelipe Balbi #define		TUSB_INT_SRC_RESERVED_18		(0x3f << 18)
177*550a7375SFelipe Balbi #define		TUSB_INT_SRC_RESERVED_10		(0x03 << 10)
178*550a7375SFelipe Balbi 
179*550a7375SFelipe Balbi /* Reserved bits for NOR flash interrupt mask and clear register */
180*550a7375SFelipe Balbi #define		TUSB_INT_MASK_RESERVED_BITS	(TUSB_INT_MASK_RESERVED_17 | \
181*550a7375SFelipe Balbi 						TUSB_INT_MASK_RESERVED_13 | \
182*550a7375SFelipe Balbi 						TUSB_INT_MASK_RESERVED_8)
183*550a7375SFelipe Balbi 
184*550a7375SFelipe Balbi /* Reserved bits for NOR flash interrupt status register */
185*550a7375SFelipe Balbi #define		TUSB_INT_SRC_RESERVED_BITS	(TUSB_INT_SRC_RESERVED_26 | \
186*550a7375SFelipe Balbi 						TUSB_INT_SRC_RESERVED_18 | \
187*550a7375SFelipe Balbi 						TUSB_INT_SRC_RESERVED_10)
188*550a7375SFelipe Balbi 
189*550a7375SFelipe Balbi #define TUSB_GPIO_REV			(TUSB_SYS_REG_BASE + 0x080)
190*550a7375SFelipe Balbi #define TUSB_GPIO_CONF			(TUSB_SYS_REG_BASE + 0x084)
191*550a7375SFelipe Balbi #define TUSB_DMA_CTRL_REV		(TUSB_SYS_REG_BASE + 0x100)
192*550a7375SFelipe Balbi #define TUSB_DMA_REQ_CONF		(TUSB_SYS_REG_BASE + 0x104)
193*550a7375SFelipe Balbi #define TUSB_EP0_CONF			(TUSB_SYS_REG_BASE + 0x108)
194*550a7375SFelipe Balbi #define TUSB_DMA_EP_MAP			(TUSB_SYS_REG_BASE + 0x148)
195*550a7375SFelipe Balbi 
196*550a7375SFelipe Balbi /* Offsets from each ep base register */
197*550a7375SFelipe Balbi #define TUSB_EP_TX_OFFSET		0x10c	/* EP_IN in docs */
198*550a7375SFelipe Balbi #define TUSB_EP_RX_OFFSET		0x14c	/* EP_OUT in docs */
199*550a7375SFelipe Balbi #define TUSB_EP_MAX_PACKET_SIZE_OFFSET	0x188
200*550a7375SFelipe Balbi 
201*550a7375SFelipe Balbi #define TUSB_WAIT_COUNT			(TUSB_SYS_REG_BASE + 0x1c8)
202*550a7375SFelipe Balbi #define TUSB_SCRATCH_PAD		(TUSB_SYS_REG_BASE + 0x1c4)
203*550a7375SFelipe Balbi #define TUSB_PROD_TEST_RESET		(TUSB_SYS_REG_BASE + 0x1d8)
204*550a7375SFelipe Balbi 
205*550a7375SFelipe Balbi /* Device System & Control register bitfields */
206*550a7375SFelipe Balbi #define TUSB_INT_CTRL_CONF_INT_RELCYC(v)	(((v) & 0x7) << 18)
207*550a7375SFelipe Balbi #define TUSB_INT_CTRL_CONF_INT_POLARITY		(1 << 17)
208*550a7375SFelipe Balbi #define TUSB_INT_CTRL_CONF_INT_MODE		(1 << 16)
209*550a7375SFelipe Balbi #define TUSB_GPIO_CONF_DMAREQ(v)		(((v) & 0x3f) << 24)
210*550a7375SFelipe Balbi #define TUSB_DMA_REQ_CONF_BURST_SIZE(v)		(((v) & 3) << 26)
211*550a7375SFelipe Balbi #define TUSB_DMA_REQ_CONF_DMA_REQ_EN(v)		(((v) & 0x3f) << 20)
212*550a7375SFelipe Balbi #define TUSB_DMA_REQ_CONF_DMA_REQ_ASSER(v)	(((v) & 0xf) << 16)
213*550a7375SFelipe Balbi #define TUSB_EP0_CONFIG_SW_EN			(1 << 8)
214*550a7375SFelipe Balbi #define TUSB_EP0_CONFIG_DIR_TX			(1 << 7)
215*550a7375SFelipe Balbi #define TUSB_EP0_CONFIG_XFR_SIZE(v)		((v) & 0x7f)
216*550a7375SFelipe Balbi #define TUSB_EP_CONFIG_SW_EN			(1 << 31)
217*550a7375SFelipe Balbi #define TUSB_EP_CONFIG_XFR_SIZE(v)		((v) & 0x7fffffff)
218*550a7375SFelipe Balbi #define TUSB_PROD_TEST_RESET_VAL		0xa596
219*550a7375SFelipe Balbi #define TUSB_EP_FIFO(ep)			(TUSB_FIFO_BASE + (ep) * 0x20)
220*550a7375SFelipe Balbi 
221*550a7375SFelipe Balbi #define TUSB_DIDR1_LO				(TUSB_SYS_REG_BASE + 0x1f8)
222*550a7375SFelipe Balbi #define TUSB_DIDR1_HI				(TUSB_SYS_REG_BASE + 0x1fc)
223*550a7375SFelipe Balbi #define		TUSB_DIDR1_HI_CHIP_REV(v)		(((v) >> 17) & 0xf)
224*550a7375SFelipe Balbi #define			TUSB_DIDR1_HI_REV_20		0
225*550a7375SFelipe Balbi #define			TUSB_DIDR1_HI_REV_30		1
226*550a7375SFelipe Balbi #define			TUSB_DIDR1_HI_REV_31		2
227*550a7375SFelipe Balbi 
228*550a7375SFelipe Balbi #define TUSB_REV_10	0x10
229*550a7375SFelipe Balbi #define TUSB_REV_20	0x20
230*550a7375SFelipe Balbi #define TUSB_REV_30	0x30
231*550a7375SFelipe Balbi #define TUSB_REV_31	0x31
232*550a7375SFelipe Balbi 
233*550a7375SFelipe Balbi /*----------------------------------------------------------------------------*/
234*550a7375SFelipe Balbi 
235*550a7375SFelipe Balbi #ifdef CONFIG_USB_TUSB6010
236*550a7375SFelipe Balbi 
237*550a7375SFelipe Balbi /* configuration parameters specific to this silicon */
238*550a7375SFelipe Balbi 
239*550a7375SFelipe Balbi /* Number of Tx endpoints. Legal values are 1 - 16 (this value includes EP0) */
240*550a7375SFelipe Balbi #define MUSB_C_NUM_EPT 16
241*550a7375SFelipe Balbi 
242*550a7375SFelipe Balbi /* Number of Rx endpoints. Legal values are 1 - 16 (this value includes EP0) */
243*550a7375SFelipe Balbi #define MUSB_C_NUM_EPR 16
244*550a7375SFelipe Balbi 
245*550a7375SFelipe Balbi /* Endpoint 1 to 15 direction types. C_EP1_DEF is defined if either Tx endpoint
246*550a7375SFelipe Balbi  * 1 or Rx endpoint 1 are used.
247*550a7375SFelipe Balbi  */
248*550a7375SFelipe Balbi #define MUSB_C_EP1_DEF
249*550a7375SFelipe Balbi 
250*550a7375SFelipe Balbi /* C_EP1_TX_DEF is defined if Tx endpoint 1 is used */
251*550a7375SFelipe Balbi #define MUSB_C_EP1_TX_DEF
252*550a7375SFelipe Balbi 
253*550a7375SFelipe Balbi /* C_EP1_RX_DEF is defined if Rx endpoint 1 is used */
254*550a7375SFelipe Balbi #define MUSB_C_EP1_RX_DEF
255*550a7375SFelipe Balbi 
256*550a7375SFelipe Balbi /* C_EP1_TOR_DEF is defined if Tx endpoint 1 and Rx endpoint 1 share a FIFO */
257*550a7375SFelipe Balbi /* #define C_EP1_TOR_DEF */
258*550a7375SFelipe Balbi 
259*550a7375SFelipe Balbi /* C_EP1_TAR_DEF is defined if both Tx endpoint 1 and Rx endpoint 1 are used
260*550a7375SFelipe Balbi  * and do not share a FIFO.
261*550a7375SFelipe Balbi  */
262*550a7375SFelipe Balbi #define MUSB_C_EP1_TAR_DEF
263*550a7375SFelipe Balbi 
264*550a7375SFelipe Balbi /* Similarly for all other used endpoints */
265*550a7375SFelipe Balbi #define MUSB_C_EP2_DEF
266*550a7375SFelipe Balbi #define MUSB_C_EP2_TX_DEF
267*550a7375SFelipe Balbi #define MUSB_C_EP2_RX_DEF
268*550a7375SFelipe Balbi #define MUSB_C_EP2_TAR_DEF
269*550a7375SFelipe Balbi #define MUSB_C_EP3_DEF
270*550a7375SFelipe Balbi #define MUSB_C_EP3_TX_DEF
271*550a7375SFelipe Balbi #define MUSB_C_EP3_RX_DEF
272*550a7375SFelipe Balbi #define MUSB_C_EP3_TAR_DEF
273*550a7375SFelipe Balbi #define MUSB_C_EP4_DEF
274*550a7375SFelipe Balbi #define MUSB_C_EP4_TX_DEF
275*550a7375SFelipe Balbi #define MUSB_C_EP4_RX_DEF
276*550a7375SFelipe Balbi #define MUSB_C_EP4_TAR_DEF
277*550a7375SFelipe Balbi 
278*550a7375SFelipe Balbi /* Endpoint 1 to 15 FIFO address bits. Legal values are 3 to 13 - corresponding
279*550a7375SFelipe Balbi  * to FIFO sizes of 8 to 8192 bytes. If an Tx endpoint shares a FIFO with an Rx
280*550a7375SFelipe Balbi  * endpoint then the Rx FIFO size must be the same as the Tx FIFO size. All
281*550a7375SFelipe Balbi  * endpoints 1 to 15 must be defined, unused endpoints should be set to 2.
282*550a7375SFelipe Balbi  */
283*550a7375SFelipe Balbi #define MUSB_C_EP1T_BITS 5
284*550a7375SFelipe Balbi #define MUSB_C_EP1R_BITS 5
285*550a7375SFelipe Balbi #define MUSB_C_EP2T_BITS 5
286*550a7375SFelipe Balbi #define MUSB_C_EP2R_BITS 5
287*550a7375SFelipe Balbi #define MUSB_C_EP3T_BITS 3
288*550a7375SFelipe Balbi #define MUSB_C_EP3R_BITS 3
289*550a7375SFelipe Balbi #define MUSB_C_EP4T_BITS 3
290*550a7375SFelipe Balbi #define MUSB_C_EP4R_BITS 3
291*550a7375SFelipe Balbi 
292*550a7375SFelipe Balbi #define MUSB_C_EP5T_BITS 2
293*550a7375SFelipe Balbi #define MUSB_C_EP5R_BITS 2
294*550a7375SFelipe Balbi #define MUSB_C_EP6T_BITS 2
295*550a7375SFelipe Balbi #define MUSB_C_EP6R_BITS 2
296*550a7375SFelipe Balbi #define MUSB_C_EP7T_BITS 2
297*550a7375SFelipe Balbi #define MUSB_C_EP7R_BITS 2
298*550a7375SFelipe Balbi #define MUSB_C_EP8T_BITS 2
299*550a7375SFelipe Balbi #define MUSB_C_EP8R_BITS 2
300*550a7375SFelipe Balbi #define MUSB_C_EP9T_BITS 2
301*550a7375SFelipe Balbi #define MUSB_C_EP9R_BITS 2
302*550a7375SFelipe Balbi #define MUSB_C_EP10T_BITS 2
303*550a7375SFelipe Balbi #define MUSB_C_EP10R_BITS 2
304*550a7375SFelipe Balbi #define MUSB_C_EP11T_BITS 2
305*550a7375SFelipe Balbi #define MUSB_C_EP11R_BITS 2
306*550a7375SFelipe Balbi #define MUSB_C_EP12T_BITS 2
307*550a7375SFelipe Balbi #define MUSB_C_EP12R_BITS 2
308*550a7375SFelipe Balbi #define MUSB_C_EP13T_BITS 2
309*550a7375SFelipe Balbi #define MUSB_C_EP13R_BITS 2
310*550a7375SFelipe Balbi #define MUSB_C_EP14T_BITS 2
311*550a7375SFelipe Balbi #define MUSB_C_EP14R_BITS 2
312*550a7375SFelipe Balbi #define MUSB_C_EP15T_BITS 2
313*550a7375SFelipe Balbi #define MUSB_C_EP15R_BITS 2
314*550a7375SFelipe Balbi 
315*550a7375SFelipe Balbi /* Define the following constant if the USB2.0 Transceiver Macrocell data width
316*550a7375SFelipe Balbi  * is 16-bits.
317*550a7375SFelipe Balbi  */
318*550a7375SFelipe Balbi /* #define C_UTM_16 */
319*550a7375SFelipe Balbi 
320*550a7375SFelipe Balbi /* Define this constant if the CPU uses big-endian byte ordering. */
321*550a7375SFelipe Balbi /* #define C_BIGEND */
322*550a7375SFelipe Balbi 
323*550a7375SFelipe Balbi /* Define the following constant if any Tx endpoint is required to support
324*550a7375SFelipe Balbi  * multiple bulk packets.
325*550a7375SFelipe Balbi  */
326*550a7375SFelipe Balbi /* #define C_MP_TX */
327*550a7375SFelipe Balbi 
328*550a7375SFelipe Balbi /* Define the following constant if any Rx endpoint is required to support
329*550a7375SFelipe Balbi  * multiple bulk packets.
330*550a7375SFelipe Balbi  */
331*550a7375SFelipe Balbi /* #define C_MP_RX */
332*550a7375SFelipe Balbi 
333*550a7375SFelipe Balbi /* Define the following constant if any Tx endpoint is required to support high
334*550a7375SFelipe Balbi  * bandwidth ISO.
335*550a7375SFelipe Balbi  */
336*550a7375SFelipe Balbi /* #define C_HB_TX */
337*550a7375SFelipe Balbi 
338*550a7375SFelipe Balbi /* Define the following constant if any Rx endpoint is required to support high
339*550a7375SFelipe Balbi  * bandwidth ISO.
340*550a7375SFelipe Balbi  */
341*550a7375SFelipe Balbi /* #define C_HB_RX */
342*550a7375SFelipe Balbi 
343*550a7375SFelipe Balbi /* Define the following constant if software connect/disconnect control is
344*550a7375SFelipe Balbi  * required.
345*550a7375SFelipe Balbi  */
346*550a7375SFelipe Balbi #define MUSB_C_SOFT_CON
347*550a7375SFelipe Balbi 
348*550a7375SFelipe Balbi /* Define the following constant if Vendor Control Registers are required. */
349*550a7375SFelipe Balbi /* #define C_VEND_REG */
350*550a7375SFelipe Balbi 
351*550a7375SFelipe Balbi /* Vendor control register widths. */
352*550a7375SFelipe Balbi #define MUSB_C_VCTL_BITS 4
353*550a7375SFelipe Balbi #define MUSB_C_VSTAT_BITS 8
354*550a7375SFelipe Balbi 
355*550a7375SFelipe Balbi /* Define the following constant to include a DMA controller. */
356*550a7375SFelipe Balbi /* #define C_DMA */
357*550a7375SFelipe Balbi 
358*550a7375SFelipe Balbi /* Define the following constant if 2 or more DMA channels are required. */
359*550a7375SFelipe Balbi /* #define C_DMA2 */
360*550a7375SFelipe Balbi 
361*550a7375SFelipe Balbi /* Define the following constant if 3 or more DMA channels are required. */
362*550a7375SFelipe Balbi /* #define C_DMA3 */
363*550a7375SFelipe Balbi 
364*550a7375SFelipe Balbi /* Define the following constant if 4 or more DMA channels are required. */
365*550a7375SFelipe Balbi /* #define C_DMA4 */
366*550a7375SFelipe Balbi 
367*550a7375SFelipe Balbi /* Define the following constant if 5 or more DMA channels are required. */
368*550a7375SFelipe Balbi /* #define C_DMA5 */
369*550a7375SFelipe Balbi 
370*550a7375SFelipe Balbi /* Define the following constant if 6 or more DMA channels are required. */
371*550a7375SFelipe Balbi /* #define C_DMA6 */
372*550a7375SFelipe Balbi 
373*550a7375SFelipe Balbi /* Define the following constant if 7 or more DMA channels are required. */
374*550a7375SFelipe Balbi /* #define C_DMA7 */
375*550a7375SFelipe Balbi 
376*550a7375SFelipe Balbi /* Define the following constant if 8 or more DMA channels are required. */
377*550a7375SFelipe Balbi /* #define C_DMA8 */
378*550a7375SFelipe Balbi 
379*550a7375SFelipe Balbi /* Enable Dynamic FIFO Sizing */
380*550a7375SFelipe Balbi #define MUSB_C_DYNFIFO_DEF
381*550a7375SFelipe Balbi 
382*550a7375SFelipe Balbi /* Derived constants. The following constants are derived from the previous
383*550a7375SFelipe Balbi  * configuration constants
384*550a7375SFelipe Balbi  */
385*550a7375SFelipe Balbi 
386*550a7375SFelipe Balbi /* Total number of endpoints. Legal values are 2 - 16. This must be equal to
387*550a7375SFelipe Balbi  * the larger of C_NUM_EPT, C_NUM_EPR
388*550a7375SFelipe Balbi  */
389*550a7375SFelipe Balbi /* #define MUSB_C_NUM_EPS 5 */
390*550a7375SFelipe Balbi 
391*550a7375SFelipe Balbi /* C_EPMAX_BITS is equal to the largest endpoint FIFO word address bits */
392*550a7375SFelipe Balbi #define MUSB_C_EPMAX_BITS 11
393*550a7375SFelipe Balbi 
394*550a7375SFelipe Balbi /* C_RAM_BITS is the number of address bits required to address the RAM (32-bit
395*550a7375SFelipe Balbi  * addresses).  It is defined as log2 of the sum of 2** of all the endpoint FIFO
396*550a7375SFelipe Balbi  * dword address bits (rounded up).
397*550a7375SFelipe Balbi  */
398*550a7375SFelipe Balbi #define MUSB_C_RAM_BITS 12
399*550a7375SFelipe Balbi 
400*550a7375SFelipe Balbi #endif /* CONFIG_USB_TUSB6010 */
401*550a7375SFelipe Balbi 
402*550a7375SFelipe Balbi #endif /* __TUSB6010_H__ */
403