Files
Ivaylo Ivanov 04a3e00bd3 drivers: introduce probe-based driver framework
The current drivers/framework.c is useless, as REGISTER_DRIVER() is a macro
that just directly calls the driver probe function. Every board file has to
reference each driver's probe function by name. This was just done to make room
for proper driver probing in the future, where we are now, so implement that.

Make drivers self-register at link time by emitting a struct driver into a
.uniloader_drivers section via DRIVER_REGISTER(). The linker brackets
the section with __drivers_start / __drivers_end symbols.

Boards describe their hardware as a static struct with the format
{ driver_name, plat_data, label }. Remove the drivers_init hook from
struct board_ops as it's no longer necessary.

The drivers probe will now be placed between early_init and splash.
The framework looks up each device's driver_name up in the
linker section and calls probe(plat_data). A failed probe is logged.

Do --whole-archive as well to convince the linker to not drop the drivers
in archived .o files that aren't called outside the archive.

Adopt all boards to use the framework.

All of the changes in this commit are co-dependent on each other, as we're
doing a large change to the ABI.
2026-05-28 00:02:41 +03:00
..
2025-11-03 21:30:37 +02:00
2025-11-03 21:30:37 +02:00