RSS Bot Posted June 4 Posted June 4 Description Attempt to work towards one U-Boot bootscript for (at least) mvebu, sunxi and rockchip64. This adds: (Aligned) load address calculations This will remove the need to update any kernel_load_addr_r or ramdisk_addr_r in case kernel image increases. Calculation is based on either Flat kernel image image_size + text_offset as specified in the vmlinux(/Image) header info Compressed kernel image filesize (vmlinuz/zImage) Clear warnings to user in case files are not found, not able to load or application failed. Merge of armbianEnv.txt kernel options was attempted for sunxi, mvebu and rockchip64. DT folder determination based on sunxi approach. DT file determination based on sunxi approach. Compat with /boot/dtb/fdtfile.dtb and /boot/dtb/vendor/fdtfile.dtb. Simplified some constructs by assuming U-Boot has successfully sourced us with a set of pre-set variables, like ${prefix} ${devtype} etc. Actively set the ${kernel_comp_*} parameters based on calculations of load addresses. Ability to select different kernel/initrd by setting kver in armbianEnv.txt Also: Any warning or error includes a 10 second delay to make sure the user is able to see and read them. Any "informative" message added by the bootscript can be silenced by setting verbosity to 0 Attempted to make the bootscript 'reentrant' in away: all variables required for proper (re)execution are set, which should allow for the entire bootscript to be re-run on a next boot_target. All variables used in for-loops are actively cleared from the environment to ensure for loops work as expected. Any pre-set variable that might be used in next boot_target will be reset whenever necessary. Documentation summary for feature / change [ ] short description (copy / paste of PR title) [x] summary (description relevant for end users) Load address calculation can be disabled by adding load_addr_calc=off to armbianEnv.txt Load address calculation OBOE avoidance can be disabled by adding align_overlap_oboe_avoidance=off to armbianEnv.txt User can set custom fdtdir and fdtfile in armbianEnv.txt, but make sure to only specify DT filename in fdtfile. fdtdir will be used to both load DT, DT overlays and fixup scripts [ ] example of usage (how to see this in function) How Has This Been Tested? [x] Helios4: OK[16:10:38] U-Boot SPL 2019.04-armbian-2019.04-S3c99-Pcd6a-H9530-V0854-Bb703-R448a (May 10 2025 - 09:39:24 +0000) [16:10:38] High speed PHY - Version: 2.0 [16:10:38] Detected Device ID 6828 [16:10:38] board SerDes lanes topology details: [16:10:38] | Lane # | Speed | Type | [16:10:38] -------------------------------- [16:10:38] | 0 | 6 | SATA0 | [16:10:38] | 1 | 5 | USB3 HOST0 | [16:10:38] | 2 | 6 | SATA1 | [16:10:38] | 3 | 6 | SATA3 | [16:10:38] | 4 | 6 | SATA2 | [16:10:38] | 5 | 5 | USB3 HOST1 | [16:10:38] -------------------------------- [16:10:39] High speed PHY - Ended Successfully [16:10:39] mv_ddr: mv_ddr-armada-18.09.2 [16:10:39] DDR3 Training Sequence - Switching XBAR Window to FastPath Window [16:10:39] DDR Training Sequence - Start scrubbing [16:10:40] DDR3 Training Sequence - End scrubbing [16:10:40] mv_ddr: completed successfully [16:10:40] Trying to boot from MMC1 [16:10:40] U-Boot 2019.04-armbian-2019.04-S3c99-Pcd6a-H9530-V0854-Bb703-R448a (May 10 2025 - 09:39:24 +0000) [16:10:40] SoC: MV88F6828-A0 at 1600 MHz [16:10:40] DRAM: 2 GiB (800 MHz, 32-bit, ECC enabled) [16:10:40] MMC: mv_sdh: 0 [16:10:41] Loading Environment from EXT4... ** File not found /boot/boot.env ** [16:10:41] ** Unable to read "/boot/boot.env" from mmc0:1 ** [16:10:41] Model: Helios4 [16:10:41] Board: Helios4 [16:10:41] SCSI: MVEBU SATA INIT [16:10:41] Target spinup took 0 ms. [16:10:41] Target spinup took 0 ms. [16:10:41] AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode [16:10:41] flags: 64bit ncq led only pmp fbss pio slum part sxs [16:10:41] Net: [16:10:41] Warning: ethernet@70000 (eth1) using random MAC address - 42:21:01:47:98:72 [16:10:41] eth1: ethernet@70000 [16:10:41] Hit any key to stop autoboot: 0 [16:10:44] switch to partitions #0, OK [16:10:44] mmc0 is current device [16:10:44] Scanning mmc 0:1... [16:10:45] Found U-Boot script /boot/boot.scr [16:10:46] 18398 bytes read in 359 ms (49.8 KiB/s) [16:10:46] ## Executing script at 03000000 [16:10:46] Boot script loaded from mmc 0:1. [16:10:46] 241 bytes read in 371 ms (0 Bytes/s) [16:10:46] Loaded/imported environment /boot/armbianEnv.txt to/from 0x00300000. [16:10:46] armada-388-helios4.dtb: No match [16:10:48] 28834 bytes read in 704 ms (39.1 KiB/s) [16:10:48] Loaded DT /boot/dtb/armada-388-helios4.dtb to 0x02040000. [16:10:48] Loading kernel provided DT overlay(s) from /boot/dtb/overlay to 0x00300000 .. [16:10:49] ** WARNING: Could NOT find DT overlay notfound! [16:10:49] Loading user provided DT overlay(s) from /boot/overlay-user to 0x00300000 .. [16:10:50] ** WARNING: Could NOT find user DT overlay notfoud (/boot/overlay-user/notfoud.dtbo)! [16:10:53] 8856168 bytes read in 1903 ms (4.4 MiB/s) [16:10:53] Loaded compressed kernel image /boot/zImage to 2049000. [16:10:53] Using compressed kernel image filesize 0x872268 bytes to calculate initial ramdisk load address. [16:10:55] 10998232 bytes read in 2295 ms (4.6 MiB/s) [16:10:55] Loaded initial ramdisk /boot/uInitrd to 28bc000. [16:10:55] Unknown command 'kaslrseed' - try 'help' [16:10:55] Not able to prepare for KASLR. [16:10:55] Kernel commandline arguments: [16:10:55] root=UUID=a36c9a2d-e1ed-469d-b1bb-2a1bc453df43 [16:10:55] rootfstype=ext4 [16:10:55] rootwait [16:10:55] splash=verbose [16:10:55] console=ttyS0,115200 [16:10:55] console=tty1 [16:10:55] consoleblank=0 [16:10:55] loglevel=8 [16:10:55] ubootpart=cb16300f-01 [16:10:55] usb-storage.quirks= [16:10:55] rw [16:10:55] net.ifnames=0 [16:10:55] ipv6.disable=1 [16:10:55] cgroup_enable=cpuset [16:10:55] cgroup_memory=1 [16:10:55] cgroup_enable=memory [16:10:55] ## Loading init Ramdisk from Legacy Image at 028bc000 ... [16:10:55] Image Name: uInitrd [16:10:55] Created: 2025-05-29 3:04:11 UTC [16:10:55] Image Type: ARM Linux RAMDisk Image (gzip compressed) [16:10:55] Data Size: 10998168 Bytes = 10.5 MiB [16:10:55] Load Address: 00000000 [16:10:55] Entry Point: 00000000 [16:10:55] Verifying Checksum ... OK [16:10:55] ## Flattened Device Tree blob at 02040000 [16:10:55] Booting using the fdt blob at 0x2040000 [16:10:55] Loading Ramdisk to 0f582000, end 0ffff198 ... OK [16:10:55] Loading Device Tree to 0f577000, end 0f581fff ... OK [16:10:55] Starting kernel ... [16:10:57] [ 0.000000] Booting Linux on physical CPU 0x0 Note: Added a non-existent DT and non-existant user DT overlay to test the warnings. Checklist: [ ] My code follows the style guidelines of this project [x] I have performed a self-review of my own code [x] I have commented my code, particularly in hard-to-understand areas [ ] My changes generate no new warnings New warnings introduced: Environment load failed Environment import failed DT load/application failed DT (user) overlay load/application failed Initial ramdisk load failed Kernel image load failed Boot failed [x] Any dependent changes have been merged and published in downstream modules Prequisite U-Boot setexpr command already merged via https://github.com/armbian/build/pull/8260. View the full article
Recommended Posts