Commit 4d7d2e570a47df28b308bbdbf7c9f265cdcf17ca

Authored by Stephen Warren
Committed by Tom Warren
1 parent 68cf64db1d

ARM: tegra: rework boot scripts

Update the common Tegra boot scripts in the default environment to

a) Make use of the new "test -e" shell command to avoid some error
   messages.

b) Allow booting using the sysboot command and extlinux.conf. This
   allows easy creation of boot menus, and provides a simple interface
   for distros to parameterize/configure the boot process.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>

Showing 1 changed file with 30 additions and 9 deletions Side-by-side Diff

include/configs/tegra-common-post.h
... ... @@ -69,20 +69,41 @@
69 69 #define BOOTCMDS_COMMON \
70 70 "rootpart=1\0" \
71 71 \
  72 + "do_script_boot=" \
  73 + "load ${devtype} ${devnum}:${rootpart} " \
  74 + "${scriptaddr} ${prefix}${script}; " \
  75 + "source ${scriptaddr}\0" \
  76 + \
72 77 "script_boot=" \
73   - "if load ${devtype} ${devnum}:${rootpart} " \
74   - "${scriptaddr} ${prefix}${script}; then " \
75   - "echo ${script} found! Executing ...;" \
76   - "source ${scriptaddr};" \
77   - "fi;\0" \
  78 + "for script in ${boot_scripts}; do " \
  79 + "if test -e ${devtype} ${devnum}:${rootpart} " \
  80 + "${prefix}${script}; then " \
  81 + "echo Found U-Boot script " \
  82 + "${prefix}${script}; " \
  83 + "run do_script_boot; " \
  84 + "echo SCRIPT FAILED: continuing...; " \
  85 + "fi; " \
  86 + "done\0" \
78 87 \
  88 + "do_sysboot_boot=" \
  89 + "sysboot ${devtype} ${devnum}:${rootpart} any " \
  90 + "${scriptaddr} ${prefix}extlinux.conf\0" \
  91 + \
  92 + "sysboot_boot=" \
  93 + "if test -e ${devtype} ${devnum}:${rootpart} " \
  94 + "${prefix}extlinux.conf; then " \
  95 + "echo Found extlinux config " \
  96 + "${prefix}extlinux.conf; " \
  97 + "run do_sysboot_boot; " \
  98 + "echo SCRIPT FAILED: continuing...; " \
  99 + "fi\0" \
  100 + \
79 101 "scan_boot=" \
80 102 "echo Scanning ${devtype} ${devnum}...; " \
81 103 "for prefix in ${boot_prefixes}; do " \
82   - "for script in ${boot_scripts}; do " \
83   - "run script_boot; " \
84   - "done; " \
85   - "done;\0" \
  104 + "run sysboot_boot; " \
  105 + "run script_boot; " \
  106 + "done\0" \
86 107 \
87 108 "boot_targets=" \
88 109 BOOT_TARGETS_MMC " " \