diff mbox

[U-Boot,12/13] mx35pdk: Add support for OTG

Message ID 516208406.587402.1352146413048.JavaMail.root@advansee.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Benoît Thébaudeau Nov. 5, 2012, 8:13 p.m. UTC
Add support for the OTG port on the mx35pdk Personality board.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Marek Vasut <marex@denx.de>
---
Note: I have tested this on a similar board, but not on the mx35pdk itself. So
please, someone test on mx35pdk. Stefano?

 .../board/freescale/mx35pdk/lowlevel_init.S         |    4 ++++
 .../board/freescale/mx35pdk/mx35pdk.c               |   19 +++++++++++++++++++
 .../include/configs/mx35pdk.h                       |   14 ++++++++++++++
 3 files changed, 37 insertions(+)

Comments

Stefano Babic Nov. 7, 2012, 2:30 p.m. UTC | #1
On 05/11/2012 21:13, Benoît Thébaudeau wrote:
> Add support for the OTG port on the mx35pdk Personality board.
> 
> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> ---
> Note: I have tested this on a similar board, but not on the mx35pdk itself. So
> please, someone test on mx35pdk. Stefano?

Yes, I will do it.
Stefano Babic Nov. 7, 2012, 4:16 p.m. UTC | #2
On 05/11/2012 21:13, Benoît Thébaudeau wrote:
> Add support for the OTG port on the mx35pdk Personality board.
> 
> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> ---
> Note: I have tested this on a similar board, but not on the mx35pdk itself. So
> please, someone test on mx35pdk. Stefano?
> 

It works on mx35pdk, too ;-)

Tested-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Benoît Thébaudeau Nov. 7, 2012, 4:27 p.m. UTC | #3
Hi Stefano,

On Wednesday, November 7, 2012 5:16:47 PM, Stefano Babic wrote:
> On 05/11/2012 21:13, Benoît Thébaudeau wrote:
> > Add support for the OTG port on the mx35pdk Personality board.
> > 
> > Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > Cc: Marek Vasut <marex@denx.de>
> > ---
> > Note: I have tested this on a similar board, but not on the mx35pdk
> > itself. So
> > please, someone test on mx35pdk. Stefano?
> > 
> 
> It works on mx35pdk, too ;-)
> 
> Tested-by: Stefano Babic <sbabic@denx.de>

Great! Thanks for testing.

Are you also OK with the other patches in this series? Can I send a v2 with just
the change that Marek asked for 13/13?

Best regards,
Benoît
Stefano Babic Nov. 7, 2012, 4:33 p.m. UTC | #4
On 07/11/2012 17:27, Benoît Thébaudeau wrote:
> Hi Stefano,
> 
> On Wednesday, November 7, 2012 5:16:47 PM, Stefano Babic wrote:
>> On 05/11/2012 21:13, Benoît Thébaudeau wrote:
>>> Add support for the OTG port on the mx35pdk Personality board.
>>>
>>> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
>>> Cc: Stefano Babic <sbabic@denx.de>
>>> Cc: Marek Vasut <marex@denx.de>
>>> ---
>>> Note: I have tested this on a similar board, but not on the mx35pdk
>>> itself. So
>>> please, someone test on mx35pdk. Stefano?
>>>
>>
>> It works on mx35pdk, too ;-)
>>
>> Tested-by: Stefano Babic <sbabic@denx.de>
> 
> Great! Thanks for testing.
> 
> Are you also OK with the other patches in this series? Can I send a v2 with just
> the change that Marek asked for 13/13?

IMHO they are ok, I have not found relevant issues.

Best regards,
Stefano
diff mbox

Patch

