blob: 0155b625d442dcc75165a9866b3c8eaa1f0c289e [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stephen Warrenbea26742012-05-16 06:21:00 +00002/*
3 * (C) Copyright 2010-2012
4 * NVIDIA Corporation <www.nvidia.com>
Stephen Warrenbea26742012-05-16 06:21:00 +00005 */
6
Tom Warren29f3e3f2012-09-04 17:00:24 -07007#ifndef __TEGRA_COMMON_POST_H
8#define __TEGRA_COMMON_POST_H
Stephen Warrenbea26742012-05-16 06:21:00 +00009
Stephen Warren99d96962015-09-04 22:03:48 -060010/*
11 * Size of malloc() pool
12 */
Marek Vasutbb4059a2018-02-16 16:41:18 +010013#ifdef CONFIG_DFU_OVER_USB
Stephen Warrenf69d72e2015-09-04 22:03:49 -060014#define CONFIG_SYS_MALLOC_LEN (SZ_4M + \
15 CONFIG_SYS_DFU_DATA_BUF_SIZE + \
16 CONFIG_SYS_DFU_MAX_FILE_SIZE)
Stephen Warren99d96962015-09-04 22:03:48 -060017#else
18#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
19#endif
20
Stephen Warren99d96962015-09-04 22:03:48 -060021#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
Stephen Warren99d96962015-09-04 22:03:48 -060022
Stephen Warren8dca9ff2014-07-30 16:37:15 -060023#ifndef CONFIG_SPL_BUILD
Tom Rini3fa03bc2021-07-09 10:11:54 -040024
25#if CONFIG_IS_ENABLED(CMD_USB)
26# define BOOT_TARGET_USB(func) func(USB, usb, 0)
27#else
28# define BOOT_TARGET_USB(func)
29#endif
30
Thierry Reding147fac62019-04-15 11:32:24 +020031#ifndef BOOT_TARGET_DEVICES
Stephen Warren8dca9ff2014-07-30 16:37:15 -060032#define BOOT_TARGET_DEVICES(func) \
33 func(MMC, mmc, 1) \
34 func(MMC, mmc, 0) \
Tom Rini3fa03bc2021-07-09 10:11:54 -040035 BOOT_TARGET_USB(func) \
Stephen Warren8dca9ff2014-07-30 16:37:15 -060036 func(PXE, pxe, na) \
37 func(DHCP, dhcp, na)
Thierry Reding147fac62019-04-15 11:32:24 +020038#endif
Stephen Warren8dca9ff2014-07-30 16:37:15 -060039#include <config_distro_bootcmd.h>
Stephen Warrenbea26742012-05-16 06:21:00 +000040#else
Stephen Warren8dca9ff2014-07-30 16:37:15 -060041#define BOOTENV
Stephen Warrenbea26742012-05-16 06:21:00 +000042#endif
43
Allen Martin7992bfb2012-10-24 08:32:05 +000044#ifdef CONFIG_TEGRA_KEYBOARD
45#define STDIN_KBD_KBC ",tegra-kbc"
46#else
47#define STDIN_KBD_KBC ""
48#endif
49
50#ifdef CONFIG_USB_KEYBOARD
51#define STDIN_KBD_USB ",usbkbd"
Allen Martin7992bfb2012-10-24 08:32:05 +000052#else
53#define STDIN_KBD_USB ""
54#endif
55
Simon Glassec022ef2015-04-14 21:03:31 -060056#ifdef CONFIG_LCD
Stephen Warrenc35eb562013-01-22 06:20:07 +000057#define STDOUT_LCD ",lcd"
58#else
59#define STDOUT_LCD ""
60#endif
61
Simon Glass135a87e2016-01-30 16:37:49 -070062#ifdef CONFIG_DM_VIDEO
63#define STDOUT_VIDEO ",vidconsole"
64#else
65#define STDOUT_VIDEO ""
66#endif
67
Simon Glassbbe0d4d2015-06-05 14:39:32 -060068#ifdef CONFIG_CROS_EC_KEYB
69#define STDOUT_CROS_EC ",cros-ec-keyb"
70#else
71#define STDOUT_CROS_EC ""
72#endif
73
Allen Martin7992bfb2012-10-24 08:32:05 +000074#define TEGRA_DEVICE_SETTINGS \
Simon Glassbbe0d4d2015-06-05 14:39:32 -060075 "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB STDOUT_CROS_EC "\0" \
Simon Glass135a87e2016-01-30 16:37:49 -070076 "stdout=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
77 "stderr=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
Stephen Warrenc35eb562013-01-22 06:20:07 +000078 ""
Allen Martin7992bfb2012-10-24 08:32:05 +000079
Stephen Warrenb9b53a62014-01-23 13:17:01 -070080#ifndef BOARD_EXTRA_ENV_SETTINGS
81#define BOARD_EXTRA_ENV_SETTINGS
82#endif
83
Simon Glasse379b032015-06-05 14:39:44 -060084#ifndef CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
85#define CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
86#endif
87
Tom Warren7aaa5a62015-03-04 16:36:00 -070088#ifdef CONFIG_ARM64
89#define FDT_HIGH "ffffffffffffffff"
90#define INITRD_HIGH "ffffffffffffffff"
91#else
92#define FDT_HIGH "ffffffff"
93#define INITRD_HIGH "ffffffff"
94#endif
95
Stephen Warrenbea26742012-05-16 06:21:00 +000096#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Warren29f3e3f2012-09-04 17:00:24 -070097 TEGRA_DEVICE_SETTINGS \
Stephen Warren938176a2012-10-02 09:26:51 +000098 MEM_LAYOUT_ENV_SETTINGS \
Tom Warren7aaa5a62015-03-04 16:36:00 -070099 "fdt_high=" FDT_HIGH "\0" \
100 "initrd_high=" INITRD_HIGH "\0" \
Stephen Warren8dca9ff2014-07-30 16:37:15 -0600101 BOOTENV \
Simon Glasse379b032015-06-05 14:39:44 -0600102 BOARD_EXTRA_ENV_SETTINGS \
103 CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
Stephen Warrenbea26742012-05-16 06:21:00 +0000104
Allen Martin77c42e82013-03-16 18:58:13 +0000105#if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
Simon Glassfda6fac2014-10-13 23:42:13 -0600106#define CONFIG_TEGRA_SPI
Allen Martin78f47b72013-03-16 18:58:07 +0000107#endif
108
Allen Martin12b7b702012-08-31 08:30:12 +0000109/* overrides for SPL build here */
110#ifdef CONFIG_SPL_BUILD
111
Allen Martin12b7b702012-08-31 08:30:12 +0000112/* remove USB */
Allen Martin12b7b702012-08-31 08:30:12 +0000113#ifdef CONFIG_USB_EHCI_TEGRA
114#undef CONFIG_USB_EHCI_TEGRA
115#endif
Allen Martin12b7b702012-08-31 08:30:12 +0000116
117#endif /* CONFIG_SPL_BUILD */
118
Tom Warren29f3e3f2012-09-04 17:00:24 -0700119#endif /* __TEGRA_COMMON_POST_H */