blob: 7cb8d64e44001c4dbc26037668ad3c8f9b44fa18 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stephen Warrende17c292012-05-16 06:21:00 +00002/*
3 * (C) Copyright 2010-2012
4 * NVIDIA Corporation <www.nvidia.com>
Stephen Warrende17c292012-05-16 06:21:00 +00005 */
6
Tom Warren22562a42012-09-04 17:00:24 -07007#ifndef __TEGRA_COMMON_POST_H
8#define __TEGRA_COMMON_POST_H
Stephen Warrende17c292012-05-16 06:21:00 +00009
Stephen Warren9d84fff2015-09-04 22:03:48 -060010#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
Stephen Warren9d84fff2015-09-04 22:03:48 -060011
Stephen Warren5c30d752014-07-30 16:37:15 -060012#ifndef CONFIG_SPL_BUILD
Tom Rinib4ab8a02021-07-09 10:11:54 -040013
14#if CONFIG_IS_ENABLED(CMD_USB)
15# define BOOT_TARGET_USB(func) func(USB, usb, 0)
16#else
17# define BOOT_TARGET_USB(func)
18#endif
19
Thierry Redingc3c67822019-04-15 11:32:24 +020020#ifndef BOOT_TARGET_DEVICES
Stephen Warren5c30d752014-07-30 16:37:15 -060021#define BOOT_TARGET_DEVICES(func) \
22 func(MMC, mmc, 1) \
23 func(MMC, mmc, 0) \
Tom Rinib4ab8a02021-07-09 10:11:54 -040024 BOOT_TARGET_USB(func) \
Stephen Warren5c30d752014-07-30 16:37:15 -060025 func(PXE, pxe, na) \
26 func(DHCP, dhcp, na)
Thierry Redingc3c67822019-04-15 11:32:24 +020027#endif
Stephen Warren5c30d752014-07-30 16:37:15 -060028#include <config_distro_bootcmd.h>
Stephen Warrende17c292012-05-16 06:21:00 +000029#else
Stephen Warren5c30d752014-07-30 16:37:15 -060030#define BOOTENV
Stephen Warrende17c292012-05-16 06:21:00 +000031#endif
32
Allen Martin50df8702012-10-24 08:32:05 +000033#ifdef CONFIG_TEGRA_KEYBOARD
34#define STDIN_KBD_KBC ",tegra-kbc"
35#else
36#define STDIN_KBD_KBC ""
37#endif
38
39#ifdef CONFIG_USB_KEYBOARD
40#define STDIN_KBD_USB ",usbkbd"
Allen Martin50df8702012-10-24 08:32:05 +000041#else
42#define STDIN_KBD_USB ""
43#endif
44
Simon Glassea797e52015-04-14 21:03:31 -060045#ifdef CONFIG_LCD
Stephen Warren3f264792013-01-22 06:20:07 +000046#define STDOUT_LCD ",lcd"
47#else
48#define STDOUT_LCD ""
49#endif
50
Simon Glass3e2b2d92016-01-30 16:37:49 -070051#ifdef CONFIG_DM_VIDEO
52#define STDOUT_VIDEO ",vidconsole"
53#else
54#define STDOUT_VIDEO ""
55#endif
56
Simon Glass576e45c2015-06-05 14:39:32 -060057#ifdef CONFIG_CROS_EC_KEYB
58#define STDOUT_CROS_EC ",cros-ec-keyb"
59#else
60#define STDOUT_CROS_EC ""
61#endif
62
Allen Martin50df8702012-10-24 08:32:05 +000063#define TEGRA_DEVICE_SETTINGS \
Simon Glass576e45c2015-06-05 14:39:32 -060064 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB STDOUT_CROS_EC "\0" \
Simon Glass3e2b2d92016-01-30 16:37:49 -070065 "stdout=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
66 "stderr=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
Stephen Warren3f264792013-01-22 06:20:07 +000067 ""
Allen Martin50df8702012-10-24 08:32:05 +000068
Stephen Warren26b02f12014-01-23 13:17:01 -070069#ifndef BOARD_EXTRA_ENV_SETTINGS
70#define BOARD_EXTRA_ENV_SETTINGS
71#endif
72
Simon Glass4a9dd322015-06-05 14:39:44 -060073#ifndef CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
74#define CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
75#endif
76
Tom Warrenab0cc6b2015-03-04 16:36:00 -070077#ifdef CONFIG_ARM64
78#define FDT_HIGH "ffffffffffffffff"
79#define INITRD_HIGH "ffffffffffffffff"
80#else
81#define FDT_HIGH "ffffffff"
82#define INITRD_HIGH "ffffffff"
83#endif
84
Stephen Warrende17c292012-05-16 06:21:00 +000085#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Warren22562a42012-09-04 17:00:24 -070086 TEGRA_DEVICE_SETTINGS \
Stephen Warren35305102012-10-02 09:26:51 +000087 MEM_LAYOUT_ENV_SETTINGS \
Tom Warrenab0cc6b2015-03-04 16:36:00 -070088 "fdt_high=" FDT_HIGH "\0" \
89 "initrd_high=" INITRD_HIGH "\0" \
Stephen Warren5c30d752014-07-30 16:37:15 -060090 BOOTENV \
Simon Glass4a9dd322015-06-05 14:39:44 -060091 BOARD_EXTRA_ENV_SETTINGS \
92 CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
Stephen Warrende17c292012-05-16 06:21:00 +000093
Allen Martin21f5b932013-03-16 18:58:13 +000094#if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
Simon Glass1121b1b2014-10-13 23:42:13 -060095#define CONFIG_TEGRA_SPI
Allen Martinb98691c2013-03-16 18:58:07 +000096#endif
97
Allen Martinc9c98462012-08-31 08:30:12 +000098/* overrides for SPL build here */
99#ifdef CONFIG_SPL_BUILD
100
Allen Martinc9c98462012-08-31 08:30:12 +0000101/* remove USB */
Allen Martinc9c98462012-08-31 08:30:12 +0000102#ifdef CONFIG_USB_EHCI_TEGRA
103#undef CONFIG_USB_EHCI_TEGRA
104#endif
Allen Martinc9c98462012-08-31 08:30:12 +0000105
106#endif /* CONFIG_SPL_BUILD */
107
Tom Warren22562a42012-09-04 17:00:24 -0700108#endif /* __TEGRA_COMMON_POST_H */