From: Dang Huynh <dang.huynh@mainlining.org>
To: Kever Yang <kever.yang@rock-chips.com>,
Simon Glass <sjg@chromium.org>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Tom Rini <trini@konsulko.com>,
u-boot@lists.denx.de
Cc: Arnaud Patard <arnaud.patard@collabora.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
FUKAUMI Naoki <naoki@radxa.com>,
u-boot@lists.denx.de, Jonas Karlman <jonas@kwiboo.se>,
Jonas Karlman <jonas@kwiboo.se>
Subject: Re: [PATCH v3 0/4] rockchip: Add support for RAM boot from maskrom mode
Date: Sun, 19 Oct 2025 09:39:46 +0000 [thread overview]
Message-ID: <3064939.mvXUDI8C0e@melttower> (raw)
In-Reply-To: <20250802220738.3018910-1-jonas@kwiboo.se>
Tested on my PineTab 2 using rkusbboot.
Tested-by: Dang Huynh <dang.huynh@mainlining.org> (RK3566 - PineTab 2)
On Saturday, August 2, 2025 10:07:21 PM Coordinated Universal Time Jonas
Karlman wrote:
> The BootROM in Rockchip SoCs will enter maskrom mode when boot firmware
> cannot be found in nand/spi/mmc storage.
>
> In maskrom mode the USB OTG port can accept one of two custom commands.
>
> Initially a 0x471 command to load TPL into SRAM. After TPL has been
> executed and it has returned back-to-BROM, a 0x472 command to load SPL
> into start of DRAM.
>
> This series adds two binman images that can be used to RAM boot from
> maskrom mode:
> - u-boot-rockchip-usb471.bin that contains TPL to init DRAM.
> - u-boot-rockchip-usb472.bin that contains SPL and the normal FIT
> payload with i.e. U-Boot proper, TF-A and FDT.
>
> The config fragment rockchip-ramboot.config can be used to enable
> building of these two binman images, e.g.:
>
> make generic-rk3588_defconfig rockchip-ramboot.config
>
> These binman images can be used with the proprietary rkbin boot_merger
> tool to create a special loader image that can be used with tools such
> as rkdeveloptool or rockusb tools to RAM boot from maskrom, e.g.:
>
> Create loader image:
> $ ../rkbin/tools/boot_merger ./RK3588MINIALL.ini
>
> Boot from maskrom:
> $ rkdeveloptool db u-boot-rockchip-rk3588-loader.bin
> or
> $ rockusb download-boot u-boot-rockchip-rk3588-loader.bin
>
> Another option that does not require use of proprietary tools is using
> open source tools such as rkflashtool or rkusbboot that can load the
> binman images directly without any need to first create a special loader
> image to RAM boot from maskrom, e.g.:
>
> $ rkflashtool l < u-boot-rockchip-usb471.bin
> $ rkflashtool L < u-boot-rockchip-usb472.bin
> or
> $ rkusbboot u-boot-rockchip-usb471.bin u-boot-rockchip-usb472.bin
>
> I am setting up a new personal lab for rockchip boards that primarily
> will use this RAM boot method for testing new U-Boot and Linux builds.
>
> More detailed instructions on how RAM boot can be used will be added
> under doc/board/rockchip/ in a follow-up series, after this series has
> been accepted and my new lab is fully up and running.
>
> Changes in v3:
> - Use read_brom_bootsource_id() to support RAM boot on RK3576
> - Add a rockchip-ramboot.config fragment to explicitly enable instead of
> imply the new Kconfig option on a few select SoCs
> - Update commit message to highlight that the binman images can be used
> directly without use of the proprietary rkbin boot_merger tool
> - Include a special patch, not intended to be merged, to demonstrate use
> of RAM boot with rk loader images
>
> Changes in v2:
> - Rebase on top of "rockchip: binman: Use a template for FIT and other
> improvements" series
> - Add patch to fix booting into Linux on RK3588 board with 16+ GiB DRAM
>
> This series depends on the "rockchip: Add support for ROCK 5B+" [1] and
> "board: rockchip: Add Radxa ROCK 4D" [2] series for a clean apply.
> See [3] for a branch including both depends.
>
> [1] https://patchwork.ozlabs.org/cover/2118033/
> [2] https://patchwork.ozlabs.org/cover/2118088/
> [3]
> https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/ramboot-> v3
>
> Jonas Karlman (4):
> rockchip: Move TEXT_BASE to 8 MiB offset from start of DRAM
> rockchip: Add support for RAM boot from maskrom mode
> rockchip: sdram: Add fallback that fixup DRAM gaps on RK3588
> HACK: rockchip: Add miniall.ini files to simplify test of RAM boot
>
> RK3308MINIALL.ini | 22 +++++++++++++++++
> RK3328MINIALL.ini | 20 +++++++++++++++
> RK3399MINIALL.ini | 20 +++++++++++++++
> RK3528MINIALL.ini | 25 +++++++++++++++++++
> RK3566MINIALL.ini | 25 +++++++++++++++++++
> RK3568MINIALL.ini | 25 +++++++++++++++++++
> RK3576MINIALL.ini | 27 ++++++++++++++++++++
> RK3588MINIALL.ini | 25 +++++++++++++++++++
> arch/arm/dts/rockchip-u-boot.dtsi | 33 +++++++++++++++++++++++++
> arch/arm/mach-rockchip/Kconfig | 14 ++++++++---
> arch/arm/mach-rockchip/rk3308/Kconfig | 3 ---
> arch/arm/mach-rockchip/rk3568/Kconfig | 3 ---
> arch/arm/mach-rockchip/rk3588/Kconfig | 3 ---
> arch/arm/mach-rockchip/rk3588/rk3588.c | 27 ++++++++++++++++++++
> arch/arm/mach-rockchip/sdram.c | 7 +++++-
> arch/arm/mach-rockchip/spl-boot-order.c | 14 ++++++++---
> board/rockchip/rockchip-ramboot.config | 1 +
> boot/Kconfig | 3 +++
> 18 files changed, 281 insertions(+), 16 deletions(-)
> create mode 100644 RK3308MINIALL.ini
> create mode 100644 RK3328MINIALL.ini
> create mode 100644 RK3399MINIALL.ini
> create mode 100644 RK3528MINIALL.ini
> create mode 100644 RK3566MINIALL.ini
> create mode 100644 RK3568MINIALL.ini
> create mode 100644 RK3576MINIALL.ini
> create mode 100644 RK3588MINIALL.ini
> create mode 100644 board/rockchip/rockchip-ramboot.config
prev parent reply other threads:[~2025-10-20 4:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-02 22:07 [PATCH v3 0/4] rockchip: Add support for RAM boot from maskrom mode Jonas Karlman
2025-08-02 22:07 ` [PATCH v3 1/4] rockchip: Move TEXT_BASE to 8 MiB offset from start of DRAM Jonas Karlman
2025-08-02 22:07 ` [PATCH v3 2/4] rockchip: Add support for RAM boot from maskrom mode Jonas Karlman
2025-11-16 12:37 ` Kever Yang
2025-08-02 22:07 ` [PATCH v3 3/4] rockchip: sdram: Add fallback that fixup DRAM gaps on RK3588 Jonas Karlman
2025-11-16 12:38 ` Kever Yang
2025-08-02 22:07 ` [PATCH v3 4/4] HACK: rockchip: Add miniall.ini files to simplify test of RAM boot Jonas Karlman
2025-10-19 9:39 ` Dang Huynh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3064939.mvXUDI8C0e@melttower \
--to=dang.huynh@mainlining.org \
--cc=arnaud.patard@collabora.com \
--cc=jonas@kwiboo.se \
--cc=kever.yang@rock-chips.com \
--cc=naoki@radxa.com \
--cc=philipp.tomsich@vrull.eu \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox