Repository navigation
feat(usb): xHCI host controller bring-up (polled) - #737
Merged
Merged
Conversation
Add `pcie::mmio::Mmio`, a panic-free accessor for an identity-mapped memory BAR: every access is bounds- and overflow-checked and returns `Result` instead of asserting, and `poll32` has an explicit iteration budget. Also add `PCIeInfo::enable_bus_master()`. Both are used by the xHCI driver that follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Detect xHCI controllers (PCI class 0x0C/0x03/0x30) and bring them up: controller reset, command/event rings, DCBAA, scratchpad buffers and Run/Stop, then verify the command ring with a No-Op command. The driver is polled (USBCMD.INTE = 0). All DMA ring accesses are volatile with Release/Acquire fences around doorbells and event consumption, and the module denies panicking constructs, unchecked arithmetic and lossy casts. Enabled on x86 through the `xhci` feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…i/2-controller
nokosaaan
marked this pull request as draft
October 19, 2026 06:00
The repository now requires every action to be pinned to a full-length commit SHA. Pin the versions currently resolved by the floating tags (no behavior change): - actions/checkout@v3 -> v3.7.0 (a37ce912…) - technote-space/assign-author@v1 -> v1.6.2 (9558557c…) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nokosaaan
marked this pull request as ready for review
October 19, 2026 06:10
…i/2-controller
Collaborator
|
Why don't you add Lines 160 to 173 in 54d8757 |
Contributor
Author
|
@ytakano |
ytakano
approved these changes
Oct 20, 2026
4 tasks done
This file contains hidden or 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
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.
Description
Add a polled xHCI host controller driver that detects xHCI controllers and brings them up. This PR covers controller initialization only; device enumeration and the USB serial console come in follow-up PRs.
What this PR does:
PCIeInfo::attach()routes Serial Bus Controllers with sub-class 0x03 / prog-if 0x30 topcie::usb::attach(), before vendor-based matching, so controllers are handled regardless of silicon vendor.xhcifeature toawkernel_driversand enables it in the kernel'sx86feature set, so CI compiles and lints the driver.New files:
pcie/usb/mod.rspcie/usb/xhci/mod.rspcie/usb/xhci/ring.rspcie/usb/xhci/regs.rsRelated links
previous PR: #731
How was this PR tested?
scripts/ci.shpasses on my machine.-device qemu-xhciwith a USB keyboard andusb-netattached) boots to the shell with the following log and no panic:make qemu-x86_64Notes for reviewers