Patchwork [U-Boot,07/10] usb: mxs: Disable USB Port 1 for i.MX23

login
register
mail settings
Submitter Otavio Salvador
Date Jan. 30, 2013, 12:13 p.m.
Message ID <1359548001-14278-8-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/216879/
State Changes Requested
Delegated to: Stefano Babic
Headers show

Comments

Otavio Salvador - Jan. 30, 2013, 12:13 p.m.
The i.MX23 just one USB port so disable the second controller probe
when building for i.MX23.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 drivers/usb/host/ehci-mxs.c | 2 ++
 1 file changed, 2 insertions(+)
Marek Vasut - Jan. 30, 2013, 2:17 p.m.
Dear Otavio Salvador,

> The i.MX23 just one USB port so disable the second controller probe
> when building for i.MX23.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  drivers/usb/host/ehci-mxs.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
> index 5062af5..28c8cde 100644
> --- a/drivers/usb/host/ehci-mxs.c
> +++ b/drivers/usb/host/ehci-mxs.c
> @@ -50,10 +50,12 @@ int mxs_ehci_get_port(struct ehci_mxs *mxs_usb, int
> port) usb_base = MXS_USBCTRL0_BASE;
>  		phy_base = MXS_USBPHY0_BASE;
>  		break;
> +#ifdef CONFIG_MX28
>  	case 1:
>  		usb_base = MXS_USBCTRL1_BASE;
>  		phy_base = MXS_USBPHY1_BASE;
>  		break;
> +#endif
>  	default:
>  		printf("CONFIG_EHCI_MXS_PORT (port = %d)\n", port);
>  		return -1;

This is not enough.

For example this portion will do something undefined on mx23:

 98         writel(HW_DIGCTL_CTRL_USB0_CLKGATE | HW_DIGCTL_CTRL_USB1_CLKGATE,
 99                 &digctl_ctrl->reg_clr);

THis ehci-mxs.c needs full review for mx23.

Best regards,
Marek Vasut
Otavio Salvador - Jan. 30, 2013, 3:36 p.m.
On Wed, Jan 30, 2013 at 12:17 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> The i.MX23 just one USB port so disable the second controller probe
>> when building for i.MX23.
>>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  drivers/usb/host/ehci-mxs.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
>> index 5062af5..28c8cde 100644
>> --- a/drivers/usb/host/ehci-mxs.c
>> +++ b/drivers/usb/host/ehci-mxs.c
>> @@ -50,10 +50,12 @@ int mxs_ehci_get_port(struct ehci_mxs *mxs_usb, int
>> port) usb_base = MXS_USBCTRL0_BASE;
>>               phy_base = MXS_USBPHY0_BASE;
>>               break;
>> +#ifdef CONFIG_MX28
>>       case 1:
>>               usb_base = MXS_USBCTRL1_BASE;
>>               phy_base = MXS_USBPHY1_BASE;
>>               break;
>> +#endif
>>       default:
>>               printf("CONFIG_EHCI_MXS_PORT (port = %d)\n", port);
>>               return -1;
>
> This is not enough.
>
> For example this portion will do something undefined on mx23:
>
>  98         writel(HW_DIGCTL_CTRL_USB0_CLKGATE | HW_DIGCTL_CTRL_USB1_CLKGATE,
>  99                 &digctl_ctrl->reg_clr);
>
> THis ehci-mxs.c needs full review for mx23.

Ok; I will handle it for v2.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

Patch

diff --git a/drivers/usb/host/ehci-mxs.c b/drivers/usb/host/ehci-mxs.c
index 5062af5..28c8cde 100644
--- a/drivers/usb/host/ehci-mxs.c
+++ b/drivers/usb/host/ehci-mxs.c
@@ -50,10 +50,12 @@  int mxs_ehci_get_port(struct ehci_mxs *mxs_usb, int port)
 		usb_base = MXS_USBCTRL0_BASE;
 		phy_base = MXS_USBPHY0_BASE;
 		break;
+#ifdef CONFIG_MX28
 	case 1:
 		usb_base = MXS_USBCTRL1_BASE;
 		phy_base = MXS_USBPHY1_BASE;
 		break;
+#endif
 	default:
 		printf("CONFIG_EHCI_MXS_PORT (port = %d)\n", port);
 		return -1;