All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Murphy <dmurphy@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 4/7] ARM: OMAP5-uevm: Add USB ehci support for the uEVM
Date: Wed, 17 Jul 2013 15:16:04 -0500	[thread overview]
Message-ID: <1374092167-27645-5-git-send-email-dmurphy@ti.com> (raw)
In-Reply-To: <1374092167-27645-1-git-send-email-dmurphy@ti.com>

Add the USB ehci support for the OMAP5 uEVM.

Configure the uEVM mux data
Add the flags to build the appropriate modules
Add the usb call backs to initialize the EHCI controller

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
v3 - Updated per comments and removed reset function - http://patchwork.ozlabs.org/patch/258231/

 board/ti/omap5_uevm/evm.c      |   41 ++++++++++++++++++++++++++++++++++++++++
 board/ti/omap5_uevm/mux_data.h |    4 +++-
 include/configs/omap5_uevm.h   |   22 +++++++++++++++++++++
 3 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
index 00bd72d..bf14cd2 100644
--- a/board/ti/omap5_uevm/evm.c
+++ b/board/ti/omap5_uevm/evm.c
@@ -29,6 +29,12 @@
 
 #include "mux_data.h"
 
+#ifdef CONFIG_USB_EHCI
+#include <usb.h>
+#include <asm/arch/ehci.h>
+#include <asm/ehci-omap.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 const struct omap_sysinfo sysinfo = {
@@ -103,3 +109,38 @@ int board_mmc_init(bd_t *bis)
 	return 0;
 }
 #endif
+
+#ifdef CONFIG_USB_EHCI
+static struct omap_usbhs_board_data usbhs_bdata = {
+	.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
+	.port_mode[1] = OMAP_EHCI_PORT_MODE_HSIC,
+	.port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC,
+};
+
+int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+{
+	int ret;
+	int auxclk;
+
+	auxclk = readl((*prcm)->scrm_auxclk1);
+	/* Request auxilary clock */
+	auxclk |= AUXCLK_ENABLE_MASK;
+	writel(auxclk, (*prcm)->scrm_auxclk1);
+
+	ret = omap_ehci_hcd_init(&usbhs_bdata, hccr, hcor);
+	if (ret < 0) {
+		printf("Failed to initialize ehci\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+int ehci_hcd_stop(void)
+{
+	int ret;
+
+	ret = omap_ehci_hcd_stop();
+	return ret;
+}
+#endif
diff --git a/board/ti/omap5_uevm/mux_data.h b/board/ti/omap5_uevm/mux_data.h
index a82795d..17de7f5 100644
--- a/board/ti/omap5_uevm/mux_data.h
+++ b/board/ti/omap5_uevm/mux_data.h
@@ -56,7 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = {
 	{USBD0_HS_DP, (IEN | M0)},	/*  USBD0_HS_DP */
 	{USBD0_HS_DM, (IEN | M0)},	/*  USBD0_HS_DM */
 	{USBD0_SS_RX, (IEN | M0)},	/*  USBD0_SS_RX */
-
+	{HSI2_ACWAKE, (PTU | M6)},    /*  HSI2_ACWAKE */
+	{HSI2_CAFLAG, (PTU | M6)},    /*  HSI2_CAFLAG */
 };
 
 const struct pad_conf_entry wkup_padconf_array_essential[] = {
@@ -64,6 +65,7 @@ const struct pad_conf_entry wkup_padconf_array_essential[] = {
 	{SR_PMIC_SCL, (PTU | IEN | M0)}, /* SR_PMIC_SCL */
 	{SR_PMIC_SDA, (PTU | IEN | M0)}, /* SR_PMIC_SDA */
 	{SYS_32K, (IEN | M0)}, /*  SYS_32K     */
+	{FREF_CLK1_OUT, (PTD | IEN | M0)},    /*  FREF_CLK1_OUT  */
 
 };
 
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 46dacc2..0740a32 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -53,6 +53,28 @@
 #define CONFIG_PARTITION_UUIDS
 #define CONFIG_CMD_PART
 
+/* USB UHH support options */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_HOST
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_STORAGE
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+
+#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 79
+#define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 80
+
+/* Enabled commands */
+#define CONFIG_NET_MULTI
+#define CONFIG_CMD_DHCP		/* DHCP Support			*/
+#define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#define CONFIG_CMD_NFS		/* NFS support			*/
+
+/* USB Networking options */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+
 #define CONFIG_SYS_PROMPT		"OMAP5432 uEVM # "
 
 #define CONSOLEDEV		"ttyO2"
-- 
1.7.9.5

  parent reply	other threads:[~2013-07-17 20:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 20:16 [U-Boot] OMAP5 uEVM USB eHCI patch set Dan Murphy
2013-07-17 20:16 ` [U-Boot] [PATCH v3 1/7] omap5: uevm: Change the board name to correct name Dan Murphy
2013-07-18  4:20   ` Marek Vasut
2013-07-17 20:16 ` [U-Boot] [PATCH v3 2/7] ARM: OMAP5: USB: Add OMAP5 common USB EHCI information Dan Murphy
2013-07-18  7:10   ` Roger Quadros
2013-07-18 17:48     ` Dan Murphy
2013-07-19  9:30       ` Roger Quadros
2013-07-22 15:14         ` Tom Rini
2013-07-17 20:16 ` [U-Boot] [PATCH v3 3/7] ARM: OMAP: USB: Fix linker error when ULPI is not defined Dan Murphy
2013-07-18  4:23   ` Marek Vasut
2013-07-17 20:16 ` Dan Murphy [this message]
2013-07-22 15:16   ` [U-Boot] [PATCH v3 4/7] ARM: OMAP5-uevm: Add USB ehci support for the uEVM Tom Rini
2013-07-17 20:16 ` [U-Boot] [PATCH v3 5/7] ARM: OMAP5-uevm: Add USB MAC ethernet address Dan Murphy
2013-07-18  4:28   ` Marek Vasut
2013-07-18 15:40     ` Dan Murphy
2013-07-18 15:47       ` Marek Vasut
2013-07-17 20:16 ` [U-Boot] [PATCH v3 6/7] USB: usb-hub: Add a weak function for resetting devices Dan Murphy
2013-07-18  4:30   ` Marek Vasut
2013-07-24 19:55     ` Dan Murphy
2013-07-25  5:32       ` Marek Vasut
2013-07-25  9:22         ` Roger Quadros
2013-07-17 20:16 ` [U-Boot] [PATCH v3 7/7] ARM: OMAP5-uevm: Add usb device reset API Dan Murphy
2013-07-18  4:30   ` Marek Vasut
2013-07-31 19:43     ` Dan Murphy
2013-07-31 20:18       ` Marek Vasut

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=1374092167-27645-5-git-send-email-dmurphy@ti.com \
    --to=dmurphy@ti.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.