[U-Boot] [PATCH 4/5] x86: efi-x86_payload: Enumerate PCI bus during early boot
Bin Meng
bmeng.cn at gmail.com
Sun Jun 17 12:57:52 UTC 2018
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 at gmail.com>
---
board/efi/efi-x86_payload/Kconfig | 1 +
board/efi/efi-x86_payload/Makefile | 2 +-
board/efi/efi-x86_payload/payload.c | 18 ++++++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 board/efi/efi-x86_payload/payload.c
diff --git a/board/efi/efi-x86_payload/Kconfig b/board/efi/efi-x86_payload/Kconfig
index b6e57b9..08dd0c2 100644
--- a/board/efi/efi-x86_payload/Kconfig
+++ b/board/efi/efi-x86_payload/Kconfig
@@ -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
diff --git a/board/efi/efi-x86_payload/Makefile b/board/efi/efi-x86_payload/Makefile
index 6982340..00ef695 100644
--- a/board/efi/efi-x86_payload/Makefile
+++ b/board/efi/efi-x86_payload/Makefile
@@ -2,4 +2,4 @@
#
# Copyright (C) 2018, Bin Meng <bmeng.cn at 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
index 0000000..4eeb49a
--- /dev/null
+++ b/board/efi/efi-x86_payload/payload.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn at 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;
+}
--
2.7.4
More information about the U-Boot
mailing list