]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/configs/tegra-common-post.h
tegra: i2c: Enable new CONFIG_SYS_I2C framework
[people/ms/u-boot.git] / include / configs / tegra-common-post.h
CommitLineData
bea2674c
SW
1/*
2 * (C) Copyright 2010-2012
3 * NVIDIA Corporation <www.nvidia.com>
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
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.
12 *
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.
17 *
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,
21 * MA 02111-1307 USA
22 */
23
29f3e3f2
TW
24#ifndef __TEGRA_COMMON_POST_H
25#define __TEGRA_COMMON_POST_H
bea2674c
SW
26
27#ifdef CONFIG_BOOTCOMMAND
28
29#define BOOTCMDS_COMMON ""
30
31#else
32
bea2674c
SW
33#ifdef CONFIG_CMD_MMC
34#define BOOTCMDS_MMC \
35 "mmc_boot=" \
36 "setenv devtype mmc; " \
37 "if mmc dev ${devnum}; then " \
03cddf28 38 "run scan_boot; " \
bea2674c 39 "fi\0" \
03cddf28
SW
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"
bea2674c
SW
43#else
44#define BOOTCMDS_MMC ""
03cddf28 45#define BOOT_TARGETS_MMC ""
bea2674c
SW
46#endif
47
48#ifdef CONFIG_CMD_USB
f78d348c 49#define BOOTCMD_INIT_USB "run usb_init; "
bea2674c 50#define BOOTCMDS_USB \
f78d348c
SW
51 "usb_init=" \
52 "if ${usb_need_init}; then " \
53 "set usb_need_init false; " \
54 "usb start 0; " \
55 "fi\0" \
56 \
bea2674c
SW
57 "usb_boot=" \
58 "setenv devtype usb; " \
f78d348c 59 BOOTCMD_INIT_USB \
bea2674c 60 "if usb dev ${devnum}; then " \
03cddf28 61 "run scan_boot; " \
bea2674c 62 "fi\0" \
f78d348c 63 \
03cddf28
SW
64 "bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
65#define BOOT_TARGETS_USB "usb0"
bea2674c 66#else
f78d348c 67#define BOOTCMD_INIT_USB ""
bea2674c 68#define BOOTCMDS_USB ""
03cddf28 69#define BOOT_TARGETS_USB ""
bea2674c
SW
70#endif
71
72#ifdef CONFIG_CMD_DHCP
73#define BOOTCMDS_DHCP \
74 "bootcmd_dhcp=" \
f78d348c 75 BOOTCMD_INIT_USB \
bea2674c
SW
76 "if dhcp ${scriptaddr} boot.scr.uimg; then "\
77 "source ${scriptaddr}; " \
78 "fi\0"
03cddf28 79#define BOOT_TARGETS_DHCP "dhcp"
bea2674c
SW
80#else
81#define BOOTCMDS_DHCP ""
03cddf28 82#define BOOT_TARGETS_DHCP ""
bea2674c
SW
83#endif
84
85#define BOOTCMDS_COMMON \
bea2674c 86 "rootpart=1\0" \
03cddf28
SW
87 \
88 "script_boot=" \
3786a942 89 "if load ${devtype} ${devnum}:${rootpart} " \
03cddf28
SW
90 "${scriptaddr} ${prefix}${script}; then " \
91 "echo ${script} found! Executing ...;" \
92 "source ${scriptaddr};" \
93 "fi;\0" \
94 \
95 "scan_boot=" \
96 "echo Scanning ${devtype} ${devnum}...; " \
3786a942
SW
97 "for prefix in ${boot_prefixes}; do " \
98 "for script in ${boot_scripts}; do " \
99 "run script_boot; " \
03cddf28
SW
100 "done; " \
101 "done;\0" \
102 \
103 "boot_targets=" \
104 BOOT_TARGETS_MMC " " \
105 BOOT_TARGETS_USB " " \
106 BOOT_TARGETS_DHCP " " \
107 "\0" \
108 \
03cddf28
SW
109 "boot_prefixes=/ /boot/\0" \
110 \
111 "boot_scripts=boot.scr.uimg boot.scr\0" \
112 \
bea2674c
SW
113 BOOTCMDS_MMC \
114 BOOTCMDS_USB \
115 BOOTCMDS_DHCP
116
03cddf28 117#define CONFIG_BOOTCOMMAND \
03cddf28 118 "for target in ${boot_targets}; do run bootcmd_${target}; done"
bea2674c
SW
119
120#endif
121
7992bfbf
AM
122#ifdef CONFIG_TEGRA_KEYBOARD
123#define STDIN_KBD_KBC ",tegra-kbc"
124#else
125#define STDIN_KBD_KBC ""
126#endif
127
128#ifdef CONFIG_USB_KEYBOARD
129#define STDIN_KBD_USB ",usbkbd"
130#define CONFIG_SYS_USB_EVENT_POLL
131#define CONFIG_PREBOOT "usb start"
132#else
133#define STDIN_KBD_USB ""
134#endif
135
c35eb56a
SW
136#ifdef CONFIG_VIDEO_TEGRA
137#define STDOUT_LCD ",lcd"
138#else
139#define STDOUT_LCD ""
140#endif
141
7992bfbf
AM
142#define TEGRA_DEVICE_SETTINGS \
143 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB "\0" \
c35eb56a
SW
144 "stdout=serial" STDOUT_LCD "\0" \
145 "stderr=serial" STDOUT_LCD "\0" \
146 ""
7992bfbf 147
bea2674c 148#define CONFIG_EXTRA_ENV_SETTINGS \
29f3e3f2 149 TEGRA_DEVICE_SETTINGS \
938176a4 150 MEM_LAYOUT_ENV_SETTINGS \
bea2674c
SW
151 BOOTCMDS_COMMON
152
77c42e80 153#if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
78f47b73
AM
154#define CONFIG_FDT_SPI
155#endif
156
12b7b70c
AM
157/* overrides for SPL build here */
158#ifdef CONFIG_SPL_BUILD
159
60985bba
AL
160#define CONFIG_SKIP_LOWLEVEL_INIT
161
12b7b70c
AM
162/* remove devicetree support */
163#ifdef CONFIG_OF_CONTROL
164#undef CONFIG_OF_CONTROL
165#endif
166
12b7b70c 167/* remove I2C support */
1f2ba722
SG
168#ifdef CONFIG_SYS_I2C_TEGRA
169#undef CONFIG_SYS_I2C_TEGRA
12b7b70c
AM
170#endif
171#ifdef CONFIG_CMD_I2C
172#undef CONFIG_CMD_I2C
173#endif
174
175/* remove MMC support */
176#ifdef CONFIG_MMC
177#undef CONFIG_MMC
178#endif
179#ifdef CONFIG_GENERIC_MMC
180#undef CONFIG_GENERIC_MMC
181#endif
29f3e3f2
TW
182#ifdef CONFIG_TEGRA_MMC
183#undef CONFIG_TEGRA_MMC
12b7b70c
AM
184#endif
185#ifdef CONFIG_CMD_MMC
186#undef CONFIG_CMD_MMC
187#endif
188
189/* remove partitions/filesystems */
190#ifdef CONFIG_DOS_PARTITION
191#undef CONFIG_DOS_PARTITION
192#endif
193#ifdef CONFIG_EFI_PARTITION
194#undef CONFIG_EFI_PARTITION
195#endif
3786a942
SW
196#ifdef CONFIG_CMD_FS_GENERIC
197#undef CONFIG_CMD_FS_GENERIC
198#endif
199#ifdef CONFIG_CMD_EXT4
200#undef CONFIG_CMD_EXT4
201#endif
12b7b70c
AM
202#ifdef CONFIG_CMD_EXT2
203#undef CONFIG_CMD_EXT2
204#endif
205#ifdef CONFIG_CMD_FAT
206#undef CONFIG_CMD_FAT
207#endif
3786a942
SW
208#ifdef CONFIG_FS_EXT4
209#undef CONFIG_FS_EXT4
210#endif
211#ifdef CONFIG_FS_FAT
212#undef CONFIG_FS_FAT
213#endif
12b7b70c
AM
214
215/* remove USB */
216#ifdef CONFIG_USB_EHCI
217#undef CONFIG_USB_EHCI
218#endif
219#ifdef CONFIG_USB_EHCI_TEGRA
220#undef CONFIG_USB_EHCI_TEGRA
221#endif
222#ifdef CONFIG_USB_STORAGE
223#undef CONFIG_USB_STORAGE
224#endif
225#ifdef CONFIG_CMD_USB
226#undef CONFIG_CMD_USB
227#endif
228
01ca2865
SW
229/* remove part command support */
230#ifdef CONFIG_PARTITION_UUIDS
231#undef CONFIG_PARTITION_UUIDS
232#endif
233
234#ifdef CONFIG_CMD_PART
235#undef CONFIG_CMD_PART
236#endif
237
12b7b70c
AM
238#endif /* CONFIG_SPL_BUILD */
239
29f3e3f2 240#endif /* __TEGRA_COMMON_POST_H */