by karog » Sun Aug 22, 2021 7:11 pm
I am finally up and running on 5.11.4-1.
First, console does change to ttyAML0 so when I still had it as ttyS0 I was not seeing serial output after kernel loaded.
I noticed that with load addresses
$this->bbcode_second_pass_code('', 'setenv dtb_loadaddr "0x1000000"
setenv loadaddr "0x1B00000"
setenv initrd_loadaddr "0x3700000"
')
that 0x3700000 - 0x1B00000 (where /Image is loaded) = 0x1C00000 = 29360128. For 4.9, /Image size is 26548736 which fits but for me, after upgrading to 5.11.4, /Image size is 34003456 which is too big.
I tried setting initrd_loadaddr to 0x4000000 to have enough space but still no go.
So I tried new load addresses found in threads developing mainline for n2 as
$this->bbcode_second_pass_code('', 'setenv dtb_loadaddr "0x20000000"
setenv loadaddr "0x1080000"
setenv initrd_loadaddr "0x4080000"
')
Note that earlier on those threads used setenv initrd_loadaddr "0x3080000" which is not big enough for the current /Image size.
Also those threads commented out "fdt addr ${dtb_loadaddr}" but I seem to need that still.
This let the kernel load and continue despite there still being concerning error messages (FDT_ERR_NOTFOUND 3 times), "Loading init Ramdisk from Legacy Image at 03080000", and "load dtb from 0x1000000" even with the different load addresses defined.
$this->bbcode_second_pass_code('', 'reading /Image
34003456 bytes read in 1973 ms (16.4 MiB/s)
reading /dtbs/amlogic/meson-g12b-odroid-n2.dtb
76018 bytes read in 13 ms (5.6 MiB/s)
reading /initramfs-linux.uimg
7264554 bytes read in 424 ms (16.3 MiB/s)
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
[rsvmem] fdt get prop fail.
## Loading init Ramdisk from Legacy Image at 03080000 ...
Image Name: Ramdisk Image
Image Type: AArch64 Linux RAMDisk Image (uncompressed)
Data Size: 7264490 Bytes = 6.9 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
load dtb from 0x1000000 ......
## Flattened Device Tree blob at 20000000
Booting using the fdt blob at 0x20000000
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
[rsvmem] fdt get prop fail.
Loading Ramdisk to 3d112000, end 3d7ff8ea ... OK
Loading Device Tree to 000000001ffea000, end 000000001ffff8f1 ... OK
Starting kernel ...
uboot time: 9226792 us
')
Now I should mention that I have /boot on an SD card but /root on a USB (SSD) drive.
As the boot proceeded I began to see error messages about some process with /dev/mmcblk1p1. For 4.9, that is the first partition on the SD card and I have it mounted to /boot in my /etc/fstab.
But in 5.11.4, /dev/mmcblk1p1 does not exist. In fact, the SD card is now /dev/mmcblk0 so changing fstab to /dev/mmcblk0p1 fixed my last problem and all appears well.
To sum up,
In /boot/boot.ini, I made following changes
$this->bbcode_second_pass_code('', 'setenv condev "console=ttyAML0,115200n8" # on both
# Set load addresses
setenv dtb_loadaddr "0x20000000"
setenv loadaddr "0x1080000"
setenv initrd_loadaddr "0x4080000"
')
and I changed my /etc/fstab to mount /dev/mmcblk0p1 as /boot.