setenv fstype btrfs

####################
### user configuration should be added to the following line. it will be preserved during updates of this file. 
setenv customcmdline 
####################

setenv baseconfig console=ttymxc0,115200 console=tty1 coherent_pool=1M rw ahci_imx.hotplug=1 raid=noautodetect telnet root=/dev/mmcblk0p2 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 rootwait consoleblank=0 selinux=0 quiet loglevel=0 nohdparm splash partswap dmfc=3

if test ${fstype} != btrfs; then
    setenv bootargs $baseconfig $customcmdline rootfstype=ext4 rootflags=data=writeback --startup-event mountall
else
    setenv bootargs $baseconfig $customcmdline rootfstype=btrfs rootflags=subvol=root/@,autodefrag,compress=lz4,commit=5 --startup-event mountall
fi

if test ${debug} != ""; then exit 1; fi

load mmc 0:1 ${loadaddr} zImage

run autodetectfdt
load mmc 0:1 ${fdt_addr} ${fdt_file}

if load mmc 0:1 0x19000000 initramfs.gz; then
    setenv initram 0x19000000
else
    setenv initram "-"
fi

if test ${debug} != ""; then exit 1; fi

bootz ${loadaddr} ${initram} ${fdt_addr}
