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 <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2025-01-19 11:03:57 -08:00
committed by Anup Patel
parent e84ba96634
commit 434add551c
32 changed files with 39 additions and 254 deletions

View File

@@ -17,21 +17,18 @@
#include <sbi/sbi_string.h>
#include <sbi/sbi_system.h>
#include <sbi/sbi_tlb.h>
#include <sbi_utils/mpxy/fdt_mpxy.h>
#include <sbi_utils/cppc/fdt_cppc.h>
#include <sbi_utils/fdt/fdt_domain.h>
#include <sbi_utils/fdt/fdt_driver.h>
#include <sbi_utils/fdt/fdt_fixup.h>
#include <sbi_utils/fdt/fdt_helper.h>
#include <sbi_utils/fdt/fdt_pmu.h>
#include <sbi_utils/hsm/fdt_hsm.h>
#include <sbi_utils/ipi/fdt_ipi.h>
#include <sbi_utils/irqchip/fdt_irqchip.h>
#include <sbi_utils/irqchip/imsic.h>
#include <sbi_utils/mpxy/fdt_mpxy.h>
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/suspend/fdt_suspend.h>
#include <sbi_utils/timer/fdt_timer.h>
#include <sbi_utils/ipi/fdt_ipi.h>
#include <sbi_utils/reset/fdt_reset.h>
#include <sbi_utils/serial/semihosting.h>
#include <sbi_utils/timer/fdt_timer.h>
/* List of platform override modules generated at compile time */
extern const struct platform_override *const platform_override_modules[];
@@ -257,10 +254,7 @@ static int generic_early_init(bool cold_boot)
if (rc)
return rc;
fdt_cppc_init(fdt);
fdt_hsm_init(fdt);
fdt_reset_init(fdt);
fdt_suspend_init(fdt);
fdt_driver_init_all(fdt, fdt_early_drivers);
}
if (!generic_plat || !generic_plat->early_init)

View File

@@ -15,9 +15,9 @@
#include <sbi/sbi_hart.h>
#include <sbi/sbi_system.h>
#include <sbi/sbi_console.h>
#include <sbi_utils/fdt/fdt_helper.h>
#include <sbi_utils/fdt/fdt_driver.h>
#include <sbi_utils/fdt/fdt_fixup.h>
#include <sbi_utils/reset/fdt_reset.h>
#include <sbi_utils/fdt/fdt_helper.h>
#include <sbi_utils/i2c/fdt_i2c.h>
#define DA9063_REG_PAGE_CON 0x00

View File

@@ -16,8 +16,8 @@
#include <sbi/sbi_console.h>
#include <sbi/sbi_timer.h>
#include <sbi/riscv_io.h>
#include <sbi_utils/fdt/fdt_driver.h>
#include <sbi_utils/fdt/fdt_helper.h>
#include <sbi_utils/reset/fdt_reset.h>
#include <sbi_utils/i2c/fdt_i2c.h>
struct pmic {