AI64 - tftpboot kernel

Hi Guys,

So I am at the stage where I can get the Image loaded into kernel_addr and the DTB loaded into fdt_addr.

Does anyone know how to boot this up know, I’m banging my head against the wall!

at the very least you need something like

bootz 0x80800000 - 0x83000000;

This is taken form an imx6ul boot I have. the first address is the kernel address, the last address that of the devicetree. These will of course be different. Can’t for the life of me remember why the ‘-’ inbetween

Hi Benedict,

Thanks for the info.

I did try using {kernel_addr} - {ftd_addr} but I think I tried bootm rather than bootz, I will give bootz a go today…

if it is a zImage then pretty sure you need to use bootz.

Right had a look there is no bootz, I was using booti but I was using mistyped variable names and it doesn’t seem to worry about that!

tftp $kernel_addr_r Image
tftp $fdtaddr k3-j721e-beagleboneai64.dtb
booti $kernel_addr_r  - $fdtaddr

It is now booting the kernel and then falling over :slight_smile:

There are a load of scripts that seem to run out of the env vars, I’m guessing I need to shoehorn something into them somehow.

Thanks for the help, got me one step further :slight_smile:

args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
args_ufs=setenv devtype scsi;setenv bootpart 1:1;run ufs_finduuid;setenv bootargs console = ${console} ${optargs}root=PARTUUID=${uuid} rw rootfstype=${scsirootfstype};setenv devtype scsi;setenv bootpart 1:1
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
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_rprocs=if test ${dorprocboot} -eq 1 && test ${boot} = mmc; then rproc init;run boot_rprocs_mmc;fi;
boot_rprocs_mmc=env set rproc_id;env set rproc_fw;for i in ${rproc_fw_binaries} ; do if test -z "${rproc_id}" ; then env set rproc_id $i;else env set rproc_fw $i;run rproc_load_and_boot_one;env set rproc_id;env set rproc_fw;fi;done
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc1 mmc0 pxe dhcp 
bootcmd=run findfdt; run distro_bootcmd; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern
bootcmd_dhcp=setenv devtype dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1;rootfs part 0 1 mmcpart 0;tiboot3.bin.raw raw 0x0 0x400 mmcpart 1;tispl.bin.raw raw 0x400 0x1000 mmcpart 1;u-boot.img.raw raw 0x1400 0x2000 mmcpart 1;u-env.raw raw 0x3400 0x100 mmcpart 1;sysfw.itb.raw raw 0x3600 0x800 mmcpart 1
dfu_alt_info_mmc=boot part 1 1;rootfs part 1 2;tiboot3.bin fat 1 1;tispl.bin fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1;sysfw.itb fat 1 1
dfu_alt_info_ospi=tiboot3.bin raw 0x0 0x080000;tispl.bin raw 0x080000 0x200000;u-boot.img raw 0x280000 0x400000;u-boot-env raw 0x680000 0x020000;sysfw.itb raw 0x6c0000 0x100000;rootfs raw 0x800000 0x3800000
dfu_alt_info_ram=tispl.bin ram 0x80080000 0x200000;u-boot.img ram 0x81000000 0x400000
distro_bootcmd=scsi_need_init=; for target in ${boot_targets}; do run bootcmd_${target}; done
eeprom_bbai_erase=i2c dev 0; i2c md 0x51 0x00.1 40; i2c mw 0x51 0x00.1 ff; i2c mw 0x51 0x01.1 ff; i2c mw 0x51 0x02.1 ff; i2c mw 0x51 0x03.1 ff; i2c mw 0x51 0x04.1 ff; i2c mw 0x51 0x05.1 ff; i2c mw 0x51 0x06.1 ff; i2c mw 0x51 0x07.1 ff; i2c mw 0x51 0x08.1 ff; i2c mw 0x51 0x09.1 ff; i2c mw 0x51 0x0a.1 ff; i2c mw 0x51 0x0b.1 ff; i2c mw 0x51 0x0c.1 ff; i2c mw 0x51 0x0d.1 ff; i2c mw 0x51 0x0e.1 ff; i2c mw 0x51 0x0f.1 ff; i2c mw 0x51 0x10.1 ff; i2c mw 0x51 0x11.1 ff; i2c mw 0x51 0x12.1 ff; i2c mw 0x51 0x13.1 ff; i2c mw 0x51 0x14.1 ff; i2c mw 0x51 0x15.1 ff; i2c mw 0x51 0x16.1 ff; i2c mw 0x51 0x17.1 ff; i2c mw 0x51 0x18.1 ff; i2c mw 0x51 0x19.1 ff; i2c mw 0x51 0x1a.1 ff; i2c mw 0x51 0x1b.1 ff; i2c mw 0x51 0x1c.1 ff; i2c mw 0x51 0x1d.1 ff; i2c mw 0x51 0x1e.1 ff; i2c mw 0x51 0x1f.1 ff; i2c mw 0x51 0x20.1 ff; i2c mw 0x51 0x21.1 ff; i2c mw 0x51 0x22.1 ff; i2c mw 0x51 0x23.1 ff; i2c mw 0x51 0x24.1 ff; i2c mw 0x51 0x25.1 ff; i2c mw 0x51 0x26.1 ff; i2c mw 0x51 0x27.1 ff; i2c mw 0x51 0x28.1 ff; i2c mw 0x51 0x29.1 ff; i2c mw 0x51 0x2a.1 ff; i2c mw 0x51 0x2b.1 ff; i2c mw 0x51 0x2c.1 ff; i2c mw 0x51 0x2d.1 ff; i2c mw 0x51 0x2e.1 ff; i2c mw 0x51 0x2f.1 ff; i2c mw 0x51 0x30.1 ff; i2c mw 0x51 0x31.1 ff; i2c mw 0x51 0x32.1 ff; i2c mw 0x51 0x33.1 ff; i2c mw 0x51 0x34.1 ff; i2c mw 0x51 0x35.1 ff; i2c mw 0x51 0x36.1 ff; i2c mw 0x51 0x37.1 ff; i2c mw 0x51 0x38.1 ff; i2c mw 0x51 0x39.1 ff; i2c mw 0x51 0x3a.1 ff; i2c mw 0x51 0x3b.1 ff; i2c mw 0x51 0x3c.1 ff; i2c mw 0x51 0x3d.1 ff; i2c mw 0x51 0x3e.1 ff; i2c mw 0x51 0x3f.1 ff; i2c md 0x51 0x00.1 40; 
eeprom_dump=i2c dev 0; i2c md 0x51 0x00.1 40; 
eeprom_production_bbai=i2c dev 0; i2c md 0x51 0x00.1 40; i2c mw 0x51 0x00.1 aa; i2c mw 0x51 0x01.1 55; i2c mw 0x51 0x02.1 33; i2c mw 0x51 0x03.1 ee; i2c mw 0x51 0x04.1 01; i2c mw 0x51 0x05.1 37; i2c mw 0x51 0x06.1 00; i2c mw 0x51 0x07.1 10; i2c mw 0x51 0x08.1 2e; i2c mw 0x51 0x09.1 00; i2c mw 0x51 0x0a.1 42; i2c mw 0x51 0x0b.1 42; i2c mw 0x51 0x0c.1 4f; i2c mw 0x51 0x0d.1 4e; i2c mw 0x51 0x0e.1 45; i2c mw 0x51 0x0f.1 41; i2c mw 0x51 0x10.1 49; i2c mw 0x51 0x11.1 2d; i2c mw 0x51 0x12.1 36; i2c mw 0x51 0x13.1 34; i2c mw 0x51 0x14.1 2d; i2c mw 0x51 0x15.1 42; i2c mw 0x51 0x16.1 30; i2c mw 0x51 0x17.1 2d; i2c mw 0x51 0x18.1 00; i2c mw 0x51 0x19.1 00; i2c mw 0x51 0x1a.1 42; i2c mw 0x51 0x1b.1 30; i2c mw 0x51 0x1c.1 30; i2c mw 0x51 0x1d.1 30; i2c mw 0x51 0x1e.1 37; i2c mw 0x51 0x1f.1 38; i2c mw 0x51 0x20.1 30; i2c mw 0x51 0x21.1 31; i2c mw 0x51 0x22.1 42; i2c mw 0x51 0x23.1 30; i2c mw 0x51 0x24.1 30; i2c mw 0x51 0x25.1 30; i2c mw 0x51 0x26.1 30; i2c mw 0x51 0x27.1 31; i2c mw 0x51 0x28.1 36; i2c mw 0x51 0x29.1 34; i2c mw 0x51 0x2a.1 57; i2c mw 0x51 0x2b.1 57; i2c mw 0x51 0x2c.1 32; i2c mw 0x51 0x2d.1 32; i2c mw 0x51 0x2e.1 42; i2c mw 0x51 0x2f.1 42; i2c mw 0x51 0x30.1 42; i2c mw 0x51 0x31.1 42; i2c mw 0x51 0x32.1 42; i2c mw 0x51 0x33.1 42; i2c mw 0x51 0x34.1 53; i2c mw 0x51 0x35.1 53; i2c mw 0x51 0x36.1 53; i2c mw 0x51 0x37.1 53; i2c mw 0x51 0x38.1 11; i2c mw 0x51 0x39.1 02; i2c mw 0x51 0x3a.1 00; i2c mw 0x51 0x3b.1 60; i2c mw 0x51 0x3c.1 7d; i2c mw 0x51 0x3d.1 fe; i2c mw 0x51 0x3e.1 ff; i2c mw 0x51 0x3f.1 ff; i2c md 0x51 0x00.1 40; 
efi_dtb_prefixes=/ /dtb/ /dtb/current/
emmc_erase_boot0=mmc dev 0 1; mmc erase 0 0x2400; 
envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
findfdt=echo board_name=[$board_name] ...;setenv name_fdt ${default_device_tree};if test $board_name = J721EX-PM1-SOM; then setenv name_fdt k3-j721e-proc-board-tps65917.dtb; elif test $board_name = J721EX-PM2-SOM; then setenv name_fdt k3-j721e-common-proc-board.dtb; elif test $board_name = BBONEAI-64-B0-; then setenv name_fdt k3-j721e-beagleboneai64.dtb; elif test $board_name = j721e; then setenv name_fdt k3-j721e-common-proc-board.dtb; elif test $board_name = j721e-eaik || test $board_name = j721e-sk; then setenv name_fdt k3-j721e-sk.dtb; else setenv name_fdt k3-j721e-beagleboneai64.dtb; fi; echo name_fdt=[${name_fdt}] ...;setenv fdtfile ${name_fdt}
finduuid=part uuid ${boot} ${bootpart} uuid
get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}
get_fdt_ufs=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
get_fit_mmc=load mmc ${bootpart} ${addr_fit} ${bootdir}/${name_fit}
get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
get_kern_ufs=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
get_overlay_mmc=fdt address ${fdtaddr};fdt resize 0x100000;for overlay in $name_overlays;do;load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && fdt apply ${dtboaddr};done;
get_overlay_ufs=fdt address ${fdtaddr};fdt resize 0x100000;for overlay in $name_overlays;do;load scsi ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && fdt apply ${dtboaddr};done;
get_overlaystring=for overlay in $name_overlays;do;setenv overlaystring ${overlaystring}'#'${overlay};done;
importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
init_mmc=run args_all args_mmc
init_ufs=ufs init; scsi scan; run args_ufs
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmcboot=mmc dev ${mmcdev}; devnum=${mmcdev}; devtype=mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then run args_mmc; if test ${boot_fit} -eq 1; then run run_fit; else run mmcloados;fi;fi;fi;
mmcloados=if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcrootfstype=ext4 rootwait
rproc_fw_binaries=2 /lib/firmware/j7-main-r5f0_0-fw 3 /lib/firmware/j7-main-r5f0_1-fw 4 /lib/firmware/j7-main-r5f1_0-fw 5 /lib/firmware/j7-main-r5f1_1-fw 6 /lib/firmware/j7-c66_0-fw 7 /lib/firmware/j7-c66_1-fw 8 /lib/firmware/j7-c71_0-fw 
rproc_load_and_boot_one=if load mmc ${bootpart} $loadaddr ${rproc_fw}; then if rproc load ${rproc_id} ${loadaddr} ${filesize}; then rproc start ${rproc_id};fi;fi
run_fit=bootm ${addr_fit}#${fdtfile}${overlaystring}
run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
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;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
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
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
scsirootfstype=ext4 rootwait
ufs_finduuid=part uuid scsi ${bootpart} uuid
update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit}
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi

And this is where it goes wrong:

[    5.918893] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    5.926367] Please append a correct "root=" boot option; here are the available partitions:

sounds like you are not setting up bootargs before booting the kernel.
The kernel should print its command line args very early. Can you see if anything is set ?

Thanks for the help.

You were absolutely correct, here was no boot args stuff, after a bit of fiddling it is booting:

tftp $kernel_addr_r Image
tftp $fdtaddr k3-j721e-beagleboneai64.dtb

run init_mmc

booti $kernel_addr_r  - $fdtaddr