OSDN Git Service

usb/gadget: Add driver for Aspeed SoC virtual hub
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 3 May 2018 20:59:43 +0000 (06:59 +1000)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 15 May 2018 07:06:53 +0000 (10:06 +0300)
commit7ecca2a4080cb6b1fa174adc588fce9e9014c43c
tree5b7fd3cbe77e1d25dab6769b73c9e0b5bf4ee1ba
parent655016dc2d30379a417404ae88df9bfb7ede38e6
usb/gadget: Add driver for Aspeed SoC virtual hub

The Aspeed BMC SoCs support a "virtual hub" function. It provides some
HW support for a top-level USB2 hub behind which sit 5 gadget "ports".

This driver adds support for the full functionality, emulating the
hub standard requests and exposing 5 UDC gadget drivers corresponding
to the ports.

The hub itself has HW provided dedicated EP0 and EP1 (the latter for
hub interrupts). It also has dedicated EP0s for each function. For
other endpoints, there's a pool of 15 "generic" endpoints that are
shared among the ports.

The driver relies on my previous patch adding a "dispose" EP op to
handle EP allocation between ports. EPs are allocated from the shared
pool in the UDC "match_ep" callback and assigned to the UDC instance
(added to the gadget ep_list).

When the composite driver gets unbound, the new hook will allow the UDC
to clean things up and return those EPs to the shared pool.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/Kconfig
drivers/usb/gadget/udc/Makefile
drivers/usb/gadget/udc/aspeed-vhub/Kconfig [new file with mode: 0644]
drivers/usb/gadget/udc/aspeed-vhub/Makefile [new file with mode: 0644]
drivers/usb/gadget/udc/aspeed-vhub/core.c [new file with mode: 0644]
drivers/usb/gadget/udc/aspeed-vhub/dev.c [new file with mode: 0644]
drivers/usb/gadget/udc/aspeed-vhub/ep0.c [new file with mode: 0644]
drivers/usb/gadget/udc/aspeed-vhub/epn.c [new file with mode: 0644]
drivers/usb/gadget/udc/aspeed-vhub/hub.c [new file with mode: 0644]
drivers/usb/gadget/udc/aspeed-vhub/vhub.h [new file with mode: 0644]