blob: 651c4c4935366bf7d5df2b2eac05c6b55d947019 [file] [log] [blame]
Stephen Warrenbea26742012-05-16 06:21:00 +00001/*
2 * (C) Copyright 2010-2012
3 * NVIDIA Corporation <www.nvidia.com>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Stephen Warrenbea26742012-05-16 06:21:00 +00006 */
7
Tom Warren29f3e3f2012-09-04 17:00:24 -07008#ifndef __TEGRA_COMMON_POST_H
9#define __TEGRA_COMMON_POST_H
Stephen Warrenbea26742012-05-16 06:21:00 +000010
Stephen Warren99d96962015-09-04 22:03:48 -060011/*
12 * Size of malloc() pool
13 */
14#ifdef CONFIG_USB_FUNCTION_DFU
Stephen Warrenf69d72e2015-09-04 22:03:49 -060015#define CONFIG_SYS_MALLOC_LEN (SZ_4M + \
16 CONFIG_SYS_DFU_DATA_BUF_SIZE + \
17 CONFIG_SYS_DFU_MAX_FILE_SIZE)
Stephen Warren99d96962015-09-04 22:03:48 -060018#else
19#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
20#endif
21
22#ifndef CONFIG_ARM64
23#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
24#endif
25
Stephen Warren8dca9ff2014-07-30 16:37:15 -060026#ifndef CONFIG_SPL_BUILD
27#define BOOT_TARGET_DEVICES(func) \
28 func(MMC, mmc, 1) \
29 func(MMC, mmc, 0) \
30 func(USB, usb, 0) \
31 func(PXE, pxe, na) \
32 func(DHCP, dhcp, na)
33#include <config_distro_bootcmd.h>
Stephen Warrenbea26742012-05-16 06:21:00 +000034#else
Stephen Warren8dca9ff2014-07-30 16:37:15 -060035#define BOOTENV
Stephen Warrenbea26742012-05-16 06:21:00 +000036#endif
37
Allen Martin7992bfb2012-10-24 08:32:05 +000038#ifdef CONFIG_TEGRA_KEYBOARD
39#define STDIN_KBD_KBC ",tegra-kbc"
40#else
41#define STDIN_KBD_KBC ""
42#endif
43
44#ifdef CONFIG_USB_KEYBOARD
45#define STDIN_KBD_USB ",usbkbd"
46#define CONFIG_SYS_USB_EVENT_POLL
47#define CONFIG_PREBOOT "usb start"
48#else
49#define STDIN_KBD_USB ""
50#endif
51
Simon Glassec022ef2015-04-14 21:03:31 -060052#ifdef CONFIG_LCD
Stephen Warrenc35eb562013-01-22 06:20:07 +000053#define STDOUT_LCD ",lcd"
54#else
55#define STDOUT_LCD ""
56#endif
57
Simon Glassbbe0d4d2015-06-05 14:39:32 -060058#ifdef CONFIG_CROS_EC_KEYB
59#define STDOUT_CROS_EC ",cros-ec-keyb"
60#else
61#define STDOUT_CROS_EC ""
62#endif
63
Allen Martin7992bfb2012-10-24 08:32:05 +000064#define TEGRA_DEVICE_SETTINGS \
Simon Glassbbe0d4d2015-06-05 14:39:32 -060065 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB STDOUT_CROS_EC "\0" \
Stephen Warrenc35eb562013-01-22 06:20:07 +000066 "stdout=serial" STDOUT_LCD "\0" \
67 "stderr=serial" STDOUT_LCD "\0" \
68 ""
Allen Martin7992bfb2012-10-24 08:32:05 +000069
Stephen Warrenb9b53a62014-01-23 13:17:01 -070070#ifndef BOARD_EXTRA_ENV_SETTINGS
71#define BOARD_EXTRA_ENV_SETTINGS
72#endif
73
Stephen Warren48cfca22015-04-01 15:40:53 -060074#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
75
Simon Glasse379b032015-06-05 14:39:44 -060076#ifndef CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
77#define CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
78#endif
79
Tom Warren7aaa5a62015-03-04 16:36:00 -070080#ifdef CONFIG_ARM64
81#define FDT_HIGH "ffffffffffffffff"
82#define INITRD_HIGH "ffffffffffffffff"
83#else
84#define FDT_HIGH "ffffffff"
85#define INITRD_HIGH "ffffffff"
86#endif
87
Stephen Warrenbea26742012-05-16 06:21:00 +000088#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Warren29f3e3f2012-09-04 17:00:24 -070089 TEGRA_DEVICE_SETTINGS \
Stephen Warren938176a2012-10-02 09:26:51 +000090 MEM_LAYOUT_ENV_SETTINGS \
Tom Warren7aaa5a62015-03-04 16:36:00 -070091 "fdt_high=" FDT_HIGH "\0" \
92 "initrd_high=" INITRD_HIGH "\0" \
Stephen Warren8dca9ff2014-07-30 16:37:15 -060093 BOOTENV \
Simon Glasse379b032015-06-05 14:39:44 -060094 BOARD_EXTRA_ENV_SETTINGS \
95 CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
Stephen Warrenbea26742012-05-16 06:21:00 +000096
Allen Martin77c42e82013-03-16 18:58:13 +000097#if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
Simon Glassfda6fac2014-10-13 23:42:13 -060098#define CONFIG_TEGRA_SPI
Allen Martin78f47b72013-03-16 18:58:07 +000099#endif
100
Allen Martin12b7b702012-08-31 08:30:12 +0000101/* overrides for SPL build here */
102#ifdef CONFIG_SPL_BUILD
103
Axel Lin60985bb2013-05-21 13:45:18 +0000104#define CONFIG_SKIP_LOWLEVEL_INIT
105
Allen Martin12b7b702012-08-31 08:30:12 +0000106/* remove I2C support */
Simon Glass1f2ba722012-10-30 07:28:53 +0000107#ifdef CONFIG_SYS_I2C_TEGRA
108#undef CONFIG_SYS_I2C_TEGRA
Allen Martin12b7b702012-08-31 08:30:12 +0000109#endif
110#ifdef CONFIG_CMD_I2C
111#undef CONFIG_CMD_I2C
112#endif
113
114/* remove MMC support */
115#ifdef CONFIG_MMC
116#undef CONFIG_MMC
117#endif
118#ifdef CONFIG_GENERIC_MMC
119#undef CONFIG_GENERIC_MMC
120#endif
Tom Warren29f3e3f2012-09-04 17:00:24 -0700121#ifdef CONFIG_TEGRA_MMC
122#undef CONFIG_TEGRA_MMC
Allen Martin12b7b702012-08-31 08:30:12 +0000123#endif
124#ifdef CONFIG_CMD_MMC
125#undef CONFIG_CMD_MMC
126#endif
127
128/* remove partitions/filesystems */
129#ifdef CONFIG_DOS_PARTITION
130#undef CONFIG_DOS_PARTITION
131#endif
132#ifdef CONFIG_EFI_PARTITION
133#undef CONFIG_EFI_PARTITION
134#endif
Stephen Warren3786a942012-11-05 13:22:00 +0000135#ifdef CONFIG_CMD_FS_GENERIC
136#undef CONFIG_CMD_FS_GENERIC
137#endif
138#ifdef CONFIG_CMD_EXT4
139#undef CONFIG_CMD_EXT4
140#endif
Allen Martin12b7b702012-08-31 08:30:12 +0000141#ifdef CONFIG_CMD_EXT2
142#undef CONFIG_CMD_EXT2
143#endif
144#ifdef CONFIG_CMD_FAT
145#undef CONFIG_CMD_FAT
146#endif
Stephen Warren3786a942012-11-05 13:22:00 +0000147#ifdef CONFIG_FS_EXT4
148#undef CONFIG_FS_EXT4
149#endif
150#ifdef CONFIG_FS_FAT
151#undef CONFIG_FS_FAT
152#endif
Allen Martin12b7b702012-08-31 08:30:12 +0000153
154/* remove USB */
155#ifdef CONFIG_USB_EHCI
156#undef CONFIG_USB_EHCI
157#endif
158#ifdef CONFIG_USB_EHCI_TEGRA
159#undef CONFIG_USB_EHCI_TEGRA
160#endif
161#ifdef CONFIG_USB_STORAGE
162#undef CONFIG_USB_STORAGE
163#endif
164#ifdef CONFIG_CMD_USB
165#undef CONFIG_CMD_USB
166#endif
167
Stephen Warren01ca2862012-09-25 13:32:26 +0000168/* remove part command support */
169#ifdef CONFIG_PARTITION_UUIDS
170#undef CONFIG_PARTITION_UUIDS
171#endif
172
173#ifdef CONFIG_CMD_PART
174#undef CONFIG_CMD_PART
175#endif
176
Allen Martin12b7b702012-08-31 08:30:12 +0000177#endif /* CONFIG_SPL_BUILD */
178
Tom Warren29f3e3f2012-09-04 17:00:24 -0700179#endif /* __TEGRA_COMMON_POST_H */