All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] USB doesn't work on Rockpro64 in u-boot
@ 2019-11-06  3:47 Vasily Khoruzhick
  2019-11-06 16:50 ` Jagan Teki
  0 siblings, 1 reply; 7+ messages in thread
From: Vasily Khoruzhick @ 2019-11-06  3:47 UTC (permalink / raw)
  To: u-boot

Hi Akash, Jagan,

Looks like USB is not functional in u-boot on Rockpro64. u-boot is
from git, commit 680023c5fab6b1777c0c6f2e76e5d2effb7903a0.

I'm using u-boot SPL and mainline ATF
(19adcb415c313d656324d54e7608cdc7d7a5c414 is ATF commit)

'usb start' doesn't detect anything but hubs and looks like there's no
power on USB ports:

=> usb start
starting USB...
Bus usb at fe380000: USB EHCI 1.00
Bus usb at fe3c0000: USB EHCI 1.00
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb at fe380000 for devices... 1 USB Device(s) found
scanning bus usb at fe3c0000 for devices... 1 USB Device(s) found
scanning bus dwc3 for devices... 1 USB Device(s) found
scanning bus dwc3 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

=> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller

  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller

  1  Hub (5 Gb/s, 0mA)
     U-Boot XHCI Host Controller

  1  Hub (5 Gb/s, 0mA)
     U-Boot XHCI Host Controller

Regulators were probed correctly according to 'dm tree':

 regulator    14  [ + ]   fixed regulator       |-- vcc12v-dcin
 regulator    15  [ + ]   fixed regulator       |-- vcc1v8-s3
 regulator    16  [ + ]   fixed regulator       |-- vcc3v3-pcie-regulator
 regulator    17  [ + ]   fixed regulator       |-- vcc3v3-sys
 regulator    18  [ + ]   fixed regulator       |-- vcc5v0-host-regulator
 regulator    19  [ + ]   fixed regulator       |-- vcc5v0-typec-regulator
 regulator    20  [ + ]   fixed regulator       |-- vcc5v0-sys
 regulator    21  [ + ]   fixed regulator       |-- vcc5v0-usb
 regulator    22  [ + ]   pwm_regulator         `-- vdd-log

Any ideas what can be wrong? Have it worked before?

Regards,
Vasily

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

* [U-Boot] USB doesn't work on Rockpro64 in u-boot
  2019-11-06  3:47 [U-Boot] USB doesn't work on Rockpro64 in u-boot Vasily Khoruzhick
@ 2019-11-06 16:50 ` Jagan Teki
  2019-11-07  3:48   ` Vasily Khoruzhick
  0 siblings, 1 reply; 7+ messages in thread
From: Jagan Teki @ 2019-11-06 16:50 UTC (permalink / raw)
  To: u-boot

Hi Vasily,

