All of lore.kernel.org
 help / color / mirror / Atom feed
* Enabling USBH1 on mx53qsb
@ 2013-07-25  2:59 Fabio Estevam
  2013-07-25  3:13 ` Peter Chen
  2013-07-25 14:03 ` Arnaud Patard (Rtp)
  0 siblings, 2 replies; 9+ messages in thread
From: Fabio Estevam @ 2013-07-25  2:59 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I am trying to get USBH1 port to work on mx53qsb (with Dialog pmic)
with the following patch against linux-next-20130724:

--- a/arch/arm/boot/dts/imx53-qsb.dts
+++ b/arch/arm/boot/dts/imx53-qsb.dts
@@ -93,6 +93,15 @@
                        regulator-max-microvolt = <3200000>;
                        regulator-always-on;
                };
+
+               reg_usb_vbus: usb_vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio7 8 0>;
+                       enable-active-high;
+               };
        };

        sound {
@@ -145,6 +154,7 @@
                                MX53_PAD_EIM_DA12__GPIO3_12       0x80000000
                                MX53_PAD_EIM_DA13__GPIO3_13       0x80000000
                                MX53_PAD_PATA_DA_0__GPIO7_6       0x80000000
+                               MX53_PAD_PATA_DA_2__GPIO7_8       0x80000000
                                MX53_PAD_GPIO_16__GPIO7_11        0x80000000
                        >;
                };
