Closed cattyhouse closed 2 years ago
hexedit u-boot.ext
bootcmd_mmc0=devnum=0; run mmc_boot
to
bootcmd_usb1=devnum=1; run usb_boot
and change boot_targets
to boot_targets=usb0 usb1 romusb mmc0 mmc1 mmc2 pxe
no bits added or removed, this is acceptable by binary edit. since i don't need mmc0 which is sd card, this is doable.
s905_autoscript
if fatload usb 0 0x1000000 u-boot.ext; then go 0x1000000; fi;
if fatload usb 1 0x1000000 u-boot.ext; then go 0x1000000; fi;
@cattyhouse - thanks a lot for sharing what you found out - for what setup is this: u-boot on sd card or u-boot on emmc? maybe i should add some notes about this to the readme ...
@cattyhouse - thanks a lot for sharing what you found out - for what setup is this: u-boot on sd card or u-boot on emmc? maybe i should add some notes about this to the readme ...
on my box, there is no SD card reader. it is just 2 USB 2.0 ports and an internal 8GB emmc.
it depends on the printenv output, on my box, the embedded u-boot 2015 looks for s905_autoscript for USB, emmc_autoscript for emmc, and mmc_autoscript for SD (which always fail because my box does not have a SD Card), sudo fw_printenv | grep start_autoscript
bootcmd=run start_autoscript; run storeboot
start_autoscript=if mmcinfo; then run start_mmc_autoscript; fi; if usb start; then run start_usb_autoscript; fi; run start_emmc_autoscript
so i made /boot/s905_autoscript
look like this :
if fatload usb 0 0x1000000 u-boot.ext; then go 0x1000000; fi;
if fatload usb 1 0x1000000 u-boot.ext; then go 0x1000000; fi;
and /boot/emmc_autoscript
like this :
if fatload mmc 1 0x1000000 u-boot.emmc; then go 0x1000000; fi;
and i made u-boot.ext
like this strings /boot/u-boot.ext | grep -E 'boot_targets|bootcmd_usb'
:
boot_targets=usb0 usb1 romusb mmc0 mmc1 mmc2 pxe
bootcmd_usb1=devnum=1; run usb_boot
bootcmd_usb0=devnum=0; run usb_boot
the u-boot.ext
and u-boot.emmc
are identical binary with a different file name. i keep u-boot.emmc
untouched, but hexedit that u-boot.ext
to what mentioned above.
so, now the boot is like this
embedded u-boot 2015 -> look for USB first -> look for s905_autoscript on USB -> load u-boot.ext on USB0 -> if fail, load u-boot.ext on USB1 -> u-boot.ext try boot_targets=usb0 usb1 romusb mmc0 mmc1 mmc2 pxe
in order...
if embedded u-boot 2015 failed to boot from USB, it looks for emmc
, then looks for emmc_autoscript
, then load u-boot.emmc
...
strings ~/Downloads/gxl-u-boot.bin | grep boot_targets
sometimes we need to boot from usb (ssd type usb for faster IO), right now i used a hex editor to change it to
which worked as expected.
but when there are 2 usb attached at the same time, the chance that our bootable usb got boot is 50% ... is it possible to define the boot_targets like this:
s905d here.