- May 16, 2024
-
-
Upstream Linux commit 3aa07f72894d. If there's a disconnection while operating in eSS, there may be a delay in VBUS drop response from the connector. In that case, the internal link state may drop to operate in usb2 speed while the controller thinks the VBUS is still high. The driver must make sure to disable GUSB2PHYCFG.SUSPHY when sending endpoint command while in usb2 speed. The End Transfer command may be called, and only that command needs to go through at this point. Let's keep it simple and unconditionally disable GUSB2PHYCFG.SUSPHY whenever we issue the command. This scenario is not seen in real hardware. In a rare case, our prototype type-c controller/interface may have a slow response triggerring this issue. Signed-off-by:
Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/5651117207803c26e2f22ddf4e5ce9e865dcf7c7.1668045468.git.Thinh.Nguyen@synopsys.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Alexander Sverdlin <alexander.sverdlin@siemens.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240412202611.3565052-7-alexander.sverdlin@siemens.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
Upstream Linux commit 5999914f227b. The cmd argument we pass to dwc3_send_gadget_ep_cmd() could contain extra arguments embedded. When checking for StartTransfer command, we need to make sure to match only lower 4 bits which contain the actual command and ignore the rest. Reported-by:
Janusz Dziedzic <januszx.dziedzic@intel.com> Signed-off-by:
Felipe Balbi <felipe.balbi@linux.intel.com> [A. Sverdlin: cherry-picked only DWC3_DEPCMD_CMD() define] Signed-off-by:
Alexander Sverdlin <alexander.sverdlin@siemens.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240412202611.3565052-6-alexander.sverdlin@siemens.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
Upstream Linux commit 87dd96111b0b. When operating in USB 2.0 speeds (HS/FS), if GUSB2PHYCFG.ENBLSLPM or GUSB2PHYCFG.SUSPHY is set, it must be cleared before issuing an endpoint command. Current implementation only save and restore GUSB2PHYCFG.SUSPHY configuration. We must save and clear both GUSB2PHYCFG.ENBLSLPM and GUSB2PHYCFG.SUSPHY settings. Restore them after the command is completed. DWC_usb3 3.30a and DWC_usb31 1.90a programming guide section 3.2.2 Signed-off-by:
Thinh Nguyen <thinhn@synopsys.com> Signed-off-by:
Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by:
Alexander Sverdlin <alexander.sverdlin@siemens.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240412202611.3565052-5-alexander.sverdlin@siemens.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
Upstream Linux commit ab2a92e7a608. As a micro-power optimization, let's only resume the USB2 PHY if we're working on <=HIGHSPEED. If we're gonna work on SUPERSPEED or SUPERSPEED+, there's no point in resuming the USB2 PHY. Fixes: 2b0f11df84bb ("usb: dwc3: gadget: clear SUSPHY bit before ep cmds") Signed-off-by:
Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by:
Alexander Sverdlin <alexander.sverdlin@siemens.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240412202611.3565052-4-alexander.sverdlin@siemens.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
Upstream Linux commit 2b0f11df84bb. Synopsys Databook 2.60a has a note that if we're sending an endpoint command we _must_ make sure that DWC3_GUSB2PHY(n).SUSPHY bit is cleared. This patch implements that particular detail. Signed-off-by:
Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by:
Alexander Sverdlin <alexander.sverdlin@siemens.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240412202611.3565052-3-alexander.sverdlin@siemens.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
Upstream Linux commit c0ca324d09a0. dwc3_send_gadget_ep_cmd() had three return points. That becomes a pain to track when we need to debug something or if we need to add more code before returning. Let's combine all three return points into a single one just by introducing a local 'ret' variable. Signed-off-by:
Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by:
Alexander Sverdlin <alexander.sverdlin@siemens.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240412202611.3565052-2-alexander.sverdlin@siemens.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
- May 14, 2024
-
-
When the device port is in a low power state [U3/L2/Not Connected], accesses to usb device registers may take a long time. This could lead to potential core hang when the controller registers are accessed after the port is disabled by setting DEVDS field. Setting the fast register access bit ensures that the PHY clock is keeping up in active state. Therefore, set fast access bit to ensure the accesses to device registers are quick even in low power states. commit b5148d946f45 ("usb: cdns3: gadget: set fast access bit") in the upstream kernel is taken as reference. Signed-off-by:
Aswath Govindraju <a-govindraju@ti.com> Signed-off-by:
Ravi Gunasekaran <r-gunasekaran@ti.com> Reviewed-by:
Roger Quadros <rogerq@kernel.org> Reviewed-by:
Marek Vasut <marex@denx.de> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240424073911.1943-1-r-gunasekaran@ti.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
- May 07, 2024
-
-
Tom Rini authored
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Apr 22, 2024
-
-
André Przywara authored
The Allwinner F1C100s SoC has a MUSB controller like the one in the A33, but needs an SRAM region to be claimed like the A10. We do the latter anyway, even on chips that don't need it, so there is no real difference in our compatible string matching. Add a mapping between the config struct used in the Linux to our requirements here on the way. Signed-off-by:
Andre Przywara <andre.przywara@arm.com>
-
- Apr 05, 2024
-
-
Discovered while trying to use the second interface in the USB keyboard driver necessary on Apple USB keyboards. Reviewed-by:
Marek Vasut <marex@denx.de> Reviewed-by:
Neal Gompa <neal@gompa.dev> Signed-off-by:
Janne Grunau <j@jannau.net>
-
The xhci driver currently only does the necessary initialization for endpoints found in the first interface descriptor. Apple USB keyboards (released 2021) use the second interface descriptor for the HID keyboard boot protocol. To allow USB drivers to use endpoints from other interface descriptors the xhci driver needs to ensure these endpoints are initialized as well. Use USB_MAX_ACTIVE_INTERFACES to control how many interface descriptors are considered during endpoint initialisation. For now define it to 2 as that is sufficient for supporting the Apple keyboards. Reviewed-by:
Marek Vasut <marex@denx.de> Reviewed-by:
Neal Gompa <neal@gompa.dev> Signed-off-by:
Janne Grunau <j@jannau.net>
-
In the next step endpoints for multiple interfaces are set up. Move most of the per endpoint initialization to separate function to avoid another identation level. Reviewed-by:
Marek Vasut <marex@denx.de> Reviewed-by:
Neal Gompa <neal@gompa.dev> Signed-off-by:
Janne Grunau <j@jannau.net>
-
- Apr 02, 2024
-
-
The only call site of dwc3_uboot_handle_interrupt() is the dm_usb_gadget_handle_interrupts(), fold the former into the later. This makes dwc3_uboot_handle_interrupt() unavailable to be called from board code as well. Signed-off-by:
Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3 Link: https://lore.kernel.org/r/20240317044357.547037-2-marek.vasut+renesas@mailbox.org Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
The dm_usb_gadget_handle_interrupts() has no place in board code. Move this into DWC3 driver. The OMAP implementation is special, add new weak dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt handling should be called, and override it in OMAP DWC3 code, to repair the special OMAP interrupt handling code until OMAP gets switched over to DM UDC proper. Signed-off-by:
Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by:
Caleb Connolly <caleb.connolly@linaro.org> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3 Tested-by: Caleb Connolly <caleb.connolly@linaro.org> # qcom sdm845 Link: https://lore.kernel.org/r/20240317044357.547037-1-marek.vasut+renesas@mailbox.org Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
- Mar 22, 2024
-
-
UFS storage often uses a 4096-byte sector size, add support for dynamic sector sizes based loosely on the Linux implementation. Support for dynamic sector sizes changes the types used in some divisions, resulting in the compiler attempting to use libgcc helpers (__aeabi_ldivmod). Replace these divisions with calls to lldiv() to handle this correctly. Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by:
Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by:
Caleb Connolly <caleb.connolly@linaro.org> Link: https://lore.kernel.org/r/20240320-b4-qcom-usb-v4-4-41be480172e1@linaro.org [mkorpershoek: squashed the lldiv() fix from caleb] Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
To actually use the gadget the peripheral driver must be probed and we must call g_dnl_clear_detach(). Otherwise acm_stdio_start() will always fail to find a UDC on DT platforms. Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by:
Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by:
Caleb Connolly <caleb.connolly@linaro.org> Link: https://lore.kernel.org/r/20240320-b4-qcom-usb-v4-3-41be480172e1@linaro.org Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
- Mar 21, 2024
-
-
The Qualcomm specific dwc3 wrapper isn't hugely complicated, implemented the missing initialisation for host and gadget mode. Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by:
Marek Vasut <marex@denx.de> Reviewed-by:
Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by:
Caleb Connolly <caleb.connolly@linaro.org> Link: https://lore.kernel.org/r/20240320-b4-qcom-usb-v4-1-41be480172e1@linaro.org Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
- Mar 14, 2024
-
-
RK3036 is using the USB product id normally used by RK3066B, and RK3328 is using the product id normally used by RK3368. Fix this and update the default USB_GADGET_PRODUCT_NUM Kconfig option for remaining supported Rockchip SoCs to match the product id used in Maskrom mode. Also remove a reference to an undefined ROCKCHIP_RK3229 Kconfig symbol. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se>
-
- Mar 05, 2024
-
-
No device tree in U-Boot or linux use the wrong spelling used in code. Use correct property name as defined in dwc3 bindings. Fixes: 062790f4 ("usb: xhci-dwc3: Add USB2 PHY configuration") Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Marek Vasut <marex@denx.de>
-
- Mar 02, 2024
-
-
Rename ARCH_RMOBILE to ARCH_RENESAS because all the chips are made by Renesas, while only a subset of them is from the R-Mobile line. Use the following command to perform the rename: " $ git grep -l 'ARCH_RMOBILE' | xargs -I {} sed -i 's@ARCH_RMOBILE@ARCH_RENESAS@g' {} " Signed-off-by:
Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by:
Paul Barker <paul.barker.ct@bp.renesas.com>
-
- Mar 01, 2024
-
-
Caleb Connolly authored
Use the root compatible strings from upstream Linux, add missing '#clock-cells' property to the gcc node. Adjust some of the msm8916/apq8016 drivers to use the correct upstream compatible properties and DT bindings. This prepares us to switch to upstream DT in a future patch. Reviewed-by:
Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by:
Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> #qcs404 Signed-off-by:
Caleb Connolly <caleb.connolly@linaro.org>
-
Caleb Connolly authored
Add support for a vbus-supply regulator specified in devicetree. This provides generic support to avoid hardcoded GPIO configuration in board init code. Reviewed-by:
Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by:
Caleb Connolly <caleb.connolly@linaro.org>
-
- Feb 19, 2024
-
-
i.MX93 uses the same USB IP as i.MX8MM. It can then reuse the ehci-mx6 driver. Reviewed-by:
Marek Vasut <marex@denx.de> Signed-off-by:
Mathieu Othacehe <othacehe@gnu.org> Reviewed-by:
Fabio Estevam <festevam@gmail.com>
-
- Jan 30, 2024
-
-
Sean Anderson authored
This function is a no-op. Remove it. Signed-off-by:
Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20231216193843.2463779-3-seanga2@gmail.com
-
- Jan 20, 2024
-
-
The phys property is optional so don't complain if it doesn't exist in device tree. Signed-off-by:
Roger Quadros <rogerq@kernel.org>
-
- Jan 19, 2024
-
-
Complete the transition away from xhci-dwc3 and dwc3-of-simple drivers and change to use the dwc3-generic driver on remaining RK3328 and RK3399 boards. MISC, USB_DWC3 and USB_DWC3_GENERIC is enabled on boards that used to enable USB_XHCI_DWC3. USB_XHCI_DWC3 is dropped from updated boards along with the default y of USB_XHCI_DWC3_OF_SIMPLE. There is no intended change in functionality with this changes, USB 3.0 is expected to continue same as before this change. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Marek Vasut <marex@denx.de> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Jan 09, 2024
-
-
Currently u-boot fastboot can only send one message back to host, so if there is a need to print more than one line messages must be kept sending until all the required data is obtained. This behavior can be adjusted using multiresponce ability (getting multiple lines of response) proposed in this patch. Signed-off-by:
Ion Agorria <ion@agorria.com> Signed-off-by:
Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240105072212.6615-2-clamor95@gmail.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-
- Dec 21, 2023
-
-
Tom Rini authored
In order to make it easier to move on to dropping common.h from code directly, remove common.h inclusion from the rest of the header file which had been including it. Reviewed-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Dec 01, 2023
-
-
Compiling with CONFIG_USB_XHCI_PCI and CONFIG_PCI=n results in usb/host/xhci-pci.c:48:(.text.xhci_pci_probe+0x44): undefined reference to `dm_pci_write_config32 Add the missing Kconfig dependency. Signed-off-by:
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by:
Mark Kettenis <kettenis@openbsd.org> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Like Rockchip RK3328 and RK3568, the RK3588 also have a single node to represent the glue and ctrl for USB 3.0. Use rk_ops as driver data to select correct ctrl node for RK3588 DWC3. Signed-off-by:
Jonas Karlman <jonas@kwiboo.se> Reviewed-by:
Kever Yang <kever.yang@rock-chips.com> Reviewed-by:
Marek Vasut <marex@denx.de>
-
We need to get the DMA address before incrementing the pointer, as that might move us onto another segment. Signed-off-by:
Hector Martin <marcan@marcan.st> Reviewed-by:
Marek Vasut <marex@denx.de>
-
Now that we always check the return value, just return NULL on timeouts. We can still log the error since this is a problem, but it's not reason to panic. Signed-off-by:
Hector Martin <marcan@marcan.st> Reviewed-by:
Marek Vasut <marex@denx.de>
-
This isn't going to work, don't pretend it will and then end up timing out. Signed-off-by:
Hector Martin <marcan@marcan.st> Reviewed-by:
Marek Vasut <marex@denx.de>
-
There is currently no codepath to recover from this case. In principle we could require that the upper layer do this explicitly, but let's just do it in xHCI when the next bulk transfer is started, since that reasonably implies whatever caused the problem has been dealt with. Signed-off-by:
Hector Martin <marcan@marcan.st> Reviewed-by:
Marek Vasut <marex@denx.de>
-
There is a race where an endpoint may halt by itself while we are trying to halt it, which results in a context state error. See xHCI 4.6.9 which mentions this case. This also avoids BUGging when we attempt to stop an endpoint which was already stopped to begin with, which is probably a bug elsewhere but not a good reason to crash. Signed-off-by:
Hector Martin <marcan@marcan.st> Reviewed-by:
Marek Vasut <marex@denx.de>
-
If the xHC has a problem with our STOP ENDPOINT command, it is likely to return a completion directly instead of first a transfer event for the in-progress transfer. Handle that more gracefully. We still BUG() on the error code, but at least we don't end up timing out on the event and ending up with unexpected event errors. Signed-off-by:
Hector Martin <marcan@marcan.st> Reviewed-by:
Marek Vasut <marex@denx.de>
-
xhci_wait_for_event returns NULL on timeout, so the caller always has to check for that. This addresses immediate explosions in this part of the code when timeouts happen, but not the root cause for the timeout. Signed-off-by:
Hector Martin <marcan@marcan.st> Reviewed-by:
Marek Vasut <marex@denx.de>
-
- Nov 28, 2023
-
-
Since {read,write}s{l, w, b}() functions are now supported in linux/io.h there is no need to add custom implementation to driver. Signed-off-by:
Igor Prusov <ivprusov@salutedevices.com>
-
Directly including asm-generic/io.h may break build because it will cause redefenition of generic io macros if linux/io.h gets included later, hence replace it with direct include of linux/io.h Signed-off-by:
Igor Prusov <ivprusov@salutedevices.com>
-
- Nov 21, 2023
-
-
At some point when trying to use USB gadgets, two situations may arise and lead to a failure. Either the UDC (USB Device Controller) is not available at all (not described or not probed) or the UDC is already in use. For instance, as the USB Ethernet gadget remains bound to the UDC, the use of any other USB gadget (fastboot, dfu, etc) *after* will always fail with the "couldn't find an available UDC" error. Let's give a more helpful message by making a difference between the two cases. Let's also hint people who would get this error and grep it into the sources a better explanation of what's wrong with their workflow. Signed-off-by:
Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20231010090304.49335-4-miquel.raynal@bootlin.com Signed-off-by:
Mattijs Korpershoek <mkorpershoek@baylibre.com>
-