Skip to contentSkip to conversation

coreboot: only init usb if necessary

PATCH New Bin Meng 2 participants 6 messages Nov 30, 2018 – Dec 10, 2018 x86

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/2 coreboot: only init usb if necessary

From: Thomas RIENOESSL <[email protected]>

Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as a coreboot payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards.

---

 arch/x86/cpu/coreboot/coreboot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/cpu/coreboot/coreboot.c +2 -1
index aaf0d07..4c6ed0b 100644
@@ -77,7 +77,8 @@ int last_stage_init(void)
 		timestamp_add_to_bootstage();
 
 	/* start usb so that usb keyboard can be used as input device */
-	usb_init();
+	if (CONFIG_IS_ENABLED(USB_KEYBOARD))
+		usb_init();
 
 	board_final_cleanup();
 
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 efi: payload: only init usb if necessary

Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as an EFI payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards.

---

 arch/x86/cpu/efi/payload.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/cpu/efi/payload.c +2 -1
index c323c7b..225aef7 100644
@@ -166,7 +166,8 @@ int reserve_arch(void)
 int last_stage_init(void)
 {
 	/* start usb so that usb keyboard can be used as input device */
-	usb_init();
+	if (CONFIG_IS_ENABLED(USB_KEYBOARD))
+		usb_init();
 
 	return 0;
 }
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 efi: payload: only init usb if necessary

Am Fr., 30. Nov. 2018 um 05:02 Uhr schrieb Bin Meng <[email protected]>:

Quoted 10 lines

Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as an EFI payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards.

Quoted 22 lines

---

 arch/x86/cpu/efi/payload.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/cpu/efi/payload.c +2 -2
index c323c7b..225aef7 100644
@@ -166,7 +166,8 @@ int reserve_arch(void)
 int last_stage_init(void)
 {
        /* start usb so that usb keyboard can be used as input device */
-       usb_init();
+       if (CONFIG_IS_ENABLED(USB_KEYBOARD))
+               usb_init();
 
        return 0;
 }
--

2.7.4

Signature · 5 lines
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
author
#3 lore raw

PATCH 2/2 efi: payload: only init usb if necessary

Quoted 11 lines · Christian Gmeiner

Am Fr., 30. Nov. 2018 um 05:02 Uhr schrieb Bin Meng <[email protected]>:

Quoted 9 lines

Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as an EFI payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards.

Quoted 3 lines
Quoted 1 line

applied to u-boot-x86, thanks!

#4 lore raw

PATCH 1/2 coreboot: only init usb if necessary

In reply to Bin Meng

Am Fr., 30. Nov. 2018 um 05:02 Uhr schrieb Bin Meng <[email protected]>:

Quoted 11 lines

From: Thomas RIENOESSL <[email protected]>

Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as a coreboot payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards.

Quoted 3 lines

I totally forgot to send an updated version of this patch - thanks for doing this Bin!

Signature · 5 lines
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
author
#5 lore raw

PATCH 1/2 coreboot: only init usb if necessary

Quoted 13 lines · Christian Gmeiner

Am Fr., 30. Nov. 2018 um 05:02 Uhr schrieb Bin Meng <[email protected]>:

Quoted 11 lines

From: Thomas RIENOESSL <[email protected]>

Up until now the call to initialize the USB subsystem was hardcoded for U-Boot running as a coreboot payload. This was used to enable the use of a USB keyboard in the U-Boot shell. However not all boards might need this functionality. As initializing the USB subsystem can take a considerable amount of time (several seconds on some boards), we now initialize the USB subsystem only if U-Boot is configured to use USB keyboards.

Quoted 9 lines
Quoted 3 lines

I totally forgot to send an updated version of this patch - thanks for doing this Bin!

applied to u-boot-x86, thanks!