Commit Graph

192 Commits

Author SHA1 Message Date
Ivaylo Ivanov
a25fb8ecaf lib: nanoprintf: let the compiler use division instructions for divmod
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.
2026-05-11 23:45:35 +03:00
Ivaylo Ivanov
732d6f30b9 board: add support for Motorola Edge 30 Fusion
Add basic support for Motorola tundra, usable to boot mainline Linux.
UniLoader has to be packaged with mkbootimg (header_version 3), as it
acts as a wrapper for the kernel image and tree.
2026-05-11 22:04:15 +02:00
Ivaylo Ivanov
24dd909e25 soc: add support for Qualcomm's Snapdragon 888
Define a config option for SM8350 to prepare for supporting devices
with that SoC.
2026-05-11 22:04:15 +02:00
Igor Belwon
84bc0d3d74 board: Add support for the Sony PlayStation Vita
This commit adds support for the PSVita 1xxx/2xxx variants, which have:
 - 4x Cortex A9
 - OLED/LCD display (both types get init. by libbaremetal before)
 - 512MB RAM (ew)
 - Some PowerVR custom GPU (ew)
2026-05-05 00:14:25 +03:00
Igor Belwon
999374b9cc soc: Add support for Sony's Kermit SoC
Used in PlayStation Vita and PlayStation TV platforms

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2026-05-05 00:14:25 +03:00
Igor Belwon
93d43c3a82 board: Add support for Lenovo Idea Tab Pro
* Needs to be unlocked via an exploit
* mkbootimg --kernel uniLoader.lz4 --header_version 4 --out boot.img
* Has very slow fastboot (usb 1.1 speeds slow), so flashing via the
  SoC flash mode or fastbootd is recommended
* fastboot flash boot boot.img reboot

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2026-05-01 14:30:38 +03:00
Igor Belwon
35a425b5d3 soc: Add support for MediaTek MT6897
Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2026-05-01 14:30:38 +03:00
faveoled
63319a14bd board: Add support for Realme C35 2026-04-27 14:49:39 +02:00
Spyware_Hunter
c9439e7bba board: Correct codenames for some Samsung devices and minor text changes 2026-04-27 13:00:24 +02:00
Spyware_Hunter
c8c864c1ed configs: Correct codenames for some Samsung devices 2026-04-27 13:00:24 +02:00
Spyware_Hunter
5f4c101b68 README: Correct codenames for some Samsung devices and fix their sorting, add Galaxy A33 5G, delete unnecessary spaces 2026-04-27 13:00:24 +02:00
Igor Belwon
1bd1f6c06a gitmodules: remove
We're not using it anyway
2026-04-21 21:57:25 +03:00
Igor Belwon
f75668571a ci: build_test: Add the build script
Tests all supposed-to-be-working devices (read - has a defconfig)
for compilation errors. No arm devices have defconfigs so it
hardcodes the arm64 compiler for now.
2026-04-21 21:57:25 +03:00
Igor Belwon
9d27cddccf ci: build_test: Adapt to our usecase
- Remove the useless make commands
- Add cross-compilers as dependencies
- Run build_test script
- Bump checkout to v5
2026-04-21 21:57:25 +03:00
Igor Bełwon
0e18fa6c40 ci: build_test: Import template from GitHub Actions 2026-04-21 21:57:25 +03:00
Aiden Isik
9ae8d18028 board: Add support for Samsung Galaxy Watch FE
Adds the initial support for Samsung Galaxy Watch FE (lucky7).
2026-04-21 16:33:50 +02:00
Trijal Saha
84c5f568b3 Makefile: Forcefully regenerate linker.lds
This fixes linking issues with ld.lld when having to regenerate linker.lds after configuration changes.
2026-03-14 15:13:45 +02:00
Igor Belwon
9a03aa6395 arch: Add architecture-dependent kernel copying functions
This is done to clean main/ code of ugly architecture ifdefs.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2026-02-23 23:02:53 +02:00
Igor Belwon
314f2addeb board: fix main.h header 2026-02-23 23:02:53 +02:00
Igor Belwon
eaacd962db main: refactor booting logic
- Move main headers from include/ to include/main/
- Split booting logic to boot.c and boot-fdt.c to avoid cluttering main()
- Conditionally compile boot-fdt only if libfdt is used
- Add some better logging

