From 434add551c2a17cac3804ff0f587d31be03f070e Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sun, 19 Jan 2025 11:03:57 -0800 Subject: lib: utils: Initialize miscellaneous drivers in one pass For driver subsystems that are not tightly integrated into the OpenSBI init sequence, it is not important that the drivers are initialized in any particular order. By putting all of these drivers in one array, they can all be initialized with a single pass through the devicetree. This saves about 10 ms of boot time on HiFive Unmatched. Signed-off-by: Samuel Holland Reviewed-by: Anup Patel --- lib/utils/cppc/fdt_cppc.c | 22 ---------------------- lib/utils/cppc/fdt_cppc_drivers.carray | 3 --- lib/utils/cppc/fdt_cppc_rpmi.c | 2 +- lib/utils/cppc/objects.mk | 5 +---- 4 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 lib/utils/cppc/fdt_cppc.c delete mode 100644 lib/utils/cppc/fdt_cppc_drivers.carray (limited to 'lib/utils/cppc') diff --git a/lib/utils/cppc/fdt_cppc.c b/lib/utils/cppc/fdt_cppc.c deleted file mode 100644 index 0e1ecb2..0000000 --- a/lib/utils/cppc/fdt_cppc.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2024 Ventana Micro Systems Inc. - * - * Authors: - * Anup Patel - */ - -#include - -/* List of FDT CPPC drivers generated at compile time */ -extern const struct fdt_driver *const fdt_cppc_drivers[]; - -void fdt_cppc_init(const void *fdt) -{ - /* - * Platforms might have multiple CPPC devices or might - * not have any so probe all and don't fail. - */ - fdt_driver_init_all(fdt, fdt_cppc_drivers); -} diff --git a/lib/utils/cppc/fdt_cppc_drivers.carray b/lib/utils/cppc/fdt_cppc_drivers.carray deleted file mode 100644 index b25c788..0000000 --- a/lib/utils/cppc/fdt_cppc_drivers.carray +++ /dev/null @@ -1,3 +0,0 @@ -HEADER: sbi_utils/cppc/fdt_cppc.h -TYPE: const struct fdt_driver -NAME: fdt_cppc_drivers diff --git a/lib/utils/cppc/fdt_cppc_rpmi.c b/lib/utils/cppc/fdt_cppc_rpmi.c index 9532840..3934219 100644 --- a/lib/utils/cppc/fdt_cppc_rpmi.c +++ b/lib/utils/cppc/fdt_cppc_rpmi.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lib/utils/cppc/objects.mk b/lib/utils/cppc/objects.mk index 07dc7d8..ece1791 100644 --- a/lib/utils/cppc/objects.mk +++ b/lib/utils/cppc/objects.mk @@ -7,8 +7,5 @@ # Anup Patel # -libsbiutils-objs-$(CONFIG_FDT_CPPC) += cppc/fdt_cppc.o -libsbiutils-objs-$(CONFIG_FDT_CPPC) += cppc/fdt_cppc_drivers.carray.o - -carray-fdt_cppc_drivers-$(CONFIG_FDT_CPPC_RPMI) += fdt_cppc_rpmi +carray-fdt_early_drivers-$(CONFIG_FDT_CPPC_RPMI) += fdt_cppc_rpmi libsbiutils-objs-$(CONFIG_FDT_CPPC_RPMI) += cppc/fdt_cppc_rpmi.o -- cgit v1.1