usb: imx: Allow multiple USB ports to be used at the same time on mx5
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 usb: imx: Allow multiple USB ports to be used at the same time on mx5
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.
---
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(-)
drivers/usb/host/ehci-mx5.c +4 -4
@@ -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 ; }
include/configs/m53evk.h +1 -1
@@ -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
include/configs/mx51_efikamx.h +1 -0
@@ -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)
include/configs/mx51evk.h +1 -1
@@ -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
include/configs/mx53loco.h +1 -1
@@ -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
include/configs/usbarmory.h +1 -1
@@ -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
Signature · 1 line
2.1.4
PATCH 1/1 usb: imx: Allow multiple USB ports to be used at the same time on mx5
Hi,
Quoted 22 lines · Matthew Starr
CONFIG_MXC_USB_PORTwas used to define which USB port was to be initialized. IfCONFIG_USB_MAX_CONTROLLER_COUNT> 1, then the port specified byCONFIG_MXC_USB_PORTwould be duplicatedCONFIG_USB_MAX_CONTROLLER_COUNTtimes 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_PORTfrom the imx53 ehci driver since it was only allowing the port specified byCONFIG_MXC_USB_PORTto be populated. Then useCONFIG_USB_MAX_CONTROLLER_COUNTto specifiy which USB ports should be enabled, starting with port 0. If port 1 is needed, then setCONFIG_USB_MAX_CONTROLLER_COUNTto 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 <[email protected]>---
Quoted 7 lines
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
PATCH 1/1 usb: imx: Allow multiple USB ports to be used at the same time on mx5
Simon,
Quoted 33 lines · Matthew Starr
Quoted 8 lines
CONFIG_MXC_USB_PORTwas used to define which USB port was to be initialized. IfCONFIG_USB_MAX_CONTROLLER_COUNT> 1, then the port specified byCONFIG_MXC_USB_PORTwould be duplicatedCONFIG_USB_MAX_CONTROLLER_COUNTtimes including duplicating all devices connected to the ports. None of the other USB ports would be available for use.Quoted 4 lines
The fix is to remove all instances of
CONFIG_MXC_USB_PORTfrom the imx53 ehci driver since it was only allowing the port specified byCONFIG_MXC_USB_PORTto be populated. Then useCONFIG_USB_MAX_CONTROLLER_COUNTto specifiy which USB portsshould be
Quoted 2 lines
enabled, starting with port 0. If port 1 is needed, then set
CONFIG_USB_MAX_CONTROLLER_COUNTto 2 so 2 ports get populated(port 0
Quoted 8 lines
and port 1) even though port 0 will not be used.
Configurations for all boards affected are updated.
Signed-off-by Matthew Starr <[email protected]>---
Quoted 7 lines
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(-)
Quoted 2 lines
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
PATCH 1/1 usb: imx: Allow multiple USB ports to be used at the same time on mx5
Hi,
Quoted 35 lines · Matthew Starr
Simon,
Quoted 33 lines · Matthew Starr
Quoted 8 lines
CONFIG_MXC_USB_PORTwas used to define which USB port was to be initialized. IfCONFIG_USB_MAX_CONTROLLER_COUNT> 1, then the port specified byCONFIG_MXC_USB_PORTwould be duplicatedCONFIG_USB_MAX_CONTROLLER_COUNTtimes including duplicating all devices connected to the ports. None of the other USB ports would be available for use.Quoted 4 lines
The fix is to remove all instances of
CONFIG_MXC_USB_PORTfrom the imx53 ehci driver since it was only allowing the port specified byCONFIG_MXC_USB_PORTto be populated. Then useCONFIG_USB_MAX_CONTROLLER_COUNTto specifiy which USB portsshould be
Quoted 2 lines
enabled, starting with port 0. If port 1 is needed, then set
CONFIG_USB_MAX_CONTROLLER_COUNTto 2 so 2 ports get populated(port 0
Quoted 15 lines
and port 1) even though port 0 will not be used.
Configurations for all boards affected are updated.
Signed-off-by Matthew Starr <[email protected]>---
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(-)
Quoted 4 lines
Quoted 2 lines
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
PATCH 1/1 usb: imx: Allow multiple USB ports to be used at the same time on mx5
In reply to Matthew StarrQuoted 15 lines · Matthew Starr
CONFIG_MXC_USB_PORTwas used to define which USB port was to be initialized. IfCONFIG_USB_MAX_CONTROLLER_COUNT> 1, then the port specified byCONFIG_MXC_USB_PORTwould be duplicatedCONFIG_USB_MAX_CONTROLLER_COUNTtimes 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_PORTfrom the imx53 ehci driver since it was only allowing the port specified byCONFIG_MXC_USB_PORTto be populated. Then useCONFIG_USB_MAX_CONTROLLER_COUNTto specifiy which USB ports should be enabled, starting with port 0. If port 1 is needed, then setCONFIG_USB_MAX_CONTROLLER_COUNTto 2 so 2 ports get populated (port 0 and port 1) even though port 0 will not be used.
Quoted 3 lines
Configurations for all boards affected are updated.
Signed-off-by Matthew Starr <[email protected]>
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