# This script is used to switch between both booting methods: secure (fitImage) and no-secure based on the variable rp_sec_boot

# The 0xD2000000 address corresponds to first free place to put the fitImage
setenv initrd_addr 0xD2000000

# setting the bootargs
setenv bootargs console=${console} rw rootwait ramdisk_size=5000000 security=smack

echo Boot into recovery mode...

load mmc ${mmcdev}:3 ${loadaddr} recovery.img
load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
load mmc ${mmcdev}:3 ${initrd_addr} initramfs.img
setenv initrd_size ${filesize}

booti ${loadaddr} ${initrd_addr}:${initrd_size} ${fdt_addr}
