[U-Boot] [RFC PATCH 1/3] add file with a default boot environment based heavily on Stephen Warrens recent tegra work.
Dan Murphy
dmurphy at ti.com
Wed Feb 19 19:44:23 CET 2014
On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
> Signed-off-by: Dennis Gilmore <dennis at ausil.us>
> ---
> include/config_distro_bootcmd.h | 172 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 172 insertions(+)
> create mode 100644 include/config_distro_bootcmd.h
>
> diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
> new file mode 100644
> index 0000000..d32dc12
> --- /dev/null
> +++ b/include/config_distro_bootcmd.h
> @@ -0,0 +1,172 @@
> +/*
> + * (C) Copyright 2014
> + * NVIDIA Corporation <www.nvidia.com>
> + *
> + * Copyright 2014 Red Hat, Inc.
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#ifndef _CONFIG_CMD_DISTRO_BOOTCMD_H
> +#define _CONFIG_CMD_DISTRO_BOOTCMD_H
> +
> +
> +#ifdef CONFIG_CMD_MMC
> +#define BOOTCMDS_MMC \
> + "mmc_boot=" \
> + "setenv devtype mmc; " \
> + "if mmc dev ${devnum}; then " \
> + "run scan_boot; " \
> + "fi\0" \
> + "bootcmd_mmc0=setenv devnum 0; run mmc_boot;\0" \
> + "bootcmd_mmc1=setenv devnum 1; run mmc_boot;\0"
> +#define BOOT_TARGETS_MMC "mmc1 mmc0"
> +#else
> +#define BOOTCMDS_MMC ""
> +#define BOOT_TARGETS_MMC ""
> +#endif
> +
> +#ifdef CONFIG_CMD_USB
> +#define BOOTCMD_INIT_USB "run usb_init; "
> +#define BOOTCMDS_USB \
> + "usb_init=" \
> + "if ${usb_need_init}; then " \
> + "set usb_need_init false; " \
> + "usb start 0; " \
> + "fi\0" \
> + \
> + "usb_boot=" \
> + "setenv devtype usb; " \
> + BOOTCMD_INIT_USB \
> + "if usb dev ${devnum}; then " \
This may have already been highlighted but I don't see where the kernel command line arguments can be set.
If you have the file system on the USB stick won't you need to direct the root to the stick?
Maybe I don't want to have a uEnv.txt file.
This is what I had to do when I did the similar implementation on the TI common file
http://patchwork.ozlabs.org/patch/292851/
> + "run scan_boot; " \
> + "fi\0" \
> + \
> + "bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
> +#define BOOT_TARGETS_USB "usb0"
> +#else
> +#define BOOTCMD_INIT_USB ""
> +#define BOOTCMDS_USB ""
> +#define BOOT_TARGETS_USB ""
> +#endif
> +
> +#ifdef CONFIG_CMD_SATA
> +#define BOOTCMDS_SATA \
> + "sata_boot=" \
> + "setenv devtype sata; " \
> + "if sata dev ${devnum}; then " \
> + "run scan_boot; " \
Same as above
> + "fi\0" \
> + \
> + "bootcmd_sata0=setenv devnum 0; run sata_boot;\0"
> + "bootcmd_sata1=setenv devnum 1; run sata_boot;\0"
> +#define BOOT_TARGETS_USB "sata0 sata1"
> +#else
> +#define BOOTCMDS_SATA ""
> +#define BOOT_TARGETS_SATA ""
> +#endif
> +
> +#ifdef CONFIG_CMD_DHCP
> +#define BOOTCMDS_DHCP \
> + "bootcmd_dhcp=" \
> + BOOTCMD_INIT_USB \
> + "if dhcp ${scriptaddr} boot.scr.uimg; then "\
> + "source ${scriptaddr}; " \
> + "fi\0"
> +#define BOOT_TARGETS_DHCP "dhcp"
> +#else
> +#define BOOTCMDS_DHCP ""
> +#define BOOT_TARGETS_DHCP ""
> +#endif
> +
> +#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
> +#define BOOTCMDS_PXE \
> + "bootcmd_pxe=" \
> + BOOTCMD_INIT_USB \
> + "dhcp; " \
> + "if pxe get; then " \
> + "pxe boot; " \
> + "fi\0"
> +#define BOOT_TARGETS_PXE "pxe"
> +#else
> +#define BOOTCMDS_PXE ""
> +#define BOOT_TARGETS_PXE ""
> +#endif
> +
>
--
------------------
Dan Murphy
More information about the U-Boot
mailing list