diff --git u-boot-usb-76454b2.orig/board/freescale/mx35pdk/lowlevel_init.S u-boot-usb-76454b2/board/freescale/mx35pdk/lowlevel_init.S
index 698c4cf..6f4d4e0 100644
--- u-boot-usb-76454b2.orig/board/freescale/mx35pdk/lowlevel_init.S
+++ u-boot-usb-76454b2/board/freescale/mx35pdk/lowlevel_init.S
@@ -178,6 +178,10 @@ 
 	orr r1, r1, #0x00000C00
 	orr r1, r1, #0x00000003
 	str r1, [r0, #CLKCTL_CGR1]
+
+	ldr r1, [r0, #CLKCTL_CGR2]
+	orr r1, r1, #0x00C00000
+	str r1, [r0, #CLKCTL_CGR2]
 .endm
 
 .macro setup_sdram
diff --git u-boot-usb-76454b2.orig/board/freescale/mx35pdk/mx35pdk.c u-boot-usb-76454b2/board/freescale/mx35pdk/mx35pdk.c
index 7cb6b30..e9ef4d1 100644
--- u-boot-usb-76454b2.orig/board/freescale/mx35pdk/mx35pdk.c
+++ u-boot-usb-76454b2/board/freescale/mx35pdk/mx35pdk.c
@@ -97,6 +97,24 @@  static void setup_iomux_spi(void)
 	mxc_request_iomux(MX35_PIN_CSPI1_SCLK, MUX_CONFIG_SION);
 }
 
+static void setup_iomux_usbotg(void)
+{
+	int in_pad, out_pad;
+
+	/* Set up pins for USBOTG. */
+	mxc_request_iomux(MX35_PIN_USBOTG_PWR, MUX_CONFIG_SION | MUX_CONFIG_FUNC);
+	mxc_request_iomux(MX35_PIN_USBOTG_OC, MUX_CONFIG_SION | MUX_CONFIG_FUNC);
+
+	in_pad = PAD_CTL_DRV_3_3V | PAD_CTL_HYS_SCHMITZ | PAD_CTL_PKE_ENABLE |
+		PAD_CTL_PUE_PUD | PAD_CTL_100K_PD | PAD_CTL_ODE_CMOS |
+		PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW;
+	out_pad = PAD_CTL_DRV_3_3V | PAD_CTL_HYS_CMOS | PAD_CTL_PKE_NONE |
+		PAD_CTL_ODE_CMOS | PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW;
+
+	mxc_iomux_set_pad(MX35_PIN_USBOTG_PWR, out_pad);
+	mxc_iomux_set_pad(MX35_PIN_USBOTG_OC, in_pad);
+}
+
 static void setup_iomux_fec(void)
 {
 	int pad;
@@ -188,6 +206,7 @@  int board_early_init_f(void)
 	__raw_writel(readl(&ccm->rcsr) | MXC_CCM_RCSR_NFC_FMS, &ccm->rcsr);
 
 	setup_iomux_i2c();
+	setup_iomux_usbotg();
 	setup_iomux_fec();
 	setup_iomux_spi();
 
diff --git u-boot-usb-76454b2.orig/include/configs/mx35pdk.h u-boot-usb-76454b2/include/configs/mx35pdk.h
index 826c912..69b7d23 100644
--- u-boot-usb-76454b2.orig/include/configs/mx35pdk.h
+++ u-boot-usb-76454b2/include/configs/mx35pdk.h
@@ -110,6 +110,8 @@ 
 #define CONFIG_NET_RETRY_COUNT	100
 #define CONFIG_CMD_DATE
 
+#define CONFIG_CMD_USB
+#define CONFIG_USB_STORAGE
 #define CONFIG_CMD_MMC
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
@@ -242,6 +244,18 @@ 
 #define CONFIG_MXC_NAND_HWECC
 #define CONFIG_SYS_NAND_LARGEPAGE
 
+/* EHCI driver */
+#define CONFIG_USB_EHCI
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	1
+#define CONFIG_EHCI_IS_TDI
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+#define CONFIG_USB_EHCI_MXC
+#define CONFIG_MXC_USB_PORT	0
+#define CONFIG_MXC_USB_FLAGS	(MXC_EHCI_INTERFACE_DIFF_UNI | \
+				 MXC_EHCI_POWER_PINS_ENABLED | \
+				 MXC_EHCI_OC_PIN_ACTIVE_LOW)
+#define CONFIG_MXC_USB_PORTSC	(MXC_EHCI_UTMI_16BIT | MXC_EHCI_MODE_UTMI)
+
 /* mmc driver */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC