diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2021-03-27 08:05:27 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-04-01 08:01:11 +0300 |
commit | 4edc8224073e61498b1de338c67174f47fc3c5e1 (patch) | |
tree | 61d60f59fd46506233c1a897a96433aec8526aaa | |
parent | ca3f35821baa18e309d856c0cf886b81970f2a00 (diff) | |
download | opensbi-4edc8224073e61498b1de338c67174f47fc3c5e1.tar.xz |
lib/utils: Support fixing up the official DT bindings of PLIC
Current fdt_plic_fixup() only does necessary fix-up against the legacy
"riscv,plic0" node. The upstream Linux kernel defines its official DT
bindings which uses "sifive,plic-1.0.0" as the compatible string and
we should check that first, and if not present fall back to legacy.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
-rw-r--r-- | lib/utils/fdt/fdt_fixup.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c index a306ff5..1465500 100644 --- a/lib/utils/fdt/fdt_fixup.c +++ b/lib/utils/fdt/fdt_fixup.c @@ -57,9 +57,12 @@ void fdt_plic_fixup(void *fdt) int i, cells_count; int plic_off; - plic_off = fdt_node_offset_by_compatible(fdt, 0, "riscv,plic0"); - if (plic_off < 0) - return; + plic_off = fdt_node_offset_by_compatible(fdt, 0, "sifive,plic-1.0.0"); + if (plic_off < 0) { + plic_off = fdt_node_offset_by_compatible(fdt, 0, "riscv,plic0"); + if (plic_off < 0) + return; + } cells = (u32 *)fdt_getprop(fdt, plic_off, "interrupts-extended", &cells_count); |