[PATCH v7 2/3] x86: coreboot: Drop USB init on startup

Simon Glass sjg at chromium.org
Thu Sep 21 15:37:44 CEST 2023


This is very annoying as it is quite slow on many machines. Also, U-Boot
has an existing 'preboot' mechanism to enable this feature if desired.

Drop this code so that it is possible to choose whether to init USB or
not.

Use the existing USE_PREBOOT mechanism instead.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v7:
- Add docs about how USB keyboard works on coreboot

Changes in v5:
- Make use of the uSE_PREBOOT mechanism

 arch/x86/cpu/coreboot/Kconfig    | 1 +
 arch/x86/cpu/coreboot/coreboot.c | 4 ----
 doc/board/coreboot/coreboot.rst  | 7 +++++++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/x86/cpu/coreboot/Kconfig b/arch/x86/cpu/coreboot/Kconfig
index b97c27790419..178f8ad18162 100644
--- a/arch/x86/cpu/coreboot/Kconfig
+++ b/arch/x86/cpu/coreboot/Kconfig
@@ -25,6 +25,7 @@ config SYS_COREBOOT
 	imply FS_CBFS
 	imply CBMEM_CONSOLE
 	imply X86_TSC_READ_BASE
+	imply USE_PREBOOT
 	select BINMAN if X86_64
 
 endif
diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index da43d66e95d7..82fe4c71cd27 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -86,10 +86,6 @@ static int last_stage_init(void)
 	if (IS_ENABLED(CONFIG_SPL_BUILD))
 		return 0;
 
-	/* start usb so that usb keyboard can be used as input device */
-	if (IS_ENABLED(CONFIG_USB_KEYBOARD))
-		usb_init();
-
 	board_final_init();
 
 	return 0;
diff --git a/doc/board/coreboot/coreboot.rst b/doc/board/coreboot/coreboot.rst
index 10ef78bb5ada..10a251c2b64f 100644
--- a/doc/board/coreboot/coreboot.rst
+++ b/doc/board/coreboot/coreboot.rst
@@ -85,6 +85,13 @@ build in `$CBDIR`::
 This allows booting and installing various distros, many of which are
 64-bit-only, so cannot work with the 32-bit 'coreboot' build.
 
+USB keyboard
+------------
+
+The `CONFIG_USE_PREBOOT` option is enabled by default, meaning that USB starts
+up just before the command-line starts. This allows user interaction on
+non-laptop devices which use a USB keyboard.
+
 CBFS access
 -----------
 
-- 
2.42.0.515.g380fc7ccd1-goog



More information about the U-Boot mailing list