Load custom script in u-boot

Hi Vincent

The DDR RAM starts at 0x10000000. U-Boot gets relocated to the end of the DDR RAM, so keep out of that address range.

If your script is to load kernel and device tree you should not use the RAM addresses used for this two components. The kernel is to be loaded at $kernel_addr_r 0x10800000, the device tree gets loaded at $fdt_addr_r 0x12000000.

uImage and device tree are files in the first partition on the eMMC. So storing your stuff also as a file on mmc 0:1 with your unique filename will prevent clashes on the eMMC.

Note that run setupdate loads and executes a script. That script sets additional environment variables, among others update_fdt.
Have a look at update_fdt which loads a file into RAM and stores that file on eMMC.