-
Notifications
You must be signed in to change notification settings - Fork 67
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
Implement IMSIC and APLIC according to AIA spec #70
Comments
I've done research on what and how to implement, but I'm not sure I can guarantee a conforming and tested implementation until there are proper upstream Linux drivers. It seems there are some patches on the mailing list, though, so worth looking at. |
According to my VF2, it uses MSI over the standard PLIC. You have any idea how that should be actually routed? According to PCI 2.2, the MSI vector address is architecture-specific. I am wondering if that's supported in Haiku. |
Maybe MSI writing to priority threshold of PLIC context while interrupt pin is hardwired to one? I can' find related code in Linux kernel.
PCIe allows to write some configured 16 bit value to any configured physical address. As long there are some MMIO register that can trigger interrupt on write, it can be used for MSI.
Haiku use Designware PCI host controller built-in MSI interrupt controller for HiFive Unmatched. In my |
Okay makes sense. Seemingly there are 3 (4) ways:
Lol that's a cool idea, but I doubt anyone actually did it. |
Any chance to implement Designware PCI and/or PLDA PCI with MSI support in RVVM? |
If it can be done without breaking My current list of whatever I'm busy with, FYI:
|
I have experimental APLIC/IMSIC support in my https://github.com/X547/haiku/tree/device_manager2 branch. |
Basically I want to look a bit more if fixing the weird i2c-hid hanging we spoke in #126 is possible, then release stable v0.6 for people to poke at and have something reliable to roll back if anything goes wrong. Then a lot of rewriting will happen:
If you wish to see anything else in v0.6, please tell me. But I just want to stop polishing it at this point. |
PLIC and APLIC are mutually-exclusive. It is not possible to run PLIC only system on hardware with APLIC. Note that interrupt controller need some handling by machine mode code such as OpenSBI, but it don't know about which interrupt controller will be used by supervisor mode code. |
I see some notes on compatibility mode in APLIC documentation where it mentions PLIC regmap supplied alongside APLIC. |
Only one of them can be configured at boot and it should be done from machine mode code. |
APLIC & IMSIC drivers got merged into Linux 6.10, so that's a good point to start soon. |
RISC-V Advanced Interrupt Architecture (AIA) specification: https://github.com/riscv/riscv-aia/releases/download/1.0/riscv-interrupts-1.0.pdf.
Reference code (QEmu):
The text was updated successfully, but these errors were encountered: