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 ""
33 #ifdef CONFIG_CMD_EXT2
34 #define BOOT_FSTYPE_EXT2 "ext2 "
36 #define BOOT_FSTYPE_EXT2 ""
40 #define BOOT_FSTYPE_FAT "fat"
42 #define BOOT_FSTYPE_FAT ""
46 #define BOOTCMDS_MMC \
48 "setenv devtype mmc; " \
49 "if mmc dev ${devnum}; then " \
52 "bootcmd_mmc0=setenv devnum 0; run mmc_boot;\0" \
53 "bootcmd_mmc1=setenv devnum 1; run mmc_boot;\0"
54 #define BOOT_TARGETS_MMC "mmc1 mmc0"
56 #define BOOTCMDS_MMC ""
57 #define BOOT_TARGETS_MMC ""
61 #define BOOTCMD_INIT_USB "run usb_init; "
62 #define BOOTCMDS_USB \
64 "if ${usb_need_init}; then " \
65 "set usb_need_init false; " \
70 "setenv devtype usb; " \
72 "if usb dev ${devnum}; then " \
76 "bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
77 #define BOOT_TARGETS_USB "usb0"
79 #define BOOTCMD_INIT_USB ""
80 #define BOOTCMDS_USB ""
81 #define BOOT_TARGETS_USB ""
84 #ifdef CONFIG_CMD_DHCP
85 #define BOOTCMDS_DHCP \
88 "if dhcp ${scriptaddr} boot.scr.uimg; then "\
89 "source ${scriptaddr}; " \
91 #define BOOT_TARGETS_DHCP "dhcp"
93 #define BOOTCMDS_DHCP ""
94 #define BOOT_TARGETS_DHCP ""
97 #define BOOTCMDS_COMMON \
101 "if ${fs}load ${devtype} ${devnum}:${rootpart} " \
102 "${scriptaddr} ${prefix}${script}; then " \
103 "echo ${script} found! Executing ...;" \
104 "source ${scriptaddr};" \
108 "echo Scanning ${devtype} ${devnum}...; " \
109 "for fs in ${boot_fstypes}; do " \
110 "for prefix in ${boot_prefixes}; do " \
111 "for script in ${boot_scripts}; do " \
112 "run script_boot; " \
118 BOOT_TARGETS_MMC " " \
119 BOOT_TARGETS_USB " " \
120 BOOT_TARGETS_DHCP " " \
124 BOOT_FSTYPE_EXT2 " " \
125 BOOT_FSTYPE_FAT " " \
128 "boot_prefixes=/ /boot/\0" \
130 "boot_scripts=boot.scr.uimg boot.scr\0" \
136 #define CONFIG_BOOTCOMMAND \
137 "for target in ${boot_targets}; do run bootcmd_${target}; done"
142 * Memory layout for where various images get loaded by boot scripts:
144 * scriptaddr can be pretty much anywhere that doesn't conflict with something
145 * else. Put it above BOOTMAPSZ to eliminate conflicts.
147 * kernel_addr_r must be within the first 128M of RAM in order for the
148 * kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
149 * decompress itself to 0x8000 after the start of RAM, kernel_addr_r
150 * should not overlap that area, or the kernel will have to copy itself
151 * somewhere else before decompression. Similarly, the address of any other
152 * data passed to the kernel shouldn't overlap the start of RAM. Pushing
153 * this up to 16M allows for a sizable kernel to be decompressed below the
154 * compressed load address.
156 * fdt_addr_r simply shouldn't overlap anything else. Choosing 32M allows for
157 * the compressed kernel to be up to 16M too.
159 * ramdisk_addr_r simply shouldn't overlap anything else. Choosing 33M allows
160 * for the FDT/DTB to be up to 1M, which is hopefully plenty.
162 #define MEM_LAYOUT_ENV_SETTINGS \
163 "scriptaddr=0x10000000\0" \
164 "kernel_addr_r=0x01000000\0" \
165 "fdt_addr_r=0x02000000\0" \
166 "ramdisk_addr_r=0x02100000\0" \
168 #define CONFIG_EXTRA_ENV_SETTINGS \
169 TEGRA_DEVICE_SETTINGS \
170 MEM_LAYOUT_ENV_SETTINGS \
173 /* overrides for SPL build here */
174 #ifdef CONFIG_SPL_BUILD
176 /* remove devicetree support */
177 #ifdef CONFIG_OF_CONTROL
178 #undef CONFIG_OF_CONTROL
181 /* remove I2C support */
182 #ifdef CONFIG_TEGRA_I2C
183 #undef CONFIG_TEGRA_I2C
185 #ifdef CONFIG_CMD_I2C
186 #undef CONFIG_CMD_I2C
189 /* remove MMC support */
193 #ifdef CONFIG_GENERIC_MMC
194 #undef CONFIG_GENERIC_MMC
196 #ifdef CONFIG_TEGRA_MMC
197 #undef CONFIG_TEGRA_MMC
199 #ifdef CONFIG_CMD_MMC
200 #undef CONFIG_CMD_MMC
203 /* remove partitions/filesystems */
204 #ifdef CONFIG_DOS_PARTITION
205 #undef CONFIG_DOS_PARTITION
207 #ifdef CONFIG_EFI_PARTITION
208 #undef CONFIG_EFI_PARTITION
210 #ifdef CONFIG_CMD_EXT2
211 #undef CONFIG_CMD_EXT2
213 #ifdef CONFIG_CMD_FAT
214 #undef CONFIG_CMD_FAT
218 #ifdef CONFIG_USB_EHCI
219 #undef CONFIG_USB_EHCI
221 #ifdef CONFIG_USB_EHCI_TEGRA
222 #undef CONFIG_USB_EHCI_TEGRA
224 #ifdef CONFIG_USB_STORAGE
225 #undef CONFIG_USB_STORAGE
227 #ifdef CONFIG_CMD_USB
228 #undef CONFIG_CMD_USB
231 /* remove part command support */
232 #ifdef CONFIG_PARTITION_UUIDS
233 #undef CONFIG_PARTITION_UUIDS
236 #ifdef CONFIG_CMD_PART
237 #undef CONFIG_CMD_PART
240 #endif /* CONFIG_SPL_BUILD */
242 #endif /* __TEGRA_COMMON_POST_H */