On Wed, Nov 6, 2019 at 9:17 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>
> Hi Akash, Jagan,
>
> Looks like USB is not functional in u-boot on Rockpro64. u-boot is
> from git, commit 680023c5fab6b1777c0c6f2e76e5d2effb7903a0.
>
> I'm using u-boot SPL and mainline ATF
> (19adcb415c313d656324d54e7608cdc7d7a5c414 is ATF commit)
>
> 'usb start' doesn't detect anything but hubs and looks like there's no
> power on USB ports:
>
> => usb start
> starting USB...
> Bus usb at fe380000: USB EHCI 1.00
> Bus usb at fe3c0000: USB EHCI 1.00
> Bus dwc3: Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.10
> Bus dwc3: Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.10
> scanning bus usb at fe380000 for devices... 1 USB Device(s) found
> scanning bus usb at fe3c0000 for devices... 1 USB Device(s) found
> scanning bus dwc3 for devices... 1 USB Device(s) found
> scanning bus dwc3 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 0 Storage Device(s) found
>
> => usb tree
> USB device tree:
>   1  Hub (480 Mb/s, 0mA)
>      u-boot EHCI Host Controller
>
>   1  Hub (480 Mb/s, 0mA)
>      u-boot EHCI Host Controller
>
>   1  Hub (5 Gb/s, 0mA)
>      U-Boot XHCI Host Controller
>
>   1  Hub (5 Gb/s, 0mA)
>      U-Boot XHCI Host Controller
>
> Regulators were probed correctly according to 'dm tree':
>
>  regulator    14  [ + ]   fixed regulator       |-- vcc12v-dcin
>  regulator    15  [ + ]   fixed regulator       |-- vcc1v8-s3
>  regulator    16  [ + ]   fixed regulator       |-- vcc3v3-pcie-regulator
>  regulator    17  [ + ]   fixed regulator       |-- vcc3v3-sys
>  regulator    18  [ + ]   fixed regulator       |-- vcc5v0-host-regulator
>  regulator    19  [ + ]   fixed regulator       |-- vcc5v0-typec-regulator
>  regulator    20  [ + ]   fixed regulator       |-- vcc5v0-sys
>  regulator    21  [ + ]   fixed regulator       |-- vcc5v0-usb
>  regulator    22  [ + ]   pwm_regulator         `-- vdd-log
>
> Any ideas what can be wrong? Have it worked before?

I remember my last checking, give me sometime will check it on master
and update you.

Jagan.

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

* [U-Boot] USB doesn't work on Rockpro64 in u-boot
  2019-11-06 16:50 ` Jagan Teki
@ 2019-11-07  3:48   ` Vasily Khoruzhick
  2019-11-07  7:28     ` Vasily Khoruzhick
  0 siblings, 1 reply; 7+ messages in thread
From: Vasily Khoruzhick @ 2019-11-07  3:48 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 6, 2019 at 8:50 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Hi Vasily,
>
> On Wed, Nov 6, 2019 at 9:17 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> >
> > Hi Akash, Jagan,
> >
> > Looks like USB is not functional in u-boot on Rockpro64. u-boot is
> > from git, commit 680023c5fab6b1777c0c6f2e76e5d2effb7903a0.
> >
> > I'm using u-boot SPL and mainline ATF
> > (19adcb415c313d656324d54e7608cdc7d7a5c414 is ATF commit)
> >
> > 'usb start' doesn't detect anything but hubs and looks like there's no
> > power on USB ports:
> >
> > => usb start
> > starting USB...
> > Bus usb at fe380000: USB EHCI 1.00
> > Bus usb at fe3c0000: USB EHCI 1.00
> > Bus dwc3: Register 2000140 NbrPorts 2
> > Starting the controller
> > USB XHCI 1.10
> > Bus dwc3: Register 2000140 NbrPorts 2
> > Starting the controller
> > USB XHCI 1.10
> > scanning bus usb at fe380000 for devices... 1 USB Device(s) found
> > scanning bus usb at fe3c0000 for devices... 1 USB Device(s) found
> > scanning bus dwc3 for devices... 1 USB Device(s) found
> > scanning bus dwc3 for devices... 1 USB Device(s) found
> >        scanning usb for storage devices... 0 Storage Device(s) found
> >
> > => usb tree
> > USB device tree:
> >   1  Hub (480 Mb/s, 0mA)
> >      u-boot EHCI Host Controller
> >
> >   1  Hub (480 Mb/s, 0mA)
> >      u-boot EHCI Host Controller
> >
> >   1  Hub (5 Gb/s, 0mA)
> >      U-Boot XHCI Host Controller
> >
> >   1  Hub (5 Gb/s, 0mA)
> >      U-Boot XHCI Host Controller
> >
> > Regulators were probed correctly according to 'dm tree':
> >
> >  regulator    14  [ + ]   fixed regulator       |-- vcc12v-dcin
> >  regulator    15  [ + ]   fixed regulator       |-- vcc1v8-s3
> >  regulator    16  [ + ]   fixed regulator       |-- vcc3v3-pcie-regulator
> >  regulator    17  [ + ]   fixed regulator       |-- vcc3v3-sys
> >  regulator    18  [ + ]   fixed regulator       |-- vcc5v0-host-regulator
> >  regulator    19  [ + ]   fixed regulator       |-- vcc5v0-typec-regulator
> >  regulator    20  [ + ]   fixed regulator       |-- vcc5v0-sys
> >  regulator    21  [ + ]   fixed regulator       |-- vcc5v0-usb
> >  regulator    22  [ + ]   pwm_regulator         `-- vdd-log
> >
> > Any ideas what can be wrong? Have it worked before?
>
> I remember my last checking, give me sometime will check it on master
> and update you.

Looks like gpio clock is not enabled anywhere in u-boot for rk3399, so
gpios just don't work.

rk3399 clock driver is very rudimentary and doesn't touch clock gates at all.

Can anyone explain how it's supposed to work?

>
> Jagan.

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

* [U-Boot] USB doesn't work on Rockpro64 in u-boot
  2019-11-07  3:48   ` Vasily Khoruzhick
