Skip to content

Conversation

@ya-mouse
Copy link
Contributor

@ya-mouse ya-mouse commented Jan 20, 2026

Add ldr-image section to generate native Rockchip LDR format boot image (u-boot-rockchip-ram-ldr.bin) for single-command USB download when CONFIG_SPL_RAM_DEVICE is enabled.

The LDR image bundles TPL (471 entry) and SPL+FIT (472 entry) in Rockchip's native loader format, enabling simplified Maskrom boot:

rkdeveloptool db u-boot-rockchip-ram-ldr.bin
rockusb download-boot u-boot-rockchip-ram-ldr.bin

Change-Id: 4b7252b9-065f-44f0-a13e-1c6deefc199c

@ya-mouse ya-mouse requested a review from alchark January 20, 2026 08:03
Comment on lines +320 to +329
* LDR format bundle: Native Rockchip loader format.
* Compatible with rkdeveloptool db command for single-step boot.
* - 471 entry: TPL (DDR init, runs in SRAM)
* - 472 entry: SPL+FIT concatenated (runs from DRAM)
*
* Note: filename uses .bin extension for rkdeveloptool compatibility
* (rkdeveloptool checks filename extension to determine file type)
*/
ldr-image {
filename = "u-boot-rockchip-ram-ldr.bin";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work without applying your binman addition first. In that case the two commits should go in the same series (i.e. one PR), in the right order: first add new common functionality, then make use of it for your required case.

Comment on lines +287 to +292
* SPL_RAM_PAD_SIZE: Size to pad SPL when building RAM-loadable images.
* This is 128KB (0x20000), matching the typical offset where FIT is loaded
* relative to SPL in DRAM. When CONFIG_SPL_RAM is enabled, CONFIG_SPL_MAX_SIZE
* is often 0 (unlimited), so we use a fixed value here.
*/
#define SPL_RAM_PAD_SIZE 0x20000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure 128KiB is enough? I'm looking at a u-boot-spl-dtb.bin which is 136822 bytes even without all that SPL_RAM_DEVICE stuff enabled, so this will likely cause headaches

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's enough for RAM-only config. But we can make more room just in case.

* special images for that workflow:
*
* u-boot-rockchip-ram.bin - Plain binary layout:
* [0x00000 - 0x1ffff] SPL padded to 128KB (SPL_RAM_PAD_SIZE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this still include ROCKCHIP_TPL? (I presume not)
Should this still include boost.bin? (I presume yes)

Please mention in the description

*
* u-boot-rockchip-ram.bin - Plain binary layout:
* [0x00000 - 0x1ffff] SPL padded to 128KB (SPL_RAM_PAD_SIZE)
* [0x20000 - ...] u-boot.itb (FIT with U-Boot + ATF + DTB)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be made to work with Falcon mode? I.e. boot a FIT with ATF+DTB+Linux instead of U-boot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Linux will be relocated past the ITB placement in memory, then it should work. I can check.

Add ldr-image section to generate native Rockchip LDR format boot
image (u-boot-rockchip-ram-ldr.bin) for single-command USB download
when CONFIG_SPL_RAM_DEVICE is enabled.

The LDR image bundles TPL (471 entry) and SPL+FIT (472 entry) in
Rockchip's native loader format, enabling simplified Maskrom boot:

    rkdeveloptool db u-boot-rockchip-ram-ldr.bin
    rockusb download-boot u-boot-rockchip-ram-ldr.bin

Change-Id: 4b7252b9-065f-44f0-a13e-1c6deefc199c
Signed-off-by: Anton Burticica <mouse@ya.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants