Skip to contentSkip to conversation

imx: mx6 sabreauto: Add board support for USB EHCI

PATCH New Ye.Li 2 participants 2 messages Oct 30, 2014 – Nov 3, 2014

Subsystems (2)
lore
Share & tools
lore

Ye.Li

author
#0 lore raw

PATCH v3 1/1 imx: mx6 sabreauto: Add board support for USB EHCI

On mx6 sabreauto board, there are two USB ports:
0: OTG
1: HOST
The EHCI driver is enabled for this board, but the IOMUX and VBUS power control is not implemented, which cause both USB port failed to work. This patch fix the problem by adding the board support codes.

Since the power control uses the GPIO pin from port expander MAX7310, the PCA953X driver is enabled for accessing the MAX7310.

The ID pin of OTG Port needs to configure the GPR1 bit 13 for selecting its daisy chain. Add a new function "imx_iomux_set_gpr_register" to handle GPR register setting.

---
Changes since v2:
- Resolve syntax error and checkpatch warning

Changes since v1:
- Modify codes and patch message according with Fabio's comments.

 arch/arm/imx-common/iomux-v3.c                |   15 ++++
 arch/arm/include/asm/imx-common/iomux-v3.h    |    5 ++
 board/freescale/mx6qsabreauto/mx6qsabreauto.c |   93 +++++++++++++++++++++++++
 include/configs/mx6qsabreauto.h               |    3 +
 4 files changed, 116 insertions(+), 0 deletions(-)
arch/arm/imx-common/iomux-v3.c +15 -0
index 22cd11a..e88e6e2 100644
@@ -77,3 +77,18 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
 		p += stride;
 	}
 }
+
+void imx_iomux_set_gpr_register(int group, int start_bit,
+					int num_bits, int value)
+{
+	int i = 0;
+	u32 reg;
+	reg = readl(base + group * 4);
+	while (num_bits) {
+		reg &= ~(1<<(start_bit + i));
+		i++;
+		num_bits--;
+	}
+	reg |= (value << start_bit);
+	writel(reg, base + group * 4);
+}
arch/arm/include/asm/imx-common/iomux-v3.h +5 -0
index a8ca49c..e0a49be 100644
@@ -182,6 +182,11 @@ typedef u64 iomux_v3_cfg_t;
 void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
 void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
 				     unsigned count);
+/*
+* Set bits for general purpose registers
+*/
+void imx_iomux_set_gpr_register(int group, int start_bit,
+					 int num_bits, int value);
 
 /* macros for declaring and using pinmux array */
 #if defined(CONFIG_MX6QDL)
board/freescale/mx6qsabreauto/mx6qsabreauto.c +93 -0

108 lines not on this page · raw message

include/configs/mx6qsabreauto.h +3 -0
index 0ab3127..235dd6d 100644
@@ -32,6 +32,9 @@
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
 
+#define CONFIG_PCA953X
+#define CONFIG_SYS_I2C_PCA953X_WIDTH	{ {0x30, 8}, {0x32, 8}, {0x34, 8} }
+
 #include "mx6sabre_common.h"
 
 #define CONFIG_SYS_FSL_USDHC_NUM	2
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v3 1/1 imx: mx6 sabreauto: Add board support for USB EHCI

Quoted 10 lines · Ye.Li

On mx6 sabreauto board, there are two USB ports:
0: OTG
1: HOST
The EHCI driver is enabled for this board, but the IOMUX and VBUS power control is not implemented, which cause both USB port failed to work. This patch fix the problem by adding the board support codes.

Since the power control uses the GPIO pin from port expander MAX7310, the PCA953X driver is enabled for accessing the MAX7310.

Quoted 6 lines

The ID pin of OTG Port needs to configure the GPR1 bit 13 for selecting its daisy chain. Add a new function "imx_iomux_set_gpr_register" to handle GPR register setting.

---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================