forked from Mirrors/opensbi
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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user