TS-4100 U-Boot USB boot: Difference between revisions

From embeddedTS Manuals
(Update for TS-4100, matches current scripts there)
 
(Cleaned up/tested example)
Line 1: Line 1:
The one addition is to create the tsinit.scr file in the root of the USB drive.  In order to do this, a U-Boot script must be created and then converted to the .scr format.  This process requires a set of U-Boot specific tools.  These are available on most every l=Linux distribution, the instructions below are for Debian, either run on a host PC or on the device itself.  See the package installation documentation for other respective distributions.
Additionally, a U-Boot script file, "tsinit.scr", must be created and placed in the root folder of this partition.  In order to do this, a script must be created and converted to the U-Boot .scr format.  This process requires a set of U-Boot specific tools.  These tools are available on most every Linux distribution, the instructions below are for Debian, either on a host PC or on the device itself.  See the package installation documentation for other respective distributions.


Install U-Boot tools in Debian
Install U-Boot tools in Debian
Line 6: Line 6:
</source>
</source>


Create the file tsinit.source in the root of the USB drive with the Linux filesystem:
Create the file "tsinit.source" in the root of the USB drive with the Linux filesystem:
<source lang=bash>
<source lang=bash>
# Prepare with:
# Prepare with:
Line 19: Line 19:
if load usb 0:1 ${fdtaddr} /boot/imx6ul-ts${model}-${baseboardid}.dtb;
if load usb 0:1 ${fdtaddr} /boot/imx6ul-ts${model}-${baseboardid}.dtb;
         then echo "${baseboardid} detected;"
         then echo "${baseboardid} detected;"
else
else echo "Booting default device tree";
        echo "Booting default device tree";
         load usb 0:1 ${fdtaddr} /boot/imx6ul-ts${model}.dtb;
         load usb 0:1 ${fdtaddr} /boot/imx6ul-ts${model}.dtb;
fi
fi;


if load usb 0:1 ${loadaddr} /boot/zImage;
load usb 0:1 ${loadaddr} /boot/zImage;
        setenv bootargs root=/dev/sda1 rootwait rw ${cmdline_append} bbid=0x{$baseboardid} bbrev=0x${baseboardrev};
setenv bootargs root=/dev/sda1 rootwait rw ${cmdline_append} bbid=0x${baseboardid} bbrev=0x${baseboardrev};
        run silowaitcharge;
run silowaitcharge;
        bootz ${loadaddr} - ${fdtaddr};
bootz ${loadaddr} - ${fdtaddr};
else
fi;
        echo "Failed to load kernel from USB";
fi


</source>
</source>

Revision as of 17:21, 8 July 2019

Additionally, a U-Boot script file, "tsinit.scr", must be created and placed in the root folder of this partition. In order to do this, a script must be created and converted to the U-Boot .scr format. This process requires a set of U-Boot specific tools. These tools are available on most every Linux distribution, the instructions below are for Debian, either on a host PC or on the device itself. See the package installation documentation for other respective distributions.

Install U-Boot tools in Debian

apt-get update && apt-get install u-boot-tools -y

Create the file "tsinit.source" in the root of the USB drive with the Linux filesystem:

# Prepare with:
# mkimage -A arm -T script -C none -n 'imx6ul usb' -d tsinit.source tsinit.scr

# DO NOT MANUALLY EDIT THE .scr FILE

if load usb 0:1 ${loadaddr} /boot/ts${model}-fpga.vme;
        then fpga load 0 ${loadaddr} ${filesize};
fi;

if load usb 0:1 ${fdtaddr} /boot/imx6ul-ts${model}-${baseboardid}.dtb;
        then echo "${baseboardid} detected;"
else echo "Booting default device tree";
        load usb 0:1 ${fdtaddr} /boot/imx6ul-ts${model}.dtb;
fi;

load usb 0:1 ${loadaddr} /boot/zImage;
setenv bootargs root=/dev/sda1 rootwait rw ${cmdline_append} bbid=0x${baseboardid} bbrev=0x${baseboardrev};
run silowaitcharge;
bootz ${loadaddr} - ${fdtaddr};
fi;

Then in the same directory generate the tsinit.scr file:

mkimage -A arm -T script -C none -n 'imx6ul usb' -d tsinit.source tsinit.scr