USB 3.0 support for Rockchip RK3328

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

USB 3.0 support for Rockchip RK3328

Denis Polygalov
Hi. I'm testing this patch:

https://reviews.freebsd.org/D19335

on my ROCK64 (v2.0) board. Not ROCKPro(!)
Compiled world and kernel with the patch applied,
boot over network. No traces of USB 3.0 in dmesg...

Also:

root@rock64-sn01:~ # gpioctl -f /dev/gpioc4 26 1
gpio_open: No such file or directory
root@rock64-sn01:~ #

root@rock64-sn01:~ # uname -a
FreeBSD rock64-sn01 13.0-CURRENT FreeBSD 13.0-CURRENT #1 r350829M: Mon
Aug 12 21:50:00 JST 2019
denis@buildarm:/usr/home/denis/boards/rock64/obj/usr/home/denis/freebsd/base/head/src/arm64.aarch64/sys/GENERIC
  arm64

Any ideas how to make this work please?

Regards,
Denis.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Greg V
On August 12, 2019 4:10:07 PM GMT+03:00, Denis Polygalov <[hidden email]> wrote:
>Hi. I'm testing this patch:
>
>https://reviews.freebsd.org/D19335
>
>on my ROCK64 (v2.0) board. Not ROCKPro(!)
>
>Any ideas how to make this work please?

Looks like the devicetree that's in the freebsd repo right now does not have the usb3 node.

Google for rk3328 dwc3 usb3, apply the related dts changes (or just download the whole dts from a newer Linux version), rebuild the dtb and boot with the new dtb.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Emmanuel Vadot-7
On Mon, 12 Aug 2019 17:19:30 +0300
Greg V <[hidden email]> wrote:

> On August 12, 2019 4:10:07 PM GMT+03:00, Denis Polygalov <[hidden email]> wrote:
> >Hi. I'm testing this patch:
> >
> >https://reviews.freebsd.org/D19335
> >
> >on my ROCK64 (v2.0) board. Not ROCKPro(!)
> >
> >Any ideas how to make this work please?
>
> Looks like the devicetree that's in the freebsd repo right now does not have the usb3 node.
>
> Google for rk3328 dwc3 usb3, apply the related dts changes (or just download the whole dts from a newer Linux version), rebuild the dtb and boot with the new dtb.

 Only the vendor DTS have something related to usb3 with a compatible
"rockchip,rk3328-xhci".
 This controller isn't documented in the TRM so I don't know much about
it, based on the property of the dts node I guess it's a dwc3 because
there is some snps props but ...

--
Emmanuel Vadot <[hidden email]> <[hidden email]>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Greg V
August 12, 2019 6:12 PM, "Emmanuel Vadot" <[hidden email]> wrote:

> On Mon, 12 Aug 2019 17:19:30 +0300
> Greg V <[hidden email]> wrote:
>
>> On August 12, 2019 4:10:07 PM GMT+03:00, Denis Polygalov <[hidden email]> wrote:
>> Hi. I'm testing this patch:
>>
>> https://reviews.freebsd.org/D19335
>>
>> on my ROCK64 (v2.0) board. Not ROCKPro(!)
>>
>> Any ideas how to make this work please?
>>
>> Looks like the devicetree that's in the freebsd repo right now does not have the usb3 node.
>>
>> Google for rk3328 dwc3 usb3, apply the related dts changes (or just download the whole dts from a
>> newer Linux version), rebuild the dtb and boot with the new dtb.
>
> Only the vendor DTS have something related to usb3 with a compatible
> "rockchip,rk3328-xhci".
> This controller isn't documented in the TRM so I don't know much about
> it, based on the property of the dts node I guess it's a dwc3 because
> there is some snps props but ...

I'm talking about this patch:

http://lkml.iu.edu/hypermail/linux/kernel/1708.2/01066.html

that mentions rockchip,rk3328-dwc3

so I guess it wasn't upstreamed
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Denis Polygalov
After application of this patch:
https://patchwork.kernel.org/patch/10853381/
and recompiling kernel I got this in dmesg:

