]> git.sur5r.net Git - u-boot/commitdiff
x86: efi-x86_payload: Enumerate PCI bus during early boot
authorBin Meng <bmeng.cn@gmail.com>
Sun, 17 Jun 2018 12:57:52 +0000 (05:57 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Sun, 24 Jun 2018 00:56:04 +0000 (08:56 +0800)
The generic efi payload currently does not enumerate the PCI bus,
which means peripherals on the PCI bus are not discovered by their
drivers. This uses board_early_init_r() to do the PCI enumeration.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
board/efi/efi-x86_payload/Kconfig
board/efi/efi-x86_payload/Makefile
board/efi/efi-x86_payload/payload.c [new file with mode: 0644]

index b6e57b9ea7735a4e14ad87fff3a975aeb237a668..08dd0c2edd75348f97a6719ba4914b6bb90b0b8a 100644 (file)
@@ -17,6 +17,7 @@ config SYS_TEXT_BASE
 
 config BOARD_SPECIFIC_OPTIONS # dummy
        def_bool y
+       select BOARD_EARLY_INIT_R
        imply SYS_NS16550
        imply SCSI
        imply SCSI_AHCI
index 6982340f177ce679226de5949f1589da65ccd61a..00ef69534d005e1d4724c3d62e15815b1a5a92a8 100644 (file)
@@ -2,4 +2,4 @@
 #
 # Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
 
-obj-y  += start.o
+obj-y  += start.o payload.o
diff --git a/board/efi/efi-x86_payload/payload.c b/board/efi/efi-x86_payload/payload.c
new file mode 100644 (file)
index 0000000..4eeb49a
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ */
+
+#include <common.h>
+#include <usb.h>
+
+int board_early_init_r(void)
+{
+       /*
+        * Make sure PCI bus is enumerated so that peripherals on the PCI bus
+        * can be discovered by their drivers
+        */
+       pci_init();
+
+       return 0;
+}