All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] mx6cuboxi: Add USB host support
Date: Mon, 27 Apr 2015 23:30:42 -0300	[thread overview]
Message-ID: <1430188244-28216-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1430188244-28216-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

Enable USB Host1 port.

Signed-off-by: Rabeeh Khoury <rabeeh@solid-run.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/solidrun/mx6cuboxi/mx6cuboxi.c | 26 ++++++++++++++++++++++++++
 include/configs/mx6cuboxi.h          | 12 ++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index eab92f1..9aa0259 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -31,6 +31,8 @@
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 #include <spl.h>
+#include <usb.h>
+#include <usb/ehci-fsl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -52,6 +54,7 @@ DECLARE_GLOBAL_DATA_PTR;
 	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
 
 #define ETH_PHY_RESET	IMX_GPIO_NR(4, 15)
+#define USB_H1_VBUS	IMX_GPIO_NR(1, 0)
 
 int dram_init(void)
 {
@@ -79,6 +82,10 @@ static iomux_v3_cfg_t const hb_cbi_sense[] = {
 	IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04   | MUX_PAD_CTRL(UART_PAD_CTRL)),
 };
 
+static iomux_v3_cfg_t const usb_pads[] = {
+	IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL)),
+};
+
 static void setup_iomux_uart(void)
 {
 	SETUP_IOMUX_PADS(uart1_pads);
@@ -253,6 +260,21 @@ static int setup_display(void)
 }
 #endif /* CONFIG_VIDEO_IPUV3 */
 
+#ifdef CONFIG_USB_EHCI_MX6
+static void setup_usb(void)
+{
+	SETUP_IOMUX_PADS(usb_pads);
+}
+
+int board_ehci_hcd_init(int port)
+{
+	if (port == 1)
+		gpio_direction_output(USB_H1_VBUS, 1);
+
+	return 0;
+}
+#endif
+
 int board_early_init_f(void)
 {
 	int ret = 0;
@@ -261,6 +283,10 @@ int board_early_init_f(void)
 #ifdef CONFIG_VIDEO_IPUV3
 	ret = setup_display();
 #endif
+
+#ifdef CONFIG_USB_EHCI_MX6
+	setup_usb();
+#endif
 	return ret;
 }
 
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
index 207a2a6..e7a18c6 100644
--- a/include/configs/mx6cuboxi.h
+++ b/include/configs/mx6cuboxi.h
@@ -82,6 +82,18 @@
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
 
+/* USB */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_MX6
+#define CONFIG_USB_STORAGE
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
+#define CONFIG_MXC_USB_FLAGS		0
+#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
+
 #define CONFIG_SYS_NO_FLASH
 
 /* Command definition */
-- 
1.9.1

  reply	other threads:[~2015-04-28  2:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28  2:30 [U-Boot] [PATCH 1/4] mx6cuboxi: Add HDMI output support Fabio Estevam
2015-04-28  2:30 ` Fabio Estevam [this message]
2015-04-28 14:48   ` [U-Boot] [PATCH 2/4] mx6cuboxi: Add USB host support Tom Rini
2015-04-28 15:11     ` Fabio Estevam
2015-04-28 15:20       ` Fabio Estevam
2015-04-28 16:39         ` Tom Rini
2015-04-28 16:45           ` Jon Nettleton
2015-04-28 16:49             ` Otavio Salvador
2015-04-28 16:52             ` Tom Rini
2015-04-28 16:58               ` Otavio Salvador
2015-04-28 18:58               ` Fabio Estevam
2015-04-28 16:47           ` Tom Rini
2015-04-28  2:30 ` [U-Boot] [PATCH 3/4] mx6cuboxi: Allow HDMI and USB keyboard to be stdout/stdin Fabio Estevam
2015-04-28 14:48   ` Tom Rini
2015-04-28  2:30 ` [U-Boot] [PATCH 4/4] logos: Add Solidrun's logo Fabio Estevam
2015-04-28 14:48   ` Tom Rini
2015-04-28 14:47 ` [U-Boot] [PATCH 1/4] mx6cuboxi: Add HDMI output support Tom Rini
2015-04-29 20:02 ` Vagrant Cascadian
2015-04-29 22:12   ` Robert Nelson
2015-04-29 22:14   ` Robert Nelson
2015-04-29 22:23   ` Fabio Estevam
2015-04-30 21:20     ` Vagrant Cascadian
2015-04-30 21:27       ` Fabio Estevam

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=1430188244-28216-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.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.