Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #include <linux/platform_data/usb-omap.h>
0003 
0004 /* AM35x */
0005 /* USB 2.0 PHY Control */
0006 #define CONF2_PHY_GPIOMODE  (1 << 23)
0007 #define CONF2_OTGMODE       (3 << 14)
0008 #define CONF2_NO_OVERRIDE   (0 << 14)
0009 #define CONF2_FORCE_HOST    (1 << 14)
0010 #define CONF2_FORCE_DEVICE  (2 << 14)
0011 #define CONF2_FORCE_HOST_VBUS_LOW (3 << 14)
0012 #define CONF2_SESENDEN      (1 << 13)
0013 #define CONF2_VBDTCTEN      (1 << 12)
0014 #define CONF2_REFFREQ_24MHZ (2 << 8)
0015 #define CONF2_REFFREQ_26MHZ (7 << 8)
0016 #define CONF2_REFFREQ_13MHZ (6 << 8)
0017 #define CONF2_REFFREQ       (0xf << 8)
0018 #define CONF2_PHYCLKGD      (1 << 7)
0019 #define CONF2_VBUSSENSE     (1 << 6)
0020 #define CONF2_PHY_PLLON     (1 << 5)
0021 #define CONF2_RESET     (1 << 4)
0022 #define CONF2_PHYPWRDN      (1 << 3)
0023 #define CONF2_OTGPWRDN      (1 << 2)
0024 #define CONF2_DATPOL        (1 << 1)
0025 
0026 /* TI81XX specific definitions */
0027 #define USBCTRL0    0x620
0028 #define USBSTAT0    0x624
0029 
0030 /* TI816X PHY controls bits */
0031 #define TI816X_USBPHY0_NORMAL_MODE  (1 << 0)
0032 #define TI816X_USBPHY_REFCLK_OSC    (1 << 8)
0033 
0034 /* TI814X PHY controls bits */
0035 #define USBPHY_CM_PWRDN     (1 << 0)
0036 #define USBPHY_OTG_PWRDN    (1 << 1)
0037 #define USBPHY_CHGDET_DIS   (1 << 2)
0038 #define USBPHY_CHGDET_RSTRT (1 << 3)
0039 #define USBPHY_SRCONDM      (1 << 4)
0040 #define USBPHY_SINKONDP     (1 << 5)
0041 #define USBPHY_CHGISINK_EN  (1 << 6)
0042 #define USBPHY_CHGVSRC_EN   (1 << 7)
0043 #define USBPHY_DMPULLUP     (1 << 8)
0044 #define USBPHY_DPPULLUP     (1 << 9)
0045 #define USBPHY_CDET_EXTCTL  (1 << 10)
0046 #define USBPHY_GPIO_MODE    (1 << 12)
0047 #define USBPHY_DPOPBUFCTL   (1 << 13)
0048 #define USBPHY_DMOPBUFCTL   (1 << 14)
0049 #define USBPHY_DPINPUT      (1 << 15)
0050 #define USBPHY_DMINPUT      (1 << 16)
0051 #define USBPHY_DPGPIO_PD    (1 << 17)
0052 #define USBPHY_DMGPIO_PD    (1 << 18)
0053 #define USBPHY_OTGVDET_EN   (1 << 19)
0054 #define USBPHY_OTGSESSEND_EN    (1 << 20)
0055 #define USBPHY_DATA_POLARITY    (1 << 23)
0056 
0057 struct usbhs_phy_data {
0058     int port;       /* 1 indexed port number */
0059     int reset_gpio;
0060     int vcc_gpio;
0061     bool vcc_polarity;  /* 1 active high, 0 active low */
0062 };
0063 
0064 extern void usb_musb_init(struct omap_musb_board_data *board_data);
0065 extern void usbhs_init(struct usbhs_omap_platform_data *pdata);
0066 extern int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys);
0067 
0068 extern void am35x_musb_reset(void);
0069 extern void am35x_musb_phy_power(u8 on);
0070 extern void am35x_musb_clear_irq(void);
0071 extern void am35x_set_mode(u8 musb_mode);