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 #define BOOTCMDS_COMMON \
73 "if load ${devtype} ${devnum}:${rootpart} " \
74 "${scriptaddr} ${prefix}${script}; then " \
75 "echo ${script} found! Executing ...;" \
76 "source ${scriptaddr};" \
80 "echo Scanning ${devtype} ${devnum}...; " \
81 "for prefix in ${boot_prefixes}; do " \
82 "for script in ${boot_scripts}; do " \
88 BOOT_TARGETS_MMC " " \
89 BOOT_TARGETS_USB " " \
90 BOOT_TARGETS_DHCP " " \
93 "boot_prefixes=/ /boot/\0" \
95 "boot_scripts=boot.scr.uimg boot.scr\0" \
101 #define CONFIG_BOOTCOMMAND \
102 "for target in ${boot_targets}; do run bootcmd_${target}; done"
106 #ifdef CONFIG_TEGRA_KEYBOARD
107 #define STDIN_KBD_KBC ",tegra-kbc"
109 #define STDIN_KBD_KBC ""
112 #ifdef CONFIG_USB_KEYBOARD
113 #define STDIN_KBD_USB ",usbkbd"
114 #define CONFIG_SYS_USB_EVENT_POLL
115 #define CONFIG_PREBOOT "usb start"
117 #define STDIN_KBD_USB ""
120 #ifdef CONFIG_VIDEO_TEGRA
121 #define STDOUT_LCD ",lcd"
123 #define STDOUT_LCD ""
126 #define TEGRA_DEVICE_SETTINGS \
127 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB "\0" \
128 "stdout=serial" STDOUT_LCD "\0" \
129 "stderr=serial" STDOUT_LCD "\0" \
132 #define CONFIG_EXTRA_ENV_SETTINGS \
133 TEGRA_DEVICE_SETTINGS \
134 MEM_LAYOUT_ENV_SETTINGS \
137 #if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
138 #define CONFIG_FDT_SPI
141 /* overrides for SPL build here */
142 #ifdef CONFIG_SPL_BUILD
144 #define CONFIG_SKIP_LOWLEVEL_INIT
146 /* remove devicetree support */
147 #ifdef CONFIG_OF_CONTROL
148 #undef CONFIG_OF_CONTROL
151 /* remove I2C support */
152 #ifdef CONFIG_SYS_I2C_TEGRA
153 #undef CONFIG_SYS_I2C_TEGRA
155 #ifdef CONFIG_CMD_I2C
156 #undef CONFIG_CMD_I2C
159 /* remove MMC support */
163 #ifdef CONFIG_GENERIC_MMC
164 #undef CONFIG_GENERIC_MMC
166 #ifdef CONFIG_TEGRA_MMC
167 #undef CONFIG_TEGRA_MMC
169 #ifdef CONFIG_CMD_MMC
170 #undef CONFIG_CMD_MMC
173 /* remove partitions/filesystems */
174 #ifdef CONFIG_DOS_PARTITION
175 #undef CONFIG_DOS_PARTITION
177 #ifdef CONFIG_EFI_PARTITION
178 #undef CONFIG_EFI_PARTITION
180 #ifdef CONFIG_CMD_FS_GENERIC
181 #undef CONFIG_CMD_FS_GENERIC
183 #ifdef CONFIG_CMD_EXT4
184 #undef CONFIG_CMD_EXT4
186 #ifdef CONFIG_CMD_EXT2
187 #undef CONFIG_CMD_EXT2
189 #ifdef CONFIG_CMD_FAT
190 #undef CONFIG_CMD_FAT
192 #ifdef CONFIG_FS_EXT4
193 #undef CONFIG_FS_EXT4
200 #ifdef CONFIG_USB_EHCI
201 #undef CONFIG_USB_EHCI
203 #ifdef CONFIG_USB_EHCI_TEGRA
204 #undef CONFIG_USB_EHCI_TEGRA
206 #ifdef CONFIG_USB_STORAGE
207 #undef CONFIG_USB_STORAGE
209 #ifdef CONFIG_CMD_USB
210 #undef CONFIG_CMD_USB
213 /* remove part command support */
214 #ifdef CONFIG_PARTITION_UUIDS
215 #undef CONFIG_PARTITION_UUIDS
218 #ifdef CONFIG_CMD_PART
219 #undef CONFIG_CMD_PART
222 #endif /* CONFIG_SPL_BUILD */
224 #endif /* __TEGRA_COMMON_POST_H */