All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 12/13] mx35pdk: Add support for OTG
Date: Mon, 5 Nov 2012 21:13:33 +0100 (CET)	[thread overview]
Message-ID: <516208406.587402.1352146413048.JavaMail.root@advansee.com> (raw)
In-Reply-To: <412111025.587245.1352146184216.JavaMail.root@advansee.com>

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(+)

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

  parent reply	other threads:[~2012-11-05 20:13 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 20:09 [U-Boot] [PATCH 01/13] mx31: Move EHCI definitions to ehci-fsl.h Benoît Thébaudeau
2012-11-05 20:10 ` [U-Boot] [PATCH 02/13] ehci-mxc: Clean up Benoît Thébaudeau
2012-11-05 20:10 ` [U-Boot] [PATCH 03/13] ehci-mx5: " Benoît Thébaudeau
2012-11-05 20:10 ` [U-Boot] [PATCH 04/13] ehci-mx5: Fix OC_DIS usage Benoît Thébaudeau
2012-11-05 20:11 ` [U-Boot] [PATCH 05/13] ehci-mx5: Fix OPM usage Benoît Thébaudeau
2012-11-05 20:11 ` [U-Boot] [PATCH 06/13] ehci-mx5: Fix *PM usage for i.MX53 Benoît Thébaudeau
2012-11-05 20:11 ` [U-Boot] [PATCH 07/13] ehci-mx5: Add missing OC_DIS " Benoît Thébaudeau
2012-11-05 20:12 ` [U-Boot] [PATCH 08/13] ehci-mxc: Make EHCI power/oc polarities configurable Benoît Thébaudeau
2012-11-05 20:12 ` [U-Boot] [PATCH 09/13] ehci-mxc: Make i.MX25 EHCI configurable Benoît Thébaudeau
2012-11-05 20:12 ` [U-Boot] [PATCH 10/13] ehci-mxc: Define host offsets Benoît Thébaudeau
2012-11-05 20:13 ` [U-Boot] [PATCH 11/13] ehci-mxc: Add support for i.MX35 Benoît Thébaudeau
2012-11-05 20:13 ` Benoît Thébaudeau [this message]
2012-11-07 14:30   ` [U-Boot] [PATCH 12/13] mx35pdk: Add support for OTG Stefano Babic
2012-11-07 16:16   ` Stefano Babic
2012-11-07 16:27     ` Benoît Thébaudeau
2012-11-07 16:33       ` Stefano Babic
2012-11-05 20:13 ` [U-Boot] [PATCH 13/13] ehci-mx5: Make board_ehci_hcd_init() optional Benoît Thébaudeau
2012-11-05 22:57   ` Marek Vasut
2012-11-05 23:34     ` Benoît Thébaudeau
2012-11-05 22:55 ` [U-Boot] [PATCH 01/13] mx31: Move EHCI definitions to ehci-fsl.h Marek Vasut
2012-11-07 16:31   ` Stefano Babic
2012-11-08 20:27 ` [U-Boot] [PATCH v2 " Benoît Thébaudeau
2012-11-08 20:28   ` [U-Boot] [PATCH v2 02/13] ehci-mxc: Clean up Benoît Thébaudeau
2012-11-08 20:28   ` [U-Boot] [PATCH v2 03/13] ehci-mx5: " Benoît Thébaudeau
2012-11-08 20:28   ` [U-Boot] [PATCH v2 04/13] ehci-mx5: Fix OC_DIS usage Benoît Thébaudeau
2012-11-08 20:29   ` [U-Boot] [PATCH v2 05/13] ehci-mx5: Fix OPM usage Benoît Thébaudeau
2012-11-08 20:29   ` [U-Boot] [PATCH v2 06/13] ehci-mx5: Fix *PM usage for i.MX53 Benoît Thébaudeau
2012-11-08 20:29   ` [U-Boot] [PATCH v2 07/13] ehci-mx5: Add missing OC_DIS " Benoît Thébaudeau
2012-11-08 20:29   ` [U-Boot] [PATCH v2 08/13] ehci-mxc: Make EHCI power/oc polarities configurable Benoît Thébaudeau
2012-11-08 20:30   ` [U-Boot] [PATCH v2 09/13] ehci-mxc: Make i.MX25 EHCI configurable Benoît Thébaudeau
2012-11-08 20:30   ` [U-Boot] [PATCH v2 10/13] ehci-mxc: Define host offsets Benoît Thébaudeau
2012-11-08 20:30   ` [U-Boot] [PATCH v2 11/13] ehci-mxc: Add support for i.MX35 Benoît Thébaudeau
2012-11-08 20:31   ` [U-Boot] [PATCH v2 12/13] mx35pdk: Add support for OTG Benoît Thébaudeau
2012-11-08 20:31   ` [U-Boot] [PATCH v2 13/13] ehci-mx5/6: Make board_ehci_hcd_init() optional Benoît Thébaudeau
2012-11-10  7:42   ` [U-Boot] [PATCH v2 01/13] mx31: Move EHCI definitions to ehci-fsl.h Stefano Babic
2012-11-10 12:37     ` Benoît Thébaudeau
2012-11-10 12:46       ` Albert ARIBAUD
2012-11-10 12:47         ` Albert ARIBAUD
2012-11-10 13:51           ` Benoît Thébaudeau
2012-11-10 16:45       ` stefano babic
2012-11-13 19:55   ` [U-Boot] [PATCH v3 " Benoît Thébaudeau
2012-11-13 19:55     ` [U-Boot] [PATCH v3 02/13] ehci-mxc: Clean up Benoît Thébaudeau
2012-11-16  8:29       ` Stefano Babic
2012-11-13 19:56     ` [U-Boot] [PATCH v3 03/13] ehci-mx5: " Benoît Thébaudeau
2012-11-13 19:56     ` [U-Boot] [PATCH v3 04/13] ehci-mx5: Fix OC_DIS usage Benoît Thébaudeau
2012-11-13 19:56     ` [U-Boot] [PATCH v3 05/13] ehci-mx5: Fix OPM usage Benoît Thébaudeau
2012-11-13 19:56     ` [U-Boot] [PATCH v3 06/13] ehci-mx5: Fix *PM usage for i.MX53 Benoît Thébaudeau
2012-11-13 19:57     ` [U-Boot] [PATCH v3 07/13] ehci-mx5: Add missing OC_DIS " Benoît Thébaudeau
2012-11-13 19:57     ` [U-Boot] [PATCH v3 08/13] ehci-mxc: Make EHCI power/oc polarities configurable Benoît Thébaudeau
2012-11-13 19:57     ` [U-Boot] [PATCH v3 09/13] ehci-mxc: Make i.MX25 EHCI configurable Benoît Thébaudeau
2012-11-13 19:57     ` [U-Boot] [PATCH v3 10/13] ehci-mxc: Define host offsets Benoît Thébaudeau
2012-11-13 19:58     ` [U-Boot] [PATCH v3 11/13] ehci-mxc: Add support for i.MX35 Benoît Thébaudeau
2012-11-13 19:58     ` [U-Boot] [PATCH v3 12/13] mx35pdk: Add support for OTG Benoît Thébaudeau
2012-11-13 19:58     ` [U-Boot] [PATCH v3 13/13] ehci-mx5/6: Make board_ehci_hcd_init() optional Benoît Thébaudeau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516208406.587402.1352146413048.JavaMail.root@advansee.com \
    --to=benoit.thebaudeau@advansee.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.