diff options
Diffstat (limited to 'arch/arm/mach-mx6')
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_sabreauto.c | 65 | ||||
-rw-r--r-- | arch/arm/mach-mx6/usb_dr.c | 34 | ||||
-rw-r--r-- | arch/arm/mach-mx6/usb_h1.c | 32 |
3 files changed, 101 insertions, 30 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_sabreauto.c b/arch/arm/mach-mx6/board-mx6q_sabreauto.c index e5dde074e026..69dd92e17cc9 100644 --- a/arch/arm/mach-mx6/board-mx6q_sabreauto.c +++ b/arch/arm/mach-mx6/board-mx6q_sabreauto.c @@ -150,6 +150,8 @@ static iomux_v3_cfg_t mx6q_sabreauto_pads[] = { MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2, MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3, MX6Q_PAD_RGMII_RX_CTL__ENET_RGMII_RX_CTL, + /*RGMII Phy Interrupt */ + MX6Q_PAD_GPIO_19__GPIO_4_5, #endif /* MCLK for csi0 */ MX6Q_PAD_GPIO_0__CCM_CLKO, @@ -473,38 +475,23 @@ static inline void mx6q_sabreauto_init_uart(void) static int mx6q_sabreauto_fec_phy_init(struct phy_device *phydev) { - unsigned short val; - - /* To enable AR8031 ouput a 125MHz clk from CLK_25M */ - phy_write(phydev, 0xd, 0x7); - phy_write(phydev, 0xe, 0x8016); - phy_write(phydev, 0xd, 0x4007); - val = phy_read(phydev, 0xe); +/* prefer master mode, 1000 Base-T capable */ + phy_write(phydev, 0x9, 0x0f00); - val &= 0xffe3; - val |= 0x18; - phy_write(phydev, 0xe, val); + /* min rx data delay */ + phy_write(phydev, 0x0b, 0x8105); + phy_write(phydev, 0x0c, 0x0000); - /* introduce tx clock delay */ - phy_write(phydev, 0x1d, 0x5); - val = phy_read(phydev, 0x1e); - val |= 0x0100; - phy_write(phydev, 0x1e, val); + /* max rx/tx clock delay, min rx/tx control delay */ + phy_write(phydev, 0x0b, 0x8104); + phy_write(phydev, 0x0c, 0xf0f0); + phy_write(phydev, 0x0b, 0x104); return 0; } static int mx6q_sabreauto_fec_power_hibernate(struct phy_device *phydev) { - unsigned short val; - - /*set AR8031 debug reg 0xb to hibernate power*/ - phy_write(phydev, 0x1d, 0xb); - val = phy_read(phydev, 0x1e); - - val |= 0x8000; - phy_write(phydev, 0x1e, val); - return 0; } @@ -568,8 +555,17 @@ static int max7310_1_setup(struct i2c_client *client, unsigned gpio_base, unsigned ngpio, void *context) { + /* 0 BACKLITE_ON */ + /* 1 SAT_SHUTDN_B */ + /* 2 CPU_PER_RST_B */ + /* 3 MAIN_PER_RST_B */ + /* 4 IPOD_RST_B */ + /* 5 MLB_RST_B */ + /* 6 SSI_STEERING */ + /* 7 GPS_RST_B */ + int max7310_gpio_value[] = { - 0, 1, 0, 1, 0, 0, 0, 0, + 0, 1, 1, 1, 0, 0, 0, 0, }; int n; @@ -593,12 +589,21 @@ static struct pca953x_platform_data max7310_platdata = { .setup = max7310_1_setup, }; -static int max7310_u48_setup(struct i2c_client *client, +static int max7310_u516_setup(struct i2c_client *client, unsigned gpio_base, unsigned ngpio, void *context) { + /* 0 not use */ + /* 1 GPS_PWREN */ + /* 2 VIDEO_ADC_PWRDN_B */ + /* 3 ENET_CAN1_STEER */ + /* 4 EIMD30_BTUART3_STEER */ + /* 5 CAN_STBY */ + /* 6 CAN_EN */ + /* 7 USB_H1_PWR */ + int max7310_gpio_value[] = { - 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; int n; @@ -616,10 +621,10 @@ static int max7310_u48_setup(struct i2c_client *client, return 0; } -static struct pca953x_platform_data max7310_u48_platdata = { +static struct pca953x_platform_data max7310_u516_platdata = { .gpio_base = MX6Q_SABREAUTO_MAX7310_2_BASE_ADDR, .invert = 0, - .setup = max7310_u48_setup, + .setup = max7310_u516_setup, }; static void ddc_dvi_init(void) @@ -679,7 +684,7 @@ static struct i2c_board_info mxc_i2c2_board_info[] __initdata = { }, { I2C_BOARD_INFO("max7310", 0x32), - .platform_data = &max7310_u48_platdata, + .platform_data = &max7310_u516_platdata, }, { I2C_BOARD_INFO("mxc_dvi", 0x50), diff --git a/arch/arm/mach-mx6/usb_dr.c b/arch/arm/mach-mx6/usb_dr.c index de84a4ded23b..fb241f517c39 100644 --- a/arch/arm/mach-mx6/usb_dr.c +++ b/arch/arm/mach-mx6/usb_dr.c @@ -310,6 +310,36 @@ static void usbotg_wakeup_event_clear(void) #ifdef CONFIG_USB_EHCI_ARC_OTG /* Beginning of host related operation for DR port */ +static void _host_platform_suspend(struct fsl_usb2_platform_data *pdata) +{ + void __iomem *phy_reg = MX6_IO_ADDRESS(USB_PHY0_BASE_ADDR); + u32 tmp; + + tmp = (BM_USBPHY_PWD_TXPWDFS + | BM_USBPHY_PWD_TXPWDIBIAS + | BM_USBPHY_PWD_TXPWDV2I + | BM_USBPHY_PWD_RXPWDENV + | BM_USBPHY_PWD_RXPWD1PT1 + | BM_USBPHY_PWD_RXPWDDIFF + | BM_USBPHY_PWD_RXPWDRX); + __raw_writel(tmp, phy_reg + HW_USBPHY_PWD_SET); +} + +static void _host_platform_resume(struct fsl_usb2_platform_data *pdata) +{ + void __iomem *phy_reg = MX6_IO_ADDRESS(USB_PHY0_BASE_ADDR); + u32 tmp; + + tmp = (BM_USBPHY_PWD_TXPWDFS + | BM_USBPHY_PWD_TXPWDIBIAS + | BM_USBPHY_PWD_TXPWDV2I + | BM_USBPHY_PWD_RXPWDENV + | BM_USBPHY_PWD_RXPWD1PT1 + | BM_USBPHY_PWD_RXPWDDIFF + | BM_USBPHY_PWD_RXPWDRX); + __raw_writel(tmp, phy_reg + HW_USBPHY_PWD_CLR); +} + static void _host_phy_lowpower_suspend(struct fsl_usb2_platform_data *pdata, bool enable) { __phy_lowpower_suspend(pdata, enable, ENABLED_BY_HOST); @@ -438,6 +468,8 @@ void __init mx6_usb_dr_init(void) #ifdef CONFIG_USB_EHCI_ARC_OTG dr_utmi_config.operating_mode = DR_HOST_MODE; dr_utmi_config.wake_up_enable = _host_wakeup_enable; + dr_utmi_config.platform_suspend = _host_platform_suspend; + dr_utmi_config.platform_resume = _host_platform_resume; dr_utmi_config.phy_lowpower_suspend = _host_phy_lowpower_suspend; dr_utmi_config.is_wakeup_event = _is_host_wakeup; dr_utmi_config.wakeup_pdata = &dr_wakeup_config; @@ -448,6 +480,8 @@ void __init mx6_usb_dr_init(void) #ifdef CONFIG_USB_GADGET_ARC dr_utmi_config.operating_mode = DR_UDC_MODE; dr_utmi_config.wake_up_enable = _device_wakeup_enable; + dr_utmi_config.platform_suspend = NULL; + dr_utmi_config.platform_resume = NULL; dr_utmi_config.phy_lowpower_suspend = _device_phy_lowpower_suspend; dr_utmi_config.is_wakeup_event = _is_device_wakeup; dr_utmi_config.wakeup_pdata = &dr_wakeup_config; diff --git a/arch/arm/mach-mx6/usb_h1.c b/arch/arm/mach-mx6/usb_h1.c index 9c247d568754..f4b84df63f2f 100644 --- a/arch/arm/mach-mx6/usb_h1.c +++ b/arch/arm/mach-mx6/usb_h1.c @@ -148,6 +148,36 @@ static void _wake_up_enable(struct fsl_usb2_platform_data *pdata, bool enable) } } +static void usbh1_platform_suspend(struct fsl_usb2_platform_data *pdata) +{ + void __iomem *phy_reg = MX6_IO_ADDRESS(USB_PHY1_BASE_ADDR); + u32 tmp; + + tmp = (BM_USBPHY_PWD_TXPWDFS + | BM_USBPHY_PWD_TXPWDIBIAS + | BM_USBPHY_PWD_TXPWDV2I + | BM_USBPHY_PWD_RXPWDENV + | BM_USBPHY_PWD_RXPWD1PT1 + | BM_USBPHY_PWD_RXPWDDIFF + | BM_USBPHY_PWD_RXPWDRX); + __raw_writel(tmp, phy_reg + HW_USBPHY_PWD_SET); +} + +static void usbh1_platform_resume(struct fsl_usb2_platform_data *pdata) +{ + void __iomem *phy_reg = MX6_IO_ADDRESS(USB_PHY1_BASE_ADDR); + u32 tmp; + + tmp = (BM_USBPHY_PWD_TXPWDFS + | BM_USBPHY_PWD_TXPWDIBIAS + | BM_USBPHY_PWD_TXPWDV2I + | BM_USBPHY_PWD_RXPWDENV + | BM_USBPHY_PWD_RXPWD1PT1 + | BM_USBPHY_PWD_RXPWDDIFF + | BM_USBPHY_PWD_RXPWDRX); + __raw_writel(tmp, phy_reg + HW_USBPHY_PWD_CLR); +} + static void _phy_lowpower_suspend(struct fsl_usb2_platform_data *pdata, bool enable) { u32 tmp; @@ -224,6 +254,8 @@ static struct fsl_usb2_platform_data usbh1_config = { .power_budget = 500, /* 500 mA max power */ .wake_up_enable = _wake_up_enable, .usb_clock_for_pm = usbh1_clock_gate, + .platform_suspend = usbh1_platform_suspend, + .platform_resume = usbh1_platform_resume, .phy_lowpower_suspend = _phy_lowpower_suspend, .is_wakeup_event = _is_usbh1_wakeup, .wakeup_handler = h1_wakeup_handler, |