bootmode=fota
else
ramdiskpart=7
-bootmode=normal
+bootmode=ramdisk
fi
-# Device for booting from ram0
-bootramdev=ram0
+# boot from ram0 if there is sbin
+if test -e $bootdev $mmcrootdev:$ramdiskpart sbin; then;
+rootdev=ram0
+else
+rootdev=mmcblk${mmcrootdev}p${mmcrootpart}
+bootmode=normal
+fi
# Kernel image
kernel=Image
setenv boot_prefixes \"/\"
# To use comdline for using serial console. /* Normal mode */
-setenv bootargs \"8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 bcm2709.uart_clock=48000000 root=/dev/${bootramdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait earlyprintk console=ttyS0,115200n8 console=tty1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000\"
+setenv bootargs \"8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 bcm2709.uart_clock=48000000 root=/dev/${rootdev} rw bootmode=${bootmode} bcm2709.boardrev=0xa02082 rootwait earlyprintk console=ttyS0,115200n8 console=tty1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000\"
# Find the ramdisk offset and block count
part start $bootdev $ramdiskdev $ramdiskpart ramdisk_start
echo ${bootmode} "boot";
load $bootdev $mmcbootdev:$mmcbootpart $fdt_addr_r $fdtfile;
load $bootdev $mmcbootdev:$mmcbootpart $kernel_addr_r $prefix$kernel;
- echo "Loading Ramdisk from partition"${ramdiskpart};
- mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
+ if test -e mmc $mmcrootdev:$ramdiskpart sbin; then;
+ echo "Loading Ramdisk from partition"${ramdiskpart};
+ mmc read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
+ fi
booti $kernel_addr_r $ramdisk_addr_r:$ramdisksize $fdt_addr_r;
fi
done