uspi icon indicating copy to clipboard operation
uspi copied to clipboard

RPi 4 support ?

Open penfold42 opened this issue 5 years ago • 11 comments

How tricky will this be ?

penfold42 avatar Jun 24 '19 22:06 penfold42

This requires a complete rewrite of the USB host controller driver. It is not likely, that there will be a version of this project, which can be used with the RPi 4, in foreseeable time.

rsta2 avatar Jun 25 '19 18:06 rsta2

Now that circle has support for Pi4 is uspi support more probable ?

Thanks !

penfold42 avatar May 10 '20 04:05 penfold42

The effort to port this from C++ to C remains huge, I'm sorry. It's not only the xHCI driver. USB on the RPi 4 needs MMU LPAE support (for AArch32) and a driver for the PCIe host bridge too. And if one wants Ethernet access, this would be another separate driver. With the increasing variety of RPi hardware, I decided to focus on Circle and related projects.

rsta2 avatar May 11 '20 10:05 rsta2

the pi4 still has the old dwc2 controller as well, but its now wired to the usb-c port

the USB_OTG pin isnt connected properly, and the fancy usb-c direction detection logic is missing, so you have to force host or device mode like with the pi A's

cleverca22 avatar Sep 29 '20 00:09 cleverca22

Why not consider converting your project to Circle so you have all the features of it ? I converted a huge Linux C 32 bit program to run on Circle 64 bit in only a few weeks with excellent results. You don't have to use all the features of Circle and indeed I used my own audio drivers, but it's still an excellent base for bare metal work. There isn't much it can't do.

MikeDB1 avatar Sep 29 '20 00:09 MikeDB1

"Circle"?? Are you referring to this? https://github.com/circleci

seamusdemora avatar Oct 01 '20 15:10 seamusdemora

No this https://github.com/rsta2/circle

uspi was derived from a much earlier version of it several years ago. Since then Circle has been updated with lots of good stuff including PnP USB.

MikeDB1 avatar Oct 01 '20 16:10 MikeDB1

@MikeDB1 : Thanks! The search I did (github circle) didn't reveal that. So glad to know of this!

Maybe you can answer another question for me: I'm interested in a reliable method for turning USB power ON and OFF. This item from the Linux kernel docs indicates it's supported in the kernel, but indicates it must also be supported by the driver. I can't find this "USB power" feature described in the RPi documentation, and so assume it's just not supported in the "native" driver. The uhubctl project indicates it's possible to do this on the RPi, but I guess it must be using sysfs? At any rate - integration with the driver would seem to be a "cleaner" way to do this. Is anybody here in circle doing something like this?

seamusdemora avatar Oct 01 '20 17:10 seamusdemora

I seem to recall a comment on the forum that the only way to do this was to use a special cable, for example to connect a Pi4 to a PC, with the power lines disconnected. That would appear to suggest that the Pi driver has no method to turn power off.

MikeDB1 avatar Oct 01 '20 18:10 MikeDB1

Perhaps... but I wonder how uhubctl manages to do it?

seamusdemora avatar Oct 01 '20 19:10 seamusdemora

Seems there was a firmware update from VLI superceding the comment I'd seen.
https://www.raspberrypi.org/forums/viewtopic.php?t=258489 I'll have a play with it.

MikeDB1 avatar Oct 01 '20 20:10 MikeDB1