summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorBin Meng <bmeng@tinylab.org>2023-07-23 12:40:41 +0800
committerLeo Yu-Chi Liang <ycliang@andestech.com>2023-08-02 16:32:44 +0800
commit02be57caf730e2213bc844bf1dbe58bedd2c3734 (patch)
treea56e2dc62406de041c67a18c25dff02d362f36bb /board
parent124308e67b6e1b6597ef34899211abac9bf7fd60 (diff)
downloadu-boot-02be57caf730e2213bc844bf1dbe58bedd2c3734.tar.gz
u-boot-02be57caf730e2213bc844bf1dbe58bedd2c3734.tar.bz2
u-boot-02be57caf730e2213bc844bf1dbe58bedd2c3734.zip
riscv: qemu: Enable usb keyboard as an input device
This brings PCI xHCI support to QEMU RISC-V and uses a usb keyboard as one of the input devices. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/emulation/qemu-riscv/Kconfig5
-rw-r--r--board/emulation/qemu-riscv/qemu-riscv.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
index 7220c55350..b503578d27 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -76,5 +76,10 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply VIDEO_BOCHS
imply SYS_WHITE_ON_BLACK
imply PRE_CONSOLE_BUFFER
+ imply USB
+ imply USB_XHCI_HCD
+ imply USB_XHCI_PCI
+ imply USB_KEYBOARD
+ imply CMD_USB
endif
diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c
index f39f3be366..181abbbf97 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -12,6 +12,7 @@
#include <log.h>
#include <spl.h>
#include <init.h>
+#include <usb.h>
#include <virtio_types.h>
#include <virtio.h>
@@ -41,6 +42,10 @@ int board_init(void)
int board_late_init(void)
{
+ /* start usb so that usb keyboard can be used as input device */
+ if (CONFIG_IS_ENABLED(USB_KEYBOARD))
+ usb_init();
+
return 0;
}