2 * da8xx-usb.h -- TI's DA8xx platform specific usb wrapper definitions.
4 * Author: Ajay Kumar Gupta <ajay.gupta@ti.com>
6 * Based on drivers/usb/musb/davinci.h
8 * Copyright (C) 2009 Texas Instruments Incorporated
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef __DA8XX_MUSB_H__
25 #define __DA8XX_MUSB_H__
27 #include <asm/arch/hardware.h>
28 #include <asm/arch/gpio.h>
30 /* Base address of da8xx usb0 wrapper */
31 #define DA8XX_USB_OTG_BASE 0x01E00000
33 /* Base address of da8xx musb core */
34 #define DA8XX_USB_OTG_CORE_BASE (DA8XX_USB_OTG_BASE + 0x400)
36 /* Timeout for DA8xx usb module */
37 #define DA8XX_USB_OTG_TIMEOUT 0x3FFFFFF
40 * DA8xx platform USB wrapper register overlay.
42 struct da8xx_usb_regs {
60 dv_reg grndis_size[4];
63 #define da8xx_usb_regs ((struct da8xx_usb_regs *)DA8XX_USB_OTG_BASE)
65 /* DA8XX interrupt bits definitions */
66 #define DA8XX_USB_TX_ENDPTS_MASK 0x1f /* ep0 + 4 tx */
67 #define DA8XX_USB_RX_ENDPTS_MASK 0x1e /* 4 rx */
68 #define DA8XX_USB_TXINT_SHIFT 0
69 #define DA8XX_USB_RXINT_SHIFT 8
71 #define DA8XX_USB_USBINT_MASK 0x01ff0000 /* 8 Mentor, DRVVBUS */
72 #define DA8XX_USB_TXINT_MASK \
73 (DA8XX_USB_TX_ENDPTS_MASK << DA8XX_USB_TXINT_SHIFT)
74 #define DA8XX_USB_RXINT_MASK \
75 (DA8XX_USB_RX_ENDPTS_MASK << DA8XX_USB_RXINT_SHIFT)
77 /* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */
78 #define CFGCHIP2_PHYCLKGD (1 << 17)
79 #define CFGCHIP2_VBUSSENSE (1 << 16)
80 #define CFGCHIP2_RESET (1 << 15)
81 #define CFGCHIP2_OTGMODE (3 << 13)
82 #define CFGCHIP2_NO_OVERRIDE (0 << 13)
83 #define CFGCHIP2_FORCE_HOST (1 << 13)
84 #define CFGCHIP2_FORCE_DEVICE (2 << 13)
85 #define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13)
86 #define CFGCHIP2_USB1PHYCLKMUX (1 << 12)
87 #define CFGCHIP2_USB2PHYCLKMUX (1 << 11)
88 #define CFGCHIP2_PHYPWRDN (1 << 10)
89 #define CFGCHIP2_OTGPWRDN (1 << 9)
90 #define CFGCHIP2_DATPOL (1 << 8)
91 #define CFGCHIP2_USB1SUSPENDM (1 << 7)
92 #define CFGCHIP2_PHY_PLLON (1 << 6) /* override PLL suspend */
93 #define CFGCHIP2_SESENDEN (1 << 5) /* Vsess_end comparator */
94 #define CFGCHIP2_VBDTCTEN (1 << 4) /* Vbus comparator */
95 #define CFGCHIP2_REFFREQ (0xf << 0)
96 #define CFGCHIP2_REFFREQ_12MHZ (1 << 0)
97 #define CFGCHIP2_REFFREQ_24MHZ (2 << 0)
98 #define CFGCHIP2_REFFREQ_48MHZ (3 << 0)
100 #define DA8XX_USB_VBUS_GPIO (1 << 15)
102 int usb_phy_on(void);
103 void usb_phy_off(void);
105 #endif /* __DA8XX_MUSB_H__ */