Since I tried to base my Arch Linux Image with VisionFive2 Software v2.8.0. Every time I boot the image, the file /boot/boot/dtbs/starfive/jh7110-visionfive-v2.dtb gets overwritten.
set_fdt_distro=if test ${chip_vision} = A; then if test ${memory_size} = 200000000; then run chipa_gmac_set;run visionfive2_mem_set;fatwrite mmc ${fatbootpart} ${fdt_addr_r} ${bootdir}/dtbs/${fdtfile} ${filesize};else run chipa_gmac_set;run visionfive2_mem_set;fatwrite mmc ${fatbootpart} ${fdt_addr_r} ${bootdir}/dtbs/${fdtfile} ${filesize};fi;else run visionfive2_mem_set;fatwrite mmc ${fatbootpart} ${fdt_addr_r} ${bootdir}/dtbs/${fdtfile} ${filesize};fi;
No clue, but from a glance there’s an else, and another fatwrite.
I do not know where these variables are stored either. They’re either hardcoded into u-boot itself, or perhaps that’s what the W25X10CL SPI flash does store.
I had seen a document on the boot process a few days ago, but it’s from early 2022 i.e. a year ago, and very inaccurate from a glance. The page where it was just disappeared.
I absolutely agree, the uboot env is quite a mess…
For now: the env ist store on the same qspi flash as u-boot itself, the according region just isn’t exposed via the device tree…
I needed access to the u-boot env from linux, this might help understanding/fixing issues in u-boot without needing to connect to the uart: Accessing U-Boot env from linux
Upstream u-boot also modify dtb for multiple board revision support/ram size support and many boards are using this method. However, they didn’t modify dtb file, only data in ram passing to kernel. And sf’s upstream series won’t modify dtb file in storage device either.
tbh the upstream patch series looks pretty minimal compared to the currently used u-boot. there are init functions missing for the ethernet phy, usb,… i’d be interrested to know what works and what doesn’t with upstream u-boot but didn’t have time for it until now
no, i was reading the source on github…
thank you for the hint. I just glanced over the patch series and noticed that the eth patches also contain the memory size fixup via the function fdt_fixup_memory()
this looks like a really good idea but is nowhere to be found in their own repo on github.
Maybe i’ll build upstream u-boot with those series applied to test them.