hw/arm/npcm7xx: Add EHCI and OHCI controllers
authorHavard Skinnemoen <hskinnemoen@google.com>
Fri, 23 Oct 2020 21:06:36 +0000 (14:06 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 27 Oct 2020 11:10:21 +0000 (11:10 +0000)
commite23e7b12594ec0804c2d9f509f71841c82a62d1c
tree19a127eff01d60860447911f76dd747cf059d5b2
parent326ccfe240ca9ef4f659a241b39390fa956e999b
hw/arm/npcm7xx: Add EHCI and OHCI controllers

The NPCM730 and NPCM750 chips have a single USB host port shared between
a USB 2.0 EHCI host controller and a USB 1.1 OHCI host controller. This
adds support for both of them.

Testing notes:
  * With -device usb-kbd, qemu will automatically insert a full-speed
    hub, and the keyboard becomes controlled by the OHCI controller.
  * With -device usb-kbd,bus=usb-bus.0,port=1, the keyboard is directly
    attached to the port without any hubs, and the device becomes
    controlled by the EHCI controller since it's high speed capable.
  * With -device usb-kbd,bus=usb-bus.0,port=1,usb_version=1, the
    keyboard is directly attached to the port, but it only advertises
    itself as full-speed capable, so it becomes controlled by the OHCI
    controller.

In all cases, the keyboard device enumerates correctly.

Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
docs/system/arm/nuvoton.rst
hw/arm/npcm7xx.c
hw/usb/hcd-ehci-sysbus.c
hw/usb/hcd-ehci.h
include/hw/arm/npcm7xx.h