Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform(d1): Support USB OTG Device Mode #88

Open
jamesmunns opened this issue Jun 23, 2023 · 4 comments
Open

platform(d1): Support USB OTG Device Mode #88

jamesmunns opened this issue Jun 23, 2023 · 4 comments
Labels
area: tools & build Related to host developer tools, including tracing, Crowtty and build processes kind: enhancement New feature or request platform: D1 Specific to the Allwinner D1 hardware platform

Comments

@jamesmunns
Copy link
Contributor

It would be very nice to support the OTG port (the one we use for xfel) in device mode, so we can remove the need for UART in most cases, and in the future support higher bandwidth comms, including potentially bridged networking.

Unfortunately, the user manual and PAC have no information for usb0/usb-otg. But it is supported in Linux.

https:/torvalds/linux/tree/8a28a0b6f1a1dcbf5a834600a9acfbe2ba51e5eb/drivers/usb/musb

Apparently they use Mentor IP for dual role ports, and allwinner (sunxi in linux terms) has used this IP for a number of devices.

If nothing else, we can likely reverse engineer the registers from these definitions, and figure out how to get something like embassy-usb supported, at least enough to get an ACM serial port up and going.

@jamesmunns
Copy link
Contributor Author

https://www.kernel.org/doc/html/v4.14/driver-api/usb/writing_musb_glue_layer.html is actually very good and relevant too.

@jamesmunns
Copy link
Contributor Author

VERY relevant (the exact PDF we need, I think): https://linux-sunxi.org/images/7/73/Musbmhdrc.pdf

@jamesmunns
Copy link
Contributor Author

@hawkw hawkw added the kind: enhancement New feature or request label Jun 25, 2023
@hawkw hawkw added platform: D1 Specific to the Allwinner D1 hardware platform area: tools & build Related to host developer tools, including tracing, Crowtty and build processes labels Jul 10, 2023
@jamesmunns
Copy link
Contributor Author

When we want to support host mode, here's a host driver for the atsamd: https:/nviennot/turbo-resin/tree/main/src/drivers/usb

(note: the rest of the project is GPL, but the usb host stack is MIT+Apache2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tools & build Related to host developer tools, including tracing, Crowtty and build processes kind: enhancement New feature or request platform: D1 Specific to the Allwinner D1 hardware platform
Projects
None yet
Development

No branches or pull requests

2 participants