if test "${devtype}" = "mmc"; then
  if test ${devnum} -eq 1; then
    setenv root /dev/mmcblk0p1;
  else
    if mmc dev 1; then
      setenv root /dev/mmcblk1p1;
      mmc dev 0;
    else
      setenv root /dev/mmcblk0p1;
    fi;
  fi;
else
  setenv root /dev/sda1;
fi

setenv bootargs "root=${root} rw rootwait console=tty1 console=ttyS0,115200n8 mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M video=tegrafb"

load ${devtype} ${devnum}:${bootpart} ${loadaddr} /boot/vmlinuz-linux-libre
load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/linux-libre/tegra20-trimslice.dtb

bootz ${loadaddr} - ${fdt_addr_r}