@ 2019-11-07  7:28     ` Vasily Khoruzhick
  2019-11-08  3:48       ` Vasily Khoruzhick
  0 siblings, 1 reply; 7+ messages in thread
From: Vasily Khoruzhick @ 2019-11-07  7:28 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 6, 2019 at 7:48 PM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>
> On Wed, Nov 6, 2019 at 8:50 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > Hi Vasily,
> >
> > On Wed, Nov 6, 2019 at 9:17 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> > >
> > > Hi Akash, Jagan,
> > >
> > > Looks like USB is not functional in u-boot on Rockpro64. u-boot is
> > > from git, commit 680023c5fab6b1777c0c6f2e76e5d2effb7903a0.
> > >
> > > I'm using u-boot SPL and mainline ATF
> > > (19adcb415c313d656324d54e7608cdc7d7a5c414 is ATF commit)
> > >
> > > 'usb start' doesn't detect anything but hubs and looks like there's no
> > > power on USB ports:
> > >
> > > => usb start
> > > starting USB...
> > > Bus usb at fe380000: USB EHCI 1.00
> > > Bus usb at fe3c0000: USB EHCI 1.00
> > > Bus dwc3: Register 2000140 NbrPorts 2
> > > Starting the controller
> > > USB XHCI 1.10
> > > Bus dwc3: Register 2000140 NbrPorts 2
> > > Starting the controller
> > > USB XHCI 1.10
> > > scanning bus usb at fe380000 for devices... 1 USB Device(s) found
> > > scanning bus usb at fe3c0000 for devices... 1 USB Device(s) found
> > > scanning bus dwc3 for devices... 1 USB Device(s) found
> > > scanning bus dwc3 for devices... 1 USB Device(s) found
> > >        scanning usb for storage devices... 0 Storage Device(s) found
> > >
> > > => usb tree
> > > USB device tree:
> > >   1  Hub (480 Mb/s, 0mA)
> > >      u-boot EHCI Host Controller
> > >
> > >   1  Hub (480 Mb/s, 0mA)
> > >      u-boot EHCI Host Controller
> > >
> > >   1  Hub (5 Gb/s, 0mA)
> > >      U-Boot XHCI Host Controller
> > >
> > >   1  Hub (5 Gb/s, 0mA)
> > >      U-Boot XHCI Host Controller
> > >
> > > Regulators were probed correctly according to 'dm tree':
> > >
> > >  regulator    14  [ + ]   fixed regulator       |-- vcc12v-dcin
> > >  regulator    15  [ + ]   fixed regulator       |-- vcc1v8-s3
> > >  regulator    16  [ + ]   fixed regulator       |-- vcc3v3-pcie-regulator
> > >  regulator    17  [ + ]   fixed regulator       |-- vcc3v3-sys
> > >  regulator    18  [ + ]   fixed regulator       |-- vcc5v0-host-regulator
> > >  regulator    19  [ + ]   fixed regulator       |-- vcc5v0-typec-regulator
> > >  regulator    20  [ + ]   fixed regulator       |-- vcc5v0-sys
> > >  regulator    21  [ + ]   fixed regulator       |-- vcc5v0-usb
> > >  regulator    22  [ + ]   pwm_regulator         `-- vdd-log
> > >
> > > Any ideas what can be wrong? Have it worked before?
> >
> > I remember my last checking, give me sometime will check it on master
> > and update you.
>
> Looks like gpio clock is not enabled anywhere in u-boot for rk3399, so
> gpios just don't work.

I was wrong about clock, it appears that set bin in CRU is disabled
clock. Yet GPIOs don't work in u-boot, e.g.

=> gpio set 154
gpio: pin 154 (gpio 154) value is 1
   Warning: value of pin is still 0

154 is vcc5v0-host-regulator.gpio.

> rk3399 clock driver is very rudimentary and doesn't touch clock gates at all.
>
> Can anyone explain how it's supposed to work?
>
> >
> > Jagan.

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

* [U-Boot] USB doesn't work on Rockpro64 in u-boot
  2019-11-07  7:28     ` Vasily Khoruzhick
