diff options
| author | Samuel Holland <[email protected]> | 2025-01-19 11:03:57 -0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-02-12 21:39:25 +0530 |
| commit | 434add551c2a17cac3804ff0f587d31be03f070e (patch) | |
| tree | 3554b7e11c36b8427cfc3349daf00a5eb5d5027b /lib/utils/suspend | |
| parent | e84ba966347009a2dae61d7399bc68c28892847e (diff) | |
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 <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/suspend')
| -rw-r--r-- | lib/utils/suspend/fdt_suspend.c | 22 | ||||
| -rw-r--r-- | lib/utils/suspend/fdt_suspend_drivers.carray | 3 | ||||
| -rw-r--r-- | lib/utils/suspend/fdt_suspend_rpmi.c | 2 | ||||
| -rw-r--r-- | lib/utils/suspend/objects.mk | 5 |
4 files changed, 2 insertions, 30 deletions
diff --git a/lib/utils/suspend/fdt_suspend.c b/lib/utils/suspend/fdt_suspend.c deleted file mode 100644 index bd4691a0..00000000 --- a/lib/utils/suspend/fdt_suspend.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2024 Ventana Micro Systems Inc. - * - * Authors: - * Anup Patel <[email protected]> - */ - -#include <sbi_utils/suspend/fdt_suspend.h> - -/* List of FDT suspend drivers generated at compile time */ -extern const struct fdt_driver *const fdt_suspend_drivers[]; - -void fdt_suspend_init(const void *fdt) -{ - /* - * Platforms might have multiple system suspend devices or - * might not have any so probe all and don't fail. - */ - fdt_driver_init_all(fdt, fdt_suspend_drivers); -} diff --git a/lib/utils/suspend/fdt_suspend_drivers.carray b/lib/utils/suspend/fdt_suspend_drivers.carray deleted file mode 100644 index a0c857fc..00000000 --- a/lib/utils/suspend/fdt_suspend_drivers.carray +++ /dev/null @@ -1,3 +0,0 @@ -HEADER: sbi_utils/suspend/fdt_suspend.h -TYPE: const struct fdt_driver -NAME: fdt_suspend_drivers diff --git a/lib/utils/suspend/fdt_suspend_rpmi.c b/lib/utils/suspend/fdt_suspend_rpmi.c index 07ff5198..b08c33e9 100644 --- a/lib/utils/suspend/fdt_suspend_rpmi.c +++ b/lib/utils/suspend/fdt_suspend_rpmi.c @@ -10,11 +10,11 @@ #include <libfdt.h> #include <sbi/sbi_system.h> #include <sbi/riscv_asm.h> +#include <sbi_utils/fdt/fdt_driver.h> #include <sbi_utils/fdt/fdt_helper.h> #include <sbi_utils/mailbox/fdt_mailbox.h> #include <sbi_utils/mailbox/mailbox.h> #include <sbi_utils/mailbox/rpmi_mailbox.h> -#include <sbi_utils/suspend/fdt_suspend.h> struct rpmi_syssusp { struct mbox_chan *chan; diff --git a/lib/utils/suspend/objects.mk b/lib/utils/suspend/objects.mk index 657670a8..9c386248 100644 --- a/lib/utils/suspend/objects.mk +++ b/lib/utils/suspend/objects.mk @@ -7,8 +7,5 @@ # Anup Patel <[email protected]> # -libsbiutils-objs-$(CONFIG_FDT_SUSPEND) += suspend/fdt_suspend.o -libsbiutils-objs-$(CONFIG_FDT_SUSPEND) += suspend/fdt_suspend_drivers.carray.o - -carray-fdt_suspend_drivers-$(CONFIG_FDT_SUSPEND_RPMI) += fdt_suspend_rpmi +carray-fdt_early_drivers-$(CONFIG_FDT_SUSPEND_RPMI) += fdt_suspend_rpmi libsbiutils-objs-$(CONFIG_FDT_SUSPEND_RPMI) += suspend/fdt_suspend_rpmi.o |
