Commit Graph

10 Commits

Author SHA1 Message Date
Jean-Jacques Hiblot 95dc2be99c UPSTREAM: usb: udc-uclass: Fixed problem when no alias is defined in DT
commit 801f1fa442 "dm: usb: udc: Use SEQ_ALIAS to index the USB gadget
ports" changed the way the udevice if found. It uses the alias to find
a udevice for a given USB port number. In the commit log it was stated
that if no alias is provided, the bind order will be used instead. However
it doesn't work. Fixing this by adding a call to uclass_get_device() if
uclass_get_device_by_seq() fails.

Change-Id: Ib2304c5ecd5d46089c3273ca3ecaa3f9eb5399f8
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit e81d9de531fb4c7f14344736bd7568c954e64e14)
2020-01-07 17:24:56 +08:00
Jean-Jacques Hiblot 9e4d054014 UPSTREAM: dm: usb: gadget: Fix boot breakage on sunxi platforms
Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for USB gadget
devices")

The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be declared
even for platforms that do not enable DM_USB_GADGET. Otherwise the driver
for their usb peripheral controller fails to bind.

Change-Id: Ide6104f24be321d05d399b03a9fc38663f44a2d1
Reported-by: Priit Laes <plaes@plaes.org>
Reported-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Priit Laes <plaes@plaes.org>
Acked-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit b3c518a88278619b1e109de114c450237d03e032)
2020-01-07 17:24:55 +08:00
Jean-Jacques Hiblot 152ba5092a UPSTREAM: dm: usb: udc: Use SEQ_ALIAS to index the USB gadget ports
dfu, fastbot and other usb gadget commands take the USB port index as a
parameter. Currently this index is assigned in the order of the driver
bindings.
Changing this behavior using the SEQ_ALIAS feature. This option assign to
the device a SEQ number based on its alias (if it exists)

To use it we must set the DM_UC_FLAG_SEQ_ALIAS flag and follow the existing
naming convention: use "usb" for the name of the gadget UCLASS_DRIVER
(same as for the UCLASS_USB).

If no alias is provided, then the index falls back to the order in which
the bindings took place.

Change-Id: I3bd5d0ef6871f69d2e4b2667817a0a81e0cee83e
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reported-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 801f1fa44275e274e33bdfc7fb76535cc6118d61)
2020-01-07 17:24:55 +08:00
Jean-Jacques Hiblot 20828bbaa7 UPSTREAM: dm: usb: create a new UCLASS ID for USB gadget devices
UCLASS_USB_DEV_GENERIC was meant for USB devices connected to host
controllers, not gadget devices.
Adding a new UCLASS for gadget devices alone.

Also move the generic DM code for USB gadgets in a separate file for
clarity.

Conflicts:
	board/sunxi/board.c

Change-Id: I9bd01ad0814b81f7718927660a8ece4080c5f988
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 0131162439508801b9f8a330fa731f04273c9337)
2020-01-07 17:24:54 +08:00
Jean-Jacques Hiblot 256dc48f87 UPSTREAM: usb: udc: implement DM versions of usb_gadget_initialize()/_release()/_handle_interrupt()
When DM_USB_GADGET the platform code for the USB device must be replaced by
calls to a USB device driver.

usb_gadget_initialize() probes the USB device driver.
usb_gadget_release() removes the USB device driver.

Change-Id: I759a0d192d4baafeb188cfad4b3a08b5d2d05c23
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ff8d75583487eb69bcb6f036088d979c76db3753)
2020-01-07 17:24:53 +08:00
Tom Rini da58dec866 Various Makefiles: Add SPDX-License-Identifier tags
After consulting with some of the SPDX team, the conclusion is that
Makefiles are worth adding SPDX-License-Identifier tags too, and most of
ours have one.  This adds tags to ones that lack them and converts a few
that had full (or in one case, very partial) license blobs into the
equivalent tag.

Cc: Kate Stewart <kstewart@linuxfoundation.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2015-11-10 09:19:52 -05:00
Michal Simek f6fcebf5c1 usb: udc: Fix warnings on 64-bit builds
Cast u32 bit value to 64bit before recasting to 64bit pointer to avoid
pointer from integer cast size mismatch warnings.

Warning log:
+../drivers/usb/gadget/udc/udc-core.c: In function
‘usb_gadget_unmap_request’:
+../drivers/usb/gadget/udc/udc-core.c:68:19: warning: cast to pointer
from integer of different size [-Wint-to-pointer-cast]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-11-03 17:29:54 +01:00
Kishon Vijay Abraham I 5b9ce0e28a usb: dwc3: Makefile: Make dwc3 driver compile in u-boot
Now that the entire dwc3 driver is adapted to compile with uboot build,
modify the Makefiles so that the dwc3 driver can be built.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
2015-04-14 05:48:10 +02:00
Kishon Vijay Abraham I 103fa06cfe usb: gadget: udc: make udc-core compile in u-boot build
Make udc-core compile in u-boot by removing all linux specific
stuff and having only the bare minimal udc-core required for
usb gadget drivers. Also modified the file header to a format that is
generally being used in u-boot.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
2015-04-14 05:48:08 +02:00
Kishon Vijay Abraham I a139b96a47 usb: gadget: udc: add udc-core from linux kernel to u-boot
Added udc-core.c from linux kernel 3.19-rc1 (97bf6af1f9) to u-boot.
This will be adapted to work with u-boot in the
following patches.
Adding support for udc will help to seamlessly port dwc3 driver from
linux kernel to u-boot (since dwc3 uses udc-core) and it'll also help
to add support for multiple gadget controllers to be functional at the
same time.
All other gadget drivers can also be adapted to use udc-core.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
2015-04-14 05:48:08 +02:00