[Banana BPI-R4] Booting image from RAM via uboot

Hello community,

I'm kind new to OpenWRT internals, used it for a long time for occasional tasks, but didn't had an opportunity to dive deeper into internals. And I've recently got my order with BPI-R4 + BE14000 WiFi 7 board (from Sinovoip). I know support for 802.11be are kinda experimental as for now so I don't expecting much right away. But what I was thinking of is having a way to quickly test boot all those new build & forks with patches coming up frequently for these boards. Without flashing NAND/eMMC or writing images to external microSDs.
I have a TTL adapter attached to it but it's installed in "hard to reach" place. So the TTL are connected to another device close to it. I've also connected RESET to GPIO of that device and can "press" that button remotely.
The thing is so far I've learned how to boot "recovery" images from ram via uboot. Basically I just need some storage with image and then I can do things like usb start if required image are on the USB mass storage, then ls mmc/usb <DEV:PART> <PATH> to list files, load them to RAM with load mmc <DEV:PART> $loadaddr <PATH> or usbboot $loadaddr <DEV:PART> and then run that firmware with bootm $loadaddr.
That works for FIT images - recovery or sysupgrade so far. But even if I burn sdcard image to a USB stick it won't boot with usbboot $loadaddr 0:0 or 0:1 as it seems to expect same FIT image on the partition.

  1. Is there are any way to make it work with "flat" images, suitable for sd card burning? Like the vendor firmware images or "sdcard" type images? Currently looking a way to boot sdcard images from USB storage, because that's a remote virtual device I can use. Tested it with real USB drive - same result.
  2. Any way to chainload another uboot (I guess it's BL33?) from another one or this isn't possible due to ATF secure boot things?

EDIT: I know I can also boot via TFTP/network or even serial "modem" file transfer, but it's just my setup to have it preferably loaded from USB storage. Dont' changes things for my questions anyways I guess.

banana provides instructions for their bootloader.

Not that I'm looking for anyways. Their bootloader totally lacks any filesystem functions unfortunately. But they got more advanced functions for NAND, especially that nmbm command. Hopefully those could be ported to the openwrt uboot, because it's way more advanced in features and allows booting, reading, writing and verifying raw flash with much more flexibility. Except for some of partition/internal storage handling, probably specific to MTK layout.

There is no OpenWRT UBoot, vendor loader loads openwrt kernel in place of their own.

Huh? That are you talking about? It's even on the Wiki: https://openwrt.org/inbox/toh/sinovoip/bananapi_bpi-r4
from the "OpenWrt bootlog" section:

NOTICE:  BL2: v2.9.0(release):OpenWrt v2023-10-13-0ea67d76-1 (mt7988-spim-nand-ubi-comb)

It's my board with uBoot from OpenWrt flashed on NAND:

NOTICE:  BL2: v2.10.0   (release):OpenWrt v2024.01.17~bacca82a-3 (mt7988-spim-nand-ubi-comb)
NOTICE:  BL2: Built : 20:47:44, Sep 16 2024
NOTICE:  WDT: [40000000] Software reset (reboot)
NOTICE:  CPU: MT7988
NOTICE:  EMI: Using DDR unknown settings
NOTICE:  EMI: Detected DRAM size: 4096 MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  SPI_NAND parses attributes from parameter page.
NOTICE:  SPI_NAND Detected ID 0xef
NOTICE:  Page size 2048, Block size 131072, size 134217728
NOTICE:  UBI: scanning [0x200000 - 0x8000000] ...
NOTICE:  UBI: scanning is finished
NOTICE:  UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
NOTICE:  UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
NOTICE:  UBI: Volume fip (Id #0) size is 2097152 bytes
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.10.0  (release):OpenWrt v2024.01.17~bacca82a-3 (mt7988-spim-nand-ubi-comb)
NOTICE:  BL31: Built : 20:47:44, Sep 16 2024


U-Boot 2024.07-OpenWrt-r27433-7e1d092552 (Sep 16 2024 - 20:47:44 +0000)

And here is how uboot from vendor (Sinovoip most recent, but still outdated OpenWrt image) looks like:

NOTICE:  BL2: v2.9(release):
NOTICE:  BL2: Built : 09:52:16, Jun  9 2023
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.9(release):
NOTICE:  BL31: Built : 18:01:46, Oct 13 2023


U-Boot 2023.10-rc4 (Oct 13 2023 - 17:58:56 +0800)