Open cyber-murmel opened 2 years ago
Since it wants to run boot_extlinux
, scriptaddr
needs to be set, but isn't.
=> echo $scriptaddr
Setting it to 0x6e00000
seems to work. After that, run bootcmd_mmc0
executes successfully.
=> env set scriptaddr 0x6e00000
=> saveenv
=> run bootcmd_mmc0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:2...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
784 bytes read in 17 ms (44.9 KiB/s)
1: NixOS - Default
Retrieving file: /boot/extlinux/../nixos/7b9dvfi210rjyj0azf5z54ga01a4d2cr-initrd-linux-aarch64-unknown-linux-gnu-5.15.11-initrd
8234165 bytes read in 367 ms (21.4 MiB/s)
Retrieving file: /boot/extlinux/../nixos/ix3mr0qb7vsaks6sfrr7f84jwcfr0zrw-linux-aarch64-unknown-linux-gnu-5.15.11-Image
45810176 bytes read in 1988 ms (22 MiB/s)
append: init=/nix/store/qlna95k7ba7vwgwcb0793f0whri5y9m7-nixos-system-nixos-21.05pre-git/init console=ttyS0,115200n8 console=ttyAMA0,115200n8 console=tty0 console=ttyMV0,115200n8 loglevel=7
Retrieving file: /boot/extlinux/../nixos/ix3mr0qb7vsaks6sfrr7f84jwcfr0zrw-linux-aarch64-unknown-linux-gnu-5.15.11-dtbs/marvell/armada-3720-espressobin.dtb
11618 bytes read in 36 ms (314.5 KiB/s)
## Flattened Device Tree blob at 06f00000
Booting using the fdt blob at 0x6f00000
Loading Ramdisk to 7f32f000, end 7fb094b5 ... OK
Loading Device Tree to 000000007f329000, end 000000007f32ed61 ... OK
Starting kernel ...
Interesting. I've done a diff between the environment I get after env default -a
and yours.
Mine has scriptaddr
set, so I'm not sure what's going on there. I do have a v7 board so maybe there is a difference in what the default environment is set to between boards. I'm not sure exactly where the default environment stuff is in U-Boot, but it should be possible to track down what gets set by seeing what the board's defconfig defines, then seeing how that affects what gets put in the default environment.
Interesting to me that you also have the eth*addr
variables set - I would have to set them manually after env default -a
and I'm not sure they get passed to Linux by default anyway (the stock bootloader did I believe). But that's not really related to this.
@@ -1,5 +1,3 @@
-board=mvebu_armada-37xx
-board_name=mvebu_armada-37xx
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
@@ -18,19 +16,24 @@
bootcmd_pxe=run boot_net_usb_start; run boot_pci_enum; dhcp; if pxe get; then pxe boot; fi
bootcmd_scsi0=devnum=0; run scsi_boot
bootcmd_usb0=devnum=0; run usb_boot
+bootfstype=ext4
distro_bootcmd=scsi_need_init=; setenv nvme_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
+eth1addr=00:51:82:11:22:01
+eth2addr=00:51:82:11:22:02
+eth3addr=00:51:82:11:22:03
+ethact=neta@30000
+ethaddr=00:51:82:11:22:00
fdt_addr=0x6f00000
fdt_addr_r=0x6f00000
-fdtcontroladdr=3fb0d330
-fdtfile=marvell/armada-3720-espressobin-v7.dtb
+fdtcontroladdr=7fb0d330
+fdtfile=marvell/armada-3720-espressobin.dtb
kernel_addr=0x7000000
kernel_addr_r=0x7000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
nvme_boot=run boot_pci_enum; run nvme_init; if nvme dev ${devnum}; then devtype=nvme; run scan_dev_for_boot_part; fi
nvme_init=if ${nvme_need_init}; then setenv nvme_need_init false; nvme scan; fi
-pu=armv8
pxefile_addr_r=0x6e00000
ramdisk_addr_r=0xa000000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
@@ -38,12 +41,9 @@
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
-scriptaddr=0x6d00000
scsi_boot=run scsi_init; if scsi dev ${devnum}; then devtype=scsi; run scan_dev_for_boot_part; fi
scsi_init=if ${scsi_need_init}; then scsi_need_init=false; scsi scan; fi
-soc=mvebu
stderr=serial@12000
stdin=serial@12000
stdout=serial@12000
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
-vendor=Marvell
Hello, I've seen a similar issue, and have been discussing it at https://forum.armbian.com/topic/19564-making-espressobin-v7-work-in-2022/page/6/ . The latest is that it seems like an array of variables is getting parsed wrong by u-boot in board_late_init. I will be submitting a u-boot patch.
I'd also like to mention that the console is passed to linux as part of the fdt, in the "chosen" node, so it shouldn't be necessary to put an explicity "console=/dev/ttyMV0" on the cmdline.
Thanks for your example of an espressobin nix configuration.
I got an ESPRESSObin v5 with 2GB RAM and tried to reproduce this project.
Steps to Reproduce
Build u-boot
Build SD Image
NIXPKGS_ALLOW_BROKEN=1
seems necessary due to zfssd-image.nix
ContentFull Boot Log
u-boot Environment Variables
/boot/extlinux/extlinux.conf
Content