* [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5
[not found] <1432242175-11817-1-git-send-email-mstarr@hedonline.com>
@ 2015-05-21 21:02 ` Matthew Starr
2015-05-21 21:06 ` Simon Glass
2015-05-21 23:09 ` Marek Vasut
0 siblings, 2 replies; 5+ messages in thread
From: Matthew Starr @ 2015-05-21 21:02 UTC (permalink / raw)
To: u-boot
CONFIG_MXC_USB_PORT was used to define which USB port was to be
initialized. If CONFIG_USB_MAX_CONTROLLER_COUNT > 1, then the
port specified by CONFIG_MXC_USB_PORT would be duplicated
CONFIG_USB_MAX_CONTROLLER_COUNT times including duplicating all
devices connected to the ports. None of the other USB ports would
be available for use.
The fix is to remove all instances of CONFIG_MXC_USB_PORT from the
imx53 ehci driver since it was only allowing the port specified by
CONFIG_MXC_USB_PORT to be populated. Then use
CONFIG_USB_MAX_CONTROLLER_COUNT to specifiy which USB ports should be
enabled, starting with port 0. If port 1 is needed, then set
CONFIG_USB_MAX_CONTROLLER_COUNT to 2 so 2 ports get populated (port 0
and port 1) even though port 0 will not be used.
Configurations for all boards affected are updated.
Signed-off-by: Matthew Starr <mstarr@hedonline.com>
---
drivers/usb/host/ehci-mx5.c | 8 ++++----
include/configs/m53evk.h | 2 +-
include/configs/mx51_efikamx.h | 1 +
include/configs/mx51evk.h | 2 +-
include/configs/mx53loco.h | 2 +-
include/configs/usbarmory.h | 2 +-
6 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/host/ehci-mx5.c b/drivers/usb/host/ehci-mx5.c
index d319962..dd0fefe 100644
--- a/drivers/usb/host/ehci-mx5.c
+++ b/drivers/usb/host/ehci-mx5.c
@@ -243,10 +243,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,
mdelay(1);
/* Do board specific initialization */
- board_ehci_hcd_init(CONFIG_MXC_USB_PORT);
+ board_ehci_hcd_init(index);
ehci = (struct usb_ehci *)(OTG_BASE_ADDR +
- (0x200 * CONFIG_MXC_USB_PORT));
+ (0x200 * index));
*hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength);
*hcor = (struct ehci_hcor *)((uint32_t)*hccr +
HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
@@ -255,11 +255,11 @@ int ehci_hcd_init(int index, enum usb_init_type init,
__raw_writel(CONFIG_MXC_USB_PORTSC, &ehci->portsc);
setbits_le32(&ehci->portsc, USB_EN);
- mxc_set_usbcontrol(CONFIG_MXC_USB_PORT, CONFIG_MXC_USB_FLAGS);
+ mxc_set_usbcontrol(index, CONFIG_MXC_USB_FLAGS);
mdelay(10);
/* Do board specific post-initialization */
- board_ehci_hcd_postinit(ehci, CONFIG_MXC_USB_PORT);
+ board_ehci_hcd_postinit(ehci, index);
return 0;
}
diff --git a/include/configs/m53evk.h b/include/configs/m53evk.h
index 0cc1282..5c0a9c7 100644
--- a/include/configs/m53evk.h
+++ b/include/configs/m53evk.h
@@ -199,7 +199,7 @@
#define CONFIG_USB_ETHER_ASIX
#define CONFIG_USB_ETHER_MCS7830
#define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT 1
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0
#endif
diff --git a/include/configs/mx51_efikamx.h b/include/configs/mx51_efikamx.h
index fce7ead..545d9ce 100644
--- a/include/configs/mx51_efikamx.h
+++ b/include/configs/mx51_efikamx.h
@@ -172,6 +172,7 @@
#define CONFIG_USB_EHCI_MX5
#define CONFIG_USB_ULPI
#define CONFIG_USB_ULPI_VIEWPORT
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_MXC_USB_PORT 1
#if (CONFIG_MXC_USB_PORT == 0)
#define CONFIG_MXC_USB_PORTSC (1 << 28)
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index b0c9717..61c8e11 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -103,7 +103,7 @@
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX
#define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT 1
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_MXC_USB_PORTSC PORT_PTS_ULPI
#define CONFIG_MXC_USB_FLAGS MXC_EHCI_POWER_PINS_ENABLED
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index a56e72e..32a2c2c 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -69,7 +69,7 @@
#define CONFIG_USB_ETHER_ASIX
#define CONFIG_USB_ETHER_MCS7830
#define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT 1
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0
diff --git a/include/configs/usbarmory.h b/include/configs/usbarmory.h
index f29ab2d..edc4fc6 100644
--- a/include/configs/usbarmory.h
+++ b/include/configs/usbarmory.h
@@ -61,7 +61,7 @@
#define CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_MX5
#define CONFIG_USB_STORAGE
-#define CONFIG_MXC_USB_PORT 1
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5
2015-05-21 21:02 ` [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5 Matthew Starr
@ 2015-05-21 21:06 ` Simon Glass
2015-05-21 21:13 ` Matthew Starr
2015-05-21 23:09 ` Marek Vasut
1 sibling, 1 reply; 5+ messages in thread
From: Simon Glass @ 2015-05-21 21:06 UTC (permalink / raw)
To: u-boot
Hi,
On 21 May 2015 at 15:02, Matthew Starr <mstarr@hedonline.com> wrote:
>
> CONFIG_MXC_USB_PORT was used to define which USB port was to be
> initialized. If CONFIG_USB_MAX_CONTROLLER_COUNT > 1, then the
> port specified by CONFIG_MXC_USB_PORT would be duplicated
> CONFIG_USB_MAX_CONTROLLER_COUNT times including duplicating all
> devices connected to the ports. None of the other USB ports would
> be available for use.
>
> The fix is to remove all instances of CONFIG_MXC_USB_PORT from the
> imx53 ehci driver since it was only allowing the port specified by
> CONFIG_MXC_USB_PORT to be populated. Then use
> CONFIG_USB_MAX_CONTROLLER_COUNT to specifiy which USB ports should be
> enabled, starting with port 0. If port 1 is needed, then set
> CONFIG_USB_MAX_CONTROLLER_COUNT to 2 so 2 ports get populated (port 0
> and port 1) even though port 0 will not be used.
>
> Configurations for all boards affected are updated.
>
> Signed-off-by: Matthew Starr <mstarr@hedonline.com>
>
> ---
>
> drivers/usb/host/ehci-mx5.c | 8 ++++----
> include/configs/m53evk.h | 2 +-
> include/configs/mx51_efikamx.h | 1 +
> include/configs/mx51evk.h | 2 +-
> include/configs/mx53loco.h | 2 +-
> include/configs/usbarmory.h | 2 +-
> 6 files changed, 9 insertions(+), 8 deletions(-)
Perhaps instead this should move to driver model - it supports EHCI.
See tegra, exynos, sunxi and sandbox.
Regards,
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5
2015-05-21 21:06 ` Simon Glass
@ 2015-05-21 21:13 ` Matthew Starr
2015-05-21 21:19 ` Simon Glass
0 siblings, 1 reply; 5+ messages in thread
From: Matthew Starr @ 2015-05-21 21:13 UTC (permalink / raw)
To: u-boot
Simon,
> On 21 May 2015 at 15:02, Matthew Starr <mstarr@hedonline.com> wrote:
> >
> > CONFIG_MXC_USB_PORT was used to define which USB port was to be
> > initialized. If CONFIG_USB_MAX_CONTROLLER_COUNT > 1, then the port
> > specified by CONFIG_MXC_USB_PORT would be duplicated
> > CONFIG_USB_MAX_CONTROLLER_COUNT times including duplicating all
> > devices connected to the ports. None of the other USB ports would be
> > available for use.
> >
> > The fix is to remove all instances of CONFIG_MXC_USB_PORT from the
> > imx53 ehci driver since it was only allowing the port specified by
> > CONFIG_MXC_USB_PORT to be populated. Then use
> > CONFIG_USB_MAX_CONTROLLER_COUNT to specifiy which USB ports
> should be
> > enabled, starting with port 0. If port 1 is needed, then set
> > CONFIG_USB_MAX_CONTROLLER_COUNT to 2 so 2 ports get populated
> (port 0
> > and port 1) even though port 0 will not be used.
> >
> > Configurations for all boards affected are updated.
> >
> > Signed-off-by: Matthew Starr <mstarr@hedonline.com>
> >
> > ---
> >
> > drivers/usb/host/ehci-mx5.c | 8 ++++----
> > include/configs/m53evk.h | 2 +-
> > include/configs/mx51_efikamx.h | 1 +
> > include/configs/mx51evk.h | 2 +-
> > include/configs/mx53loco.h | 2 +-
> > include/configs/usbarmory.h | 2 +-
> > 6 files changed, 9 insertions(+), 8 deletions(-)
>
> Perhaps instead this should move to driver model - it supports EHCI.
> See tegra, exynos, sunxi and sandbox.
Wouldn't that require imx53 support for device trees? Currently I don't believe that is implemented yet.
Regards,
Matthew
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5
2015-05-21 21:13 ` Matthew Starr
@ 2015-05-21 21:19 ` Simon Glass
0 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2015-05-21 21:19 UTC (permalink / raw)
To: u-boot
Hi,
On 21 May 2015 at 15:13, Matthew Starr <mstarr@hedonline.com> wrote:
> Simon,
>
>> On 21 May 2015 at 15:02, Matthew Starr <mstarr@hedonline.com> wrote:
>> >
>> > CONFIG_MXC_USB_PORT was used to define which USB port was to be
>> > initialized. If CONFIG_USB_MAX_CONTROLLER_COUNT > 1, then the port
>> > specified by CONFIG_MXC_USB_PORT would be duplicated
>> > CONFIG_USB_MAX_CONTROLLER_COUNT times including duplicating all
>> > devices connected to the ports. None of the other USB ports would be
>> > available for use.
>> >
>> > The fix is to remove all instances of CONFIG_MXC_USB_PORT from the
>> > imx53 ehci driver since it was only allowing the port specified by
>> > CONFIG_MXC_USB_PORT to be populated. Then use
>> > CONFIG_USB_MAX_CONTROLLER_COUNT to specifiy which USB ports
>> should be
>> > enabled, starting with port 0. If port 1 is needed, then set
>> > CONFIG_USB_MAX_CONTROLLER_COUNT to 2 so 2 ports get populated
>> (port 0
>> > and port 1) even though port 0 will not be used.
>> >
>> > Configurations for all boards affected are updated.
>> >
>> > Signed-off-by: Matthew Starr <mstarr@hedonline.com>
>> >
>> > ---
>> >
>> > drivers/usb/host/ehci-mx5.c | 8 ++++----
>> > include/configs/m53evk.h | 2 +-
>> > include/configs/mx51_efikamx.h | 1 +
>> > include/configs/mx51evk.h | 2 +-
>> > include/configs/mx53loco.h | 2 +-
>> > include/configs/usbarmory.h | 2 +-
>> > 6 files changed, 9 insertions(+), 8 deletions(-)
>>
>> Perhaps instead this should move to driver model - it supports EHCI.
>> See tegra, exynos, sunxi and sandbox.
>
> Wouldn't that require imx53 support for device trees? Currently I don't believe that is implemented yet.
Yes, although it's pretty simple. Add CONFIG_OF_CONTROL and
CONFIG_OF_SEPARATE, copy the files in from the kernel and all should
be well.
Regards,
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5
2015-05-21 21:02 ` [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5 Matthew Starr
2015-05-21 21:06 ` Simon Glass
@ 2015-05-21 23:09 ` Marek Vasut
1 sibling, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2015-05-21 23:09 UTC (permalink / raw)
To: u-boot
On Thursday, May 21, 2015 at 11:02:55 PM, Matthew Starr wrote:
> CONFIG_MXC_USB_PORT was used to define which USB port was to be
> initialized. If CONFIG_USB_MAX_CONTROLLER_COUNT > 1, then the
> port specified by CONFIG_MXC_USB_PORT would be duplicated
> CONFIG_USB_MAX_CONTROLLER_COUNT times including duplicating all
> devices connected to the ports. None of the other USB ports would
> be available for use.
>
> The fix is to remove all instances of CONFIG_MXC_USB_PORT from the
> imx53 ehci driver since it was only allowing the port specified by
> CONFIG_MXC_USB_PORT to be populated. Then use
> CONFIG_USB_MAX_CONTROLLER_COUNT to specifiy which USB ports should be
> enabled, starting with port 0. If port 1 is needed, then set
> CONFIG_USB_MAX_CONTROLLER_COUNT to 2 so 2 ports get populated (port 0
> and port 1) even though port 0 will not be used.
>
> Configurations for all boards affected are updated.
>
> Signed-off-by: Matthew Starr <mstarr@hedonline.com>
Hi! Why don't you just define a list of controllers which should be
initialized instead ?
#define CONTROLLERS_TO_INIT { USB1, USB3 }
Where USB1 and USB3 is the address of the controller. Note that these
addresses are defined in arch/arm/include/ headers.
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-21 23:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1432242175-11817-1-git-send-email-mstarr@hedonline.com>
2015-05-21 21:02 ` [U-Boot] [PATCH] usb: imx: Allow multiple USB ports to be used at the same time on mx5 Matthew Starr
2015-05-21 21:06 ` Simon Glass
2015-05-21 21:13 ` Matthew Starr
2015-05-21 21:19 ` Simon Glass
2015-05-21 23:09 ` Marek Vasut
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.