diff options
-rw-r--r-- | include/configs/tegra2-common-post.h | 82 |
1 files changed, 52 insertions, 30 deletions
diff --git a/include/configs/tegra2-common-post.h b/include/configs/tegra2-common-post.h index 0484a52..85b037c 100644 --- a/include/configs/tegra2-common-post.h +++ b/include/configs/tegra2-common-post.h @@ -31,15 +31,15 @@ #else #ifdef CONFIG_CMD_EXT2 -#define BOOTCMD_FS_EXT2 "ext2 " +#define BOOT_FSTYPE_EXT2 "ext2 " #else -#define BOOTCMD_FS_EXT2 "" +#define BOOT_FSTYPE_EXT2 "" #endif #ifdef CONFIG_CMD_FAT -#define BOOTCMD_FS_FAT "fat" +#define BOOT_FSTYPE_FAT "fat" #else -#define BOOTCMD_FS_FAT "" +#define BOOT_FSTYPE_FAT "" #endif #ifdef CONFIG_CMD_MMC @@ -47,15 +47,14 @@ "mmc_boot=" \ "setenv devtype mmc; " \ "if mmc dev ${devnum}; then " \ - "run script_boot; " \ + "run scan_boot; " \ "fi\0" \ - "mmc0_boot=setenv devnum 0; run mmc_boot;\0" \ - "mmc1_boot=setenv devnum 1; run mmc_boot;\0" \ - "bootcmd_mmc=run mmc1_boot; run mmc0_boot\0" -#define BOOTCMD_MMC "run bootcmd_mmc; " + "bootcmd_mmc0=setenv devnum 0; run mmc_boot;\0" \ + "bootcmd_mmc1=setenv devnum 1; run mmc_boot;\0" +#define BOOT_TARGETS_MMC "mmc1 mmc0" #else #define BOOTCMDS_MMC "" -#define BOOTCMD_MMC "" +#define BOOT_TARGETS_MMC "" #endif #ifdef CONFIG_CMD_USB @@ -63,15 +62,14 @@ "usb_boot=" \ "setenv devtype usb; " \ "if usb dev ${devnum}; then " \ - "run script_boot; " \ + "run scan_boot; " \ "fi\0" \ - "usb0_boot=setenv devnum 0; run usb_boot;\0" \ - "bootcmd_usb=run usb0_boot\0" -#define BOOTCMD_USB "run bootcmd_usb; " + "bootcmd_usb0=setenv devnum 0; run usb_boot;\0" +#define BOOT_TARGETS_USB "usb0" #define BOOTCMD_INIT_USB "usb start 0; " #else #define BOOTCMDS_USB "" -#define BOOTCMD_USB "" +#define BOOT_TARGETS_USB "" #define BOOTCMD_INIT_USB "" #endif @@ -81,32 +79,56 @@ "if dhcp ${scriptaddr} boot.scr.uimg; then "\ "source ${scriptaddr}; " \ "fi\0" -#define BOOTCMD_DHCP "run bootcmd_dhcp; " +#define BOOT_TARGETS_DHCP "dhcp" #else #define BOOTCMDS_DHCP "" -#define BOOTCMD_DHCP "" +#define BOOT_TARGETS_DHCP "" #endif #define BOOTCMDS_COMMON \ "scriptaddr=0x400000\0" \ + \ "rootpart=1\0" \ - "script_boot=" \ - "for fs in " BOOTCMD_FS_EXT2 BOOTCMD_FS_FAT "; do " \ - "for prefix in / /boot/; do " \ - "for script in boot.scr.uimg boot.scr; do " \ - "echo Scanning ${devtype} ${devnum}:${rootpart} ${fs} ${prefix}${script} ...; " \ - "if ${fs}load ${devtype} ${devnum}:${rootpart} ${scriptaddr} ${prefix}${script}; then " \ - "echo ${script} found! Executing ...;" \ - "source ${scriptaddr};" \ - "fi; " \ - "done; " \ - "done; " \ - "done;\0" \ + \ + "script_boot=" \ + "if ${fs}load ${devtype} ${devnum}:${rootpart} " \ + "${scriptaddr} ${prefix}${script}; then " \ + "echo ${script} found! Executing ...;" \ + "source ${scriptaddr};" \ + "fi;\0" \ + \ + "scan_boot=" \ + "echo Scanning ${devtype} ${devnum}...; " \ + "for fs in ${boot_fstypes}; do " \ + "for prefix in ${boot_prefixes}; do " \ + "for script in ${boot_scripts}; do " \ + "run script_boot; " \ + "done; " \ + "done; " \ + "done;\0" \ + \ + "boot_targets=" \ + BOOT_TARGETS_MMC " " \ + BOOT_TARGETS_USB " " \ + BOOT_TARGETS_DHCP " " \ + "\0" \ + \ + "boot_fstypes=" \ + BOOT_FSTYPE_EXT2 " " \ + BOOT_FSTYPE_FAT " " \ + "\0" \ + \ + "boot_prefixes=/ /boot/\0" \ + \ + "boot_scripts=boot.scr.uimg boot.scr\0" \ + \ BOOTCMDS_MMC \ BOOTCMDS_USB \ BOOTCMDS_DHCP -#define CONFIG_BOOTCOMMAND BOOTCMD_INIT_USB BOOTCMD_USB BOOTCMD_MMC BOOTCMD_DHCP +#define CONFIG_BOOTCOMMAND \ + BOOTCMD_INIT_USB \ + "for target in ${boot_targets}; do run bootcmd_${target}; done" #endif |