Files
opensbi/lib/utils/ipi/fdt_ipi_plicsw.c
Samuel Holland 693afc818f lib: sbi_ipi: Move initial IPI clear to sbi_ipi_init()
sbi_ipi_init() expects the platform warm init function to clear IPIs
on the local hart, but there is already a generic function to do this.
After this change, none of the existing drivers need a warm init
callback.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
2024-11-11 18:18:35 +05:30

48 lines
1022 B
C

/*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2022 Andes Technology Corporation
*
* Authors:
* Zong Li <zong@andestech.com>
* Nylon Chen <nylon7@andestech.com>
* Leo Yu-Chi Liang <ycliang@andestech.com>
* Yu Chien Peter Lin <peterlin@andestech.com>
*/
#include <sbi/riscv_io.h>
#include <sbi_utils/fdt/fdt_helper.h>
#include <sbi_utils/ipi/fdt_ipi.h>
#include <sbi_utils/ipi/andes_plicsw.h>
extern struct plicsw_data plicsw;
int fdt_plicsw_cold_ipi_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
rc = fdt_parse_plicsw_node(fdt, nodeoff, &plicsw.addr, &plicsw.size,
&plicsw.hart_count);
if (rc)
return rc;
rc = plicsw_cold_ipi_init(&plicsw);
if (rc)
return rc;
return 0;
}
static const struct fdt_match ipi_plicsw_match[] = {
{ .compatible = "andestech,plicsw" },
{},
};
struct fdt_ipi fdt_ipi_plicsw = {
.match_table = ipi_plicsw_match,
.cold_init = fdt_plicsw_cold_ipi_init,
.warm_init = NULL,
.exit = NULL,
};