summaryrefslogtreecommitdiff
path: root/board/freescale
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2014-06-10 13:48:03 +0800
committerYe.Li <B37916@freescale.com>2014-06-17 11:13:51 +0800
commit923063a858b165060decea13b68737501a8cc98c (patch)
tree16653a3e73e0457fc687fd0199067895857aba4d /board/freescale
parent124d8f3fd7b751e1f46775de277bcbd87d7945a1 (diff)
downloadu-boot-imx-923063a858b165060decea13b68737501a8cc98c.zip
u-boot-imx-923063a858b165060decea13b68737501a8cc98c.tar.gz
u-boot-imx-923063a858b165060decea13b68737501a8cc98c.tar.bz2
ENGR00315894-45 ARM:imx6:sabreauto Add USB HOST BSP support
Sabreauto board has pin conflict (pin EIM_D18) between NOR flash and i2c3. To enable the USB host, the i2c3 must be used to operate the max7310 IO expander to output the VBUS power. As SPINOR is enabled at default, it is impossible to use USB host at same time. Thus, remove the SYS_USE_SPINOR from sabreauto configurations to disable SPINOR. Signed-off-by: Ye.Li <B37916@freescale.com>
Diffstat (limited to 'board/freescale')
-rw-r--r--board/freescale/mx6qsabreauto/mx6qsabreauto.c105
1 files changed, 94 insertions, 11 deletions
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
index f06599f..d916b84 100644
--- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c
+++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
@@ -39,6 +39,10 @@
#endif
#endif /*CONFIG_FASTBOOT*/
+#ifdef CONFIG_MAX7310_IOEXP
+#include <gpio_exp.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
#define I2C_EXP_RST IMX_GPIO_NR(1, 15)
@@ -524,6 +528,37 @@ static void setup_gpmi_nand(void)
}
#endif
+#ifdef CONFIG_MAX7310_IOEXP
+void reset_max7310(void)
+{
+ gpio_direction_output(I2C_EXP_RST, 1);
+ imx_iomux_v3_setup_multiple_pads(port_exp,
+ ARRAY_SIZE(port_exp));
+}
+
+int setup_max7310(void)
+{
+#ifdef CONFIG_SYS_I2C_MXC
+ /* set steering config to i2c,
+ * note: this causes pin conflicts with eimnor and spinor
+ */
+ gpio_direction_output(IMX_GPIO_NR(5, 4), 1);
+ imx_iomux_v3_setup_multiple_pads(i2c3_pads,
+ ARRAY_SIZE(i2c3_pads));
+
+ /*setup i2c info 2*/
+ setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
+
+ gpio_exp_setup_port(1, 2, 0x30);
+ gpio_exp_setup_port(2, 2, 0x32);
+ gpio_exp_setup_port(3, 2, 0x34);
+
+ return 0;
+#else
+ return -EPERM;
+#endif
+}
+#endif
int mx6_rgmii_rework(struct phy_device *phydev)
{
unsigned short val;
@@ -798,6 +833,11 @@ int board_early_init_f(void)
{
setup_iomux_uart();
+#ifdef CONFIG_MAX7310_IOEXP
+ /*Reset gpio expander at early stage*/
+ reset_max7310();
+#endif
+
#if defined(CONFIG_VIDEO_IPUV3)
setup_display();
#endif
@@ -825,17 +865,6 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
-#ifdef CONFIG_SYS_I2C_MXC
- /* I2C 3 setup - I2C 3 hw mux with EIM */
- /* I2C 3 Steer */
- gpio_direction_output(IMX_GPIO_NR(5, 4), 1);
- imx_iomux_v3_setup_multiple_pads(i2c3_pads, ARRAY_SIZE(i2c3_pads));
- setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);
-
- gpio_direction_output(IMX_GPIO_NR(1, 15), 1);
- imx_iomux_v3_setup_multiple_pads(port_exp, ARRAY_SIZE(port_exp));
-#endif
-
return 0;
}
@@ -861,6 +890,10 @@ int board_late_init(void)
return -1;
#endif
+#ifdef CONFIG_MAX7310_IOEXP
+ setup_max7310();
+#endif
+
#ifdef CONFIG_ENV_IS_IN_MMC
board_late_mmc_env_init();
#endif
@@ -1022,3 +1055,53 @@ void udc_pins_setting(void)
}
#endif /*CONFIG_IMX_UDC*/
+
+#ifdef CONFIG_USB_EHCI_MX6
+#define USB_HOST1_PWR IOEXP_GPIO_NR(2, 7)
+#define USB_OTG_PWR IOEXP_GPIO_NR(3, 1)
+
+iomux_v3_cfg_t const usb_otg_pads[] = {
+ MX6_PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+int board_ehci_hcd_init(int port)
+{
+ switch (port) {
+ case 0:
+ imx_iomux_v3_setup_multiple_pads(usb_otg_pads,
+ ARRAY_SIZE(usb_otg_pads));
+
+ /*set daisy chain for otg_pin_id on 6q. for 6dl, this bit is reserved*/
+ mxc_iomux_set_gpr_register(1, 13, 1, 0);
+ break;
+ case 1:
+ break;
+ default:
+ printf("MXC USB port %d not yet supported\n", port);
+ return 1;
+ }
+ return 0;
+}
+
+int board_ehci_power(int port, int on)
+{
+ switch (port) {
+ case 0:
+ if (on)
+ gpio_exp_direction_output(USB_OTG_PWR, 1);
+ else
+ gpio_exp_direction_output(USB_OTG_PWR, 0);
+ break;
+ case 1:
+ if (on)
+ gpio_exp_direction_output(USB_HOST1_PWR, 1);
+ else
+ gpio_exp_direction_output(USB_HOST1_PWR, 0);
+ break;
+ default:
+ printf("MXC USB port %d not yet supported\n", port);
+ return 1;
+ }
+ return 0;
+}
+#endif