lib: utils: Add FDT parsing API common for both ACLINT and CLINT

We add fdt_parse_aclint_node() which can parse both ACLINT and
CLINT DT nodes. This means fdt_parse_clint_node() is not required
anymore so we remove it as well.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Xiang W <wxjstz@126.com>
This commit is contained in:
Anup Patel
2021-05-20 13:38:38 +05:30
committed by Anup Patel
parent 5a049fe1d6
commit bd5d2089b8
4 changed files with 30 additions and 22 deletions

View File

@@ -21,15 +21,18 @@ static int ipi_clint_cold_init(void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
unsigned long cisize;
struct clint_data *ci;
if (CLINT_IPI_MAX_NR <= clint_ipi_count)
return SBI_ENOSPC;
ci = &clint_ipi[clint_ipi_count++];
rc = fdt_parse_clint_node(fdt, nodeoff, FALSE, ci);
rc = fdt_parse_aclint_node(fdt, nodeoff, false, &ci->addr, &cisize,
&ci->first_hartid, &ci->hart_count);
if (rc)
return rc;
ci->has_64bit_mmio = false;
return clint_cold_ipi_init(ci);
}