# dmesg | egrep 'usb|dwc|USB'
dwc0: <Rockchip Gigabit Ethernet Controller> mem 0xff540000-0xff54ffff
irq 43 on ofwbus0
miibus0: <MII bus> on dwc0
dwc0: Ethernet address: 82:d6:05:ce:da:87
dwcotg0: <DWC OTG 2.0 integrated USB controller> mem
0xff580000-0xff5bffff irq 45 on ofwbus0
usbus0 on dwcotg0
usbus1 on ohci0
usbus0: 480Mbps High Speed USB v2.0
usbus1: 12Mbps Full Speed USB v1.0
ugen1.1: <Generic OHCI root HUB> at usbus1
uhub0 on usbus1
uhub0: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen0.1: <DWCOTG OTG Root HUB> at usbus0
uhub1 on usbus0
uhub1: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
Root mount waiting for: usbus1 usbus0
dwc0: link state changed to DOWN
dwc0: link state changed to UP

but no response to connection of any USB device.
Also I noticed that 'gpioctl -f /dev/gpioc4 26 1'
make sense only for ROCKPro64 which is not what I have:

  # ls /dev/gp*
/dev/gpioc0     /dev/gpioc1     /dev/gpioc2     /dev/gpioc3

Is there some similar magic command to turn on USB parts on ROCK64?

Regards,
Denis.

On 13/08/2019 4:53 am, [hidden email] wrote:

> August 12, 2019 6:12 PM, "Emmanuel Vadot" <[hidden email]> wrote:
>
>> On Mon, 12 Aug 2019 17:19:30 +0300
>> Greg V <[hidden email]> wrote:
>>
>>> On August 12, 2019 4:10:07 PM GMT+03:00, Denis Polygalov <[hidden email]> wrote:
>>> Hi. I'm testing this patch:
>>>
>>> https://reviews.freebsd.org/D19335
>>>
>>> on my ROCK64 (v2.0) board. Not ROCKPro(!)
>>>
>>> Any ideas how to make this work please?
>>>
>>> Looks like the devicetree that's in the freebsd repo right now does not have the usb3 node.
>>>
>>> Google for rk3328 dwc3 usb3, apply the related dts changes (or just download the whole dts from a
>>> newer Linux version), rebuild the dtb and boot with the new dtb.
>>
>> Only the vendor DTS have something related to usb3 with a compatible
>> "rockchip,rk3328-xhci".
>> This controller isn't documented in the TRM so I don't know much about
>> it, based on the property of the dts node I guess it's a dwc3 because
>> there is some snps props but ...
>
> I'm talking about this patch:
>
> http://lkml.iu.edu/hypermail/linux/kernel/1708.2/01066.html
>
> that mentions rockchip,rk3328-dwc3
>
> so I guess it wasn't upstreamed
>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Greg V
On August 14, 2019 4:04:08 PM GMT+03:00, Denis Polygalov <[hidden email]> wrote:
>After application of this patch:
>https://patchwork.kernel.org/patch/10853381

>dwcotg0: <DWC OTG 2.0 integrated USB controller>

That's not it, that's 2.0, not xhci. Make sure you have the 3.0 node in the device tree.

>Also I noticed that 'gpioctl -f /dev/gpioc4 26 1'
>make sense only for ROCKPro64
>Is there some similar magic command to turn on USB parts on ROCK64?

Probably. Really they shouldn't be turned off, there's some place in the rockchip drivers that's responsible for regulators, I just haven't figured out what to do there.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Andreas Tobler-5
In reply to this post by Denis Polygalov
On 14.08.19 15:04, Denis Polygalov wrote:

> After application of this patch:
> https://patchwork.kernel.org/patch/10853381/
> and recompiling kernel I got this in dmesg:
>
> # dmesg | egrep 'usb|dwc|USB'
> dwc0: <Rockchip Gigabit Ethernet Controller> mem 0xff540000-0xff54ffff
> irq 43 on ofwbus0
> miibus0: <MII bus> on dwc0
> dwc0: Ethernet address: 82:d6:05:ce:da:87
> dwcotg0: <DWC OTG 2.0 integrated USB controller> mem
> 0xff580000-0xff5bffff irq 45 on ofwbus0
> usbus0 on dwcotg0
> usbus1 on ohci0
> usbus0: 480Mbps High Speed USB v2.0
> usbus1: 12Mbps Full Speed USB v1.0
> ugen1.1: <Generic OHCI root HUB> at usbus1
> uhub0 on usbus1
> uhub0: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
> ugen0.1: <DWCOTG OTG Root HUB> at usbus0
> uhub1 on usbus0
> uhub1: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
> Root mount waiting for: usbus1 usbus0
> dwc0: link state changed to DOWN
> dwc0: link state changed to UP
>
> but no response to connection of any USB device.
> Also I noticed that 'gpioctl -f /dev/gpioc4 26 1'
> make sense only for ROCKPro64 which is not what I have:
>
>    # ls /dev/gp*
> /dev/gpioc0     /dev/gpioc1     /dev/gpioc2     /dev/gpioc3
>
> Is there some similar magic command to turn on USB parts on ROCK64?

With the latest u-boot-rock64 from ports:

gpioctl -f /dev/gpioc0 2 0

Andreas

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Denis Polygalov

>>
>> Is there some similar magic command to turn on USB parts on ROCK64?
>
> With the latest u-boot-rock64 from ports:
>
> gpioctl -f /dev/gpioc0 2 0
>

Thanks, I noticed that this command actually turn on USB 2.0(!)
ports on my ROCK64 board. USB 3.0 still does not work.

> That's not it, that's 2.0, not xhci. Make sure you have the 3.0 node in the device tree.
Yes, I'm agree that was 2.0. But I'm also sure that I have the patches
applied properly and also I can see entries from these patches in the
nfsroot/boot/dtb/rockchip/rk3328-rock64.dtb file after compilation.

I also noticed that for ROCKPro64 (RK3399) USB 3.0 node is already
included into FreeBSD source tree. Here:
https://github.com/freebsd/freebsd/blob/ea36ac604737d55bb248babf59633f67f770bab5/sys/gnu/dts/arm64/rockchip/rk3399.dtsi#L391

Which means (this is my naive speculation) that this patch:

https://reviews.freebsd.org/D19335

is actually works only for RK3399 (ROCKPro64)
despite "RK3328" included in it's title.

and using the D19335 + this patch:
http://lkml.iu.edu/hypermail/linux/kernel/1708.2/01066.html

is not enough to make USB 3.0 work on ROCK64 (RK3328)... :(

Regards,
Denis.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: USB 3.0 support for Rockchip RK3328

Emmanuel Vadot-7
On Thu, 15 Aug 2019 21:33:04 +0900
Denis Polygalov <[hidden email]> wrote:

>
> >>
> >> Is there some similar magic command to turn on USB parts on ROCK64?
> >
> > With the latest u-boot-rock64 from ports:
> >
> > gpioctl -f /dev/gpioc0 2 0
> >
>
> Thanks, I noticed that this command actually turn on USB 2.0(!)
> ports on my ROCK64 board. USB 3.0 still does not work.
>
> > That's not it, that's 2.0, not xhci. Make sure you have the 3.0 node in the device tree.
> Yes, I'm agree that was 2.0. But I'm also sure that I have the patches
> applied properly and also I can see entries from these patches in the
> nfsroot/boot/dtb/rockchip/rk3328-rock64.dtb file after compilation.
>
> I also noticed that for ROCKPro64 (RK3399) USB 3.0 node is already
> included into FreeBSD source tree. Here:
> https://github.com/freebsd/freebsd/blob/ea36ac604737d55bb248babf59633f67f770bab5/sys/gnu/dts/arm64/rockchip/rk3399.dtsi#L391
>
> Which means (this is my naive speculation) that this patch:
>
> https://reviews.freebsd.org/D19335
>
> is actually works only for RK3399 (ROCKPro64)
> despite "RK3328" included in it's title.
>
> and using the D19335 + this patch:
> http://lkml.iu.edu/hypermail/linux/kernel/1708.2/01066.html
>
> is not enough to make USB 3.0 work on ROCK64 (RK3328)... :(

 That's because the patch isn't enough, it only worked on RK3399
because u-boot enabled the phy and the clocks etc ... thing that isn't
done in the patch.

> Regards,
> Denis.
> _______________________________________________
> [hidden email] mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "[hidden email]"


--
Emmanuel Vadot <[hidden email]> <[hidden email]>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"