distro bootcmd: enumerate PCI before network operations
authorStephen Warren <swarren@nvidia.com>
Tue, 26 Jan 2016 18:10:13 +0000 (11:10 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 29 Jan 2016 04:01:23 +0000 (21:01 -0700)
The PCI bus must be enumerated before PCI devices, such as Ethernet
devices, are known to U-Boot. Enhance the distro boot commands to perform
PCI enumeration when needed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
doc/README.distro
include/config_distro_bootcmd.h

index 019903ea7d91fb0a58c9d8c5474782760c81c420..3715c8c3bad7339c41a9da7e1f11fd6d4f902a08 100644 (file)
@@ -349,6 +349,14 @@ boot_net_usb_start:
   device is not attached to USB, and you wish to increase boot speed by
   avoiding unnecessary actions.
 
+boot_net_pci_enum:
+
+  If you want to prevent PCI enumeration by distro boot commands which execute
+  network operations, set the value to something innocuous, e.g. setenv
+  boot_net_pci_enum true. This would be useful if you know your Ethernet
+  device is not attached to PCI, and you wish to increase boot speed by
+  avoiding unnecessary actions.
+
 Interactively booting from a specific device at the u-boot prompt
 =================================================================
 
index c027d8643967c1e393a9831fbaa3250f038e82ab..37c6b438e29f8b7e670b395a77289cd8d8189b6b 100644 (file)
        BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE
 #endif
 
+#if defined(CONFIG_CMD_PCI_ENUM) || 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"
+#else
+#define BOOTENV_RUN_NET_PCI_ENUM
+#define BOOTENV_SHARED_PCI
+#endif
+
 #ifdef CONFIG_CMD_USB
 #define BOOTENV_RUN_NET_USB_START "run boot_net_usb_start; "
 #define BOOTENV_SHARED_USB \
 #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"
 #define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \
        "bootcmd_pxe=" \
                BOOTENV_RUN_NET_USB_START \
+               BOOTENV_RUN_NET_PCI_ENUM \
                "dhcp; " \
                "if pxe get; then " \
                        "pxe boot; " \
 #define BOOTENV \
        BOOTENV_SHARED_HOST \
        BOOTENV_SHARED_MMC \
+       BOOTENV_SHARED_PCI \
        BOOTENV_SHARED_USB \
        BOOTENV_SHARED_SATA \
        BOOTENV_SHARED_SCSI \