mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-06-29 17:48:51 +00:00
lib: utils: Add fdt_fixup_node() helper function
Add a helper function fdt_fixup_node() based on the compatible string. This will avoid code duplication for every new node fixup being added. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
4640d041d3
commit
e9775120f5
1 changed files with 8 additions and 7 deletions
|
@ -74,22 +74,23 @@ static void fdt_domain_based_fixup_one(void *fdt, int nodeoff)
|
|||
}
|
||||
}
|
||||
|
||||
void fdt_aplic_fixup(void *fdt)
|
||||
static void fdt_fixup_node(void *fdt, const char *compatible)
|
||||
{
|
||||
int noff = 0;
|
||||
|
||||
while ((noff = fdt_node_offset_by_compatible(fdt, noff,
|
||||
"riscv,aplic")) >= 0)
|
||||
compatible)) >= 0)
|
||||
fdt_domain_based_fixup_one(fdt, noff);
|
||||
}
|
||||
|
||||
void fdt_aplic_fixup(void *fdt)
|
||||
{
|
||||
fdt_fixup_node(fdt, "riscv,aplic");
|
||||
}
|
||||
|
||||
void fdt_imsic_fixup(void *fdt)
|
||||
{
|
||||
int noff = 0;
|
||||
|
||||
while ((noff = fdt_node_offset_by_compatible(fdt, noff,
|
||||
"riscv,imsics")) >= 0)
|
||||
fdt_domain_based_fixup_one(fdt, noff);
|
||||
fdt_fixup_node(fdt, "riscv,imsics");
|
||||
}
|
||||
|
||||
void fdt_plic_fixup(void *fdt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue