Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds initial PCIe support to the kernel, including multi-level PCIe bus enumeration, PCIe virtio transport, BAR pre-initialization/mapping, and DT-based interrupt-map parsing for the root bus (with platform/QEMU config updates for LoongArch64).
Changes:
- Introduce PCIe bus infrastructure (ECAM access, device/domain modeling, address parsing, BAR sizing/allocation, and ioremap registry).
- Add a VirtIO PCIe transport driver and update VirtIO HAL/device IRQ wiring for PCIe-backed virtio devices.
- Implement DT
ranges+interrupt-mapparsing for the PCIe host bridge and update LoongArch64 QEMU platform/rootfs configs.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| conf/rootfs/minimal.toml | Switches minimal rootfs build arch to loongarch64. |
| conf/platforms/qemu-virt-la64.toml | Enables virtio-blk PCIe devices and sets rootfs settings for LoongArch64 QEMU. |
| anemone-kernel/src/mm/remap.rs | Exposes IoRemap virtual base and size for PCIe/ioremap consumers. |
| anemone-kernel/src/exception/intr/irq.rs | Adds IrqDomain::xlate helper to translate interrupt specifiers. |
| anemone-kernel/src/driver/virtio/pcie.rs | New VirtIO PCIe transport driver (virtio-drivers PciTransport integration). |
| anemone-kernel/src/driver/virtio/mod.rs | Implements mmio_phys_to_virt using the PCIe remap registry. |
| anemone-kernel/src/driver/pcie_drivers/platform.rs | PCIe ECAM platform driver: parses DT bus-range, ranges, and interrupt-map. |
| anemone-kernel/src/driver/pcie_drivers/bus.rs | Bridge driver: multi-level bus enumeration, BAR/bridge window setup, interrupt keying. |
| anemone-kernel/src/driver/intc/sifive_plic.rs | Makes PLIC xlate unconditional on OF-node presence (supports non-OF fw nodes). |
| anemone-kernel/src/driver/intc/loongson_platic.rs | Same xlate behavior adjustment for LA7A1000 PLATIC. |
| anemone-kernel/src/driver/block/virtio_blk.rs | Requests IRQ earlier during virtio-blk probe. |
| anemone-kernel/src/device/bus/virtio/device.rs | Allows virtio transport parent to be either PlatformDevice or PcieDevice. |
| anemone-kernel/src/device/bus/pcie/remap.rs | New global remap registry for mapping phys MMIO ranges to virt addresses. |
| anemone-kernel/src/device/bus/pcie/mod.rs | PCIe module exports, naming docs, and class-code constants. |
| anemone-kernel/src/device/bus/pcie/fwnode.rs | New firmware-node wrapper for PCIe devices to provide interrupt routing info. |
| anemone-kernel/src/device/bus/pcie/ecam.rs | Enhances ECAM config access: writers, BAR/capability handling, multi-function iteration. |
| anemone-kernel/src/device/bus/pcie/driver.rs | Extends PCIe driver trait with vendor/device match table + postinit hook. |
| anemone-kernel/src/device/bus/pcie/device.rs | PCIe device/domain model, BAR resource allocators, and driver preinit/postinit flow. |
| anemone-kernel/src/device/bus/pcie/bus.rs | PCIe BusType: matching logic, BAR preinit/allocation/ioremap integration. |
| anemone-kernel/src/device/bus/pcie/addr.rs | New OpenFirmware PCI address parsing/encoding helpers. |
| anemone-kernel/crates/range-allocator/src/lib.rs | Adds aligned allocation and introduces IncreasingRangeAllocator; updates Rangable bounds. |
| anemone-kernel/crates/range-allocator/src/increasing.rs | New monotonic range allocator implementation + tests. |
| anemone-kernel/crates/device-tree/src/unflattened.rs | Adds raw accessors and optional address/size-cells getters. |
| anemone-kernel/Cargo.toml | Adds wavltree dependency. |
| Cargo.lock | Locks wavltree crate. |
| .vscode/settings.json | Switches rust-analyzer target to loongarch64. |
| .gitattributes | Marks PCI ID database file as binary for git attributes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
doruche
approved these changes
Apr 24, 2026
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.
This PR includes
AI Usage Status
AI is used for