Some boards don't populate clk/reset entries as these are are optional
as per binding documentation. Therefore, don't fail driver probe if
clk/reset entries are absent in DT.
This fixes fastboot failures seen due to enabling of CONFIG_CLK on AM57xx
Change-Id: I5a8e1d24f74b78647fd263ba11eaf68d4252abb5
Fixes: e8e683d33b0c ("board: ti: am57xx-idk: Configure the CDCE913 clock synthesizer")
Reported-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d624434f5ebc5e3eb5f5609f06200f477cf8d8b5)
Add a new function that read quirk and configuration information from the
DT. The goal is to allow platforms using their own version of DWC3 driver
to migrate to the generic DWC3 driver.
The function is adapted from the function dwc3_get_properties() in the
linux dwc3 driver introduced in commit c5ac6116db35d.
Change-Id: I0716519c36b390cee532d3556e136012a277d036
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ba6c5f7a28c8f8ac9eae194c2d37afa0ef51cb3d)
There is no need to fail if the maximum speed is not specified.
If the speed is not specified, do the same as linux and assume super speed.
Change-Id: I6fd5df9a3536a939b96915f6e260904da947e466
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 1a63e5e5fbfff7779ce24b404bef3b8ccddf1a8b)
Currently the host driver used by dwc3-generic is "xhci-dwc3". This is
a functional driver but it doesn't use the dwc3 core and, in particular,
it lacks some bits that may be important.
For example on the k2 platforms, it is important that the phy are properly
suspended when the USB is not used anymore. The dwc3 core also has a
partial support for quirks.
The new driver can be used as a drop-in replacement for "xhci-dwc3".
In terms of implementation, it may seem strange that 2 private structures
dwc3_generic_host_priv and dwc3_generic_priv) are used. The reason for this
is simply that the xhci layer expects a struct xhci_ctrl at the beginning
of the private data and it seemed wasteful to include it also for the
peripheral case.
Change-Id: I68b9e506836292d5de24feb55c5619d907c173ef
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit b575e909168ca559609f6793720c4811b1dd55fd)
Factor code for re-usability.
This is another step toward adding host support.
Change-Id: I7c59c13bd9df4839e77555a45720fe318acde94c
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 1af590df164f88fffb6484842eec8c8d8e500e70)
Separate platform data from the private data.
This is one step toward adding host support.
Change-Id: Ibd70d22283d064c77a179105c7e7f5675a598c49
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 3a38a0adb95bfebbbd39b2bb164f04bdeb10bc03)
dwc3-generic has been broken since MISC uclass has been modified to scan DT
sub-nodes after bind.
Fixing it by a using the no-op uclass.
Change-Id: Id95c49a16951cbe8bc7e58d8a3f85a7372ffd00a
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 3b83829ed63fabe460592395571c1d8fd9b861c8)
There is simply no reason to do that here.
Change-Id: I4336f493dc638bd0b5dd57cbd4a934c93c5bb0ff
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit e445d46651de61fdfecf34cc2cd97d58ca6c5cf3)
Change-Id: Ifbb1d31cfa83384e60c2d20af4e1b37085ee4232
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 1ce5f1f933b6b3e0994b4b7d198afe0198442888)
Change-Id: Ibb728efe79707ce2d5b4cc7910428b4821719b28
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 1c03ade328dd08603fa717076c5888557f1a9fa7)
Change-Id: Id225a6f88c94a187f3d19f1bef90dd66a9399a95
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d66e54ac8084f892bf9a43f3242b5e2bf9a686ed)
The select_dr_mode operation is executed when the glue driver is probed.
The role of this optional function is to configure the operating mode
of the controller at the glue level.
Change-Id: I613fc4e985d9400ae9f27b6becff9d6c8d105e98
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 93991cf1969077108ae36e90acb3cd25a6a449ac)
This make the driver more generic. At this point this driver can replace
the dwc3-of-simple implementation.
Make the description in the Kconfig more generic too.
Change-Id: Icf52db944e2559492cee912e14357f79713ba797
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 446e3a205b871943736e22565092771fac98a9a4)
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)
The driver will be probed when usb_gadget_initialize() is called.
Change-Id: I3783059179b8b4f21592227ea948f809a6b7c438
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 20bebd866690bb09dd1c1cb8ac674c3b17b63c6d)
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)
Using CONFIG_DM_USB for this purpose prevents using DM_USB for host and not
for device.
Conflicts:
arch/arm/Kconfig
Change-Id: I075c887a77e2243463a580eac59d842b620af2f5
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 687ab54560809e01a10652ef82dbac6ae72deb91)
By enabling BLK by default this is the next driver which needs to get
support for DM_USB. Adding generic DWC3 glue logic which only
parse nodes and read device mode. Based on it probe proper
host/peripheral DWC3 drivers for it.
Change-Id: I946ce3749b0323302426b9a08c70f37297654e33
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 49d674547c5bf668802b4b6a24218205fed957f0)