12a43201aSDennis Gilmore /* 22a43201aSDennis Gilmore * (C) Copyright 2014 32a43201aSDennis Gilmore * NVIDIA Corporation <www.nvidia.com> 42a43201aSDennis Gilmore * 52a43201aSDennis Gilmore * Copyright 2014 Red Hat, Inc. 62a43201aSDennis Gilmore * 72a43201aSDennis Gilmore * SPDX-License-Identifier: GPL-2.0+ 82a43201aSDennis Gilmore */ 92a43201aSDennis Gilmore 102a43201aSDennis Gilmore #ifndef _CONFIG_CMD_DISTRO_BOOTCMD_H 112a43201aSDennis Gilmore #define _CONFIG_CMD_DISTRO_BOOTCMD_H 122a43201aSDennis Gilmore 1390b7caafSStephen Warren /* 1490b7caafSStephen Warren * A note on error handling: It is possible for BOOT_TARGET_DEVICES to 1590b7caafSStephen Warren * reference a device that is not enabled in the U-Boot configuration, e.g. 1690b7caafSStephen Warren * it may include MMC in the list without CONFIG_CMD_MMC being enabled. Given 1790b7caafSStephen Warren * that BOOT_TARGET_DEVICES is a macro that's expanded by the C pre-processor 1890b7caafSStephen Warren * at compile time, it's not possible to detect and report such problems via 1990b7caafSStephen Warren * a simple #ifdef/#error combination. Still, the code needs to report errors. 2090b7caafSStephen Warren * The best way I've found to do this is to make BOOT_TARGET_DEVICES expand to 2190b7caafSStephen Warren * reference a non-existent symbol, and have the name of that symbol encode 2290b7caafSStephen Warren * the error message. Consequently, this file contains references to e.g. 2390b7caafSStephen Warren * BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC. Given the 2490b7caafSStephen Warren * prevalence of capitals here, this looks like a pre-processor macro and 2590b7caafSStephen Warren * hence seems like it should be all capitals, but it's really an error 2690b7caafSStephen Warren * message that includes some other pre-processor symbols in the text. 2790b7caafSStephen Warren */ 2890b7caafSStephen Warren 29af21f2fbSHans de Goede /* We need the part command */ 30af21f2fbSHans de Goede #define CONFIG_PARTITION_UUIDS 31af21f2fbSHans de Goede #define CONFIG_CMD_PART 32af21f2fbSHans de Goede 332a43201aSDennis Gilmore #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \ 342a43201aSDennis Gilmore "if " #devtypel " dev ${devnum}; then " \ 352a43201aSDennis Gilmore "setenv devtype " #devtypel "; " \ 36735b1cfeSSjoerd Simons "run scan_dev_for_boot_part; " \ 372a43201aSDennis Gilmore "fi\0" 382a43201aSDennis Gilmore 392a43201aSDennis Gilmore #define BOOTENV_SHARED_BLKDEV(devtypel) \ 402a43201aSDennis Gilmore #devtypel "_boot=" \ 412a43201aSDennis Gilmore BOOTENV_SHARED_BLKDEV_BODY(devtypel) 422a43201aSDennis Gilmore 432a43201aSDennis Gilmore #define BOOTENV_DEV_BLKDEV(devtypeu, devtypel, instance) \ 442a43201aSDennis Gilmore "bootcmd_" #devtypel #instance "=" \ 452a43201aSDennis Gilmore "setenv devnum " #instance "; " \ 462a43201aSDennis Gilmore "run " #devtypel "_boot\0" 472a43201aSDennis Gilmore 482a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \ 492a43201aSDennis Gilmore #devtypel #instance " " 502a43201aSDennis Gilmore 51d0bce0d1SSjoerd Simons #ifdef CONFIG_SANDBOX 52d0bce0d1SSjoerd Simons #define BOOTENV_SHARED_HOST BOOTENV_SHARED_BLKDEV(host) 53d0bce0d1SSjoerd Simons #define BOOTENV_DEV_HOST BOOTENV_DEV_BLKDEV 54d0bce0d1SSjoerd Simons #define BOOTENV_DEV_NAME_HOST BOOTENV_DEV_NAME_BLKDEV 55d0bce0d1SSjoerd Simons #else 56d0bce0d1SSjoerd Simons #define BOOTENV_SHARED_HOST 57d0bce0d1SSjoerd Simons #define BOOTENV_DEV_HOST \ 58d0bce0d1SSjoerd Simons BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX 59d0bce0d1SSjoerd Simons #define BOOTENV_DEV_NAME_HOST \ 60d0bce0d1SSjoerd Simons BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX 61d0bce0d1SSjoerd Simons #endif 62d0bce0d1SSjoerd Simons 632a43201aSDennis Gilmore #ifdef CONFIG_CMD_MMC 642a43201aSDennis Gilmore #define BOOTENV_SHARED_MMC BOOTENV_SHARED_BLKDEV(mmc) 652a43201aSDennis Gilmore #define BOOTENV_DEV_MMC BOOTENV_DEV_BLKDEV 662a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_MMC BOOTENV_DEV_NAME_BLKDEV 672a43201aSDennis Gilmore #else 682a43201aSDennis Gilmore #define BOOTENV_SHARED_MMC 692a43201aSDennis Gilmore #define BOOTENV_DEV_MMC \ 702a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC 712a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_MMC \ 722a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC 732a43201aSDennis Gilmore #endif 742a43201aSDennis Gilmore 7540d21547SRoy Spliet #ifdef CONFIG_CMD_UBIFS 7640d21547SRoy Spliet #define BOOTENV_SHARED_UBIFS \ 7740d21547SRoy Spliet "ubifs_boot=" \ 7840d21547SRoy Spliet "if ubi part UBI && ubifsmount ubi${devnum}:boot; then " \ 7940d21547SRoy Spliet "setenv devtype ubi; " \ 8040d21547SRoy Spliet "setenv bootpart 0; " \ 8140d21547SRoy Spliet "run scan_dev_for_boot; " \ 8240d21547SRoy Spliet "fi\0" 8340d21547SRoy Spliet #define BOOTENV_DEV_UBIFS BOOTENV_DEV_BLKDEV 8440d21547SRoy Spliet #define BOOTENV_DEV_NAME_UBIFS BOOTENV_DEV_NAME_BLKDEV 8540d21547SRoy Spliet #else 8640d21547SRoy Spliet #define BOOTENV_SHARED_UBIFS 8740d21547SRoy Spliet #define BOOTENV_DEV_UBIFS \ 8840d21547SRoy Spliet BOOT_TARGET_DEVICES_references_UBIFS_without_CONFIG_CMD_UBIFS 8940d21547SRoy Spliet #define BOOTENV_DEV_NAME_UBIFS \ 9040d21547SRoy Spliet BOOT_TARGET_DEVICES_references_UBIFS_without_CONFIG_CMD_UBIFS 9140d21547SRoy Spliet #endif 9240d21547SRoy Spliet 9374522c89SAlexander Graf #ifdef CONFIG_EFI_LOADER 9474522c89SAlexander Graf #if defined(CONFIG_ARM64) 9574522c89SAlexander Graf #define BOOTEFI_NAME "bootaa64.efi" 9674522c89SAlexander Graf #elif defined(CONFIG_ARM) 9774522c89SAlexander Graf #define BOOTEFI_NAME "bootarm.efi" 9874522c89SAlexander Graf #endif 9974522c89SAlexander Graf #endif 10074522c89SAlexander Graf 10174522c89SAlexander Graf #ifdef BOOTEFI_NAME 102ff2545abSAlexander Graf #if defined(CONFIG_ARM) && !defined(CONFIG_ARM64) 103ff2545abSAlexander Graf /* 104ff2545abSAlexander Graf * On 32bit ARM systems there is a reasonable number of systems that follow 105ff2545abSAlexander Graf * the $soc-$board$boardver.dtb name scheme for their device trees. Use that 106ff2545abSAlexander Graf * scheme if we don't have an explicit fdtfile variable. 107ff2545abSAlexander Graf */ 108ff2545abSAlexander Graf #define BOOTENV_EFI_SET_FDTFILE_FALLBACK \ 109ff2545abSAlexander Graf "if test -z \"${fdtfile}\" -a -n \"${soc}\"; then " \ 110ff2545abSAlexander Graf "setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; " \ 111ff2545abSAlexander Graf "fi; " 112ff2545abSAlexander Graf #else 113ff2545abSAlexander Graf #define BOOTENV_EFI_SET_FDTFILE_FALLBACK 114ff2545abSAlexander Graf #endif 115ff2545abSAlexander Graf 116ff2545abSAlexander Graf 11774522c89SAlexander Graf #define BOOTENV_SHARED_EFI \ 11874522c89SAlexander Graf "boot_efi_binary=" \ 11974522c89SAlexander Graf "load ${devtype} ${devnum}:${distro_bootpart} " \ 12074522c89SAlexander Graf "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \ 1211c39809bSAlexander Graf "if fdt addr ${fdt_addr_r}; then " \ 1221c39809bSAlexander Graf "bootefi ${kernel_addr_r} ${fdt_addr_r};" \ 1231c39809bSAlexander Graf "else" \ 1241c39809bSAlexander Graf "bootefi ${kernel_addr_r} ${fdtcontroladdr};" \ 1251c39809bSAlexander Graf "fi\0" \ 12674522c89SAlexander Graf \ 12774522c89SAlexander Graf "load_efi_dtb=" \ 12874522c89SAlexander Graf "load ${devtype} ${devnum}:${distro_bootpart} " \ 129ff2545abSAlexander Graf "${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \ 13074522c89SAlexander Graf \ 13174522c89SAlexander Graf "efi_dtb_prefixes=/ /dtb/ /dtb/current/\0" \ 13274522c89SAlexander Graf "scan_dev_for_efi=" \ 133ff2545abSAlexander Graf "setenv efi_fdtfile ${fdtfile}; " \ 134ff2545abSAlexander Graf BOOTENV_EFI_SET_FDTFILE_FALLBACK \ 13574522c89SAlexander Graf "for prefix in ${efi_dtb_prefixes}; do " \ 13674522c89SAlexander Graf "if test -e ${devtype} " \ 13774522c89SAlexander Graf "${devnum}:${distro_bootpart} " \ 138ff2545abSAlexander Graf "${prefix}${efi_fdtfile}; then " \ 13974522c89SAlexander Graf "run load_efi_dtb; " \ 14074522c89SAlexander Graf "fi;" \ 14174522c89SAlexander Graf "done;" \ 14274522c89SAlexander Graf "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ 14374522c89SAlexander Graf "efi/boot/"BOOTEFI_NAME"; then " \ 14474522c89SAlexander Graf "echo Found EFI removable media binary " \ 14574522c89SAlexander Graf "efi/boot/"BOOTEFI_NAME"; " \ 14674522c89SAlexander Graf "run boot_efi_binary; " \ 14774522c89SAlexander Graf "echo EFI LOAD FAILED: continuing...; " \ 148ff2545abSAlexander Graf "fi; " \ 149ff2545abSAlexander Graf "setenv efi_fdtfile\0" 15074522c89SAlexander Graf #define SCAN_DEV_FOR_EFI "run scan_dev_for_efi;" 15174522c89SAlexander Graf #else 15274522c89SAlexander Graf #define BOOTENV_SHARED_EFI 15374522c89SAlexander Graf #define SCAN_DEV_FOR_EFI 15474522c89SAlexander Graf #endif 15574522c89SAlexander Graf 1562a43201aSDennis Gilmore #ifdef CONFIG_CMD_SATA 1572a43201aSDennis Gilmore #define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata) 1582a43201aSDennis Gilmore #define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV 1592a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV 1602a43201aSDennis Gilmore #else 1612a43201aSDennis Gilmore #define BOOTENV_SHARED_SATA 1622a43201aSDennis Gilmore #define BOOTENV_DEV_SATA \ 1632a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA 1642a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_SATA \ 1652a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA 1662a43201aSDennis Gilmore #endif 1672a43201aSDennis Gilmore 168*c649e3c9SSimon Glass #ifdef CONFIG_SCSI 169a03bdaa1SHans de Goede #define BOOTENV_RUN_SCSI_INIT "run scsi_init; " 170a03bdaa1SHans de Goede #define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; " 171a03bdaa1SHans de Goede #define BOOTENV_SHARED_SCSI \ 172a03bdaa1SHans de Goede "scsi_init=" \ 173a03bdaa1SHans de Goede "if ${scsi_need_init}; then " \ 174a03bdaa1SHans de Goede "setenv scsi_need_init false; " \ 175a03bdaa1SHans de Goede "scsi scan; " \ 176a03bdaa1SHans de Goede "fi\0" \ 177a03bdaa1SHans de Goede \ 178a03bdaa1SHans de Goede "scsi_boot=" \ 179a03bdaa1SHans de Goede BOOTENV_RUN_SCSI_INIT \ 180a03bdaa1SHans de Goede BOOTENV_SHARED_BLKDEV_BODY(scsi) 1812a43201aSDennis Gilmore #define BOOTENV_DEV_SCSI BOOTENV_DEV_BLKDEV 1822a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_SCSI BOOTENV_DEV_NAME_BLKDEV 1832a43201aSDennis Gilmore #else 184a03bdaa1SHans de Goede #define BOOTENV_RUN_SCSI_INIT 185a03bdaa1SHans de Goede #define BOOTENV_SET_SCSI_NEED_INIT 1862a43201aSDennis Gilmore #define BOOTENV_SHARED_SCSI 1872a43201aSDennis Gilmore #define BOOTENV_DEV_SCSI \ 188*c649e3c9SSimon Glass BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI 1892a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_SCSI \ 190*c649e3c9SSimon Glass BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI 1912a43201aSDennis Gilmore #endif 1922a43201aSDennis Gilmore 1932a43201aSDennis Gilmore #ifdef CONFIG_CMD_IDE 1942a43201aSDennis Gilmore #define BOOTENV_SHARED_IDE BOOTENV_SHARED_BLKDEV(ide) 1952a43201aSDennis Gilmore #define BOOTENV_DEV_IDE BOOTENV_DEV_BLKDEV 1962a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_IDE BOOTENV_DEV_NAME_BLKDEV 1972a43201aSDennis Gilmore #else 1982a43201aSDennis Gilmore #define BOOTENV_SHARED_IDE 1992a43201aSDennis Gilmore #define BOOTENV_DEV_IDE \ 2002a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE 2012a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_IDE \ 2022a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE 2032a43201aSDennis Gilmore #endif 2042a43201aSDennis Gilmore 205986691fbSStephen Warren #if defined(CONFIG_CMD_PCI_ENUM) || defined(CONFIG_DM_PCI) 206986691fbSStephen Warren #define BOOTENV_RUN_NET_PCI_ENUM "run boot_net_pci_enum; " 207986691fbSStephen Warren #define BOOTENV_SHARED_PCI \ 208986691fbSStephen Warren "boot_net_pci_enum=pci enum\0" 209986691fbSStephen Warren #else 210986691fbSStephen Warren #define BOOTENV_RUN_NET_PCI_ENUM 211986691fbSStephen Warren #define BOOTENV_SHARED_PCI 212986691fbSStephen Warren #endif 213986691fbSStephen Warren 2142a43201aSDennis Gilmore #ifdef CONFIG_CMD_USB 2153483b75dSStephen Warren #define BOOTENV_RUN_NET_USB_START "run boot_net_usb_start; " 2162a43201aSDennis Gilmore #define BOOTENV_SHARED_USB \ 2173483b75dSStephen Warren "boot_net_usb_start=usb start\0" \ 2182a43201aSDennis Gilmore "usb_boot=" \ 2193483b75dSStephen Warren "usb start; " \ 2202a43201aSDennis Gilmore BOOTENV_SHARED_BLKDEV_BODY(usb) 2212a43201aSDennis Gilmore #define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV 2222a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_USB BOOTENV_DEV_NAME_BLKDEV 2232a43201aSDennis Gilmore #else 2243483b75dSStephen Warren #define BOOTENV_RUN_NET_USB_START 2252a43201aSDennis Gilmore #define BOOTENV_SHARED_USB 2262a43201aSDennis Gilmore #define BOOTENV_DEV_USB \ 2272a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB 2282a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_USB \ 2292a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB 2302a43201aSDennis Gilmore #endif 2312a43201aSDennis Gilmore 2322a43201aSDennis Gilmore #if defined(CONFIG_CMD_DHCP) 2332a43201aSDennis Gilmore #define BOOTENV_DEV_DHCP(devtypeu, devtypel, instance) \ 2342a43201aSDennis Gilmore "bootcmd_dhcp=" \ 2353483b75dSStephen Warren BOOTENV_RUN_NET_USB_START \ 236986691fbSStephen Warren BOOTENV_RUN_NET_PCI_ENUM \ 237cc11b392SStephen Warren "if dhcp ${scriptaddr} ${boot_script_dhcp}; then " \ 2382a43201aSDennis Gilmore "source ${scriptaddr}; " \ 2392a43201aSDennis Gilmore "fi\0" 2402a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_DHCP(devtypeu, devtypel, instance) \ 2412a43201aSDennis Gilmore "dhcp " 2422a43201aSDennis Gilmore #else 2432a43201aSDennis Gilmore #define BOOTENV_DEV_DHCP \ 2442a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP 2452a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_DHCP \ 2462a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP 2472a43201aSDennis Gilmore #endif 2482a43201aSDennis Gilmore 2492a43201aSDennis Gilmore #if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE) 2502a43201aSDennis Gilmore #define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \ 2512a43201aSDennis Gilmore "bootcmd_pxe=" \ 2523483b75dSStephen Warren BOOTENV_RUN_NET_USB_START \ 253986691fbSStephen Warren BOOTENV_RUN_NET_PCI_ENUM \ 2542a43201aSDennis Gilmore "dhcp; " \ 2552a43201aSDennis Gilmore "if pxe get; then " \ 2562a43201aSDennis Gilmore "pxe boot; " \ 2572a43201aSDennis Gilmore "fi\0" 2582a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_PXE(devtypeu, devtypel, instance) \ 2592a43201aSDennis Gilmore "pxe " 2602a43201aSDennis Gilmore #else 2612a43201aSDennis Gilmore #define BOOTENV_DEV_PXE \ 2622a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE 2632a43201aSDennis Gilmore #define BOOTENV_DEV_NAME_PXE \ 2642a43201aSDennis Gilmore BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE 2652a43201aSDennis Gilmore #endif 2662a43201aSDennis Gilmore 2672a43201aSDennis Gilmore #define BOOTENV_DEV_NAME(devtypeu, devtypel, instance) \ 2682a43201aSDennis Gilmore BOOTENV_DEV_NAME_##devtypeu(devtypeu, devtypel, instance) 2692a43201aSDennis Gilmore #define BOOTENV_BOOT_TARGETS \ 2702a43201aSDennis Gilmore "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0" 2712a43201aSDennis Gilmore 2722a43201aSDennis Gilmore #define BOOTENV_DEV(devtypeu, devtypel, instance) \ 2732a43201aSDennis Gilmore BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance) 2742a43201aSDennis Gilmore #define BOOTENV \ 275d0bce0d1SSjoerd Simons BOOTENV_SHARED_HOST \ 2762a43201aSDennis Gilmore BOOTENV_SHARED_MMC \ 277986691fbSStephen Warren BOOTENV_SHARED_PCI \ 2782a43201aSDennis Gilmore BOOTENV_SHARED_USB \ 2792a43201aSDennis Gilmore BOOTENV_SHARED_SATA \ 2802a43201aSDennis Gilmore BOOTENV_SHARED_SCSI \ 2812a43201aSDennis Gilmore BOOTENV_SHARED_IDE \ 28240d21547SRoy Spliet BOOTENV_SHARED_UBIFS \ 28374522c89SAlexander Graf BOOTENV_SHARED_EFI \ 2842a43201aSDennis Gilmore "boot_prefixes=/ /boot/\0" \ 2852a43201aSDennis Gilmore "boot_scripts=boot.scr.uimg boot.scr\0" \ 286cc11b392SStephen Warren "boot_script_dhcp=boot.scr.uimg\0" \ 2872a43201aSDennis Gilmore BOOTENV_BOOT_TARGETS \ 2882a43201aSDennis Gilmore \ 2892a43201aSDennis Gilmore "boot_extlinux=" \ 29059d03cb3SSjoerd Simons "sysboot ${devtype} ${devnum}:${distro_bootpart} any " \ 2912a43201aSDennis Gilmore "${scriptaddr} ${prefix}extlinux/extlinux.conf\0" \ 2922a43201aSDennis Gilmore \ 2932a43201aSDennis Gilmore "scan_dev_for_extlinux=" \ 29459d03cb3SSjoerd Simons "if test -e ${devtype} " \ 29559d03cb3SSjoerd Simons "${devnum}:${distro_bootpart} " \ 2962a43201aSDennis Gilmore "${prefix}extlinux/extlinux.conf; then " \ 2972a43201aSDennis Gilmore "echo Found ${prefix}extlinux/extlinux.conf; " \ 2982a43201aSDennis Gilmore "run boot_extlinux; " \ 2992a43201aSDennis Gilmore "echo SCRIPT FAILED: continuing...; " \ 3002a43201aSDennis Gilmore "fi\0" \ 3012a43201aSDennis Gilmore \ 3022a43201aSDennis Gilmore "boot_a_script=" \ 30359d03cb3SSjoerd Simons "load ${devtype} ${devnum}:${distro_bootpart} " \ 3042a43201aSDennis Gilmore "${scriptaddr} ${prefix}${script}; " \ 3052a43201aSDennis Gilmore "source ${scriptaddr}\0" \ 3062a43201aSDennis Gilmore \ 3072a43201aSDennis Gilmore "scan_dev_for_scripts=" \ 3082a43201aSDennis Gilmore "for script in ${boot_scripts}; do " \ 30959d03cb3SSjoerd Simons "if test -e ${devtype} " \ 31059d03cb3SSjoerd Simons "${devnum}:${distro_bootpart} " \ 3112a43201aSDennis Gilmore "${prefix}${script}; then " \ 3122a43201aSDennis Gilmore "echo Found U-Boot script " \ 3132a43201aSDennis Gilmore "${prefix}${script}; " \ 3142a43201aSDennis Gilmore "run boot_a_script; " \ 3152a43201aSDennis Gilmore "echo SCRIPT FAILED: continuing...; " \ 3162a43201aSDennis Gilmore "fi; " \ 3172a43201aSDennis Gilmore "done\0" \ 3182a43201aSDennis Gilmore \ 3192a43201aSDennis Gilmore "scan_dev_for_boot=" \ 32059d03cb3SSjoerd Simons "echo Scanning ${devtype} " \ 32159d03cb3SSjoerd Simons "${devnum}:${distro_bootpart}...; " \ 3222a43201aSDennis Gilmore "for prefix in ${boot_prefixes}; do " \ 3232a43201aSDennis Gilmore "run scan_dev_for_extlinux; " \ 3242a43201aSDennis Gilmore "run scan_dev_for_scripts; " \ 32574522c89SAlexander Graf "done;" \ 32674522c89SAlexander Graf SCAN_DEV_FOR_EFI \ 32774522c89SAlexander Graf "\0" \ 3282a43201aSDennis Gilmore \ 329735b1cfeSSjoerd Simons "scan_dev_for_boot_part=" \ 330f643d929SSjoerd Simons "part list ${devtype} ${devnum} -bootable devplist; " \ 331f643d929SSjoerd Simons "env exists devplist || setenv devplist 1; " \ 33259d03cb3SSjoerd Simons "for distro_bootpart in ${devplist}; do " \ 33359d03cb3SSjoerd Simons "if fstype ${devtype} " \ 33459d03cb3SSjoerd Simons "${devnum}:${distro_bootpart} " \ 335735b1cfeSSjoerd Simons "bootfstype; then " \ 336735b1cfeSSjoerd Simons "run scan_dev_for_boot; " \ 337735b1cfeSSjoerd Simons "fi; " \ 338735b1cfeSSjoerd Simons "done\0" \ 339735b1cfeSSjoerd Simons \ 3402a43201aSDennis Gilmore BOOT_TARGET_DEVICES(BOOTENV_DEV) \ 3412a43201aSDennis Gilmore \ 342453c6cc1SSjoerd Simons "distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT \ 3432a43201aSDennis Gilmore "for target in ${boot_targets}; do " \ 3442a43201aSDennis Gilmore "run bootcmd_${target}; " \ 3452a43201aSDennis Gilmore "done\0" 3462a43201aSDennis Gilmore 347453c6cc1SSjoerd Simons #ifndef CONFIG_BOOTCOMMAND 348453c6cc1SSjoerd Simons #define CONFIG_BOOTCOMMAND "run distro_bootcmd" 349453c6cc1SSjoerd Simons #endif 350453c6cc1SSjoerd Simons 3512a43201aSDennis Gilmore #endif /* _CONFIG_CMD_DISTRO_BOOTCMD_H */ 352