]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: rt-loader: add ROM uImage lookup (aka standalone) 19832/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Fri, 22 Aug 2025 08:43:23 +0000 (04:43 -0400)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 3 Sep 2025 19:36:34 +0000 (21:36 +0200)
commit1a200ead4f9ba1fdc4f05e1bdced0dee04b71598
tree68e199f10c35cc46ec1bb7533c7990c734c8301d
parent908cda6943cef3c380884172fa2a3220814a5d6f
realtek: rt-loader: add ROM uImage lookup (aka standalone)

The rt-loader currently only supports booting piggy backed lzma
compressed kernels. This requires a data layout where the kernel
directly follows the loader. That might not be sufficient for
more complex flash layouts.

Especially bootbase devices (like ZyXEL GS1920) will need some
kind of chain loading that needs to be explored yet.

Enhance the rt-loader as follows:

- Allow to build as standalone version
- In this case a flash start address is given
- During boot loader will search the ROM starting from that address
- If it finds a uImage this will be loaded into RAM
- Afterwards it will be decompressed to its load address
- While we are here add uncompressed uImage support

As always the implementation tries to be as simple as possible.

- uImage detection works without magics
- uImage will be loaded to highest possible memory address
- Documentation in Makefile has been adapted accordingly

Funny side fact: A standalone rt-loader can chain load a piggy
backed rt-loader from flash.

During bootup loader will show

rt-loader
Running on RTL8380M (chip id 6275C) with 256MB
Relocate 15760 bytes from 0x82000000 to 0x8ffa0000
Searching for uImage starting at 0xb45a0000 ...
uImage 'MIPS OpenWrt Linux-6.12.40' found at 0xb45a0000 with load address 0x80100000
Copy 2923034 bytes of image data to 0x8fcd61e6 ...
Extract image with 2923034 bytes from 0x8fcd61e6 to 0x80100000 ...
Final kernel size is 2923034 bytes
Booting kernel from 0x80100000 ...

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19832
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/image/rt-loader/Makefile
target/linux/realtek/image/rt-loader/include/globals.h
target/linux/realtek/image/rt-loader/src/main.c
target/linux/realtek/image/rt-loader/src/startup.S