blob: dd72e5b4db6533e032d0a02cec5bb7be14b8473f [file] [log] [blame]
Stephen Warrende17c292012-05-16 06:21:00 +00001/*
2 * (C) Copyright 2010-2012
3 * NVIDIA Corporation <www.nvidia.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Stephen Warrende17c292012-05-16 06:21:00 +00006 */
7
Tom Warren22562a42012-09-04 17:00:24 -07008#ifndef __TEGRA_COMMON_POST_H
9#define __TEGRA_COMMON_POST_H
Stephen Warrende17c292012-05-16 06:21:00 +000010
Stephen Warren9d84fff2015-09-04 22:03:48 -060011/*
12 * Size of malloc() pool
13 */
14#ifdef CONFIG_USB_FUNCTION_DFU
Stephen Warren8dc8f332015-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 Warren9d84fff2015-09-04 22:03:48 -060018#else
19#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
20#endif
21
Stephen Warren9d84fff2015-09-04 22:03:48 -060022#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
Stephen Warren9d84fff2015-09-04 22:03:48 -060023
Stephen Warren5c30d752014-07-30 16:37:15 -060024#ifndef CONFIG_SPL_BUILD
25#define BOOT_TARGET_DEVICES(func) \
26 func(MMC, mmc, 1) \
27 func(MMC, mmc, 0) \
28 func(USB, usb, 0) \
29 func(PXE, pxe, na) \
30 func(DHCP, dhcp, na)
31#include <config_distro_bootcmd.h>
Stephen Warrende17c292012-05-16 06:21:00 +000032#else
Stephen Warren5c30d752014-07-30 16:37:15 -060033#define BOOTENV
Stephen Warrende17c292012-05-16 06:21:00 +000034#endif
35
Allen Martin50df8702012-10-24 08:32:05 +000036#ifdef CONFIG_TEGRA_KEYBOARD
37#define STDIN_KBD_KBC ",tegra-kbc"
38#else
39#define STDIN_KBD_KBC ""
40#endif
41
42#ifdef CONFIG_USB_KEYBOARD
43#define STDIN_KBD_USB ",usbkbd"
44#define CONFIG_SYS_USB_EVENT_POLL
45#define CONFIG_PREBOOT "usb start"
46#else
47#define STDIN_KBD_USB ""
48#endif
49
Simon Glassea797e52015-04-14 21:03:31 -060050#ifdef CONFIG_LCD
Stephen Warren3f264792013-01-22 06:20:07 +000051#define STDOUT_LCD ",lcd"
52#else
53#define STDOUT_LCD ""
54#endif
55
Simon Glass3e2b2d92016-01-30 16:37:49 -070056#ifdef CONFIG_DM_VIDEO
57#define STDOUT_VIDEO ",vidconsole"
58#else
59#define STDOUT_VIDEO ""
60#endif
61
Simon Glass576e45c2015-06-05 14:39:32 -060062#ifdef CONFIG_CROS_EC_KEYB
63#define STDOUT_CROS_EC ",cros-ec-keyb"
64#else
65#define STDOUT_CROS_EC ""
66#endif
67
Allen Martin50df8702012-10-24 08:32:05 +000068#define TEGRA_DEVICE_SETTINGS \
Simon Glass576e45c2015-06-05 14:39:32 -060069 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB STDOUT_CROS_EC "\0" \
Simon Glass3e2b2d92016-01-30 16:37:49 -070070 "stdout=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
71 "stderr=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
Stephen Warren3f264792013-01-22 06:20:07 +000072 ""
Allen Martin50df8702012-10-24 08:32:05 +000073
Stephen Warren26b02f12014-01-23 13:17:01 -070074#ifndef BOARD_EXTRA_ENV_SETTINGS
75#define BOARD_EXTRA_ENV_SETTINGS
76#endif
77
Stephen Warrenf61f1292015-04-01 15:40:53 -060078#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
79
Simon Glass4a9dd322015-06-05 14:39:44 -060080#ifndef CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
81#define CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
82#endif
83
Tom Warrenab0cc6b2015-03-04 16:36:00 -070084#ifdef CONFIG_ARM64
85#define FDT_HIGH "ffffffffffffffff"
86#define INITRD_HIGH "ffffffffffffffff"
87#else
88#define FDT_HIGH "ffffffff"
89#define INITRD_HIGH "ffffffff"
90#endif
91
Stephen Warrende17c292012-05-16 06:21:00 +000092#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Warren22562a42012-09-04 17:00:24 -070093 TEGRA_DEVICE_SETTINGS \
Stephen Warren35305102012-10-02 09:26:51 +000094 MEM_LAYOUT_ENV_SETTINGS \
Tom Warrenab0cc6b2015-03-04 16:36:00 -070095 "fdt_high=" FDT_HIGH "\0" \
96 "initrd_high=" INITRD_HIGH "\0" \
Stephen Warren5c30d752014-07-30 16:37:15 -060097 BOOTENV \
Simon Glass4a9dd322015-06-05 14:39:44 -060098 BOARD_EXTRA_ENV_SETTINGS \
99 CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
Stephen Warrende17c292012-05-16 06:21:00 +0000100
Allen Martin21f5b932013-03-16 18:58:13 +0000101#if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
Simon Glass1121b1b2014-10-13 23:42:13 -0600102#define CONFIG_TEGRA_SPI
Allen Martinb98691c2013-03-16 18:58:07 +0000103#endif
104
Allen Martinc9c98462012-08-31 08:30:12 +0000105/* overrides for SPL build here */
106#ifdef CONFIG_SPL_BUILD
107
Simon Glass8e842442017-05-31 17:57:21 -0600108#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
Axel Lin53e512a2013-05-21 13:45:18 +0000109
Allen Martinc9c98462012-08-31 08:30:12 +0000110/* remove I2C support */
Simon Glass026fefb2012-10-30 07:28:53 +0000111#ifdef CONFIG_SYS_I2C_TEGRA
112#undef CONFIG_SYS_I2C_TEGRA
Allen Martinc9c98462012-08-31 08:30:12 +0000113#endif
114#ifdef CONFIG_CMD_I2C
Allen Martinc9c98462012-08-31 08:30:12 +0000115#endif
116
Allen Martinc9c98462012-08-31 08:30:12 +0000117/* remove partitions/filesystems */
Stephen Warren480860c2012-11-05 13:22:00 +0000118#ifdef CONFIG_FS_EXT4
119#undef CONFIG_FS_EXT4
120#endif
Allen Martinc9c98462012-08-31 08:30:12 +0000121
122/* remove USB */
Allen Martinc9c98462012-08-31 08:30:12 +0000123#ifdef CONFIG_USB_EHCI_TEGRA
124#undef CONFIG_USB_EHCI_TEGRA
125#endif
Allen Martinc9c98462012-08-31 08:30:12 +0000126#ifdef CONFIG_CMD_USB
Allen Martinc9c98462012-08-31 08:30:12 +0000127#endif
128
129#endif /* CONFIG_SPL_BUILD */
130
Tom Warren22562a42012-09-04 17:00:24 -0700131#endif /* __TEGRA_COMMON_POST_H */