Booting from SD is a fallback if booting from SPI-NAND fails. For other boot devices, you must change the bootstrap pins to the corresponding combinations.
Hereās updated procedures for flashing OpenWRT v23.05.0 & later on BPi R3:
Does mt7981b support nand booting the system, and then mounting emmc or SD card as storage space?
Yes, that should work. Since I can see the NAND when booting from eMMC, it should work vice versa.
does anyone know How to configure mt7981, uboot, openwrt, dts, default spi nand to boot into the system, and mount SD card as an external simple storage device? Thank you
Why asking again? This thread is only uboot+atf,no kernel/userspace.
When you want openwrt please ask there or in a openwrtone thread (maybe create one).
Ok, sorry, Iāll try to ask on openwrt one, thank you
Hi @hackpascal, it looks like current atf code misses some files (wdt,mmc,spi,efuse)
Or has build been changed? I see menuconfig support compared to my old tree.
after i got the missing efuse error also on my default atf-branch i had to delete ./build/mt7988/release/ manually (make clean does not clean it up) to be able to compile my old branch again, but i got a strange error
LD build/mt7988/release/bl2/bl2.elf
/bin/sh: 1: -g: not found
when compiling the new tree, it also seems like the MAKE_BUILD_STRINGS was dropped from make_helpers/build_macros.mk which i had used to print the bootdevice in bl2/fip
looks like the error above was caused by my comit readding the MAKE_BUILD_STRINGS, to where was this moved?
uploaded my full tree to GitHub - frank-w/u-boot at mtk-atf-2025
finally got the 8GB variant working with the new atf-codeā¦
NOTICE: BL2: v2.12.0(release):v2.11.0-1599-gc6dad9faceb5
NOTICE: BL2: Built : 23:34:17, Apr 7 2025
NOTICE: WDT: [40000000] Software reset (reboot)
NOTICE: CPU: MT7988
NOTICE: EMI: DDR4 4BG mode
NOTICE: EMI: Using DDR unknown settings
NOTICE: EMI: Detected DRAM size: 8192 MB
NOTICE: EMI: complex R/W mem test passed
NOTICE: LVTS: Enable thermal HW reset
NOTICE: BL2: Booting BL31
NOTICE: BL31: v2.12.0(release):v2.11.0-1599-gc6dad9faceb5
NOTICE: BL31: Built : 23:34:20, Apr 7 2025
only canāt get the build-version string working
linux also sees full 8G of ram
root@bpi-r4-8G:~# free
total used free shared buff/cache available
Mem: 8140504 202848 7922844 1592 89244 7937656
Swap: 0 0 0
but noticed that powerdown is not supported by atf-code (was working with old atf)
[ 82.829046] reboot: Power down
ERROR: Power-down unsupported.
PAļæ½
F0: 102B 0000
power down doesnāt really supported (was implemented as WFI). Only soft reset is supported.
But my older tree does not print this eror and does not rebootā¦then atf imgo should hang if it cannot powerdown the pmic.
If I remember correctly, I was also struggling, it has to do with the tags in the git repo. Also pull the tags when cloning.
I got this working passing BUILD_STRING as parameter. See mtk-atf-2025 branch. This is also the way openwrt does it to extend the version string
@hackpascal do you miss drivers (mmc,ā¦) above in current atf? I cherry-picked them into my new branch and this way it works,but have to remove build dir completely when using the older atf before (make clean is not enough,so there is something missing too).
regarding old ATF and poweroffā¦the older ATF shows this, but does not do reboot on poweroff
[ 82.860016] reboot: Power down
PANIC at PC : 0x00000000430052a4
u-boot .config : config.txt (44,7 KB) german (Beschreibung): summary.pdf (214,6 KB) english description: summary_en.pdf (211,2 KB)
Hello, i built an openbsd7.6 image with u-boot patch, like descrition above. But the .dtb files are still for raspberry pi, can it be fixed, by adding the openwrt boot .dtb files? Can anybody share the .config for the openwrt u-boot ? Because it must look very similar to the openbsd u-boot above : config.txt, or a diff?
The problem is, that the banana RPI R3 will not boot with mine. Something important must be left in the BOOT partition, you can reproduce mine, by following the description above.
Anybody interested? or have an idea to fix the boot?
I would make an extern topic, but this issue is also very common.
Openwrt does not use BOOT gpt partition like i do (and sdk did)ā¦they flash kernel fit/itb (including dtbs) to specific offset or ubi partition.
Not sure openbsd has all necessary drivers as imho they do not use linux kernel
Is there any output on uart? Without uart it is nearly impossible to find errorā¦
edit: tried without the additional patches (mmc,spi,efuse) and still seem to workā¦looks like my error was only because of unclean build-directory, dropped the commits from the tree to avoid confusion
Is there any possible solution to use a general atf .bin to use on both 4GB and 8GB versions of the R4?
Seems like the R4 gives nvme and nand errors when booting 8bg board with 4gb atf build.
To reduce the number of pre-build images, it would be nice if both versions can boot from 1 atf .bin, and once booted, the 8gb build can be written to mmc/nand of the 8gb board.
I guess the dram is completely handled in the binary blob and so we cannot add any probing
i only see dome definition of static vars and printing related messages here:
maybe @hackpascal can implement a 8G probing with 4G fallback in the binary blob.
Thereās not any bootstrap defined for ddr combination⦠So you have to build dedicated bl2 for each ddr configuration
Can mtk_mem_init_real(); be run more then once? Then examining the results?
Thereās no special design for this purpose. The dram controller team didnāt test it at all.
So⦠Iām not sure if this can work.
I can only garanatee that the original mtksoc-xxxxxxxx branch with clean build (remove the entire build directory) can work correctly. The released patches in the newest branch are basically identical to what we released in the official sdk, except that some security features were removed.
As I said, poweroff in old branches was implemented as a single āpanicā while the new one has changed it to a soft reset.
Old implementation:
Current implementation:
This change is used to tell users power off is not supported and should not be used.
You can revert these changes.