1 /*
2  * (C) Copyright 2010-2012
3  * NVIDIA Corporation <www.nvidia.com>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef __TEGRA_COMMON_POST_H
9 #define __TEGRA_COMMON_POST_H
10 
11 #ifndef CONFIG_SPL_BUILD
12 #define BOOT_TARGET_DEVICES(func) \
13 	func(MMC, mmc, 1) \
14 	func(MMC, mmc, 0) \
15 	func(USB, usb, 0) \
16 	func(PXE, pxe, na) \
17 	func(DHCP, dhcp, na)
18 #include <config_distro_bootcmd.h>
19 #else
20 #define BOOTENV
21 #endif
22 
23 #ifdef CONFIG_TEGRA_KEYBOARD
24 #define STDIN_KBD_KBC ",tegra-kbc"
25 #else
26 #define STDIN_KBD_KBC ""
27 #endif
28 
29 #ifdef CONFIG_USB_KEYBOARD
30 #define STDIN_KBD_USB ",usbkbd"
31 #define CONFIG_SYS_USB_EVENT_POLL
32 #define CONFIG_PREBOOT			"usb start"
33 #else
34 #define STDIN_KBD_USB ""
35 #endif
36 
37 #ifdef CONFIG_VIDEO_TEGRA
38 #define STDOUT_LCD ",lcd"
39 #else
40 #define STDOUT_LCD ""
41 #endif
42 
43 #define TEGRA_DEVICE_SETTINGS \
44 	"stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB "\0" \
45 	"stdout=serial" STDOUT_LCD "\0" \
46 	"stderr=serial" STDOUT_LCD "\0" \
47 	""
48 
49 #ifndef BOARD_EXTRA_ENV_SETTINGS
50 #define BOARD_EXTRA_ENV_SETTINGS
51 #endif
52 
53 #define CONFIG_EXTRA_ENV_SETTINGS \
54 	TEGRA_DEVICE_SETTINGS \
55 	MEM_LAYOUT_ENV_SETTINGS \
56 	"fdt_high=ffffffff\0" \
57 	"initrd_high=ffffffff\0" \
58 	BOOTENV \
59 	BOARD_EXTRA_ENV_SETTINGS
60 
61 #if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
62 #define CONFIG_FDT_SPI
63 #endif
64 
65 /* overrides for SPL build here */
66 #ifdef CONFIG_SPL_BUILD
67 
68 #define CONFIG_SKIP_LOWLEVEL_INIT
69 
70 /* remove devicetree support */
71 #ifdef CONFIG_OF_CONTROL
72 #undef CONFIG_OF_CONTROL
73 #endif
74 
75 /* remove I2C support */
76 #ifdef CONFIG_SYS_I2C_TEGRA
77 #undef CONFIG_SYS_I2C_TEGRA
78 #endif
79 #ifdef CONFIG_CMD_I2C
80 #undef CONFIG_CMD_I2C
81 #endif
82 
83 /* remove MMC support */
84 #ifdef CONFIG_MMC
85 #undef CONFIG_MMC
86 #endif
87 #ifdef CONFIG_GENERIC_MMC
88 #undef CONFIG_GENERIC_MMC
89 #endif
90 #ifdef CONFIG_TEGRA_MMC
91 #undef CONFIG_TEGRA_MMC
92 #endif
93 #ifdef CONFIG_CMD_MMC
94 #undef CONFIG_CMD_MMC
95 #endif
96 
97 /* remove partitions/filesystems */
98 #ifdef CONFIG_DOS_PARTITION
99 #undef CONFIG_DOS_PARTITION
100 #endif
101 #ifdef CONFIG_EFI_PARTITION
102 #undef CONFIG_EFI_PARTITION
103 #endif
104 #ifdef CONFIG_CMD_FS_GENERIC
105 #undef CONFIG_CMD_FS_GENERIC
106 #endif
107 #ifdef CONFIG_CMD_EXT4
108 #undef CONFIG_CMD_EXT4
109 #endif
110 #ifdef CONFIG_CMD_EXT2
111 #undef CONFIG_CMD_EXT2
112 #endif
113 #ifdef CONFIG_CMD_FAT
114 #undef CONFIG_CMD_FAT
115 #endif
116 #ifdef CONFIG_FS_EXT4
117 #undef CONFIG_FS_EXT4
118 #endif
119 #ifdef CONFIG_FS_FAT
120 #undef CONFIG_FS_FAT
121 #endif
122 
123 /* remove USB */
124 #ifdef CONFIG_USB_EHCI
125 #undef CONFIG_USB_EHCI
126 #endif
127 #ifdef CONFIG_USB_EHCI_TEGRA
128 #undef CONFIG_USB_EHCI_TEGRA
129 #endif
130 #ifdef CONFIG_USB_STORAGE
131 #undef CONFIG_USB_STORAGE
132 #endif
133 #ifdef CONFIG_CMD_USB
134 #undef CONFIG_CMD_USB
135 #endif
136 
137 /* remove part command support */
138 #ifdef CONFIG_PARTITION_UUIDS
139 #undef CONFIG_PARTITION_UUIDS
140 #endif
141 
142 #ifdef CONFIG_CMD_PART
143 #undef CONFIG_CMD_PART
144 #endif
145 
146 #endif /* CONFIG_SPL_BUILD */
147 
148 #endif /* __TEGRA_COMMON_POST_H */
149