Skip to content

RFC usb/uhci: Add UHCI sysbus support, and enable for AST machines

Guenter Roeck qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8usb/uhci: checkpatch cleanuphw/usb/hcd-uhci.c+56 -341 reply
2/8usb/uhci: Introduce and use register defineshw/usb/hcd-uhci.c include/hw/usb/uhci-regs.h+27 -161 reply
3/8usb/uhci: Move PCI-related code into a separate filehw/isa/Kconfig hw/isa/vt82c686.c hw/usb/Kconfig +7 more+386 -2203 replies
4/8usb/uhci: enlarge uhci memory spacehw/usb/hcd-uhci.c+1 -10 replies
5/8usb/uhci: Add support for usb-uhci-sysbushw/arm/Kconfig hw/usb/Kconfig hw/usb/hcd-uhci-sysbus.c +2 more+129 -00 replies
6/8usb/uhci: Add aspeed specific read and write functionshw/usb/hcd-uhci-sysbus.c hw/usb/hcd-uhci-sysbus.h+112 -00 replies
7/8aspeed: Add uhci support for ast2600hw/arm/aspeed_ast2600.c include/hw/arm/aspeed_soc.h+16 -01 reply
8/8aspeed: Add uhci support for ast2400 and ast2500hw/arm/aspeed_ast2400.c+14 -01 reply

Reviews trailers per patch

4 of 8 patches have a Reviewed-by or Acked-by.

PatchCédric Le Goater
1/8R-b
2/8R-b
3/8
4/8
5/8
6/8
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/8] usb/uhci: Add UHCI sysbus support, and enable for AST machines

Some machines (like Aspeed ARM) only support a sysbus UHCI controller. The current UHCI implementation in qemu only supports PCI based UHCI controllers.

This patch series separates basic and PCI functionality from the hcd-uhci implementation and then adds uhci-sysbus support. This is then used to implement and enable sysbus based UHCI support for Aspeed machines.

The series is submitted as RFC since I am quite sure that I didn't get everything right. All code surrounding VMStates deserves special scrutiny, as well as the changes outside hw/usb/ and hw/arm/.

A side effect of this patch series is that all Aspeed machines will now instantiate UHCI, even if the machine does not actually support it (it also always instantiates both EHCI ports, so that is not really different). This means that the default USB bus is now the UHCI bus, not the second EHCI bus. The bus number must therefore now be specified explicitly when attaching a device unless attaching it to the UHCI port is ok. I don't know if it is possible to avoid that and to ensure that the default USB port is still the second EHCI port.

The code was tested on x86 machines to ensure that the existing UHCI implementation still works. It was also tested on various Aspeed machines with enabled UHCI ports (ast2500-evb, ast2600-evb, and rainier-bmc).

----------------------------------------------------------------
Guenter Roeck (8):
usb/uhci: checkpatch cleanup
usb/uhci: Introduce and use register defines usb/uhci: Move PCI-related code into a separate file usb/uhci: enlarge uhci memory space usb/uhci: Add support for usb-uhci-sysbus usb/uhci: Add aspeed specific read and write functions
aspeed: Add uhci support for ast2600
aspeed: Add uhci support for ast2400 and ast2500

 hw/arm/Kconfig                |   1 +
 hw/arm/aspeed_ast2400.c       |  14 ++
 hw/arm/aspeed_ast2600.c       |  13 ++
 hw/isa/Kconfig                |   4 +-
 hw/isa/vt82c686.c             |   4 +-
 hw/usb/Kconfig                |  10 +-
 hw/usb/hcd-uhci-pci.c         | 255 ++++++++++++++++++++++++++++++++
 hw/usb/hcd-uhci-pci.h         |  63 ++++++++
 hw/usb/hcd-uhci-sysbus.c      | 201 +++++++++++++++++++++++++
 hw/usb/hcd-uhci-sysbus.h      |  34 +++++
 hw/usb/hcd-uhci.c             | 337 +++++++++++++-----------------------------
 hw/usb/hcd-uhci.h             |  30 ++--
 hw/usb/meson.build            |   2 +
 hw/usb/vt82c686-uhci-pci.c    |  18 +--
 include/hw/arm/aspeed_soc.h   |   3 +
 include/hw/southbridge/piix.h |   4 +-
 include/hw/usb/uhci-regs.h    |  11 ++
 17 files changed, 737 insertions(+), 267 deletions(-)
 create mode 100644 hw/usb/hcd-uhci-pci.c
 create mode 100644 hw/usb/hcd-uhci-pci.h
 create mode 100644 hw/usb/hcd-uhci-sysbus.c
 create mode 100644 hw/usb/hcd-uhci-sysbus.h