Add support for compressing the uniLoader image with lz4, and while we're at it add two new Kconfig variables for setting compression tools used in the build.
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.
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.
At some point building for arm32 was broken, because the assumption
of an assembly memcpy existing was made. It, however, did not exist
for arm32, only arm64, hence build failing. Avoid this.
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
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>
Move onto using asmdefs macros in assembly files. Implement an
assembly-based memcpy for aarch64 and a C-optimized memset, while
also making place for replacing functions with more optimized ones
in the future.
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>
unic is a small library of C functions that is currently written
in plain C. It's purpose isn't to be fast, but "universal" - as
in include as little architecture-specific code as possible.
The old neatlibc still resides, but isn't being built. There is
still more to do, including implementation of memory management,
so keep it there for now.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Introduce stack and bss memory regions, rename Start.S to start.S
This commit should allow jumping out of assembly code for certain
SoCs that had issues with SP like MTK and QCOM.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Make 2 different folders for armv7 and aarch64 assembly neatlibc
functions. Add the neatlibc submodule, make it work against the
Makefile system. Pray.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
This was an issue for other armv7 boards that have slightly different
addresses till now. This also allows to start working on relocation
in the near future for both armv7 and aarch64.
While we're at it, fix some mistakes here and there.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>