-
Notifications
You must be signed in to change notification settings - Fork 85
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
Usb breaking change #607
Merged
Merged
Usb breaking change #607
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
so processes other than swap can use it
- disable IRQs on departure - put EV enable outside of the HAL function this is necessary because we need all HAL calls to be finished before an interrupt happens to avoid locking problems
so that we can share app uart with other processes that need it for debug
the uart in the shared library is claimed by the first process that touches it, so prints in the shared library at early boot have to be carefully configured
we have to allocate the virtual page in our process space before we can use the debug UART.
This commit turns the USB stack inside out and puts the handler in a protected IRQ section so that it can't be interrupted during event processing.
the UsbBus implementation is being totally rewritten for the inside-out IRQ protected scheme. we can now get past some preliminaries in the link protocol (i.e., address setting and the first config descriptor), but a long way to go still in debugging.
used for debugging some IRQ issues
this one just sends a string as if typed on a keyboard.
realizing a bunch of stuff like the stack expects you to enqueue the OUT receiver with calls to read() that happen to block, fixing max packet size that can be different for in and out end points, and handling quirks of the core when sending setup packets longer than 64 bytes.
we're going to strip out the USB cramium support from this crate eventually because it has migrated to a stand-alone crate the hardware model is just too different to keep the two branches in sync: one allows interrupts to be delegated to userspace, the other requires the interrupts to happen all in the locked handler context due to timing assumptions of the core. the problem with the interrupt handler context is that panics are really hard to debug - you can't actually send a panic message from an interrupt context, because there is no IPC when the handler is running. Normally we try to keep the handlers as minimal as possible, but in this case we can't due to hardware assumptions.
also clean up some debug statements and add a TODO list
programs should now use the usb-cramium crate for a USB stack. It preserves the `lib` API, so you /should/ be able to integrate it seamlessly by just renaming crates between the two.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an integration of the USB stack that is meant to break the old
usb-device-xous
code, with the intention thatcramium-soc
targets would rename the included crate to refer tousb-cramium
. The two crates retain the samelib
API, but because the underlying implementations are so vastly different a decision was made to diverge the code bases, at least for now, to simplify the debug and bring-up process on the new hardware.