X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fconfig_distro_bootcmd.h;h=373fee78a99931e55dfc10f8308c92f624e9c0cb;hb=cd83bb371ff3a8a61eb3f65ded762da7daaa9b06;hp=7f673448c92d0cb71d894b203e05bc9ba3df9482;hpb=588d269ffe736c3dc03f63c3708d82eb33e670ee;p=oweals%2Fu-boot.git diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 7f673448c9..373fee78a9 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -1,10 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * (C) Copyright 2014 * NVIDIA Corporation * * Copyright 2014 Red Hat, Inc. - * - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _CONFIG_CMD_DISTRO_BOOTCMD_H @@ -26,10 +25,6 @@ * message that includes some other pre-processor symbols in the text. */ -/* We need the part command */ -#define CONFIG_PARTITION_UUIDS -#define CONFIG_CMD_PART - #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \ "if " #devtypel " dev ${devnum}; then " \ "setenv devtype " #devtypel "; " \ @@ -75,10 +70,15 @@ #ifdef CONFIG_CMD_UBIFS #define BOOTENV_SHARED_UBIFS \ "ubifs_boot=" \ - "if ubi part UBI && ubifsmount ubi${devnum}:boot; then " \ - "setenv devtype ubi; " \ - "setenv bootpart 0; " \ - "run scan_dev_for_boot; " \ + "env exists bootubipart || " \ + "env set bootubipart UBI; " \ + "env exists bootubivol || " \ + "env set bootubivol boot; " \ + "if ubi part ${bootubipart} && " \ + "ubifsmount ubi${devnum}:${bootubivol}; " \ + "then " \ + "setenv devtype ubi; " \ + "run scan_dev_for_boot; " \ "fi\0" #define BOOTENV_DEV_UBIFS BOOTENV_DEV_BLKDEV #define BOOTENV_DEV_NAME_UBIFS BOOTENV_DEV_NAME_BLKDEV @@ -95,6 +95,14 @@ #define BOOTEFI_NAME "bootaa64.efi" #elif defined(CONFIG_ARM) #define BOOTEFI_NAME "bootarm.efi" +#elif defined(CONFIG_X86_RUN_32BIT) +#define BOOTEFI_NAME "bootia32.efi" +#elif defined(CONFIG_X86_RUN_64BIT) +#define BOOTEFI_NAME "bootx64.efi" +#elif defined(CONFIG_CPU_RISCV_32) +#define BOOTEFI_NAME "bootriscv32.efi" +#elif defined(CONFIG_CPU_RISCV_64) +#define BOOTEFI_NAME "bootriscv64.efi" #endif #endif @@ -116,11 +124,16 @@ #define BOOTENV_SHARED_EFI \ "boot_efi_binary=" \ + "if fdt addr ${fdt_addr_r}; then " \ + "bootefi bootmgr ${fdt_addr_r};" \ + "else " \ + "bootefi bootmgr ${fdtcontroladdr};" \ + "fi;" \ "load ${devtype} ${devnum}:${distro_bootpart} " \ "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \ "if fdt addr ${fdt_addr_r}; then " \ "bootefi ${kernel_addr_r} ${fdt_addr_r};" \ - "else" \ + "else " \ "bootefi ${kernel_addr_r} ${fdtcontroladdr};" \ "fi\0" \ \ @@ -153,19 +166,19 @@ #define SCAN_DEV_FOR_EFI #endif -#ifdef CONFIG_CMD_SATA +#ifdef CONFIG_SATA #define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata) #define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV #define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV #else #define BOOTENV_SHARED_SATA #define BOOTENV_DEV_SATA \ - BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA + BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_SATA #define BOOTENV_DEV_NAME_SATA \ - BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA + BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_SATA #endif -#ifdef CONFIG_CMD_SCSI +#ifdef CONFIG_SCSI #define BOOTENV_RUN_SCSI_INIT "run scsi_init; " #define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; " #define BOOTENV_SHARED_SCSI \ @@ -185,24 +198,24 @@ #define BOOTENV_SET_SCSI_NEED_INIT #define BOOTENV_SHARED_SCSI #define BOOTENV_DEV_SCSI \ - BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI + BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI #define BOOTENV_DEV_NAME_SCSI \ - BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI + BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI #endif -#ifdef CONFIG_CMD_IDE +#ifdef CONFIG_IDE #define BOOTENV_SHARED_IDE BOOTENV_SHARED_BLKDEV(ide) #define BOOTENV_DEV_IDE BOOTENV_DEV_BLKDEV #define BOOTENV_DEV_NAME_IDE BOOTENV_DEV_NAME_BLKDEV #else #define BOOTENV_SHARED_IDE #define BOOTENV_DEV_IDE \ - BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE + BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_IDE #define BOOTENV_DEV_NAME_IDE \ - BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE + BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_IDE #endif -#if defined(CONFIG_CMD_PCI_ENUM) || defined(CONFIG_DM_PCI) +#if defined(CONFIG_DM_PCI) #define BOOTENV_RUN_NET_PCI_ENUM "run boot_net_pci_enum; " #define BOOTENV_SHARED_PCI \ "boot_net_pci_enum=pci enum\0" @@ -230,13 +243,69 @@ #endif #if defined(CONFIG_CMD_DHCP) +#if defined(CONFIG_EFI_LOADER) +/* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */ +#if defined(CONFIG_ARM64) || defined(__aarch64__) +#define BOOTENV_EFI_PXE_ARCH "0xb" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00011:UNDI:003000" +#elif defined(CONFIG_ARM) || defined(__arm__) +#define BOOTENV_EFI_PXE_ARCH "0xa" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00010:UNDI:003000" +#elif defined(CONFIG_X86) || defined(__x86_64__) +#define BOOTENV_EFI_PXE_ARCH "0x7" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00007:UNDI:003000" +#elif defined(__i386__) +#define BOOTENV_EFI_PXE_ARCH "0x6" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00006:UNDI:003000" +#elif defined(CONFIG_CPU_RISCV_32) || ((defined(__riscv) && __riscv_xlen == 32)) +#define BOOTENV_EFI_PXE_ARCH "0x19" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00025:UNDI:003000" +#elif defined(CONFIG_CPU_RISCV_64) || ((defined(__riscv) && __riscv_xlen == 64)) +#define BOOTENV_EFI_PXE_ARCH "0x1b" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00027:UNDI:003000" +#elif defined(CONFIG_SANDBOX) +# error "sandbox EFI support is only supported on ARM and x86" +#else +#error Please specify an EFI client identifier +#endif + +/* + * Ask the dhcp server for an EFI binary. If we get one, check for a + * device tree in the same folder. Then boot everything. If the file was + * not an EFI binary, we just return from the bootefi command and continue. + */ +#define BOOTENV_EFI_RUN_DHCP \ + "setenv efi_fdtfile ${fdtfile}; " \ + BOOTENV_EFI_SET_FDTFILE_FALLBACK \ + "setenv efi_old_vci ${bootp_vci};" \ + "setenv efi_old_arch ${bootp_arch};" \ + "setenv bootp_vci " BOOTENV_EFI_PXE_VCI ";" \ + "setenv bootp_arch " BOOTENV_EFI_PXE_ARCH ";" \ + "if dhcp ${kernel_addr_r}; then " \ + "tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};" \ + "if fdt addr ${fdt_addr_r}; then " \ + "bootefi ${kernel_addr_r} ${fdt_addr_r}; " \ + "else " \ + "bootefi ${kernel_addr_r} ${fdtcontroladdr};" \ + "fi;" \ + "fi;" \ + "setenv bootp_vci ${efi_old_vci};" \ + "setenv bootp_arch ${efi_old_arch};" \ + "setenv efi_fdtfile;" \ + "setenv efi_old_arch;" \ + "setenv efi_old_vci;" +#else +#define BOOTENV_EFI_RUN_DHCP +#endif #define BOOTENV_DEV_DHCP(devtypeu, devtypel, instance) \ "bootcmd_dhcp=" \ BOOTENV_RUN_NET_USB_START \ BOOTENV_RUN_NET_PCI_ENUM \ "if dhcp ${scriptaddr} ${boot_script_dhcp}; then " \ "source ${scriptaddr}; " \ - "fi\0" + "fi;" \ + BOOTENV_EFI_RUN_DHCP \ + "\0" #define BOOTENV_DEV_NAME_DHCP(devtypeu, devtypel, instance) \ "dhcp " #else