tegra: flesh out bootcmd
This implements a useful bootcmd for Tegra. The boot order is:
* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP
When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.
When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.
In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-05-16 06:21:00 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2010-2012
|
|
|
|
* NVIDIA Corporation <www.nvidia.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
tegra: flesh out bootcmd
This implements a useful bootcmd for Tegra. The boot order is:
* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP
When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.
When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.
In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-05-16 06:21:00 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-05 00:00:24 +00:00
|
|
|
#ifndef __TEGRA_COMMON_POST_H
|
|
|
|
#define __TEGRA_COMMON_POST_H
|
tegra: flesh out bootcmd
This implements a useful bootcmd for Tegra. The boot order is:
* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP
When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.
When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.
In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-05-16 06:21:00 +00:00
|
|
|
|
2015-09-05 04:03:48 +00:00
|
|
|
/*
|
|
|
|
* Size of malloc() pool
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_USB_FUNCTION_DFU
|
2015-09-05 04:03:49 +00:00
|
|
|
#define CONFIG_SYS_MALLOC_LEN (SZ_4M + \
|
|
|
|
CONFIG_SYS_DFU_DATA_BUF_SIZE + \
|
|
|
|
CONFIG_SYS_DFU_MAX_FILE_SIZE)
|
2015-09-05 04:03:48 +00:00
|
|
|
#else
|
|
|
|
#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
|
|
|
|
|
2014-07-30 22:37:15 +00:00
|
|
|
#ifndef CONFIG_SPL_BUILD
|
|
|
|
#define BOOT_TARGET_DEVICES(func) \
|
|
|
|
func(MMC, mmc, 1) \
|
|
|
|
func(MMC, mmc, 0) \
|
|
|
|
func(USB, usb, 0) \
|
|
|
|
func(PXE, pxe, na) \
|
|
|
|
func(DHCP, dhcp, na)
|
|
|
|
#include <config_distro_bootcmd.h>
|
tegra: flesh out bootcmd
This implements a useful bootcmd for Tegra. The boot order is:
* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP
When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.
When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.
In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-05-16 06:21:00 +00:00
|
|
|
#else
|
2014-07-30 22:37:15 +00:00
|
|
|
#define BOOTENV
|
tegra: flesh out bootcmd
This implements a useful bootcmd for Tegra. The boot order is:
* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP
When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.
When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.
In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-05-16 06:21:00 +00:00
|
|
|
#endif
|
|
|
|
|
2012-10-24 08:32:05 +00:00
|
|
|
#ifdef CONFIG_TEGRA_KEYBOARD
|
|
|
|
#define STDIN_KBD_KBC ",tegra-kbc"
|
|
|
|
#else
|
|
|
|
#define STDIN_KBD_KBC ""
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_USB_KEYBOARD
|
|
|
|
#define STDIN_KBD_USB ",usbkbd"
|
|
|
|
#define CONFIG_SYS_USB_EVENT_POLL
|
|
|
|
#define CONFIG_PREBOOT "usb start"
|
|
|
|
#else
|
|
|
|
#define STDIN_KBD_USB ""
|
|
|
|
#endif
|
|
|
|
|
2015-04-15 03:03:31 +00:00
|
|
|
#ifdef CONFIG_LCD
|
2013-01-22 06:20:07 +00:00
|
|
|
#define STDOUT_LCD ",lcd"
|
|
|
|
#else
|
|
|
|
#define STDOUT_LCD ""
|
|
|
|
#endif
|
|
|
|
|
2016-01-30 23:37:49 +00:00
|
|
|
#ifdef CONFIG_DM_VIDEO
|
|
|
|
#define STDOUT_VIDEO ",vidconsole"
|
|
|
|
#else
|
|
|
|
#define STDOUT_VIDEO ""
|
|
|
|
#endif
|
|
|
|
|
2015-06-05 20:39:32 +00:00
|
|
|
#ifdef CONFIG_CROS_EC_KEYB
|
|
|
|
#define STDOUT_CROS_EC ",cros-ec-keyb"
|
|
|
|
#else
|
|
|
|
#define STDOUT_CROS_EC ""
|
|
|
|
#endif
|
|
|
|
|
2012-10-24 08:32:05 +00:00
|
|
|
#define TEGRA_DEVICE_SETTINGS \
|
2015-06-05 20:39:32 +00:00
|
|
|
"stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB STDOUT_CROS_EC "\0" \
|
2016-01-30 23:37:49 +00:00
|
|
|
"stdout=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
|
|
|
|
"stderr=serial" STDOUT_LCD STDOUT_VIDEO "\0" \
|
2013-01-22 06:20:07 +00:00
|
|
|
""
|
2012-10-24 08:32:05 +00:00
|
|
|
|
2014-01-23 20:17:01 +00:00
|
|
|
#ifndef BOARD_EXTRA_ENV_SETTINGS
|
|
|
|
#define BOARD_EXTRA_ENV_SETTINGS
|
|
|
|
#endif
|
|
|
|
|
ARM: tegra: CONFIG_{SYS_, }LOAD{_, }ADDR rationalization
As best I can tell, CONFIG_SYS_LOAD_ADDR and CONFIG_LOADADDR/$loadaddr
serve essentially the same purpose. Roughly, if a command takes a load
address, then CONFIG_SYS_LOAD_ADDR or $loadaddr (or both) are the default
if the command-line does not specify the address. Different U-Boot
commands are inconsistent re: which of the two default values they use.
As such, set the two to the same value, and move the logic that does this
into tegra-common-post.h so it's not duplicated. A number of other non-
Tegra boards do this too.
The values chosen for these macros are no longer consistent with anything
in MEM_LAYOUT_ENV_SETTINGS. Regain consistency by setting $kernel_addr_r
to CONFIG_LOADADDR. Older scripts tend to use $loadaddr for the default
kernel load address, whereas newer scripts and features tend to use
$kernel_addr_r, along with other variables for other purposes such as
DTBs and initrds. Hence, it's logical they should share the same value.
I had originally thought to make the $kernel_addr_r and CONFIG_LOADADDR
have different values. This would guarantee no interference if a script
used the two variables for different purposes. However, that scenario is
unlikely given the semantic meaning associated with the two variables.
The lowest available value is 0x90200000; see comments for
MEM_LAYOUT_ENV_SETTINGS in tegra30-common-post.h for details. However,
that value would be problematic for a script that loaded a raw zImage to
$loadaddr, since it's more than 128MB beyond the start of SDRAM, which
would interfere with the kernel's CONFIG_AUTO_ZRELADDR. So, let's not do
that.
The only potential fallout I could foresee from this patch is if someone
has a script that loads the kernel to $loadaddr, but some other file
(DTB, initrd) to a hard-coded address that the new value of $loadaddr
interferes with. This seems unlikely. A user should not do that; they
should either hard-code all load addresses, or use U-Boot-supplied
variables for all load addresses. Equally, any fallout due to this change
is trivial to fix; simply modify the load addresses in that script.
Cc: Paul Walmsley <pwalmsley@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Paul Walmsley <pwalmsley@nvidia.com>
Reviewed-by: Simon Glass
Signed-off-by: Tom Warren <twarren@nvidia.com>
2015-04-01 21:40:53 +00:00
|
|
|
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
|
|
|
|
|
2015-06-05 20:39:44 +00:00
|
|
|
#ifndef CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
|
|
|
|
#define CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
|
|
|
|
#endif
|
|
|
|
|
2015-03-04 23:36:00 +00:00
|
|
|
#ifdef CONFIG_ARM64
|
|
|
|
#define FDT_HIGH "ffffffffffffffff"
|
|
|
|
#define INITRD_HIGH "ffffffffffffffff"
|
|
|
|
#else
|
|
|
|
#define FDT_HIGH "ffffffff"
|
|
|
|
#define INITRD_HIGH "ffffffff"
|
|
|
|
#endif
|
|
|
|
|
tegra: flesh out bootcmd
This implements a useful bootcmd for Tegra. The boot order is:
* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP
When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.
When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.
In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-05-16 06:21:00 +00:00
|
|
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
2012-09-05 00:00:24 +00:00
|
|
|
TEGRA_DEVICE_SETTINGS \
|
2012-10-02 09:26:51 +00:00
|
|
|
MEM_LAYOUT_ENV_SETTINGS \
|
2015-03-04 23:36:00 +00:00
|
|
|
"fdt_high=" FDT_HIGH "\0" \
|
|
|
|
"initrd_high=" INITRD_HIGH "\0" \
|
2014-07-30 22:37:15 +00:00
|
|
|
BOOTENV \
|
2015-06-05 20:39:44 +00:00
|
|
|
BOARD_EXTRA_ENV_SETTINGS \
|
|
|
|
CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
|
tegra: flesh out bootcmd
This implements a useful bootcmd for Tegra. The boot order is:
* If USB enabled, USB storage
* Internal MMC (SD card or eMMC)
* If networking is enabled, BOOTP/TFTP
When booting from USB or MMC, the boot script is assumed to be in
partition 1 (although this may be overridden via the rootpart variable),
both ext2 and FAT filesystems are supported, the boot script may exist
in either / or /boot, and the boot script may be named boot.scr.uimg or
boot.scr.
When booting over the network, it is assumed that boot.scr.uimg exists
on the TFTP server. There is less flexibility here since those setting
up network booting are expected to need less hand-holding.
In all cases, it is expected that the initial file loaded is a U-Boot
image containing a script that will load the kernel, load any required
initrd, load any required DTB, and finally bootm the kernel.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-05-16 06:21:00 +00:00
|
|
|
|
2013-03-16 18:58:13 +00:00
|
|
|
#if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI)
|
2014-10-14 05:42:13 +00:00
|
|
|
#define CONFIG_TEGRA_SPI
|
2013-03-16 18:58:07 +00:00
|
|
|
#endif
|
|
|
|
|
2012-08-31 08:30:12 +00:00
|
|
|
/* overrides for SPL build here */
|
|
|
|
#ifdef CONFIG_SPL_BUILD
|
|
|
|
|
2013-05-21 13:45:18 +00:00
|
|
|
#define CONFIG_SKIP_LOWLEVEL_INIT
|
|
|
|
|
2012-08-31 08:30:12 +00:00
|
|
|
/* remove I2C support */
|
2012-10-30 07:28:53 +00:00
|
|
|
#ifdef CONFIG_SYS_I2C_TEGRA
|
|
|
|
#undef CONFIG_SYS_I2C_TEGRA
|
2012-08-31 08:30:12 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_CMD_I2C
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* remove MMC support */
|
|
|
|
#ifdef CONFIG_MMC
|
|
|
|
#undef CONFIG_MMC
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_GENERIC_MMC
|
|
|
|
#undef CONFIG_GENERIC_MMC
|
|
|
|
#endif
|
2012-09-05 00:00:24 +00:00
|
|
|
#ifdef CONFIG_TEGRA_MMC
|
|
|
|
#undef CONFIG_TEGRA_MMC
|
2012-08-31 08:30:12 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_CMD_MMC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* remove partitions/filesystems */
|
|
|
|
#ifdef CONFIG_DOS_PARTITION
|
|
|
|
#undef CONFIG_DOS_PARTITION
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_EFI_PARTITION
|
|
|
|
#undef CONFIG_EFI_PARTITION
|
|
|
|
#endif
|
2012-11-05 13:22:00 +00:00
|
|
|
#ifdef CONFIG_FS_EXT4
|
|
|
|
#undef CONFIG_FS_EXT4
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FS_FAT
|
|
|
|
#undef CONFIG_FS_FAT
|
|
|
|
#endif
|
2012-08-31 08:30:12 +00:00
|
|
|
|
|
|
|
/* remove USB */
|
|
|
|
#ifdef CONFIG_USB_EHCI
|
|
|
|
#undef CONFIG_USB_EHCI
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_USB_EHCI_TEGRA
|
|
|
|
#undef CONFIG_USB_EHCI_TEGRA
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_USB_STORAGE
|
|
|
|
#undef CONFIG_USB_STORAGE
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_CMD_USB
|
|
|
|
#endif
|
|
|
|
|
2012-09-25 13:32:26 +00:00
|
|
|
/* remove part command support */
|
|
|
|
#ifdef CONFIG_PARTITION_UUIDS
|
|
|
|
#undef CONFIG_PARTITION_UUIDS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_CMD_PART
|
|
|
|
#undef CONFIG_CMD_PART
|
|
|
|
#endif
|
|
|
|
|
2012-08-31 08:30:12 +00:00
|
|
|
#endif /* CONFIG_SPL_BUILD */
|
|
|
|
|
2012-09-05 00:00:24 +00:00
|
|
|
#endif /* __TEGRA_COMMON_POST_H */
|