Hi everyone,
I’m working on MSI support. Here’s my issue:
- Kernel boots fine with PLIC enabled.
- Kernel fails to boot with PLIC disabled + APLIC+IMSIC (MSI mode) enabled.
My device tree:
/*plic0: plic@PLIC_UNIT {
compatible = "riscv,plic0", "sifive,plic-1.0.0";
reg = <PLIC_CTRL>;
interrupt-controller;
#interrupt-cells = <1>;
#address-cells = <0>;
riscv,ndev = <31>;
riscv,max-priority = <7>;
interrupts-extended = <&cpu0_hlic 11 &cpu0_hlic 9
&cpu1_hlic 11 &cpu1_hlic 9>;
};*/
imsic0: imsic@MSIC_UNIT {
compatible = "qemu,imsics", "riscv,imsics";
reg = <MSIC_CTRL>;
interrupt-controller;
#interrupt-cells = <0>;
msi-controller;
#msi-cells = <0>;
riscv,num-ids = <127>;
interrupts-extended = <&cpu0_hlic 9 &cpu1_hlic 9>;
};
aplic0: aplic@APIC_UNIT {
compatible = "riscv,aplic", "qemu,aplic";
reg = <APIC_CTRL>;
interrupt-controller;
#interrupt-cells = <1>;
#address-cells = <0>;
riscv,num-sources = <32>;
//interrupts-extended = <&cpu0_hlic 9 &cpu1_hlic 9>; // Direct mode
msi-parent = <&imsic0>; // MSI mode
};
Any help would be appreciated!
No expert on DTS’s but this is what I have been running in a small system, this boots in simulation on Linux 6.13 and 7.
IMSIC_MLEVEL: interrupt-controller@f8600000 {
compatible = "riscv,imsicm";
reg = <0x0 0xf8600000 0x0 0x40000>;
interrupt-controller;
#interrupt-cells = <0>;
#address-cells = <0>;
interrupts-extended = <
&CPU0_intc 11
>;
msi-controller;
riscv,num-ids = <63>;
};
IMSIC_SLEVEL: interrupt-controller@f8640000 {
compatible = "riscv,imsics";
reg = <0x0 0xf8640000 0x0 0x40000>;
interrupt-controller;
#interrupt-cells = <0>;
#address-cells = <0>;
interrupts-extended = <
&CPU0_intc 9
>;
msi-controller;
riscv,num-ids = <63>;
riscv,guest-index-bits = <5>;
};
ROOT_APLIC: interrupt-controller@f8500000 {
compatible = "riscv,aplic";
#interrupt-cells = <0x2>;
#address-cells = <0x0>;
riscv,children = <&M_APLIC>;
riscv,num-sources = <31>;
riscv,delegation = <&M_APLIC 1 31>;
riscv,delegate = <&M_APLIC 1 31>;
reg = <0x0 0xf8500000 0x0 0x8000>;
msi-parent = <&IMSIC_MLEVEL>;
interrupt-controller;
};
M_APLIC: interrupt-controller@f8508000 {
compatible = "riscv,aplic";
#interrupt-cells = <0x2>;
#address-cells = <0x0>;
riscv,children = <&S_APLIC>;
riscv,num-sources = <31>;
riscv,delegation = <&S_APLIC 1 31>;
riscv,delegate = <&S_APLIC 1 31>;
reg = <0x0 0xf8508000 0x0 0x8000>;
msi-parent = <&IMSIC_MLEVEL>;
interrupt-controller;
};
S_APLIC: interrupt-controller@f8510000 {
compatible = "riscv,aplic";
#interrupt-cells = <0x2>;
#address-cells = <0x0>;
riscv,num-sources = <31>;
reg = <0x0 0xf8510000 0x0 0x8000>;
msi-parent = <&IMSIC_SLEVEL>;
interrupt-controller;
};
clint@b0000000 {
compatible = "riscv,clint0";
reg-names = "control";
interrupts-extended = <&CPU0_intc 3 &CPU0_intc 7 >;
reg = <0x0 0xb0000000 0x0 0x100000>;
};
Hi JonathanJ,
Thank you so much for the help! I tried your DTS config and it works! Now my system boots fine with PLIC disabled + APLIC+IMSIC(MSI mode) enabled.
Greatly appreciate your support!