diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-05-12 18:38:31 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-05-23 10:36:43 +0530 |
commit | a9a97511851198559e75640a9e5e67f65695dc2e (patch) | |
tree | 3c7a01bfa30aab552fbb049f5fea25b8007a2d83 /lib/utils/ipi | |
parent | d30bb684481b6be642a0eaa9e7f0778d6519cc15 (diff) |
lib: utils: Allow CLINT functions to be used for multiple CLINTs
We extend CLINT cold init function to have a "struct clint_data *"
parameter pointing to CLINT details. This allows platforms to use
CLINT functions for multiple CLINT instances.
When multiple CLINTs are present, the platform can also provide
one of the CLINT as reference CLINT for other CLINTs. This will
help CLINTs to sync their time value with reference CLINT using
a time_delta computed in warm init function.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/utils/ipi')
-rw-r--r-- | lib/utils/ipi/fdt_ipi_clint.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/utils/ipi/fdt_ipi_clint.c b/lib/utils/ipi/fdt_ipi_clint.c index 05b66c6..c4ac0df 100644 --- a/lib/utils/ipi/fdt_ipi_clint.c +++ b/lib/utils/ipi/fdt_ipi_clint.c @@ -11,6 +11,8 @@ #include <sbi_utils/ipi/fdt_ipi.h> #include <sbi_utils/sys/clint.h> +static struct clint_data clint_ipi; + static int ipi_clint_cold_init(void *fdt, int nodeoff, const struct fdt_match *match) { @@ -26,7 +28,13 @@ static int ipi_clint_cold_init(void *fdt, int nodeoff, if (rc) return rc; - return clint_cold_ipi_init(addr, max_hartid + 1); + /* TODO: We should figure-out CLINT has_64bit_mmio from DT node */ + clint_ipi.addr = addr; + clint_ipi.first_hartid = 0; + clint_ipi.hart_count = max_hartid + 1; + clint_ipi.has_64bit_mmio = TRUE; + + return clint_cold_ipi_init(&clint_ipi); } static const struct fdt_match ipi_clint_match[] = { |