@@ -302,7 +312,8 @@
 };

 &usbh1 {
-       status = "okay";
+       vbus-supply = <&reg_usb_vbus>;
+       status = "okay";
 };

 &usbotg {


mx53qsb board has two USB host ports:

- The top port is USBH1
- The bottom port is OTG (also shared with J3 connector)

After applying the above patch the OTG port does work, but the USBH1 does not.

However, if I access USBH1 within U-boot prior to launching the
kernel, then I am able to use USBH1 in the kernel succesfully.

Any idea of something I am missing?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25  2:59 Enabling USBH1 on mx53qsb Fabio Estevam
@ 2013-07-25  3:13 ` Peter Chen
  2013-07-25  3:28   ` Fabio Estevam
  2013-07-25 14:03 ` Arnaud Patard (Rtp)
  1 sibling, 1 reply; 9+ messages in thread
From: Peter Chen @ 2013-07-25  3:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 24, 2013 at 11:59:35PM -0300, Fabio Estevam wrote:
> Hi,
> 
> I am trying to get USBH1 port to work on mx53qsb (with Dialog pmic)
> with the following patch against linux-next-20130724:
> 
> --- a/arch/arm/boot/dts/imx53-qsb.dts
> +++ b/arch/arm/boot/dts/imx53-qsb.dts
> @@ -93,6 +93,15 @@
>                         regulator-max-microvolt = <3200000>;
>                         regulator-always-on;
>                 };
> +
> +               reg_usb_vbus: usb_vbus {
> +                       compatible = "regulator-fixed";
> +                       regulator-name = "usb_vbus";
> +                       regulator-min-microvolt = <5000000>;
> +                       regulator-max-microvolt = <5000000>;
> +                       gpio = <&gpio7 8 0>;
> +                       enable-active-high;
> +               };
>         };
> 
>         sound {
> @@ -145,6 +154,7 @@
>                                 MX53_PAD_EIM_DA12__GPIO3_12       0x80000000
>                                 MX53_PAD_EIM_DA13__GPIO3_13       0x80000000
>                                 MX53_PAD_PATA_DA_0__GPIO7_6       0x80000000
> +                               MX53_PAD_PATA_DA_2__GPIO7_8       0x80000000
>                                 MX53_PAD_GPIO_16__GPIO7_11        0x80000000
>                         >;
>                 };
> @@ -302,7 +312,8 @@
>  };
> 
>  &usbh1 {
> -       status = "okay";
> +       vbus-supply = <&reg_usb_vbus>;
> +       status = "okay";
>  };
> 
>  &usbotg {
> 
> 
> mx53qsb board has two USB host ports:
> 
> - The top port is USBH1
> - The bottom port is OTG (also shared with J3 connector)
> 
> After applying the above patch the OTG port does work, but the USBH1 does not.

Would you enable CONFIG_USB_DEBUG to see where is the problem?

> 
> However, if I access USBH1 within U-boot prior to launching the
> kernel, then I am able to use USBH1 in the kernel succesfully.

access host 1 at u-boot, what do you mean, only register access
or let host 1 work?

If it is really true, that means the kernel may omit some init steps
for host 1, but u-boot has.


-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25  3:13 ` Peter Chen
@ 2013-07-25  3:28   ` Fabio Estevam
  2013-07-25  3:37     ` Peter Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2013-07-25  3:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Peter,

On Thu, Jul 25, 2013 at 12:13 AM, Peter Chen <peter.chen@freescale.com> wrote:

> Would you enable CONFIG_USB_DEBUG to see where is the problem?

This is what I get:

ci_hdrc ci_hdrc.0: ChipIdea HDRC found, lpm: 0; cap: f5780100 op: f5780140
ci_hdrc ci_hdrc.0: doesn't support gadget
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ci_hdrc ci_hdrc.1: ChipIdea HDRC found, lpm: 0; cap: f5780300 op: f5780340
ci_hdrc ci_hdrc.1: doesn't support gadget
ci_hdrc ci_hdrc.1: EHCI Host Controller
ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2
ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected

>
>>
>> However, if I access USBH1 within U-boot prior to launching the
>> kernel, then I am able to use USBH1 in the kernel succesfully.
>
> access host 1 at u-boot, what do you mean, only register access
> or let host 1 work?

This is what I do in U-boot:

MX53LOCO U-Boot > usb reset
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
MX53LOCO U-Boot > run bootcmd

Then kernel is launched and I can use USBH1 succesfully.

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25  3:28   ` Fabio Estevam
@ 2013-07-25  3:37     ` Peter Chen
  2013-07-25  3:44       ` Fabio Estevam
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Chen @ 2013-07-25  3:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 25, 2013 at 12:28:15AM -0300, Fabio Estevam wrote:
> Hi Peter,
> 
> On Thu, Jul 25, 2013 at 12:13 AM, Peter Chen <peter.chen@freescale.com> wrote:
> 
> > Would you enable CONFIG_USB_DEBUG to see where is the problem?
> 
> This is what I get:
> 
> ci_hdrc ci_hdrc.0: ChipIdea HDRC found, lpm: 0; cap: f5780100 op: f5780140
> ci_hdrc ci_hdrc.0: doesn't support gadget
> ci_hdrc ci_hdrc.0: EHCI Host Controller
> ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
> ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
> hub 1-0:1.0: USB hub found
> hub 1-0:1.0: 1 port detected
> ci_hdrc ci_hdrc.1: ChipIdea HDRC found, lpm: 0; cap: f5780300 op: f5780340
> ci_hdrc ci_hdrc.1: doesn't support gadget
> ci_hdrc ci_hdrc.1: EHCI Host Controller
> ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2
> ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
> hub 2-0:1.0: USB hub found
> hub 2-0:1.0: 1 port detected
> 
> >
> >>
> >> However, if I access USBH1 within U-boot prior to launching the
> >> kernel, then I am able to use USBH1 in the kernel succesfully.
> >
> > access host 1 at u-boot, what do you mean, only register access
> > or let host 1 work?
> 
> This is what I do in U-boot:
> 
> MX53LOCO U-Boot > usb reset
> (Re)start USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 2 USB Device(s) found
>        scanning usb for storage devices... 1 Storage Device(s) found
>        scanning usb for ethernet devices... 0 Ethernet Device(s) found
> MX53LOCO U-Boot > run bootcmd
> 
> Then kernel is launched and I can use USBH1 succesfully.

seems u-boot already support mx53.

Can you measure the host 1 vbus pin? The vbus should be 5v to let
the host works normal.

-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25  3:37     ` Peter Chen
@ 2013-07-25  3:44       ` Fabio Estevam
  2013-07-25  3:57         ` Marek Vasut
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2013-07-25  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 25, 2013 at 12:37 AM, Peter Chen <peter.chen@freescale.com> wrote:

> seems u-boot already support mx53.
>
> Can you measure the host 1 vbus pin? The vbus should be 5v to let
> the host works normal.

The VBUS is the same for both USBH1 port and OTG ports and it is at
5V, since OTG port does work.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25  3:44       ` Fabio Estevam
@ 2013-07-25  3:57         ` Marek Vasut
  0 siblings, 0 replies; 9+ messages in thread
From: Marek Vasut @ 2013-07-25  3:57 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Fabio Estevam,

> On Thu, Jul 25, 2013 at 12:37 AM, Peter Chen <peter.chen@freescale.com> wrote:
> > seems u-boot already support mx53.
> > 
> > Can you measure the host 1 vbus pin? The vbus should be 5v to let
> > the host works normal.
> 
> The VBUS is the same for both USBH1 port and OTG ports and it is at
> 5V, since OTG port does work.

Check either VBUS or clock, it's one of those ;-)

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25  2:59 Enabling USBH1 on mx53qsb Fabio Estevam
  2013-07-25  3:13 ` Peter Chen
@ 2013-07-25 14:03 ` Arnaud Patard (Rtp)
  2013-07-25 20:26   ` Fabio Estevam
  1 sibling, 1 reply; 9+ messages in thread
From: Arnaud Patard (Rtp) @ 2013-07-25 14:03 UTC (permalink / raw)
  To: linux-arm-kernel

Fabio Estevam <festevam@gmail.com> writes:

> Hi,

Hi,
>
> I am trying to get USBH1 port to work on mx53qsb (with Dialog pmic)
> with the following patch against linux-next-20130724:

I've been trying to reach the same goal for quite some time without
success (on the same version of the mx53qsb).
>
> --- a/arch/arm/boot/dts/imx53-qsb.dts
> +++ b/arch/arm/boot/dts/imx53-qsb.dts
> @@ -93,6 +93,15 @@
>                         regulator-max-microvolt = <3200000>;
>                         regulator-always-on;
>                 };
> +
> +               reg_usb_vbus: usb_vbus {
> +                       compatible = "regulator-fixed";
> +                       regulator-name = "usb_vbus";
> +                       regulator-min-microvolt = <5000000>;
> +                       regulator-max-microvolt = <5000000>;
> +                       gpio = <&gpio7 8 0>;
> +                       enable-active-high;
> +               };
>         };
>
>         sound {
> @@ -145,6 +154,7 @@
>                                 MX53_PAD_EIM_DA12__GPIO3_12       0x80000000
>                                 MX53_PAD_EIM_DA13__GPIO3_13       0x80000000
>                                 MX53_PAD_PATA_DA_0__GPIO7_6       0x80000000
> +                               MX53_PAD_PATA_DA_2__GPIO7_8       0x80000000
>                                 MX53_PAD_GPIO_16__GPIO7_11        0x80000000
>                         >;
>                 };
> @@ -302,7 +312,8 @@
>  };
>
>  &usbh1 {
> -       status = "okay";
> +       vbus-supply = <&reg_usb_vbus>;
> +       status = "okay";

I tried also with:
+       phy_type = "utmi_wide";
+       dr_mode = "host";

but nothing.

>  };
>
>  &usbotg {
>
>
> mx53qsb board has two USB host ports:
>
> - The top port is USBH1
> - The bottom port is OTG (also shared with J3 connector)
>
> After applying the above patch the OTG port does work, but the USBH1
> does not.

Given that the same gpio controls vbus for both ports, my current guess
is something on port configuration side (I guess the board would freeze
hard if a clock is not enabled).


Arnaud

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25 14:03 ` Arnaud Patard (Rtp)
@ 2013-07-25 20:26   ` Fabio Estevam
  2013-07-25 21:06     ` Fabio Estevam
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2013-07-25 20:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnaud,

On Thu, Jul 25, 2013 at 11:03 AM, Arnaud Patard
<arnaud.patard@rtp-net.org> wrote:

> Given that the same gpio controls vbus for both ports, my current guess
> is something on port configuration side (I guess the board would freeze
> hard if a clock is not enabled).

I agree.

Did a quick test: in U-boot I read the value of USB_UH1_PORTSC1, which
is 0xdc000000 right after reset.

If I only change the PTS field to 00 (write 1c000000), which
configures UTMI mode, then USBH1 can work in Linux.

So we have a bug in the chipidea driver not writing to USBH1 PORTSC
register even if I pass the "phy_type" via dt.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Enabling USBH1 on mx53qsb
  2013-07-25 20:26   ` Fabio Estevam
@ 2013-07-25 21:06     ` Fabio Estevam
  0 siblings, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2013-07-25 21:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 25, 2013 at 5:26 PM, Fabio Estevam <festevam@gmail.com> wrote:

> So we have a bug in the chipidea driver not writing to USBH1 PORTSC
> register even if I pass the "phy_type" via dt.

I fixed the issue and will submit the patches shortly.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-25 21:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-25  2:59 Enabling USBH1 on mx53qsb Fabio Estevam
2013-07-25  3:13 ` Peter Chen
2013-07-25  3:28   ` Fabio Estevam
2013-07-25  3:37     ` Peter Chen
2013-07-25  3:44       ` Fabio Estevam
2013-07-25  3:57         ` Marek Vasut
2013-07-25 14:03 ` Arnaud Patard (Rtp)
2013-07-25 20:26   ` Fabio Estevam
2013-07-25 21:06     ` Fabio Estevam

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.