@ 2019-11-08  3:48       ` Vasily Khoruzhick
  2019-11-08  6:33         ` Jagan Teki
  0 siblings, 1 reply; 7+ messages in thread
From: Vasily Khoruzhick @ 2019-11-08  3:48 UTC (permalink / raw)
  To: u-boot

I checked voltage on regulator enable pin and it's 1.5v in u-boot (and it's
not enough to enable regulator!) and in linux it's 3v. That's why USB
ports have no power in u-boot.

Looks like u-boot doesn't switch GPIO voltage from 1.8v to 3.3v. Any
ideas how to fix this?


On Wed, Nov 6, 2019 at 11:28 PM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>
> On Wed, Nov 6, 2019 at 7:48 PM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> >
> > On Wed, Nov 6, 2019 at 8:50 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > Hi Vasily,
> > >
> > > On Wed, Nov 6, 2019 at 9:17 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> > > >
> > > > Hi Akash, Jagan,
> > > >
> > > > Looks like USB is not functional in u-boot on Rockpro64. u-boot is
> > > > from git, commit 680023c5fab6b1777c0c6f2e76e5d2effb7903a0.
> > > >
> > > > I'm using u-boot SPL and mainline ATF
> > > > (19adcb415c313d656324d54e7608cdc7d7a5c414 is ATF commit)
> > > >
> > > > 'usb start' doesn't detect anything but hubs and looks like there's no
> > > > power on USB ports:
> > > >
> > > > => usb start
> > > > starting USB...
> > > > Bus usb at fe380000: USB EHCI 1.00
> > > > Bus usb at fe3c0000: USB EHCI 1.00
> > > > Bus dwc3: Register 2000140 NbrPorts 2
> > > > Starting the controller
> > > > USB XHCI 1.10
> > > > Bus dwc3: Register 2000140 NbrPorts 2
> > > > Starting the controller
> > > > USB XHCI 1.10
> > > > scanning bus usb at fe380000 for devices... 1 USB Device(s) found
> > > > scanning bus usb at fe3c0000 for devices... 1 USB Device(s) found
> > > > scanning bus dwc3 for devices... 1 USB Device(s) found
> > > > scanning bus dwc3 for devices... 1 USB Device(s) found
> > > >        scanning usb for storage devices... 0 Storage Device(s) found
> > > >
> > > > => usb tree
> > > > USB device tree:
> > > >   1  Hub (480 Mb/s, 0mA)
> > > >      u-boot EHCI Host Controller
> > > >
> > > >   1  Hub (480 Mb/s, 0mA)
> > > >      u-boot EHCI Host Controller
> > > >
> > > >   1  Hub (5 Gb/s, 0mA)
> > > >      U-Boot XHCI Host Controller
> > > >
> > > >   1  Hub (5 Gb/s, 0mA)
> > > >      U-Boot XHCI Host Controller
> > > >
> > > > Regulators were probed correctly according to 'dm tree':
> > > >
> > > >  regulator    14  [ + ]   fixed regulator       |-- vcc12v-dcin
> > > >  regulator    15  [ + ]   fixed regulator       |-- vcc1v8-s3
> > > >  regulator    16  [ + ]   fixed regulator       |-- vcc3v3-pcie-regulator
> > > >  regulator    17  [ + ]   fixed regulator       |-- vcc3v3-sys
> > > >  regulator    18  [ + ]   fixed regulator       |-- vcc5v0-host-regulator
> > > >  regulator    19  [ + ]   fixed regulator       |-- vcc5v0-typec-regulator
> > > >  regulator    20  [ + ]   fixed regulator       |-- vcc5v0-sys
> > > >  regulator    21  [ + ]   fixed regulator       |-- vcc5v0-usb
> > > >  regulator    22  [ + ]   pwm_regulator         `-- vdd-log
> > > >
> > > > Any ideas what can be wrong? Have it worked before?
> > >
> > > I remember my last checking, give me sometime will check it on master
> > > and update you.
> >
> > Looks like gpio clock is not enabled anywhere in u-boot for rk3399, so
> > gpios just don't work.
>
> I was wrong about clock, it appears that set bin in CRU is disabled
> clock. Yet GPIOs don't work in u-boot, e.g.
>
> => gpio set 154
> gpio: pin 154 (gpio 154) value is 1
>    Warning: value of pin is still 0
>
> 154 is vcc5v0-host-regulator.gpio.
>
> > rk3399 clock driver is very rudimentary and doesn't touch clock gates at all.
> >
> > Can anyone explain how it's supposed to work?
> >
> > >
> > > Jagan.

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

* [U-Boot] USB doesn't work on Rockpro64 in u-boot
  2019-11-08  3:48       ` Vasily Khoruzhick
