-
Notifications
You must be signed in to change notification settings - Fork 12
ot_usbdev
: add initial host protocol and bus handling
#238
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
base: ot-9.2.0
Are you sure you want to change the base?
Conversation
4db9cec
to
4dc34ad
Compare
ot_usbdev_server_write_packet(s, OT_USBDEV_SERVER_CMD_HELLO, | ||
server->recv_pkt.id, &resp_hello, | ||
sizeof(resp_hello)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not just send back the same hello
packet now that you have checked its integrity, or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could but that feels like premature optimization, if the hello packet changed, it could become asymmetrical (e.g. different server and client versions).
5fcbdcf
to
bdc6ba3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @pamaury!
Once this passes CI, can this be merged or are there any big blockers left? The code will still be modified quite a lot to add support for data transfers but I am relunctant to base too much work on this PR until it's merged. |
There are a couple of remaining comments not closed (in the GitHub "hidden" conversation sections), and a couple of remaining details, mostly:
|
bcdf022
to
57d9ec5
Compare
I hope I caught everything this time. I may have missed some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I only reviewed the protocol)
This commit creates a new chardev for the USBDEV block over which the driver can communicate with a virtual USB host. The protocol (still under development) is documented and implemented. At the moment, only bus events (vbus handling, connection, reset, stub suspend/resume) are implemented. Signed-off-by: Amaury Pouly <amaury.pouly@lowrisc.org>
This PR creates a new chardev for the USBDEV block over which the driver can communicate with a virtual USB host. The protocol (still under development) is documented and implemented. At the moment, only bus events (vbus handling, connection, reset, stub suspend/resume) are implemented.
In order to test this implementation, a virtual USB host speaking the protocol must be used. I am currently testing this using a custom python script but I think it is too hacky to upstream at the moment.
See lowRISC/opentitan#28487 for the OpenTitan side