blob: 900fc005b4f6c1effc586a61bce008b2185558ff [file] [log] [blame]
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +05301/*
2 * Copyright (C) 2007 Google, Inc.
3 * Author: Brian Swetland <swetland@google.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__
17#define __LINUX_USB_GADGET_MSM72K_UDC_H__
18
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053019#define USB_AHBBURST (MSM_USB_BASE + 0x0090)
20#define USB_AHBMODE (MSM_USB_BASE + 0x0098)
Amit Blay1572b492012-11-27 16:45:32 +020021#define USB_GENCONFIG (MSM_USB_BASE + 0x009C)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053022#define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
Vamsi Krishnafce1bd22012-08-17 17:12:26 -070023#define USB_HS_GPTIMER_BASE (MSM_USB_BASE + 0x80)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053024
25#define USB_USBCMD (MSM_USB_BASE + 0x0140)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070026#define USB_USBSTS (MSM_USB_BASE + 0x0144)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053027#define USB_PORTSC (MSM_USB_BASE + 0x0184)
28#define USB_OTGSC (MSM_USB_BASE + 0x01A4)
29#define USB_USBMODE (MSM_USB_BASE + 0x01A8)
Pavankumar Kondeti04aebcb2011-05-04 10:19:49 +053030#define USB_PHY_CTRL (MSM_USB_BASE + 0x0240)
Vijayavardhan Vennapusa1f5da0b2013-01-08 20:03:57 +053031#define USB_PHY_CTRL2 (MSM_USB_BASE + 0x0278)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053032
33#define USBCMD_RESET 2
34#define USB_USBINTR (MSM_USB_BASE + 0x0148)
Hemant Kumar8fdc3982012-08-21 12:22:27 -070035#define USB_FRINDEX (MSM_USB_BASE + 0x014C)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053036
37#define PORTSC_PHCD (1 << 23) /* phy suspend mode */
38#define PORTSC_PTS_MASK (3 << 30)
39#define PORTSC_PTS_ULPI (3 << 30)
Pavankumar Kondeti9ec21d32012-05-07 15:50:23 +053040#define PORTSC_LS (3 << 10)
41#define PORTSC_LS_DM (1 << 10)
Vijayavardhan Vennapusaa3152032012-03-05 16:29:30 +053042#define PORTSC_CSC (1 << 1)
43#define PORTSC_CCS (1 << 0)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053044
45#define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
46#define ULPI_RUN (1 << 30)
47#define ULPI_WRITE (1 << 29)
48#define ULPI_READ (0 << 29)
Vijayavardhan Vennapusa39025fe2011-10-15 05:55:10 +053049#define ULPI_SYNC_STATE (1 << 27)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053050#define ULPI_ADDR(n) (((n) & 255) << 16)
51#define ULPI_DATA(n) ((n) & 255)
52#define ULPI_DATA_READ(n) (((n) >> 8) & 255)
53
Amit Blay1572b492012-11-27 16:45:32 +020054#define GENCONFIG_BAM_DISABLE (1 << 13)
55
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056/* synopsys 28nm phy registers */
57#define ULPI_PWR_CLK_MNG_REG 0x88
58#define OTG_COMP_DISABLE BIT(0)
59
60#define PHY_ALT_INT (1 << 28) /* PHY alternate interrupt */
Pavankumar Kondeti87c01042010-12-07 17:53:58 +053061#define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */
62#define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */
Pavankumar Kondeti04aebcb2011-05-04 10:19:49 +053063#define PHY_RETEN (1 << 1) /* PHY retention enable/disable */
Amit Blay58b31472011-11-18 09:39:39 +020064#define PHY_IDHV_INTEN (1 << 8) /* PHY ID HV interrupt */
65#define PHY_OTGSESSVLDHV_INTEN (1 << 9) /* PHY Session Valid HV int. */
Pavankumar Kondeti87c01042010-12-07 17:53:58 +053066
Vijayavardhan Vennapusaa3152032012-03-05 16:29:30 +053067#define STS_PCI (1 << 2) /* R/WC - Port Change Detect */
68#define STS_URI (1 << 6) /* R/WC - RESET recv'd */
69#define STS_SLI (1 << 8) /* R/WC - suspend state entered */
70
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053071/* OTG definitions */
72#define OTGSC_INTSTS_MASK (0x7f << 16)
Pavankumar Kondetiaa449e12011-11-04 11:09:26 +053073#define OTGSC_IDPU (1 << 5)
Vijayavardhan Vennapusaa3152032012-03-05 16:29:30 +053074#define OTGSC_INTR_MASK (0x7f << 24)
75#define OTGSC_HADP (1 << 6)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053076#define OTGSC_ID (1 << 8)
77#define OTGSC_BSV (1 << 11)
78#define OTGSC_IDIS (1 << 16)
79#define OTGSC_BSVIS (1 << 19)
80#define OTGSC_IDIE (1 << 24)
81#define OTGSC_BSVIE (1 << 27)
Vijayavardhan Vennapusaa3152032012-03-05 16:29:30 +053082#define OTGSC_DPIE (1 << 30)
83#define OTGSC_DPIS (1 << 22)
84
85/* OTG interrupt status mask */
86#define OTG_USBSTS_MASK (STS_PCI | STS_URI | STS_SLI | PHY_ALT_INT)
87#define OTG_OTGSTS_MASK (OTGSC_IDIS | OTGSC_BSVIS | OTGSC_DPIS)
Pavankumar Kondetie0c201f2010-12-07 17:53:55 +053088
89#endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */