blob: 743be6bb5682f5c6a468c918ba6bb5f6961d4e94 [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
Stephen Warren99d96962015-09-04 22:03:48 -060022#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
Stephen Warren99d96962015-09-04 22:03:48 -060023
Stephen Warren8dca9ff2014-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 Warrenbea26742012-05-16 06:21:00 +000032#else
Stephen Warren8dca9ff2014-07-30 16:37:15 -060033#define BOOTENV
Stephen Warrenbea26742012-05-16 06:21:00 +000034#endif
35
Allen Martin7992bfb2012-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"
Allen Martin7992bfb2012-10-24 08:32:05 +000044#define CONFIG_PREBOOT "usb start"
45#else
46#define STDIN_KBD_USB ""
47#endif
48
Simon Glassec022ef2015-04-14 21:03:31 -060049#ifdef CONFIG_LCD
Stephen Warrenc35eb562013-01-22 06:20:07 +000050#define STDOUT_LCD ",lcd"
51#else
52#define STDOUT_LCD ""
53#endif
54
Simon Glass135a87e2016-01-30 16:37:49 -070055#ifdef CONFIG_DM_VIDEO
56#define STDOUT_VIDEO ",vidconsole"
57#else
58#define STDOUT_VIDEO ""
59#endif
60
Simon Glassbbe0d4d2015-06-05 14:39:32 -060061#ifdef CONFIG_CROS_EC_KEYB
62#define STDOUT_CROS_EC ",cros-ec-keyb"
63#else
64#define STDOUT_CROS_EC ""
65#endif
66
Allen Martin7992bfb2012-10-24 08:32:05 +000067#define TEGRA_DEVICE_SETTINGS \
Simon Glassbbe0d4d2015-06-05 14:39:32 -060068 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB STDOUT_CROS_EC "\0" \
Simon Glass135a87e2016-01-30 16:37:49 -070069 "stdout=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
70 "stderr=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
Stephen Warrenc35eb562013-01-22 06:20:07 +000071 ""
Allen Martin7992bfb2012-10-24 08:32:05 +000072
Stephen Warrenb9b53a62014-01-23 13:17:01 -070073#ifndef BOARD_EXTRA_ENV_SETTINGS
74#define BOARD_EXTRA_ENV_SETTINGS
75#endif
76
Stephen Warren48cfca22015-04-01 15:40:53 -060077#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
78
Simon Glasse379b032015-06-05 14:39:44 -060079#ifndef CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
80#define CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
81#endif
82
Tom Warren7aaa5a62015-03-04 16:36:00 -070083#ifdef CONFIG_ARM64
84#define FDT_HIGH "ffffffffffffffff"
85#define INITRD_HIGH "ffffffffffffffff"
86#else
87#define FDT_HIGH "ffffffff"
88#define INITRD_HIGH "ffffffff"
89#endif
90
Stephen Warrenbea26742012-05-16 06:21:00 +000091#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Warren29f3e3f2012-09-04 17:00:24 -070092 TEGRA_DEVICE_SETTINGS \
Stephen Warren938176a2012-10-02 09:26:51 +000093 MEM_LAYOUT_ENV_SETTINGS \
Tom Warren7aaa5a62015-03-04 16:36:00 -070094 "fdt_high=" FDT_HIGH "\0" \
95 "initrd_high=" INITRD_HIGH "\0" \
Stephen Warren8dca9ff2014-07-30 16:37:15 -060096 BOOTENV \
Simon Glasse379b032015-06-05 14:39:44 -060097 BOARD_EXTRA_ENV_SETTINGS \
98 CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
Stephen Warrenbea26742012-05-16 06:21:00 +000099
Allen Martin77c42e82013-03-16 18:58:13 +0000100#if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
Simon Glassfda6fac2014-10-13 23:42:13 -0600101#define CONFIG_TEGRA_SPI
Allen Martin78f47b72013-03-16 18:58:07 +0000102#endif
103
Allen Martin12b7b702012-08-31 08:30:12 +0000104/* overrides for SPL build here */
105#ifdef CONFIG_SPL_BUILD
106
Simon Glass06cc85a2017-05-31 17:57:21 -0600107#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
Axel Lin60985bb2013-05-21 13:45:18 +0000108
Allen Martin12b7b702012-08-31 08:30:12 +0000109/* remove I2C support */
Simon Glass1f2ba722012-10-30 07:28:53 +0000110#ifdef CONFIG_SYS_I2C_TEGRA
111#undef CONFIG_SYS_I2C_TEGRA
Allen Martin12b7b702012-08-31 08:30:12 +0000112#endif
113#ifdef CONFIG_CMD_I2C
Allen Martin12b7b702012-08-31 08:30:12 +0000114#endif
115
Allen Martin12b7b702012-08-31 08:30:12 +0000116/* remove partitions/filesystems */
Stephen Warren3786a942012-11-05 13:22:00 +0000117#ifdef CONFIG_FS_EXT4
118#undef CONFIG_FS_EXT4
119#endif
Allen Martin12b7b702012-08-31 08:30:12 +0000120
121/* remove USB */
Allen Martin12b7b702012-08-31 08:30:12 +0000122#ifdef CONFIG_USB_EHCI_TEGRA
123#undef CONFIG_USB_EHCI_TEGRA
124#endif
Allen Martin12b7b702012-08-31 08:30:12 +0000125#ifdef CONFIG_CMD_USB
Allen Martin12b7b702012-08-31 08:30:12 +0000126#endif
127
128#endif /* CONFIG_SPL_BUILD */
129
Tom Warren29f3e3f2012-09-04 17:00:24 -0700130#endif /* __TEGRA_COMMON_POST_H */