lib: utils/ipi: Generate FDT ipi driver list at compile-time

Instead of having FDT ipi driver list hard-coded in the C source,
we generate it using carray.sh at compile-time.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
This commit is contained in:
Anup Patel
2022-05-13 09:26:35 +05:30
committed by Anup Patel
parent 3a69d12fc3
commit 4ee0c57969
3 changed files with 12 additions and 7 deletions

View File

@@ -12,11 +12,9 @@
#include <sbi_utils/fdt/fdt_helper.h>
#include <sbi_utils/ipi/fdt_ipi.h>
extern struct fdt_ipi fdt_ipi_mswi;
static struct fdt_ipi *ipi_drivers[] = {
&fdt_ipi_mswi
};
/* List of FDT ipi drivers generated at compile time */
extern struct fdt_ipi *fdt_ipi_drivers[];
extern unsigned long fdt_ipi_drivers_size;
static struct fdt_ipi dummy = {
.match_table = NULL,
@@ -47,8 +45,8 @@ static int fdt_ipi_cold_init(void)
const struct fdt_match *match;
void *fdt = fdt_get_address();
for (pos = 0; pos < array_size(ipi_drivers); pos++) {
drv = ipi_drivers[pos];
for (pos = 0; pos < fdt_ipi_drivers_size; pos++) {
drv = fdt_ipi_drivers[pos];
noff = -1;
while ((noff = fdt_find_match(fdt, noff,

View File

@@ -0,0 +1,3 @@
HEADER: sbi_utils/ipi/fdt_ipi.h
TYPE: struct fdt_ipi
NAME: fdt_ipi_drivers

View File

@@ -8,5 +8,9 @@
#
libsbiutils-objs-y += ipi/aclint_mswi.o
libsbiutils-objs-y += ipi/fdt_ipi.o
libsbiutils-objs-y += ipi/fdt_ipi_drivers.o
carray-fdt_ipi_drivers-y += fdt_ipi_mswi
libsbiutils-objs-y += ipi/fdt_ipi_mswi.o