All of lore.kernel.org
 help / color / mirror / Atom feed
From: Otavio Salvador <otavio@ossystems.com.br>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 13/16] cgtqmx6eval: Add USB support
Date: Mon, 13 Jul 2015 12:23:15 -0300	[thread overview]
Message-ID: <1436800998-21248-13-git-send-email-otavio@ossystems.com.br> (raw)
In-Reply-To: <1436800998-21248-1-git-send-email-otavio@ossystems.com.br>

Add USB support.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---

 board/congatec/cgtqmx6eval/cgtqmx6eval.c | 47 ++++++++++++++++++++++++++++++++
 include/configs/cgtqmx6eval.h            | 15 ++++++++++
 2 files changed, 62 insertions(+)

diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
index 9167cf8..a3d01bf 100644
--- a/board/congatec/cgtqmx6eval/cgtqmx6eval.c
+++ b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
@@ -151,6 +151,11 @@ static iomux_v3_cfg_t enet_pads_ar8035[] = {
 	MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),
 };
 
+static iomux_v3_cfg_t const usb_otg_pads[] = {
+	MX6_PAD_EIM_D22__USB_OTG_PWR | MUX_PAD_CTRL(NO_PAD_CTRL),
+	MX6_PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
 #define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
 struct i2c_pads_info i2c_pad_info1 = {
 	.scl = {
@@ -458,6 +463,48 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+int board_ehci_hcd_init(int port)
+{
+	switch (port) {
+	case 0:
+		imx_iomux_v3_setup_multiple_pads(usb_otg_pads,
+						 ARRAY_SIZE(usb_otg_pads));
+		/*
+		 * set daisy chain for otg_pin_id on 6q.
+		 * for 6dl, this bit is reserved
+		 */
+		imx_iomux_set_gpr_register(1, 13, 1, 0);
+		break;
+	case 1:
+		/* nothing to do */
+		break;
+	default:
+		printf("Invalid USB port: %d\n", port);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+int board_ehci_power(int port, int on)
+{
+	switch (port) {
+	case 0:
+		break;
+	case 1:
+		if (on)
+			gpio_direction_output(IMX_GPIO_NR(5, 5), 1);
+		else
+			gpio_direction_output(IMX_GPIO_NR(5, 5), 0);
+		break;
+	default:
+		printf("Invalid USB port: %d\n", port);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 int board_early_init_f(void)
 {
 	setup_iomux_uart();
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index 4c91154..a88c4db 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -78,6 +78,21 @@
 #define CONFIG_POWER_PFUZE100
 #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
 
+/* USB Configs */
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+#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 /* Enabled USB controller number */
+#define CONFIG_USB_KEYBOARD
+#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
+
 #define CONFIG_DEFAULT_FDT_FILE "imx6q-congatec.dtb"
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-- 
2.4.5

  parent reply	other threads:[~2015-07-13 15:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13 15:23 [U-Boot] [PATCH 01/16] mx53loco: Use generic 'load' command instead of 'fatload' Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 02/16] cgtqmx6eval: Use default prompt Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 03/16] cgtqmx6eval: Use the default CONFIG_SYS_PBSIZE Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 04/16] cgtqmx6eval: Staticize when possible Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 05/16] cgtqmx6eval: Improve the error handling Otavio Salvador
2015-07-13 15:59   ` Marek Vasut
2015-07-13 15:23 ` [U-Boot] [PATCH 06/16] cgtqmx6eval: Fit into single lines Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 07/16] cgtqmx6eval: Add ESDHC3 support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 08/16] cgtqmx6eval: Add ESDHC write-protect support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 09/16] cgtqmx6eval: Add SPI NOR flash support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 10/16] cgtqmx6eval: Add Ethernet support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 11/16] cgtqmx6eval: Add thermal support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 12/16] cgtqmx6eval: Add PMIC support Otavio Salvador
2015-07-13 15:56   ` Marek Vasut
2015-07-13 15:23 ` Otavio Salvador [this message]
2015-07-13 15:54   ` [U-Boot] [PATCH 13/16] cgtqmx6eval: Add USB support Marek Vasut
2015-07-13 15:23 ` [U-Boot] [PATCH 14/16] cgtqmx6eval: Add splash screen support Otavio Salvador
2015-07-13 15:53   ` Marek Vasut
2015-07-13 15:23 ` [U-Boot] [PATCH 15/16] cgtqmx6eval: Add SATA support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 16/16] cgtqmx6eval: Use standard boot script Otavio Salvador
2015-07-13 15:51   ` Marek Vasut
2015-07-13 16:11     ` Otavio Salvador
2015-07-13 16:13       ` Marek Vasut
2015-07-13 17:15         ` Otavio Salvador
2015-07-13 21:28           ` Marek Vasut
2015-07-14 11:54             ` Otavio Salvador

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=1436800998-21248-13-git-send-email-otavio@ossystems.com.br \
    --to=otavio@ossystems.com.br \
    --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.