diff mbox

[U-Boot,1/3] arm: mx6: cm-fx6: force host mode on usb controller

Message ID 1440938209-1731-2-git-send-email-nikita@compulab.co.il
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Commit Message

Nikita Kiryanov Aug. 30, 2015, 12:36 p.m. UTC
On some CM-FX6 modules U-Boot attempts to configure the usb0 controller in
device mode, which renders it unavailable:
	USB0:   Port not available.
and also causes usb stop to report an error
	EHCI failed to shut down host controller.

This happens mostly on MX6 Dual based modules, and is caused by the USBPHY_CTRL
register reporting USBPHY_CTRL_OTG_ID to be 1, even when it is pulled down.
Since we do not support device mode in cm-fx6 u-boot, force all controllers to
be configured as hosts.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
 board/compulab/cm_fx6/cm_fx6.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Igor Grinberg Aug. 30, 2015, 1:33 p.m. UTC | #1
On 08/30/15 15:36, Nikita Kiryanov wrote:
> On some CM-FX6 modules U-Boot attempts to configure the usb0 controller in
> device mode, which renders it unavailable:
> 	USB0:   Port not available.
> and also causes usb stop to report an error
> 	EHCI failed to shut down host controller.
> 
> This happens mostly on MX6 Dual based modules, and is caused by the USBPHY_CTRL
> register reporting USBPHY_CTRL_OTG_ID to be 1, even when it is pulled down.
> Since we do not support device mode in cm-fx6 u-boot, force all controllers to
> be configured as hosts.
> 
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

> ---
>  board/compulab/cm_fx6/cm_fx6.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
> index def821c..668d221 100644
> --- a/board/compulab/cm_fx6/cm_fx6.c
> +++ b/board/compulab/cm_fx6/cm_fx6.c
> @@ -14,6 +14,7 @@
>  #include <miiphy.h>
>  #include <netdev.h>
>  #include <errno.h>
> +#include <usb.h>
>  #include <fdt_support.h>
>  #include <sata.h>
>  #include <splash.h>
> @@ -349,6 +350,11 @@ static int cm_fx6_setup_usb_otg(void)
>  	return gpio_direction_output(SB_FX6_USB_OTG_PWR, 0);
>  }
>  
> +int board_usb_phy_mode(int port)
> +{
> +	return USB_INIT_HOST;
> +}
> +
>  int board_ehci_hcd_init(int port)
>  {
>  	int ret;
>
diff mbox

Patch

diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index def821c..668d221 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -14,6 +14,7 @@ 
 #include <miiphy.h>
 #include <netdev.h>
 #include <errno.h>
+#include <usb.h>
 #include <fdt_support.h>
 #include <sata.h>
 #include <splash.h>
@@ -349,6 +350,11 @@  static int cm_fx6_setup_usb_otg(void)
 	return gpio_direction_output(SB_FX6_USB_OTG_PWR, 0);
 }
 
+int board_usb_phy_mode(int port)
+{
+	return USB_INIT_HOST;
+}
+
 int board_ehci_hcd_init(int port)
 {
 	int ret;