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 __TEGRA_COMMON_POST_H
25 #define __TEGRA_COMMON_POST_H
27 #ifdef CONFIG_BOOTCOMMAND
29 #define BOOTCMDS_COMMON ""
34 #define BOOTCMDS_MMC \
36 "setenv devtype mmc; " \
37 "if mmc dev ${devnum}; then " \
40 "bootcmd_mmc0=setenv devnum 0; run mmc_boot;\0" \
41 "bootcmd_mmc1=setenv devnum 1; run mmc_boot;\0"
42 #define BOOT_TARGETS_MMC "mmc1 mmc0"
44 #define BOOTCMDS_MMC ""
45 #define BOOT_TARGETS_MMC ""
49 #define BOOTCMD_INIT_USB "run usb_init; "
50 #define BOOTCMDS_USB \
52 "if ${usb_need_init}; then " \
53 "set usb_need_init false; " \
58 "setenv devtype usb; " \
60 "if usb dev ${devnum}; then " \
64 "bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
65 #define BOOT_TARGETS_USB "usb0"
67 #define BOOTCMD_INIT_USB ""
68 #define BOOTCMDS_USB ""
69 #define BOOT_TARGETS_USB ""
72 #ifdef CONFIG_CMD_DHCP
73 #define BOOTCMDS_DHCP \
76 "if dhcp ${scriptaddr} boot.scr.uimg; then "\
77 "source ${scriptaddr}; " \
79 #define BOOT_TARGETS_DHCP "dhcp"
81 #define BOOTCMDS_DHCP ""
82 #define BOOT_TARGETS_DHCP ""
85 #define BOOTCMDS_COMMON \
89 "if load ${devtype} ${devnum}:${rootpart} " \
90 "${scriptaddr} ${prefix}${script}; then " \
91 "echo ${script} found! Executing ...;" \
92 "source ${scriptaddr};" \
96 "echo Scanning ${devtype} ${devnum}...; " \
97 "for prefix in ${boot_prefixes}; do " \
98 "for script in ${boot_scripts}; do " \
104 BOOT_TARGETS_MMC " " \
105 BOOT_TARGETS_USB " " \
106 BOOT_TARGETS_DHCP " " \
109 "boot_prefixes=/ /boot/\0" \
111 "boot_scripts=boot.scr.uimg boot.scr\0" \
117 #define CONFIG_BOOTCOMMAND \
118 "for target in ${boot_targets}; do run bootcmd_${target}; done"
122 #ifdef CONFIG_TEGRA_KEYBOARD
123 #define STDIN_KBD_KBC ",tegra-kbc"
125 #define STDIN_KBD_KBC ""
128 #ifdef CONFIG_USB_KEYBOARD
129 #define STDIN_KBD_USB ",usbkbd"
130 #define CONFIG_SYS_USB_EVENT_POLL
131 #define CONFIG_PREBOOT "usb start"
133 #define STDIN_KBD_USB ""
136 #ifdef CONFIG_VIDEO_TEGRA
137 #define STDOUT_LCD ",lcd"
139 #define STDOUT_LCD ""
142 #define TEGRA_DEVICE_SETTINGS \
143 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB "\0" \
144 "stdout=serial" STDOUT_LCD "\0" \
145 "stderr=serial" STDOUT_LCD "\0" \
148 #define CONFIG_EXTRA_ENV_SETTINGS \
149 TEGRA_DEVICE_SETTINGS \
150 MEM_LAYOUT_ENV_SETTINGS \
153 #if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK)
154 #define CONFIG_FDT_SPI
157 /* overrides for SPL build here */
158 #ifdef CONFIG_SPL_BUILD
160 /* remove devicetree support */
161 #ifdef CONFIG_OF_CONTROL
162 #undef CONFIG_OF_CONTROL
165 /* remove I2C support */
166 #ifdef CONFIG_TEGRA_I2C
167 #undef CONFIG_TEGRA_I2C
169 #ifdef CONFIG_CMD_I2C
170 #undef CONFIG_CMD_I2C
173 /* remove MMC support */
177 #ifdef CONFIG_GENERIC_MMC
178 #undef CONFIG_GENERIC_MMC
180 #ifdef CONFIG_TEGRA_MMC
181 #undef CONFIG_TEGRA_MMC
183 #ifdef CONFIG_CMD_MMC
184 #undef CONFIG_CMD_MMC
187 /* remove partitions/filesystems */
188 #ifdef CONFIG_DOS_PARTITION
189 #undef CONFIG_DOS_PARTITION
191 #ifdef CONFIG_EFI_PARTITION
192 #undef CONFIG_EFI_PARTITION
194 #ifdef CONFIG_CMD_FS_GENERIC
195 #undef CONFIG_CMD_FS_GENERIC
197 #ifdef CONFIG_CMD_EXT4
198 #undef CONFIG_CMD_EXT4
200 #ifdef CONFIG_CMD_EXT2
201 #undef CONFIG_CMD_EXT2
203 #ifdef CONFIG_CMD_FAT
204 #undef CONFIG_CMD_FAT
206 #ifdef CONFIG_FS_EXT4
207 #undef CONFIG_FS_EXT4
214 #ifdef CONFIG_USB_EHCI
215 #undef CONFIG_USB_EHCI
217 #ifdef CONFIG_USB_EHCI_TEGRA
218 #undef CONFIG_USB_EHCI_TEGRA
220 #ifdef CONFIG_USB_STORAGE
221 #undef CONFIG_USB_STORAGE
223 #ifdef CONFIG_CMD_USB
224 #undef CONFIG_CMD_USB
227 /* remove part command support */
228 #ifdef CONFIG_PARTITION_UUIDS
229 #undef CONFIG_PARTITION_UUIDS
232 #ifdef CONFIG_CMD_PART
233 #undef CONFIG_CMD_PART
236 #endif /* CONFIG_SPL_BUILD */
238 #endif /* __TEGRA_COMMON_POST_H */