bootargs=earlycon panic=-1
bootcmd=run distro_bootcmd
bootdelay=5
baudrate=115200
bootfile=kernel.itb
loadaddr=0x2000000
arch=arm
cpu=armv8
board=stratix10-socdk
board_name=stratix10-socdk
vendor=altera
soc=socfpga
kernel_addr_r=0x2000000
fdt_addr_r=0x6000000
qspiscriptaddr=0x02110000
scriptsize=0x00010000
qspibootimageaddr=0x02120000
bootimagesize=0x03200000
loadaddr=0x2000000
bootfile=kernel.itb
mmcroot=/dev/mmcblk0p2
mtdids=nand0=ffb90000.nand.0
mtdparts=mtdparts=ffb90000.nand.0:2m(u-boot),-(root)
linux_qspi_enable=if sf probe; then echo Enabling QSPI at Linux DTB...;fdt addr ${fdt_addr}; fdt resize;fdt set /soc/spi@ff8d2000 status okay;if fdt set /soc/clocks/qspi-clk clock-frequency ${qspi_clock}; then else fdt set /soc/clkmgr/clocks/qspi_clk clock-frequency ${qspi_clock}; fi; fi
scriptaddr=0x05FF0000
scriptfile=boot.scr
nandroot=ubi0:rootfs
socfpga_legacy_reset_compat=1
rsu_status=rsu dtb; rsu display_dcmf_version; rsu display_dcmf_status; rsu display_max_retry
smc_fid_rd=0xC2000007
smc_fid_wr=0xC2000008
smc_fid_upd=0xC2000009
 mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
boot_net_usb_start=usb start
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
ubifs_boot=env exists bootubipart || env set bootubipart UBI; env exists bootubivol || env set bootubivol boot; if ubi part ${bootubipart} && ubifsmount ubi${devnum}:${bootubivol}; then devtype=ubi; run scan_dev_for_boot; fi
boot_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
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
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
efi_dtb_prefixes=/ /dtb/ /dtb/current/
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
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_script_dhcp=boot.scr.uimg
boot_targets=mmc0 qspi nand 
boot_syslinux_conf=extlinux/extlinux.conf
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
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
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
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
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
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_qspi=sf probe && sf read ${scriptaddr} ${qspiscriptaddr} ${scriptsize} && echo QSPI: Trying to boot script at ${scriptaddr} && source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;
bootcmd_nand=ubi part root && ubi readvol ${scriptaddr} script && echo NAND: Trying to boot script at ${scriptaddr} && source ${scriptaddr}; echo NAND: SCRIPT FAILED: continuing...;
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done