#include "cpu_op-mx6.h"
#include "board-mx6sl_arm2.h"
+#define MX6_ARM2_USBOTG1_PWR IMX_GPIO_NR(4, 0) /* KEY_COL4 */
+#define MX6_ARM2_USBOTG2_PWR IMX_GPIO_NR(4, 2) /* KEY_COL5 */
#define MX6_ARM2_SD1_WP IMX_GPIO_NR(4, 6) /* KEY_COL7 */
#define MX6_ARM2_SD1_CD IMX_GPIO_NR(4, 7) /* KEY_ROW7 */
#define MX6_ARM2_SD2_WP IMX_GPIO_NR(4, 29) /* SD2_DAT6 */
imx6q_add_sdhci_usdhc_imx(2, &mx6_arm2_sd3_data);
}
+static void imx6_arm2_usbotg_vbus(bool on)
+{
+ if (on)
+ gpio_set_value(MX6_ARM2_USBOTG1_PWR, 1);
+ else
+ gpio_set_value(MX6_ARM2_USBOTG1_PWR, 0);
+}
+
+static void __init mx6_arm2_init_usb(void)
+{
+ int ret = 0;
+
+ imx_otg_base = MX6_IO_ADDRESS(MX6Q_USB_OTG_BASE_ADDR);
+
+ /* disable external charger detect,
+ * or it will affect signal quality at dp.
+ */
+
+ ret = gpio_request(MX6_ARM2_USBOTG1_PWR, "usbotg-pwr");
+ if (ret) {
+ pr_err("failed to get GPIO MX6_ARM2_USBOTG1_PWR:%d\n", ret);
+ return;
+ }
+ gpio_direction_output(MX6_ARM2_USBOTG1_PWR, 0);
+
+ ret = gpio_request(MX6_ARM2_USBOTG2_PWR, "usbh1-pwr");
+ if (ret) {
+ pr_err("failed to get GPIO MX6_ARM2_USBOTG2_PWR:%d\n", ret);
+ return;
+ }
+ gpio_direction_output(MX6_ARM2_USBOTG2_PWR, 1);
+
+ mx6_set_otghost_vbus_func(imx6_arm2_usbotg_vbus);
+ mx6_usb_dr_init();
+ mx6_usb_h1_init();
+#ifdef CONFIG_USB_EHCI_ARC_HSIC
+ mx6_usb_h2_init();
+#endif
+}
+
/*!
* Board specific initialization.
*/
mxc_iomux_v3_setup_multiple_pads(mx6sl_arm2_pads, ARRAY_SIZE(mx6sl_arm2_pads));
mx6_arm2_init_uart();
+ mx6_arm2_init_usb();
}
extern void __iomem *twd_base;
MX6SL_PAD_UART1_RXD__UART1_RXD,
MX6SL_PAD_UART1_TXD__UART1_TXD,
+ /* USBOTG ID pin */
+ MX6SL_PAD_EPDC_PWRCOM__ANATOP_USBOTG1_ID,
+
+ /* USBOTG POWER GPIO */
+ MX6SL_PAD_KEY_COL4__GPIO_4_0,
+ MX6SL_PAD_KEY_COL5__GPIO_4_2,
+ /* USB OC pin */
+ MX6SL_PAD_KEY_ROW4__USB_USBOTG1_OC,
+ MX6SL_PAD_ECSPI2_SCLK__USB_USBOTG2_OC,
+ /* USB HSIC pin */
+ MX6SL_PAD_HSIC_STROBE__USB_H_STROBE,
+ MX6SL_PAD_HSIC_DAT__USB_H_DATA,
+
/* SD1 */
MX6SL_PAD_SD1_CLK__USDHC1_CLK,
MX6SL_PAD_SD1_CMD__USDHC1_CMD,
#include <mach/hardware.h>
#include <mach/iomux-mx6q.h>
#include <mach/iomux-mx6dl.h>
+#include <mach/iomux-mx6sl.h>
#include "devices-imx6q.h"
#include "regs-anadig.h"
#include "usb.h"
else if (cpu_is_mx6dl())
mxc_iomux_v3_setup_pad(
MX6DL_PAD_RGMII_TX_CTL__USBOH3_H2_STROBE_START);
+ else if (cpu_is_mx6sl())
+ mxc_iomux_v3_setup_pad(
+ MX6SL_PAD_HSIC_STROBE__USB_H_STROBE_START);
}
static void hsic_device_connected(void)
usb_ahb_clk = clk_get(NULL, "usb_ahb_clk");
if (clk_enable(usb_ahb_clk)) {
- if (cpu_is_mx6q() || cpu_is_mx6dl())
+ if (cpu_is_mx6())
return 0; /* there is no ahb clock at mx6 */
printk(KERN_ERR "clk_enable(usb_ahb_clk) failed\n");
return -EINVAL;
usb_clk = clk_get(NULL, "usb_clk");
if (clk_enable(usb_clk)) {
- if (cpu_is_mx6q() || cpu_is_mx6dl())
+ if (cpu_is_mx6())
return 0; /* there is usb_clk at mx6 */
printk(KERN_ERR "clk_enable(usb_clk) failed\n");
return -EINVAL;
if (usb_register_remote_wakeup(pdev))
pr_debug("%s port is not a wakeup source.\n", pdata->name);
- if (!(cpu_is_mx6q() || cpu_is_mx6dl())) {
+ if (!(cpu_is_mx6())) {
if (xops->xcvr_type == PORTSC_PTS_SERIAL) {
if (cpu_is_mx35()) {
usbh2_set_serial_xcvr();
return -EINVAL;
if (xops->init)
xops->init(xops);
- if (!((cpu_is_mx6q() || cpu_is_mx6dl()))) {
+ if (!(cpu_is_mx6())) {
UOG_PORTSC1 = UOG_PORTSC1 & ~PORTSC_PHCD;