2 * (C) Copyright 2010-2012
3 * NVIDIA Corporation <www.nvidia.com>
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __TEGRA_COMMON_POST_H
9 #define __TEGRA_COMMON_POST_H
11 #ifdef CONFIG_BOOTCOMMAND
13 #define BOOTCMDS_COMMON ""
18 #define BOOTCMDS_MMC \
20 "setenv devtype mmc; " \
21 "if mmc dev ${devnum}; then " \
24 "bootcmd_mmc0=setenv devnum 0; run mmc_boot;\0" \
25 "bootcmd_mmc1=setenv devnum 1; run mmc_boot;\0"
26 #define BOOT_TARGETS_MMC "mmc1 mmc0"
28 #define BOOTCMDS_MMC ""
29 #define BOOT_TARGETS_MMC ""
33 #define BOOTCMD_INIT_USB "run usb_init; "
34 #define BOOTCMDS_USB \
36 "if ${usb_need_init}; then " \
37 "set usb_need_init false; " \
42 "setenv devtype usb; " \
44 "if usb dev ${devnum}; then " \
48 "bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
49 #define BOOT_TARGETS_USB "usb0"
51 #define BOOTCMD_INIT_USB ""
52 #define BOOTCMDS_USB ""
53 #define BOOT_TARGETS_USB ""
56 #ifdef CONFIG_CMD_DHCP
57 #define BOOTCMDS_DHCP \
60 "if dhcp ${scriptaddr} boot.scr.uimg; then "\
61 "source ${scriptaddr}; " \
63 #define BOOT_TARGETS_DHCP "dhcp"
65 #define BOOTCMDS_DHCP ""
66 #define BOOT_TARGETS_DHCP ""
69 #if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
70 #define BOOTCMDS_PXE \
77 #define BOOT_TARGETS_PXE "pxe"
79 #define BOOTCMDS_PXE ""
80 #define BOOT_TARGETS_PXE ""
83 #define BOOTCMDS_COMMON \
87 "load ${devtype} ${devnum}:${rootpart} " \
88 "${scriptaddr} ${prefix}${script}; " \
89 "source ${scriptaddr}\0" \
92 "for script in ${boot_scripts}; do " \
93 "if test -e ${devtype} ${devnum}:${rootpart} " \
94 "${prefix}${script}; then " \
95 "echo Found U-Boot script " \
96 "${prefix}${script}; " \
97 "run do_script_boot; " \
98 "echo SCRIPT FAILED: continuing...; " \
103 "sysboot ${devtype} ${devnum}:${rootpart} any " \
104 "${scriptaddr} ${prefix}extlinux/extlinux.conf\0" \
107 "if test -e ${devtype} ${devnum}:${rootpart} " \
108 "${prefix}extlinux/extlinux.conf; then " \
109 "echo Found ${prefix}extlinux/extlinux.conf; " \
110 "run do_sysboot_boot; " \
111 "echo SCRIPT FAILED: continuing...; " \
115 "echo Scanning ${devtype} ${devnum}...; " \
116 "for prefix in ${boot_prefixes}; do " \
117 "run sysboot_boot; " \
118 "run script_boot; " \
122 BOOT_TARGETS_MMC " " \
123 BOOT_TARGETS_USB " " \
124 BOOT_TARGETS_PXE " " \
125 BOOT_TARGETS_DHCP " " \
128 "boot_prefixes=/ /boot/\0" \
130 "boot_scripts=boot.scr.uimg boot.scr\0" \
137 #define CONFIG_BOOTCOMMAND \
138 "set usb_need_init; " \
139 "for target in ${boot_targets}; do run bootcmd_${target}; done"
143 #ifdef CONFIG_TEGRA_KEYBOARD
144 #define STDIN_KBD_KBC ",tegra-kbc"
146 #define STDIN_KBD_KBC ""
149 #ifdef CONFIG_USB_KEYBOARD
150 #define STDIN_KBD_USB ",usbkbd"
151 #define CONFIG_SYS_USB_EVENT_POLL
152 #define CONFIG_PREBOOT "usb start"
154 #define STDIN_KBD_USB ""
157 #ifdef CONFIG_VIDEO_TEGRA
158 #define STDOUT_LCD ",lcd"
160 #define STDOUT_LCD ""
163 #define TEGRA_DEVICE_SETTINGS \
164 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB "\0" \
165 "stdout=serial" STDOUT_LCD "\0" \
166 "stderr=serial" STDOUT_LCD "\0" \
169 #ifndef BOARD_EXTRA_ENV_SETTINGS
170 #define BOARD_EXTRA_ENV_SETTINGS
173 #define CONFIG_EXTRA_ENV_SETTINGS \
174 TEGRA_DEVICE_SETTINGS \
175 MEM_LAYOUT_ENV_SETTINGS \
176 "fdt_high=ffffffff\0" \
177 "initrd_high=ffffffff\0" \
179 BOARD_EXTRA_ENV_SETTINGS
181 #if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
182 #define CONFIG_FDT_SPI
185 /* overrides for SPL build here */
186 #ifdef CONFIG_SPL_BUILD
188 #define CONFIG_SKIP_LOWLEVEL_INIT
190 /* remove devicetree support */
191 #ifdef CONFIG_OF_CONTROL
192 #undef CONFIG_OF_CONTROL
195 /* remove I2C support */
196 #ifdef CONFIG_SYS_I2C_TEGRA
197 #undef CONFIG_SYS_I2C_TEGRA
199 #ifdef CONFIG_CMD_I2C
200 #undef CONFIG_CMD_I2C
203 /* remove MMC support */
207 #ifdef CONFIG_GENERIC_MMC
208 #undef CONFIG_GENERIC_MMC
210 #ifdef CONFIG_TEGRA_MMC
211 #undef CONFIG_TEGRA_MMC
213 #ifdef CONFIG_CMD_MMC
214 #undef CONFIG_CMD_MMC
217 /* remove partitions/filesystems */
218 #ifdef CONFIG_DOS_PARTITION
219 #undef CONFIG_DOS_PARTITION
221 #ifdef CONFIG_EFI_PARTITION
222 #undef CONFIG_EFI_PARTITION
224 #ifdef CONFIG_CMD_FS_GENERIC
225 #undef CONFIG_CMD_FS_GENERIC
227 #ifdef CONFIG_CMD_EXT4
228 #undef CONFIG_CMD_EXT4
230 #ifdef CONFIG_CMD_EXT2
231 #undef CONFIG_CMD_EXT2
233 #ifdef CONFIG_CMD_FAT
234 #undef CONFIG_CMD_FAT
236 #ifdef CONFIG_FS_EXT4
237 #undef CONFIG_FS_EXT4
244 #ifdef CONFIG_USB_EHCI
245 #undef CONFIG_USB_EHCI
247 #ifdef CONFIG_USB_EHCI_TEGRA
248 #undef CONFIG_USB_EHCI_TEGRA
250 #ifdef CONFIG_USB_STORAGE
251 #undef CONFIG_USB_STORAGE
253 #ifdef CONFIG_CMD_USB
254 #undef CONFIG_CMD_USB
257 /* remove part command support */
258 #ifdef CONFIG_PARTITION_UUIDS
259 #undef CONFIG_PARTITION_UUIDS
262 #ifdef CONFIG_CMD_PART
263 #undef CONFIG_CMD_PART
266 #endif /* CONFIG_SPL_BUILD */
268 #endif /* __TEGRA_COMMON_POST_H */