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>
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
#include <log.h>
#include <spl.h>
#include <init.h>
+#include <usb.h>
#include <virtio_types.h>
#include <virtio.h>
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;
}
-serial stdio -device VGA
+In addition, a usb keyboard can be attached to an emulated xHCI controller in
+RISC-V virt machine as an option of input devices by adding::
+
+ -device qemu-xhci,id=xhci -device usb-kbd,bus=xhci.0
+
Running with KVM
----------------
/* Environment options */
-#define CFG_STD_DEVICES_SETTINGS "stdin=serial\0" \
+#define CFG_STD_DEVICES_SETTINGS "stdin=serial,usbkbd\0" \
"stdout=serial,vidconsole\0" \
"stderr=serial,vidconsole\0"