19 Commits

Author SHA1 Message Date
vipoll
266fb485dd drivers: introduce ramdisk-handler (adds linux,initrd-start/end at boot time) 2025-11-03 21:30:37 +02:00
Igor Belwon
7993348878 main: Add proper initcall logic
Currently we are checking if the function returns nonzero. This is fine,
however it adds a lot of bloat, for example the late_init initcall is
practically never used and is only a stub function that returns zero. So
- add a proper initcall macro to prepare for cleaning up unused stubs.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2025-10-01 20:02:15 +02:00
Ivaylo Ivanov
83f36d5576 main: set printk log levels to meaningful values 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
c6b486f0ed aarch64: introduce early relocation of the bootloader
All newer exynos devices with s-boot have the "feature" of placing the
android kernel at a random location in dram, specifically around
0x80000000 and 0x83000000. This made it hard to assume where we are at,
hence why we made everything as PiE (position-independent) as possible.

This, however, resulted in a lot of issues. I usually managed to get
around them with ugly hacks, but in the last 5-6 commits, with the
fixed support for armv7, everything fell apart for arm64.

So, the solution for this is to implement code at the beginning
of the bootloader that relocates it to a safe place in memory.
This is currently enabled for dreamlte, and it must be enabled
and configured for all other boards with that issue. Otherwise they
will NOT boot anymore. Boards that don't need this can keep
CONFIG_POSITION_INDEPENDENT disabled.
2025-07-10 15:58:45 +03:00
Ivaylo Ivanov
925a60bbf9 main: spew out a "versioning" tag that's defined in root makefile
This will be useful for tracking bugs of users in the future. Also
lowercase each print and drop exclamation marks because I like this
aesthetic of unofficialness a bit better.
2025-07-08 19:05:46 +03:00
Ivaylo Ivanov
8dc27cc402 board: introduce Amazon Kindle PW3 support
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
2025-07-08 15:54:02 +03:00
famfo
21bf08f9d4 main: Move initialization of board_data to the stack
When the board_data is initialized at compile time, it is placed into
the data section, which doesn't get relocated by the linker. The resulting
address of the board_data that is passed to board_init lies within reserved
memory and the device crashes.
2025-04-04 15:57:39 +03:00
Ivaylo Ivanov
9c60b66f71 AARCH64: Allow for embedding an initramfs
This actually breaks the armv7 port. It has to be revisited in the
future, since it not only is not compilable right now, but also
cannot boot linux properly. TODO

Also introduce a new C-based __memcpy_optimized that does not
cause an exception on some devices when copying the initramfs.
This issue has to be debugged further.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2024-10-12 19:43:05 +03:00
Ivaylo Ivanov
3b517ba95a lib: debug: Introduce loglevels + many minor changes
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>
2024-10-10 16:24:20 +03:00
Ivaylo Ivanov
81d26edaa3 uniLoader: Mass rework
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>
2024-10-08 21:22:21 +03:00
Ivaylo Ivanov
b301e51432 board: Introduce board file configurations
This is meant to replace the current Kconfig / SoC / Board files
configuration, which is ugly and annoying to maintain. Begin
by creating the board files registration framework and
transitioning all exynos boards to it. This also opens room for
creating the drivers registration framework in the future.

All non-samsung boards will be no longer able to do their board
configuration until they're also transitioned.

Every new board must have the following structure:
struct board_data default_board = {
	.name = "DEFAULT",
	.init = NULL,
	.late_init = NULL,
	.driver_setup = NULL,
};

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2024-09-26 15:34:26 +03:00
Ivaylo Ivanov
ed246836e9 lib: simplefb: Add support for RGB888 24bpp (dependant on the stride)
Also comes with small changes here and there.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2023-07-24 09:54:16 +03:00
Ivaylo Ivanov
ed98b5d900 .: Multiple changes
arch: Implement ARM32 support
soc: Implement ARM32 support for MSM8916
board: Implement ARM32 support for Samsung Galaxy J5 2015
include: main: Revert built-in memcpy, rearrange and add support for writel
lib: simplefb: Make the clear screen function usable

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Cc: Efim Girjeu <efimgirjeu@gmail.com>
2023-07-18 14:41:37 +03:00
Markuss Broks
3643d6a0c8 main: Use built-in memcpy
Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
2022-06-16 18:18:20 +03:00
ivoszbg
7ce00a6ed2 main: Move assembly code into an individual arch-specific folder
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2022-06-16 14:40:28 +03:00
ivoszbg
c038c7839c lib: Move debug print function into a separate file
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2022-06-14 19:51:51 +03:00
Markuss Broks
0ac15a9da6 main: Drop PAYLOAD_SIZE, use compile time kernel size
Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
2022-06-14 19:06:38 +03:00
ivoszbg
fd8ed2d1b8 uniLoader: Migrate to kconfig based configurations
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
2022-06-14 18:02:47 +03:00