diff options
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic')
-rw-r--r-- | meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic new file mode 100644 index 00000000..0249a8a0 --- /dev/null +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.generic | |||
@@ -0,0 +1,70 @@ | |||
1 | # This is a boot script for U-Boot | ||
2 | # Generate boot.scr: | ||
3 | # mkimage -c none -A arm -T script -d boot.cmd.default boot.scr | ||
4 | # | ||
5 | ################ | ||
6 | fitimage_name=@@FIT_IMAGE@@ | ||
7 | kernel_name=@@KERNEL_IMAGE@@ | ||
8 | ramdisk_name=@@RAMDISK_IMAGE1@@ | ||
9 | rootfs_name=@@RAMDISK_IMAGE@@ | ||
10 | @@PRE_BOOTENV@@ | ||
11 | |||
12 | for boot_target in ${boot_targets}; | ||
13 | do | ||
14 | echo "Trying to load boot images from ${boot_target}" | ||
15 | if test "${boot_target}" = "jtag" ; then | ||
16 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
17 | fi | ||
18 | if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" ; then | ||
19 | if test -e ${devtype} ${devnum}:${distro_bootpart} /@@UENV_TEXTFILE@@; then | ||
20 | fatload ${devtype} ${devnum}:${distro_bootpart} @@UENV_MMC_LOAD_ADDRESS@@ @@UENV_TEXTFILE@@; | ||
21 | echo "Importing environment(@@UENV_TEXTFILE@@) from ${boot_target}..." | ||
22 | env import -t @@UENV_MMC_LOAD_ADDRESS@@ $filesize | ||
23 | if test -n $uenvcmd; then | ||
24 | echo "Running uenvcmd ..."; | ||
25 | run uenvcmd; | ||
26 | fi | ||
27 | fi | ||
28 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${fitimage_name}; then | ||
29 | fatload ${devtype} ${devnum}:${distro_bootpart} @@FIT_IMAGE_LOAD_ADDRESS@@ ${fitimage_name}; | ||
30 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
31 | fi | ||
32 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${kernel_name}; then | ||
33 | fatload ${devtype} ${devnum}:${distro_bootpart} @@KERNEL_LOAD_ADDRESS@@ ${kernel_name}; | ||
34 | fi | ||
35 | if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then | ||
36 | fatload ${devtype} ${devnum}:${distro_bootpart} @@DEVICETREE_ADDRESS@@ system.dtb; | ||
37 | fi | ||
38 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${ramdisk_name} && test "${skip_tinyramdisk}" != "yes"; then | ||
39 | fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${ramdisk_name}; | ||
40 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
41 | fi | ||
42 | if test -e ${devtype} ${devnum}:${distro_bootpart} /${rootfs_name} && test "${skip_ramdisk}" != "yes"; then | ||
43 | fatload ${devtype} ${devnum}:${distro_bootpart} @@RAMDISK_IMAGE_ADDRESS@@ ${rootfs_name}; | ||
44 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@ | ||
45 | fi | ||
46 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ - @@DEVICETREE_ADDRESS@@ | ||
47 | fi | ||
48 | if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then | ||
49 | sf probe 0 0 0; | ||
50 | sf read @@FIT_IMAGE_LOAD_ADDRESS@@ @@QSPI_FIT_IMAGE_OFFSET@@ @@QSPI_FIT_IMAGE_SIZE@@ | ||
51 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
52 | echo "Booting using Fit image failed" | ||
53 | |||
54 | sf read @@KERNEL_LOAD_ADDRESS@@ @@QSPI_KERNEL_OFFSET@@ @@QSPI_KERNEL_SIZE@@ | ||
55 | sf read @@RAMDISK_IMAGE_ADDRESS@@ @@QSPI_RAMDISK_OFFSET@@ @@QSPI_RAMDISK_SIZE@@ | ||
56 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; | ||
57 | echo "Booting using Separate images failed" | ||
58 | fi | ||
59 | if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then | ||
60 | nand info; | ||
61 | nand read @@FIT_IMAGE_LOAD_ADDRESS@@ @@NAND_FIT_IMAGE_OFFSET@@ @@NAND_FIT_IMAGE_SIZE@@ | ||
62 | bootm @@FIT_IMAGE_LOAD_ADDRESS@@; | ||
63 | echo "Booting using Fit image failed" | ||
64 | |||
65 | nand read @@KERNEL_LOAD_ADDRESS@@ @@NAND_KERNEL_OFFSET@@ @@NAND_KERNEL_SIZE@@ | ||
66 | nand read @@RAMDISK_IMAGE_ADDRESS@@ @@NAND_RAMDISK_OFFSET@@ @@NAND_RAMDISK_SIZE@@ | ||
67 | @@KERNEL_BOOTCMD@@ @@KERNEL_LOAD_ADDRESS@@ @@RAMDISK_IMAGE_ADDRESS@@ @@DEVICETREE_ADDRESS@@; | ||
68 | echo "Booting using Separate images failed" | ||
69 | fi | ||
70 | done | ||