Skip to contentSkip to conversation

tbs2910: support for usb otg host mode

PATCH New Soeren Moch 2 participants 10 messages May 5, 2015 – May 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 tbs2910: support for usb otg host mode

Add support for USB OTG host mode. Only high speed devices supported so far (e.g. usb 2.0 hub required to connect a keyboard).

---
Cc: Stefano Babic <[email protected]>

---
 board/tbs/tbs2910/tbs2910.c | 10 ++++++++++
 include/configs/tbs2910.h   |  1 +
 2 files changed, 11 insertions(+)
board/tbs/tbs2910/tbs2910.c +10 -0
index 42b166d..0b509b6 100644
@@ -372,6 +372,12 @@ static const struct boot_mode board_boot_modes[] = {
 };
 #endif
 
+#ifdef CONFIG_USB_EHCI_MX6
+static iomux_v3_cfg_t const usb_otg_pads[] = {
+	MX6_PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+#endif
+
 int board_init(void)
 {
 	/* address of boot parameters */
@@ -391,6 +397,10 @@ int board_init(void)
 #ifdef CONFIG_CMD_BMODE
 	add_board_boot_modes(board_boot_modes);
 #endif
+#ifdef CONFIG_USB_EHCI_MX6
+	imx_iomux_v3_setup_multiple_pads(
+		usb_otg_pads, ARRAY_SIZE(usb_otg_pads));
+#endif
 	return 0;
 }
 
include/configs/tbs2910.h +1 -0
index 7089378..e5828e0 100644
@@ -163,6 +163,7 @@
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_MX6
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_USB_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/5 tbs2910: only enable vga output for stdout/stderr when hdmi detected

Only enable graphical output for stdout/stderr (and a usb keyboard for stdin) when a hdmi device is detected.
Serial console is always enabled for stdin/stdout/stderr.

---
Cc: Stefano Babic <[email protected]>

---
 include/configs/tbs2910.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
include/configs/tbs2910.h +13 -4
index e5828e0..ea4666d 100644
@@ -183,7 +183,13 @@
 #ifdef CONFIG_USB_KEYBOARD
 #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 #define CONFIG_SYS_STDIO_DEREGISTER
-#define CONFIG_PREBOOT "if hdmidet; then usb start; fi"
+#define CONFIG_PREBOOT \
+	"if hdmidet; then " \
+		"usb start; " \
+		"run set_con_usb_hdmi; " \
+	"else " \
+		"run set_con_serial; " \
+	"fi;"
 #endif /* CONFIG_USB_KEYBOARD */
 #endif /* CONFIG_CMD_USB      */
 
@@ -241,9 +247,12 @@
 			"bootm 0x10800000 0x10d00000\0" \
 	"console=ttymxc0\0" \
 	"fan=gpio set 92\0" \
-	"stdin=serial,usbkbd\0" \
-	"stdout=serial,vga\0" \
-	"stderr=serial,vga\0"
+	"set_con_serial=setenv stdin serial; " \
+			"setenv stdout serial; " \
+			"setenv stderr serial;\0" \
+	"set_con_usb_hdmi=setenv stdin serial,usbkbd; " \
+			"setenv stdout serial,vga; " \
+			"setenv stderr serial,vga;\0"
 
 #define CONFIG_BOOTCOMMAND \
 	"mmc rescan; " \
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/5 tbs2910: only enable vga output for stdout/stderr when hdmi detected

Quoted 37 lines · Soeren Moch

Only enable graphical output for stdout/stderr (and a usb keyboard for stdin) when a hdmi device is detected.
Serial console is always enabled for stdin/stdout/stderr.

---
Cc: Stefano Babic <[email protected]>

---
 include/configs/tbs2910.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
include/configs/tbs2910.h +7 -3
index e5828e0..ea4666d 100644
@@ -183,7 +183,13 @@
 #ifdef CONFIG_USB_KEYBOARD
 #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 #define CONFIG_SYS_STDIO_DEREGISTER
-#define CONFIG_PREBOOT "if hdmidet; then usb start; fi"
+#define CONFIG_PREBOOT \
+	"if hdmidet; then " \
+		"usb start; " \
+		"run set_con_usb_hdmi; " \
+	"else " \
+		"run set_con_serial; " \
+	"fi;"
 #endif /* CONFIG_USB_KEYBOARD */
 #endif /* CONFIG_CMD_USB      */
 
@@ -241,9 +247,12 @@
 			"bootm 0x10800000 0x10d00000\0" \
 	"console=ttymxc0\0" \
 	"fan=gpio set 92\0" \
-	"stdin=serial,usbkbd\0" \
-	"stdout=serial,vga\0" \

include/configs/tbs2910.h line 258

Quoted 10 lines
include/configs/tbs2910.h +6 -1
-	"stderr=serial,vga\0"
+	"set_con_serial=setenv stdin serial; " \
+			"setenv stdout serial; " \
+			"setenv stderr serial;\0" \
+	"set_con_usb_hdmi=setenv stdin serial,usbkbd; " \
+			"setenv stdout serial,vga; " \
+			"setenv stderr serial,vga;\0"
 
 #define CONFIG_BOOTCOMMAND \
 	"mmc rescan; " \

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 3/5 tbs2910: use default CONFIG_SYS_PBSIZE

In reply to Soeren Moch

Since there is a default CONFIG_SYS_PBSIZE definition in config_fallbacks.h, this setting is no longer required in board configurations.

---
Cc: Stefano Babic <[email protected]>

---
 include/configs/tbs2910.h | 2 --
 1 file changed, 2 deletions(-)
include/configs/tbs2910.h +0 -2
index ea4666d..9efb8c2 100644
@@ -39,8 +39,6 @@
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_SYS_MAXARGS		16
 #define CONFIG_SYS_CBSIZE		1024
-#define CONFIG_SYS_PBSIZE \
-	(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_HZ			1000
 
 /* Physical Memory Map */
Signature · 1 line
1.9.1
#4 lore raw

PATCH 3/5 tbs2910: use default CONFIG_SYS_PBSIZE

Quoted 16 lines · Soeren Moch

Since there is a default CONFIG_SYS_PBSIZE definition in config_fallbacks.h, this setting is no longer required in board configurations.

---
Cc: Stefano Babic <[email protected]>

---
 include/configs/tbs2910.h | 2 --
 1 file changed, 2 deletions(-)
include/configs/tbs2910.h +0 -0
index ea4666d..9efb8c2 100644

include/configs/tbs2910.h line 44

Quoted 8 lines
include/configs/tbs2910.h +0 -2
@@ -39,8 +39,6 @@
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_SYS_MAXARGS		16
 #define CONFIG_SYS_CBSIZE		1024
-#define CONFIG_SYS_PBSIZE \
-	(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_HZ			1000
 
 /* Physical Memory Map */

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#5 lore raw

PATCH 4/5 tbs2910: add CONFIG_SUPPORT_EMMC_BOOT

In reply to Soeren Moch

Add emmc boot partition commands to be able to select the boot partition.

---
Cc: Stefano Babic <[email protected]>

---
 include/configs/tbs2910.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/tbs2910.h +1 -0
index 9efb8c2..1f3c3d8 100644
@@ -102,6 +102,7 @@
 #define CONFIG_MMC
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_SUPPORT_EMMC_BOOT
 #define CONFIG_BOUNCE_BUFFER
 
 /* Ethernet */
Signature · 1 line
1.9.1
#6 lore raw

PATCH 4/5 tbs2910: add CONFIG_SUPPORT_EMMC_BOOT

Quoted 15 lines · Soeren Moch

Add emmc boot partition commands to be able to select the boot partition.

---
Cc: Stefano Babic <[email protected]>

---
 include/configs/tbs2910.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/tbs2910.h +0 -0
index 9efb8c2..1f3c3d8 100644

include/configs/tbs2910.h line 108

Quoted 7 lines
include/configs/tbs2910.h +1 -0
@@ -102,6 +102,7 @@
 #define CONFIG_MMC
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_SUPPORT_EMMC_BOOT
 #define CONFIG_BOUNCE_BUFFER
 
 /* Ethernet */

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#7 lore raw

PATCH 5/5 tbs2910: add ext4 write support

In reply to Soeren Moch

Add CONFIG_CMD_EXT4_WRITE to enable ext4 write support.

---
Cc: Stefano Babic <[email protected]>

---
 include/configs/tbs2910.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/tbs2910.h +1 -0
index 1f3c3d8..d0d6a30 100644
@@ -83,6 +83,7 @@
 
 /* Filesystems / image support */
 #define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 #define CONFIG_EFI_PARTITION
Signature · 1 line
1.9.1
#8 lore raw

PATCH 5/5 tbs2910: add ext4 write support

Quoted 14 lines · Soeren Moch

Add CONFIG_CMD_EXT4_WRITE to enable ext4 write support.

---
Cc: Stefano Babic <[email protected]>

---
  include/configs/tbs2910.h | 1 +
  1 file changed, 1 insertion(+)
include/configs/tbs2910.h +0 -0
index 1f3c3d8..d0d6a30 100644

include/configs/tbs2910.h line 89

Quoted 7 lines
include/configs/tbs2910.h +1 -0
@@ -83,6 +83,7 @@
 
  /* Filesystems / image support */
  #define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
  #define CONFIG_CMD_FAT
  #define CONFIG_DOS_PARTITION
  #define CONFIG_EFI_PARTITION

Stefano,

if the series
[PATCH 0/10 v2] i.MX6: move duplicated options to mx6_common to standardise mx6 config
<http://lists.denx.de/pipermail/u-boot/2015-May/213883.html>

will be applied (what I think would be a good idea), then please drop this patch.

Thanks,
Soeren

#9 lore raw

PATCH 1/5 tbs2910: support for usb otg host mode

In reply to Soeren Moch
Quoted 7 lines · Soeren Moch

Add support for USB OTG host mode. Only high speed devices supported so far (e.g. usb 2.0 hub required to connect a keyboard).

---
Cc: Stefano Babic <[email protected]>
---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================