Commit Graph
8 Commits
Author SHA1 Message Date
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
Igor Belwon 209066181c board: apple-n61ap: Hardcode framebuffer addresses
In preparation for removing these addresses from Kbuild configurators,
hardcode these properties.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2025-10-01 22:17:28 +03:00
Igor Belwon 66baf5f889 board: apple-n61ap: Remove stub init functions
This does not accomplish anything, and with the new initcall logic,
can be harmlessly removed.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2025-10-01 20:02:15 +02:00
Ivaylo Ivanov 579bbfa393 lib: break ABI by reworking simplefb and then fix it
Jokes aside, commit adds support for colored indexes based on the
loglevel, introduces a better simplefb probing that does not depend
on hardcoded config options. Implementing support for fdt should be
easier now.
2025-07-11 13:45:58 +03:00
Ivaylo Ivanov 5359c3caeb board: rework the board data structure
Since we don't have to worry about writing positionally-independent
code, we can safely pass around globally defined structures and
have more fun with pointers without falling into UB.
2025-07-11 13:45:58 +03:00
Ivaylo Ivanov 2ceed988bc board: apple: modernize n61ap
This brings it up to the latest changes, like the other boards,
and makes it compilable.
2025-07-09 11:42:19 +03:00
ivoszbg 4d1a5f84bc board: Drop Board specific headers
It isn't required anymore, as we've moved on to Kconfig.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2022-06-14 18:51:04 +03:00
ivoszbg 94b2cf0c4a board: apple: Add basic iPhone 6 support
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2022-06-12 19:08:34 +03:00