bblfile=bbl.bin
vmlfile=vmlinux.bin
irdfile=initramfs.cpio.gz
#fdtfile=hifive-unleashed-a00-fu540.dtb
#fdtfile=ux00_fsbl.dtb
fdtfile=hifive_u540.dtb
bbladdr=80000000
fdtaddr=81f00000
vmladdr=80200000
irdaddr=82000000
loadbbl=dhcp ${bbladdr} ${bblfile}; setenv bblsize ${filesize}
loadvml=dhcp ${vmladdr} ${vmlfile}; setenv vmlsize ${filesize}
loadird=dhcp ${irdaddr} ${irdfile}; setenv irdsize ${filesize}
loadfdt=dhcp ${fdtaddr} ${fdtfile}; setenv fdtsize ${filesize}
newfdt=f0000000
bootargs=console=ttySIF0,921600 debug
setup1=fdt addr ${fdtaddr}; fdt resize; fdt set /chosen linux,initrd-start <0x0 0x${irdaddr}>; fdt set /chosen riscv,kernel-start <0x0 0x${vmladdr}>; fdt move ${fdtaddr} ${newfdt}
setup2=setexpr vmlend ${vmladdr} + ${vmlsize}; setexpr irdend ${irdaddr} + ${irdsize}
setup3=fdt set /chosen linux,initrd-end <0x0 0x${irdend}>; fdt set /chosen riscv,kernel-end <0x0 0x${vmlend}>
#setup4=fdt set /chosen bootargs ${bootargs}; fdt print /chosen
setup4=fdt print /chosen
boot2=run loadbbl; run loadvml; run loadird; run loadfdt; run setup1; run setup2; run setup3; run setup4; go 80000000
#boot2=run loadbbl; run loadfdt; run setup1; run setup3; run setup4; go 80000000

