Discussion:
[U-Boot] [PATCH 1/2] coreboot: only init usb if necessary
Bin Meng
2018-11-30 04:07:12 UTC
Permalink
From: Thomas RIENOESSL <***@bachmann.info>

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.

Signed-off-by: Thomas RIENOESSL <***@bachmann.info>
Reviewed-by: Bin Meng <***@gmail.com>
Signed-off-by: Bin Meng <***@gmail.com>
---

arch/x86/cpu/coreboot/coreboot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index aaf0d07..4c6ed0b 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -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();
--
2.7.4
Bin Meng
2018-11-30 04:07:13 UTC
Permalink
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.

Signed-off-by: Bin Meng <***@gmail.com>
---

arch/x86/cpu/efi/payload.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c
index c323c7b..225aef7 100644
--- a/arch/x86/cpu/efi/payload.c
+++ b/arch/x86/cpu/efi/payload.c
@@ -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
Christian Gmeiner
2018-11-30 07:43:49 UTC
Permalink
Post by Bin Meng
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(-)
diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c
index c323c7b..225aef7 100644
--- a/arch/x86/cpu/efi/payload.c
+++ b/arch/x86/cpu/efi/payload.c
@@ -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
--
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
Bin Meng
2018-12-10 02:17:06 UTC
Permalink
On Fri, Nov 30, 2018 at 3:43 PM Christian Gmeiner
Post by Bin Meng
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.
applied to u-boot-x86, thanks!
Christian Gmeiner
2018-11-30 07:43:27 UTC
Permalink
Post by Bin Meng
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.
I totally forgot to send an updated version of this patch - thanks for
doing this Bin!

Reviewed-by: Christian Gmeiner <***@gmail.com>
--
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
Bin Meng
2018-12-10 02:17:03 UTC
Permalink
On Fri, Nov 30, 2018 at 3:43 PM Christian Gmeiner
Post by Christian Gmeiner
Post by Bin Meng
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.
I totally forgot to send an updated version of this patch - thanks for
doing this Bin!
applied to u-boot-x86, thanks!

Loading...