@ 2019-11-08  6:33         ` Jagan Teki
  2019-11-09  8:42           ` Vasily Khoruzhick
  0 siblings, 1 reply; 7+ messages in thread
From: Jagan Teki @ 2019-11-08  6:33 UTC (permalink / raw)
  To: u-boot

Hi Vasily,

On Fri, Nov 8, 2019 at 9:18 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>
> I checked voltage on regulator enable pin and it's 1.5v in u-boot (and it's
> not enough to enable regulator!) and in linux it's 3v. That's why USB
> ports have no power in u-boot.
>
> Looks like u-boot doesn't switch GPIO voltage from 1.8v to 3.3v. Any
> ideas how to fix this?

I think I need to clock look of this, will look into it next week. I'm
travelling till that time.

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

* [U-Boot] USB doesn't work on Rockpro64 in u-boot
  2019-11-08  6:33         ` Jagan Teki
@ 2019-11-09  8:42           ` Vasily Khoruzhick
  0 siblings, 0 replies; 7+ messages in thread
From: Vasily Khoruzhick @ 2019-11-09  8:42 UTC (permalink / raw)
  To: u-boot

On Thu, Nov 7, 2019 at 10:33 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Hi Vasily,
>
> On Fri, Nov 8, 2019 at 9:18 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> >
> > I checked voltage on regulator enable pin and it's 1.5v in u-boot (and it's
> > not enough to enable regulator!) and in linux it's 3v. That's why USB
> > ports have no power in u-boot.
> >
> > Looks like u-boot doesn't switch GPIO voltage from 1.8v to 3.3v. Any
> > ideas how to fix this?
>
> I think I need to clock look of this, will look into it next week. I'm
> travelling till that time.

I figured it out, rockpro64 needs I/O domains to be configured in
order for USB to work.

See "rockchip: rk3399: split rockpro64 out of evb_rk3399" patch on ML.

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

end of thread, other threads:[~2019-11-09  8:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06  3:47 [U-Boot] USB doesn't work on Rockpro64 in u-boot Vasily Khoruzhick
2019-11-06 16:50 ` Jagan Teki
2019-11-07  3:48   ` Vasily Khoruzhick
2019-11-07  7:28     ` Vasily Khoruzhick
2019-11-08  3:48       ` Vasily Khoruzhick
2019-11-08  6:33         ` Jagan Teki
2019-11-09  8:42           ` Vasily Khoruzhick

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.