X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fconfig_distro_bootcmd.h;h=9ecaf38a3300c3efd68e3f00f353b91c4dbe14f2;hb=63d747477be2f6f948760f2dc9ce0f440c0af45c;hp=7f673448c92d0cb71d894b203e05bc9ba3df9482;hpb=588d269ffe736c3dc03f63c3708d82eb33e670ee;p=u-boot diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 7f673448c9..9ecaf38a33 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -120,7 +120,7 @@ "${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" \ \ @@ -165,7 +165,7 @@ BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_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,9 +185,9 @@ #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 @@ -230,13 +230,58 @@ #endif #if defined(CONFIG_CMD_DHCP) +#if defined(CONFIG_EFI_LOADER) +#if defined(CONFIG_ARM64) +#define BOOTENV_EFI_PXE_ARCH "0xb" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00011:UNDI:003000" +#elif defined(CONFIG_ARM) +#define BOOTENV_EFI_PXE_ARCH "0xa" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00010:UNDI:003000" +#elif defined(CONFIG_X86) +/* Always assume we're running 64bit */ +#define BOOTENV_EFI_PXE_ARCH "0x7" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00007:UNDI:003000" +#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