| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Only three of the compatibles listed exist in up-to-date upstream device
trees. As barebox need not worry about backwards compatibility with
older device trees, remove the rest that would never be matched.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240108132721.1666173-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Syncing device trees with Linux upstream can lead to breakage, when
the device trees are switched to newer bindings, which are not yet
supported in barebox. To make it easier to spot such issues, we want to
start applying some heuristics to flag possibly problematic DT changes.
One step towards being able to do that is to know what nodes barebox
actually consumes. Most of the nodes have a compatible entry, which is
matched by an array of of_device_id, so let's have MODULE_DEVICE_TABLE
point at it for future extraction.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230612125908.1087340-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our DWC3 driver is based on a relatively old Kernel driver. Although
it is updated from Linux-5.2 once, it still shows traces of an U-Boot
driver taken from Linux-3.19. The driver misbehaves in gadget mode,
like for example it gets stuck when the USB cable is unplugged and
plugged again.
Do a fresh port from Linux-6.3-rc2.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| | |
Our usbgadget stack is quite outdated. Sync core.c with Linux-6.3-rc2.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Update ch9.h from Linux-6.3-rc2. Linux has split up the file into a
kernel and a uapi portion. We do the same for barebox for easier
updating in the future.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For easier patch merging and comparison with Linux move the usb
gadget files to where Linux has them. For now do a plain git mv
include/usb include/linux/usb, eventhough there might be some
files which are purely barebox specific.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
Reparent xHCIs instantiated from DWC3 controllers to their parents
instead of them being direct children of the bus. Apart from improving
devinfo/drvinfo output, this should introduce no functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230414145259.3644816-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
The binding described three clocks, but not all SoCs actually provide
all three clocks. For example Xilinx Zynqmp doesn't have s suspend
clock. Use clk_bulk_get_all() to get all clocks that are actually
there.
Link: https://lore.barebox.org/20230303134530.102237-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
The '_d' suffix was originally meant to distinguish barebox struct
names from Linux struct names. struct driver doesn't exist in Linux,
so we can rename it and remove the meaningless suffix.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The '_d' suffix was originally introduced in case we want to import
Linux struct device as a separate struct into barebox. Over time it
became clear that this won't happen, instead barebox struct device_d
is basically the same as Linux struct device. Rename the struct name
accordingly to make porting Linux code easier.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux struct device has the member of_node for the device_node pointer.
Rename this in barebox accordingly to minimize the necessary changes
when porting Linux code. This was done with the semantic patch:
@@ struct device_d E; @@
- E.device_node
+ E.of_node
@@ struct device_d *E; @@
- E->device_node
+ E->of_node
Plus some manual adjustments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The driver currently configures the Synopsis USB 3.0/2.0 PHY to
unconditionally provide a free-running PHY clock. This must
be disabled on the i.MX8MP as well as RK3328 and RK3399 SoC,
because the clock control input is inactive.
The upstream Linux binding specifies a boolean DT property
snps,dis-u2-freeclk-exists-quirk to disable the free-running
PHY clock and the property is already used in the i.MX8MP
DT, that barebox imports from upstream. Thus implement the
binding for barebox. This fixes barebox USB host support on the
i.MX8MP, which previously triggered a BUG() when enumerating[1].
Link: https://github.com/saschahauer/barebox/issues/13 [1]
Fixes: e213627bbe1d ("usb: dwc3: of-simple: add i.MX8MP compatible")
Signed-off-by: Hans Christian Lønstad <hcl@datarespons.no>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The device tree bindings snps,dwc3.yaml and rockchip,dwc3.yaml
specify different clock names. This inconsistency did not matter
in the past as the snps,dwc3 used to be a subnode of the
rockchip,rk3xyz-dwc3 glue node. For the RK356x, however, a
different approach is used and the two nodes are merged.
Therefore, the dwc3 driver must accept both groups of clock names.
This step is a prerequisite for replacing the initial rk3568.dtsi
in arch/arm/dts with the mainline Linux version. For compatibility,
the former is updated accordingly. This also illustrates the
migration from glue node and subnode to a single device tree node.
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.barebox.org/20220509113618.1602657-3-michael.riesch@wolfvision.net
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
| |
The DWC3 DT node in the i.MX8MP is contained in a wrapper node for
the glue logic. Linux uses this wrapper for wakeup handling, but we
don't need this functionality in Barebox, so we can just handle it
with the of-simple DWC3 driver.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://lore.barebox.org/20220412195241.126535-2-l.stach@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
"GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier
"GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>.
Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier")
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the suitable SPDX-License-Identifier to all files in drivers/
that previously lacked one.
To aid manual inspection, following heuristics can be used:
* No changes outside of comments/whitespace:
git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)'
* -or-later come in pairs:
git show --inter-hunk-context=19 HEAD | \
perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }'
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some dwc3 controllers have a reset assigned to them. Request it and
reset the device before using it.
Linux upstream driver uses an array of resets here, but in barebox we
currently do have this functionality, so for now use the first reset
only.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20211012073352.4071559-6-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
| |
We early exit on all errors, so no need to single out EPROBE_DEFER.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030175446.2274194-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On both ARM and ARM64 we map DMA coherent memory the same as IO memory.
This has the effect that unaligned accesses are not possible on DMA
coherent memory. The dwc3 gadget driver uses memset() and memcpy() on
that memory which may generate unaligned accesses and result in data
aborts. Use memcpy_fromio() and memset_io() instead which are desgined
to work on IO space and thus do not generate unaligned accesses.
The alternative would be to map DMA coherent memory as MT_NORMAL_NC
instead of MT_DEVICE_nGnRnE, but that require us to add memory
barriers to drivers which we currently do not have. SO instead of
risking regressions in drivers we take the easy way out and avoid
unaligned accesses in the dwc3 driver.
In this concrete case the dwc3 driver generated unaligned accesses
on a Rockchip RK3568 ARM64 system. The driver copies data out of the
receive queue. In my case first 4 bytes were copied, both source and
target were aligned. The second access then copied more data beginning
at the place where the first memcpy stopped. On this 4byte aligned
address memcpy generated an 8byte read access which resulted in a data
abort. On an ARM32 system this might not be a problem as that place,
while not 8byte aligned, is still 4byte aligned, enough for a 32bit
system.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210622074545.17059-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
Use clk_bulk_get_all() to retrieve all clocks rather than open code
this. Also actually enable the clocks, previously they had been disabled
in the error path, but never enabled before. Also this fixes a memory
corruption: The driver populated an array of clks, but only allocated
space for a single entry.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
Replace spaces with tabs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
When the role in the device tree is specified as "otg" then register
a otg device in barebox so that the user can configure the desired mode.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The dwc3 driver warns when the value written to DWC3_GFLADJ happens to
be same as already read from the register. This always happens when the
driver was previously running when started 2nd stage from another
barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Obviously the mode where both host and gadget mode are available
also needs to depend on the Barebox gadget support.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
The DWC3 driver uses some functions which are only available when
Barebox is built with OFDEVICE support. Since there is no platform
without DT support suing DWC3 we can reasonably depend on this
config option.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
When phy_get() returns -ENOSYS or -ENODEV it means we can go without
phy. Do not print an error message in this case.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Expand the DWC3 usb core with gadget support.
Patches imported and adopted from Linux v5.2.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Toggle GCTL.CORESOFTRESET before trying to access any of the block's
registers. Without this additional step, first read of DWC3_GHWPARAMS*
that follows results in assertion of GSTS.CSRTIMEOUT and IP block
stuck in a non-functional state.
Note that all above has only been observerd on i.MX8MQ (ZII Zest
board) for USB1 controller. USB2 doesn't seem to be affected by this.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
Import DWC3 USB controller driver from Linux. This is a bare minimum
port of the code needed to support USB host functionality on
i.MX8MQ. No other use-case is explicitly supported.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|