2 * (C) Copyright 2010-2012
3 * NVIDIA Corporation <www.nvidia.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #ifndef __TEGRA2_COMMON_POST_H
25 #define __TEGRA2_COMMON_POST_H
27 #ifdef CONFIG_BOOTCOMMAND
29 #define BOOTCMDS_COMMON ""
33 #ifdef CONFIG_CMD_EXT2
34 #define BOOTCMD_FS_EXT2 "ext2 "
36 #define BOOTCMD_FS_EXT2 ""
40 #define BOOTCMD_FS_FAT "fat"
42 #define BOOTCMD_FS_FAT ""
46 #define BOOTCMDS_MMC \
48 "setenv devtype mmc; " \
49 "if mmc dev ${devnum}; then " \
52 "mmc0_boot=setenv devnum 0; run mmc_boot;\0" \
53 "mmc1_boot=setenv devnum 1; run mmc_boot;\0" \
54 "bootcmd_mmc=run mmc1_boot; run mmc0_boot\0"
55 #define BOOTCMD_MMC "run bootcmd_mmc; "
57 #define BOOTCMDS_MMC ""
58 #define BOOTCMD_MMC ""
62 #define BOOTCMDS_USB \
64 "setenv devtype usb; " \
65 "if usb dev ${devnum}; then " \
68 "usb0_boot=setenv devnum 0; run usb_boot;\0" \
69 "bootcmd_usb=run usb0_boot\0"
70 #define BOOTCMD_USB "run bootcmd_usb; "
71 #define BOOTCMD_INIT_USB "usb start 0; "
73 #define BOOTCMDS_USB ""
74 #define BOOTCMD_USB ""
75 #define BOOTCMD_INIT_USB ""
78 #ifdef CONFIG_CMD_DHCP
79 #define BOOTCMDS_DHCP \
81 "if dhcp ${scriptaddr} boot.scr.uimg; then "\
82 "source ${scriptaddr}; " \
84 #define BOOTCMD_DHCP "run bootcmd_dhcp; "
86 #define BOOTCMDS_DHCP ""
87 #define BOOTCMD_DHCP ""
90 #define BOOTCMDS_COMMON \
91 "scriptaddr=0x400000\0" \
94 "for fs in " BOOTCMD_FS_EXT2 BOOTCMD_FS_FAT "; do " \
95 "for prefix in / /boot/; do " \
96 "for script in boot.scr.uimg boot.scr; do " \
97 "echo Scanning ${devtype} ${devnum}:${rootpart} ${fs} ${prefix}${script} ...; " \
98 "if ${fs}load ${devtype} ${devnum}:${rootpart} ${scriptaddr} ${prefix}${script}; then " \
99 "echo ${script} found! Executing ...;" \
100 "source ${scriptaddr};" \
109 #define CONFIG_BOOTCOMMAND BOOTCMD_INIT_USB BOOTCMD_USB BOOTCMD_MMC BOOTCMD_DHCP
113 #define CONFIG_EXTRA_ENV_SETTINGS \
114 TEGRA2_DEVICE_SETTINGS \
117 #endif /* __TEGRA2_COMMON_POST_H */