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.
The value 5 appeared bare in two places: simplefb.c (when text wraps
past the bottom of the screen) and debug.c (initial y position for
the printk overlay). Replace both with FB_TEXT_TOP_PADDING defined
once in simplefb.h.
Due to divmod performing division by subtracting in a linear loop,
it's *really* slow. When performing division with larger numbers (like
32-bit addresses), it goes thru massive amounts of iterations and causes
a stall-like appearance.
Instead, let the compiler handle it by using cpu instructions like
UDIV/MSUB for armv8.
Fixes#86.
As we can make use of the video_info struct for base address,
this argument is not required anymore and only breaks havoc on
boards that don't set the CONFIG option.
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.
With support for this board also come the following changes:
- rework blobs handling to get past the 0 size bug
- basic cpu "set up" in start.S
- assembly memcpy
- uart debugging
Implement 8 loglevels to use with printk:
While at it, separate the font in a new "video" directory, which
also makes space for a proper video probing implementation. Fill
in the font from 32 to 256. Scale the font to render twice as big.
Implement dynamic line length detection. Change a few things here
and there to follow the linux kernel code style. Add a nice logo.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
arch: aarch64: Load addresses via page + offset
arch: aarch64: Align the TEXT region
drivers: Introduce an empty framework
board: Rework to be PIC
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>