From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Sun, 17 Jun 2018 05:57:53 -0700 Subject: [U-Boot] [PATCH 5/5] x86: efi-x86_payload: Enable usb keyboard during boot In-Reply-To: <1529240273-32045-1-git-send-email-bmeng.cn@gmail.com> References: <1529240273-32045-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1529240273-32045-5-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de For boards that don't route serial port pins out, it's quite common to attach a USB keyboard as the input device, along with a monitor. However USB is not automatically started in the generic efi payload codes. This uses a payload specific last_stage_init() to start the USB bus, so that a USB keyboard can be used on the U-Boot shell. Signed-off-by: Bin Meng --- arch/x86/cpu/cpu.c | 2 +- arch/x86/cpu/efi/payload.c | 9 +++++++++ include/configs/efi-x86_payload.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index db36553..6aefa12 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -193,7 +193,7 @@ void show_boot_progress(int val) outb(val, POST_PORT); } -#ifndef CONFIG_SYS_COREBOOT +#if !defined(CONFIG_SYS_COREBOOT) && !defined(CONFIG_EFI_STUB) /* * Implement a weak default function for boards that optionally * need to clean up the system before jumping to the kernel. diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c index 9fd9f57..e3f0f82 100644 --- a/arch/x86/cpu/efi/payload.c +++ b/arch/x86/cpu/efi/payload.c @@ -7,6 +7,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -160,3 +161,11 @@ int reserve_arch(void) return 0; } + +int last_stage_init(void) +{ + /* start usb so that usb keyboard can be used as input device */ + usb_init(); + + return 0; +} diff --git a/include/configs/efi-x86_payload.h b/include/configs/efi-x86_payload.h index 9c62fd2..1cf5c03 100644 --- a/include/configs/efi-x86_payload.h +++ b/include/configs/efi-x86_payload.h @@ -14,7 +14,7 @@ #define CONFIG_SYS_MONITOR_LEN (1 << 20) -#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd\0" \ +#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd,usbkbd\0" \ "stdout=serial,vidconsole\0" \ "stderr=serial,vidconsole\0" -- 2.7.4