xref: /openbmc/u-boot/drivers/usb/musb/am35x.h (revision c2cde27d)
1 /*
2  * am35x.h - TI's AM35x platform specific usb wrapper definitions.
3  *
4  * Author: Ajay Kumar Gupta <ajay.gupta@ti.com>
5  *
6  * Based on drivers/usb/musb/da8xx.h
7  *
8  * Copyright (c) 2010 Texas Instruments Incorporated
9  *
10  * SPDX-License-Identifier:	GPL-2.0+
11  */
12 
13 #ifndef __AM35X_USB_H__
14 #define __AM35X_USB_H__
15 
16 #include <asm/arch/am35x_def.h>
17 #include "musb_core.h"
18 
19 /* Base address of musb wrapper */
20 #define AM35X_USB_OTG_BASE	0x5C040000
21 
22 /* Base address of musb core */
23 #define AM35X_USB_OTG_CORE_BASE	(AM35X_USB_OTG_BASE + 0x400)
24 
25 /* Timeout for AM35x usb module */
26 #define AM35X_USB_OTG_TIMEOUT	0x3FFFFFF
27 
28 /*
29  * AM35x platform USB wrapper register overlay.
30  */
31 struct am35x_usb_regs {
32 	u32	revision;
33 	u32	control;
34 	u32	status;
35 	u32	emulation;
36 	u32	reserved0[1];
37 	u32	autoreq;
38 	u32	srpfixtime;
39 	u32	ep_intsrc;
40 	u32	ep_intsrcset;
41 	u32	ep_intsrcclr;
42 	u32	ep_intmsk;
43 	u32	ep_intmskset;
44 	u32	ep_intmskclr;
45 	u32	ep_intsrcmsked;
46 	u32	reserved1[1];
47 	u32	core_intsrc;
48 	u32	core_intsrcset;
49 	u32	core_intsrcclr;
50 	u32	core_intmsk;
51 	u32	core_intmskset;
52 	u32	core_intmskclr;
53 	u32	core_intsrcmsked;
54 	u32	reserved2[1];
55 	u32	eoi;
56 	u32	mop_sop_en;
57 	u32	reserved3[2];
58 	u32	txmode;
59 	u32	rxmode;
60 	u32	epcount_mode;
61 };
62 
63 #define am35x_usb_regs ((struct am35x_usb_regs *)AM35X_USB_OTG_BASE)
64 
65 /* USB 2.0 PHY Control */
66 #define DEVCONF2_PHY_GPIOMODE	(1 << 23)
67 #define DEVCONF2_OTGMODE	(3 << 14)
68 #define DEVCONF2_SESENDEN	(1 << 13)       /* Vsess_end comparator */
69 #define DEVCONF2_VBDTCTEN	(1 << 12)       /* Vbus comparator */
70 #define DEVCONF2_REFFREQ_24MHZ	(2 << 8)
71 #define DEVCONF2_REFFREQ_26MHZ	(7 << 8)
72 #define DEVCONF2_REFFREQ_13MHZ	(6 << 8)
73 #define DEVCONF2_REFFREQ	(0xf << 8)
74 #define DEVCONF2_PHYCKGD	(1 << 7)
75 #define DEVCONF2_VBUSSENSE	(1 << 6)
76 #define DEVCONF2_PHY_PLLON	(1 << 5)        /* override PLL suspend */
77 #define DEVCONF2_RESET		(1 << 4)
78 #define DEVCONF2_PHYPWRDN	(1 << 3)
79 #define DEVCONF2_OTGPWRDN	(1 << 2)
80 #define DEVCONF2_DATPOL		(1 << 1)
81 
82 #endif	/* __AM35X_USB_H__ */
83