diff options
author | Tan En De <ende.tan@starfivetech.com> | 2023-04-11 17:39:17 +0800 |
---|---|---|
committer | Jerry Zhao <jerryz123@berkeley.edu> | 2023-12-11 14:48:19 -0800 |
commit | 87690a90c785230eab306c2af973b3cbfe9bd88a (patch) | |
tree | 1f5ee52e72f887df0d34d9a2f2073f6ab1bdabcd /riscv/plic.cc | |
parent | 1f466dfd1520d44dc77af123d68b58d558eee3c4 (diff) | |
download | riscv-isa-sim-87690a90c785230eab306c2af973b3cbfe9bd88a.zip riscv-isa-sim-87690a90c785230eab306c2af973b3cbfe9bd88a.tar.gz riscv-isa-sim-87690a90c785230eab306c2af973b3cbfe9bd88a.tar.bz2 |
riscv: sim.cc: Parse for "sifive,plic-1.0.0" if "riscv,plic0" is absent
"riscv,plic0" and "sifive,plic-1.0.0" in device tree's "compatible" string point to the same driver,
as can be seen from drivers/irqchip/irq-sifive-plic.c in Linux kernel.
https://github.com/torvalds/linux/commit/5873ba559101fa37ad9764e79856f71bf54021aa
The other two "compatible" strings below isn't included,
because of their different plic behavior (plic_edge_init instead of plic_init as explained in the Linux commit).
- "andestech,nceplic100"
- "thead,c900-plic"
Signed-off-by: Tan En De <ende.tan@starfivetech.com>
Diffstat (limited to 'riscv/plic.cc')
-rw-r--r-- | riscv/plic.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/riscv/plic.cc b/riscv/plic.cc index 57c37c5..44f80cf 100644 --- a/riscv/plic.cc +++ b/riscv/plic.cc @@ -418,7 +418,8 @@ std::string plic_generate_dts(const sim_t* sim) plic_t* plic_parse_from_fdt(const void* fdt, const sim_t* sim, reg_t* base, const std::vector<std::string>& sargs) { uint32_t plic_ndev; - if (fdt_parse_plic(fdt, base, &plic_ndev, "riscv,plic0") == 0) + if (fdt_parse_plic(fdt, base, &plic_ndev, "riscv,plic0") == 0 || + fdt_parse_plic(fdt, base, &plic_ndev, "sifive,plic-1.0.0") == 0) return new plic_t(sim, plic_ndev); else return nullptr; |