Hi there,
Some other solution that I have not been able to make "permanent" yet.
Thanks @FredK@Josua-SR and @Igor for allowing me to have some fun building U-Boot once more (have not built a U-Boot since i think 2006!), it for sure did bring back some good memories 🙂
Unfortunately the built U-Boot (with SDHCI_SDMA disabled) did not solve my issue.
Then i decided to revert back to the previous release (*-6.6.87-current-mvebu => *-6.6.43-current-mvebu) by moving the symlinks in /boot around, which at least allowed the kernel and some userspace to boot. But due to lacking kernel modules (the 6.6.43 were removed during upgrade to 6.6.87) the box itself did not really work.
After some inspection, based on the remarks from @Josua-SR about memory corruption, i decided to check if this might not be just a simple overlapping issue with the images, e.g. kernel image partially occupying where the initrd is loaded.
Kernel image
Size
Size (hex)
vmlinuz-6.6.43-current-mvebu
7170736
0x6d6ab0
vmlinuz-6.6.87-current-mvebu
8858728
0x872c68
Loading of files is done as follows:
fdt (dtb)
0x2040000
(0x840000 max size)
ramdisk (uInit)
0x2880000
kernel (vmlinuz)
0x2080000
(0x7fffff max size)
You can already spot that the kernel image will not fit into the area that U-Boot has designated for it: 0x872c68 > 0x7fffff. whereas the 6.6.43 kernel should fit fine: 0x6d6ab0 < 0x7fffff.
Some testing showed that when setting ramdisk_addr_r to a higher value - which should fit the bigger kernel image - things started to boot again:
=> setenv ramdisk_addr_r 2980000
=> boot
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
2996 bytes read in 210 ms (13.7 KiB/s)
## Executing script at 03000000
Boot script loaded from mmc
176 bytes read in 201 ms (0 Bytes/s)
28834 bytes read in 424 ms (66.4 KiB/s)
11504908 bytes read in 2562 ms (4.3 MiB/s)
8858728 bytes read in 2218 ms (3.8 MiB/s)
## Loading init Ramdisk from Legacy Image at 02980000 ...
Image Name: uInitrd
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 11504844 Bytes = 11 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02040000
Booting using the fdt blob at 0x2040000
Loading Ramdisk to 0f507000, end 0ffffccc ... OK
reserving fdt memory region: addr=2040000 size=6d000
Loading Device Tree to 0f497000, end 0f506fff ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
Next is to try and figure out how I could change ramdisk_addr_r (the initial spot where U-Boot wants to load the ramdisk into), as I prefer not to have to type this at the U-Boot prompt every single time i reboot the box.
Hope this helps someone out there with similar issue.
Update: I built a U-Boot from the Kobol repo (https://wiki.kobol.io/helios4/uboot/#u-boot-2018) with the SDHCI_SDMA option disabled, and different memory load addresses for the ramdisk, script and efi stuff, see attached. Note i had some issues with the scripts/dtb, some yylloc variable had to be defined as external due to some linker error.
in "scripts/dtc/dtc-lexer.lex.c" i had to change line 618 to:
extern YYLTYPE yylloc;
To update the memory load addresses, in "include/configs/helios4.h":
#define KERNEL_ADDR_R __stringify(0x2080000)
#define FDT_ADDR_R __stringify(0x2040000)
#define RAMDISK_ADDR_R __stringify(0x3000000)
#define SCRIPT_ADDR_R __stringify(0x4000000)
#define PXEFILE_ADDR_R __stringify(0x4100000)
Essentially moved RAMDISK_ADDR_R from 0x0288'0000 to 0x0300'0000 to allow for larger kernel image and moved SCRIPT_ADDR_R (a.o.) to make room for the ramdisk image, from 0x0300'0000 to 0x0400'0000.
Then to write the U-Boot single page loader image out to the SDcard:
sudo dd if=u-boot-spl.kwb of=/dev/mmcblk0 seek=1 bs=512
Groetjes,
PS Warranty until the door for the attached U-Boot....
u-boot-spl.kwb