Change was tested on qemu-virt, which succesfully booted a kernel:
$ qemu-system-aarch64 -machine virt -cpu cortex-a72 -nographic -m 512m -kernel uniLoader.o
[INFO]              .__.____                     .___
[INFO]  __ __  ____ |__|    |    _________     __| _/___________
[INFO] |  |  \/    \|  |    |   /  _ \__  \   / __ |/ __ \_  __\
[INFO] |  |  /   |  \  |    |__(  <_> ) __ \_/ /_/ \  ___/|  |\/
[INFO] |____/|___|  /__|_______ \____(____  /\____ |\___  >__|
[INFO]            \/           \/         \/      \/    \/
[INFO] passed board initialization
[INFO] welcome to uniLoader (e69eba1) - date 2026-02-21 14:01:34 on qemu-virt
[INFO] Booting kernel...
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 6.12.73+deb13-arm64 (debian-kernel@lists.debian.org) (aarch64-linux-gnu-gcc-14 (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44) #1 SMP Debian 6.12.73-1 (2026-02-17)
[    0.000000] KASLR enabled
[    0.000000] random: crng init done
[...]

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2026-02-23 23:02:53 +02:00
Igor Belwon
ecd7ebf677 virt: disable gzip and libfdt
gzip: qemu shall use uniLoader.o as the kernel which also enables symbol maps and other cool stuff.
so, the gzip-compressed uniLoader image is useless and can slow down the compile process

libfdt: temporary. it doesn't seem to pick up the fdt that is passed when booting raw kernel

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2026-02-23 23:02:53 +02:00
tildeguy
e69eba1d89 board: add support for Huawei Mediapad T5
Adds the initial support for Huawei Mediapad T5 (agassi2) and Hi6250-based devices.
2026-02-21 11:16:21 +01:00
tildeguy
88cc20b0d6 project: allow not to load ramdisk but only its size
HiSilicon bootloader copies the ramdisk itself, and marks
its memory region as protected, so we can't memcpy on it.
Even more: we also can NOT include the ramdisk into uniLoader
for it, because the kernel partition is too small.

The easiest workaround for that is just using an empty
blob/ramdisk, so it won't be copied. But it breaks
libfdt, as it doesn't know the actual ramdisk size.
2026-02-21 11:16:21 +01:00
tildeguy
4c41a44b62 lib: simplefb: allow boards to override font scale
Make it possible to set font scale via video_info struct,
as a dynamic font scale may be slightly too big on some screens.
2026-02-21 11:16:21 +01:00
faveoled
c4d3f6490e board: add support for Samsung Galaxy S10 2026-02-07 09:34:05 +02:00
Hendra Manudinata
da2cd8d222 configs: j4lte: Add required addresses 2026-01-27 10:52:40 +02:00
R0rt1z2
741f3e6a61 arch: zero BSS section during early boot
The C runtime requires that uninitialized global variables are zero.
In a bare-metal environment, memory contents are undefined at startup
and the BSS section is not automatically cleared, so we must zero out
this entire section ourselves.

Without this, static variables contain garbage values, leading to
unpredictable behavior. For example, the simplefb driver uses a static
variable to track the current print position, which resulted in text
being drawn at random locations on the screen.
2026-01-13 14:06:09 +02:00
evilMyQueen
f60112e4b6 board: Order every board properly
This commit orders every board firstly in ascending numerical order
and then in alphabetical order of letters.
Also adds missing CONFIG_SAMSUNG_A336B to board/Makefile

Signed-off-by: evilMyQueen <evilMyQueen@mainlining.org>
2026-01-13 14:03:51 +02:00
R0rt1z2
ba5c82604a main: Fix duplicate drivers_init call
Commit 7993348878 accidentally replaced the late_init call with a
duplicate drivers_init call when converting the initcall logic to use
the new INITCALL macro.

This causes drivers to be probed twice during boot. For the simplefb
driver, this results in the framebuffer being cleared after the boot
logo has already been printed, since simplefb_probe() calls
clean_fbmem() unconditionally.
2026-01-06 00:16:31 +01:00
evilMyQueen
65de257b2c board: add support for Infinix Note 30 VIP
Signed-off-by: evilMyQueen <evilMyQueen@mainlining.org>
2026-01-04 10:51:14 +02:00
faveoled
cf4c76be24 board: add support for Samsung Galaxy A30 2026-01-02 11:11:03 +02:00
Ivaylo Ivanov
6cd8dfd0d0 board: samsung-j5lte: cast mmio addresses in writel's
Fix build errors for j5lte by casting mmio addresses in writel's. While
at it, do some quality of life changes, like moving entry addresses out
of board/Kconfig into the j5lte defconfig and setting LINUX_KRNL_HEADER_IMG.
2025-12-28 17:33:25 +01:00
Ivaylo Ivanov
a8428f37d6 lib: provide aeabi stubs to satisfy compiler on armv7
The framebuffer scaling code was not tested on armv7 due to no
current platforms making use of simplefb. Turns out the compiler
wants a set of aeabi helpers for divisions, not present due to
the bare metal nature of the bootloader. Satisfy this with empty
stubs.
2025-12-28 17:33:25 +01:00
vipoll
6d1c7a9dc9 board: samsung-herolte: fix incorrect framebuffer height 2025-12-28 14:39:35 +02:00
RadGoodNow
81f7b06b81 board: Add support for itel Vision 3 Plus
Signed-off-by: RadGoodNow <81907382+RadGoodNow@users.noreply.github.com>
2025-12-28 13:22:41 +01:00
BotchedRPR
f6d2577d4b drivers: Add driver selection menu
This avoids building Exynos drivers for all platforms

Signed-off-by: BotchedRPR <igor.belwon@mentallysanemainliners.org>
2025-11-03 21:30:37 +02:00
vipoll
918e08f85d libfdt: use C memmove/memcpy instead of ASM to avoid rebooting
asm memmove() and memcpy() are not reliable yet,
so just use the C analogues for now
2025-11-03 21:30:37 +02:00
vipoll
266fb485dd drivers: introduce ramdisk-handler (adds linux,initrd-start/end at boot time) 2025-11-03 21:30:37 +02:00
vipoll
f4a3e966b5 import libfdt from Linux v6.18-rc2-3080-g6474677ce915 2025-11-03 21:30:37 +02:00
Ivaylo Ivanov
f22f626ebd .: add a project configuration file for readthedocs
readthedocs.org allows to automatically generate and publish HTML
documentations.
2025-11-03 18:41:58 +01:00
Ivaylo Ivanov
4d26881b3c README: add supported devices and rearrange information
As this is the first thing people will see about our project, keep
it simple, but well arranged and informative.
2025-11-03 17:19:38 +02:00
Violet
467d16f378 r0q: Enable Linux kernel header
S22 will only boot with this enabled in recent versions of uniLoader.
2025-10-31 10:51:46 +02:00
evilMyQueen
424b351dfc board: introduce support for Xiaomi Poco M3 Pro 5G
Signed-off-by: evilMyQueen <vernamjap@gmail.com>
2025-10-20 17:25:56 +03:00
evilMyQueen
3b18c48ba9 soc: fix Kconfig warning
Signed-off-by: evilMyQueen <vernamjap@gmail.com>
2025-10-18 14:02:09 +02:00
evilMyQueen
b6635ab77d board: introduce support for xiaomi blossom devices
Signed-off-by: evilMyQueen <vernamjap@gmail.com>
2025-10-17 22:50:51 +02:00
predefine
b80aaacaff board: introduce support for Xiaomi Redmi Note 8 Pro
Signed-off-by: predefine <predefine@yandex.ru>
2025-10-04 13:56:49 +03:00
Eric Gonçalves
6557f34c66 board: Add support for the Samsung Galaxy S22 2025-10-03 17:36:36 +03:00
Igor Belwon
cb549596c0 kconfig: lxdialog: textbox: Fix compilation warnings
x, y are only used if OLD_NCURSES is set. Add the declaration in its
scope.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2025-10-01 22:17:28 +03:00
Igor Belwon
c9c6116afd soc: Clear Kconfig of warnings
This removes default values for these SoCs. They're N by default. This
generates a Kbuild warnings.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2025-10-01 22:17:28 +03:00
Igor Belwon
22ee49a6cf board: Remove framebuffer properties
These properties are board specific, and were already moved to board
files. As such, remove these leftovers.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2025-10-01 22:17:28 +03:00