aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* usb: gadget: Add and use matching SPL USB ethernet gadget Kconfig symbolsMarek Vasut2023-05-172-2/+25
| | | | | | | | | | Define SPL_USB_ETH_RNDIS symbol to make it possible to select USB gadget ethernet support in SPL and U-Boot separately in Kconfig . Make use of the new symbols in gadget Makefile and move the rndis.o just below the now merged USB_ETHER symbol in Makefile. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* usb: Move SPL_USB_GADGET and related Kconfig symbols to drivers/usb/Marek Vasut2023-05-172-3/+66
| | | | | | | | | | | | To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_GADGET and related symbols. Fix typo and rename SPL_USB_GADGET to "USB Gadget Support in SPL" . Update the gadget Makefile to match the symbol changes. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* usb: Move SPL_USB_STORAGE Kconfig symbol to drivers/usb/Marek Vasut2023-05-171-0/+22
| | | | | | | | | To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_STORAGE and matching SYS_USB_FAT_BOOT_PARTITION . Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* usb: Move SPL_USB_HOST Kconfig symbol to drivers/usb/Marek Vasut2023-05-171-0/+13
| | | | | | | | | | To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_HOST and updates help text of both USB_HOST and SPL_USB_HOST . Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* usb: ehci-mx6: move phy setup before register accessTim Harvey2023-05-021-6/+4
| | | | | | | | | | For the CONFIG_PHY case, move the PHY setup before the register access. This avoids a hang when updating the imx8mm.dtsi which moves the USB OTG power-domains to the PHY. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Tested-by: Fabio Estevam <festevam@denx.de>
* sandbox: fix sandbox_hub_submit_control_msg()Heinrich Schuchardt2023-04-281-21/+9
| | | | | | | | | | | | | Avoid incorrect fall through: A USB_RT_HUB request should not be treated as USB_RT_PORT. Simplify the coding: Avoid duplicate debug() statements. This fixes all -Wimplicit-fallthrough warnings. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* sandbox: fix fall through in sandbox_flash_bulk()Heinrich Schuchardt2023-04-281-0/+1
| | | | | | | | | | | Handling of SANDBOX_FLASH_EP_OUT should never fall through to SANDBOX_FLASH_EP_IN. This addresses a warning shown when compiling with -Wimplicit-fallthrough. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* usb: gadget: f_mass_storage: Rework do_request_sense slightlyTom Rini2023-04-251-2/+1
| | | | | | | | | | When building with clang, it notes that sdinfo may be unused uninitialized in some cases. This appears to be true from reading the code, and we can simply set the variable to zero to start with and be as correct as before. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Marek Vasut <marex@denx.de>
* Merge https://source.denx.de/u-boot/custodians/u-boot-usbTom Rini2023-04-032-1/+2
|\ | | | | | | - Two USB gadget fixes
| * usb: gadget: f_sdp: Add missing spl_board_prepare_for_boot() callMarek Vasut2023-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | The spl_board_prepare_for_boot() should be called before jump_to_image_no_args() to perform board-specific deinitialization before jumping to the next stage. This board-specific deinitialization can be very much anything, e.g. disable dcache in case it was enabled, or such. Add the missing spl_board_prepare_for_boot() call into f_sdp . Signed-off-by: Marek Vasut <marex@denx.de>
| * usb: gadget: missing fallthrough in composite_setup()Heinrich Schuchardt2023-04-041-1/+1
| | | | | | | | | | | | | | Add a missing fallthrough macro. This fixes a -Wimplicit-fallthrough warning. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* | Merge tag 'v2023.04-rc4' into nextWIP/14Mar2023-nextTom Rini2023-03-141-0/+11
|\| | | | | | | | | | | Prepare v2023.04-rc4 Signed-off-by: Tom Rini <trini@konsulko.com>
| * usb: move CONFIG_USB_HUB_DEBOUNCE_TIMEOUT to USBHeinrich Schuchardt2023-03-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | This configuration setting is only relevant if the board supports USB. It should not be in the main menu but in the USB menu. The setting is only relevant in USB host mode. Fixes: 5454dea3137d ("usb: hub: allow to increase HUB_DEBOUNCE_TIMEOUT") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* | usb: xhci-mtk: modify the SOF/ITP interval for mt8195Chunfeng Yun2023-03-021-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 4 USB controllers on MT8195, the controllers (IP1~IP3, exclude IP0) have a wrong default SOF/ITP interval which is calculated from the frame counter clock 24Mhz by default, but in fact, the frame counter clock is 48Mhz, so we shall set the accurate interval according to 48Mhz for those controllers. Note: The first controller no need set it, but if set it, shall change tphy's pll at the same time. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: dwc3-meson-g12a: Select PHY instead of imply PHYMarek Vasut2023-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | Imply means you can turn off the option and expect things to work - "it's a good idea to have X enabled" is when to use imply - "you must have X for Y to work" is when to use select Use "select" here. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
* | Merge tag 'v2023.04-rc3' into nextTom Rini2023-02-272-19/+22
|\| | | | | | | Prepare v2023.04-rc3
| * ARM: tegra: provide default USB gadget setupMaxim Schwalm2023-02-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | All Nvidia boards use the same manufacturer, vendor ID and product ID for the gadgets. Make them the defaults to remove some boilerplate from the defconfigs. Inspired by commit e02687bda96c ("sunxi: provide default USB gadget setup") which did the same for Allwinner boards. Tested-by: Thierry Reding <treding@nvidia.com> # T30 and T124 Signed-off-by: Maxim Schwalm <maxim.schwalm@gmail.com> Signed-off-by: Tom <twarren@nvidia.com>
| * usb: dwc3: Use the devm_gpiod_get_optional() API for reset gpioVenkatesh Yadav Abbarapu2023-02-221-19/+19
| | | | | | | | | | | | | | As the "reset-gpios" property is optional, don't return the error and just skip the gpio reset sequence. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
* | usb: dwc3-uniphier: Select PHYMarek Vasut2023-02-231-0/+1
| | | | | | | | | | | | | | Make sure the PHY subsystem is activated for the uniphier DWC3 glue logic, as it depends on PHY implementation there. Signed-off-by: Marek Vasut <marex@denx.de>
* | usb: dwc3-uniphier: Use dwc3-generic instead of xhci-dwc3Kunihiko Hayashi2023-02-222-42/+78
| | | | | | | | | | | | | | | | | | | | | | dwc3-uniphier depends on xhci-dwc3 framework, however, it is preferable to use dwc3-generic. This driver calls the exported dwc3-generic functions and redefine the SoC-dependent operations to fit dwc3-generic. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: dwc3-generic: Add the size of regs property to glue structureKunihiko Hayashi2023-02-222-1/+2
| | | | | | | | | | | | | | | | Add the size of regs property to the glue structure to correctly specify the register region to map. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: dwc3-generic: Export glue structures and functionsKunihiko Hayashi2023-02-222-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to allow external SoC-dependent glue drivers to use dwc3-generic functions, push the glue structures and export the functions to a header file. The exported structures and functions are: - struct dwc3_glue_data - struct dwc3_glue_ops - dwc3_glue_bind() - dwc3_glue_probe() - dwc3_glue_remove() The SoC-dependent glue drivers can only define their own wrapper driver and specify these functions. The drivers can also add their own compatible strings and configure functions. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: dwc3-generic: Add clock initialization in child DT nodeKunihiko Hayashi2023-02-221-0/+6
| | | | | | | | | | | | | | | | Same as the reset cotnrol, should add a clock initialization in child DT node, if the glue node doesn't have any clocks. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: dwc3-generic: Allow different controller DT node patternKunihiko Hayashi2023-02-221-36/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most of devicetree has the following USB node structure. The controller node is placed as a child node of the glue node. Current dwc3-generic driver works on this premise. glue { /* glue node */ usb { /* controller node */ }; }; However, UniPhier original devicetree has the following USB node structure. The controller node is separately placed from the glue node. usb { /* controller node */ }; glue { /* glue node */ }; In dwc_glue_bind(), this patch provides .glue_get_ctrl_dev() callback to get such a controller node and binds the driver related to the node. If this callback isn't defined, dwc_glue_bind() looks for the controller nodes from the child nodes, as before. Suggested-by: Marek Vasut <marex@denx.de> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: dwc3: Look up reference clock DT phandle in both controller DT nodesMarek Vasut2023-02-221-0/+17
|/ | | | | | | | | | | | | | | | There are currently four disparate placement possibilities of DWC3 reference clock phandle in SoC DTs: - in top level glue node, with generic subnode without clock (ZynqMP) - in top level generic node, with no subnode (i.MX8MQ) - in generic subnode, with other clock in top level node (i.MX8MP) - in both top level node and generic subnode (Rockchip) Cover all the possibilities here by looking into both nodes, start with the top level node as that seems to be used in majority of DTs to reference the clock. Signed-off-by: Marek Vasut <marex@denx.de> Acked-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
* usb: gadget: Fix typo in obj lineTom Rini2023-02-111-1/+1
| | | | | | | | | When dropping the unused fotg210 gadget driver a leading 0 was introduced to the next line, drop it. Fixes: e9b4678bc78e ("usb: Drop unused fotg210 gadget") Reported-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* Correct SPL uses of USB_MUSB_HOSTSimon Glass2023-02-101-1/+1
| | | | | | | This converts 2 usages of this option to the non-SPL form, since there is no SPL_USB_MUSB_HOST defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL uses of IMX_MODULE_FUSESimon Glass2023-02-101-2/+2
| | | | | | | This converts 6 usages of this option to the non-SPL form, since there is no SPL_IMX_MODULE_FUSE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* usb: Drop unused sl811-hcd driverSimon Glass2023-02-073-819/+0
| | | | | | This is not used. Drop the driver and Kconfig option. Signed-off-by: Simon Glass <sjg@chromium.org>
* usb: Drop unused ehci-vct driverSimon Glass2023-02-072-45/+0
| | | | | | This is not used. Drop the driver and Kconfig option. Signed-off-by: Simon Glass <sjg@chromium.org>
* rmobile: Drop unused ehci-rmobile driverSimon Glass2023-02-072-130/+0
| | | | | | This is not used. Drop the driver and Kconfig option. Signed-off-by: Simon Glass <sjg@chromium.org>
* usb: Drop unused fotg210 gadgetSimon Glass2023-02-073-974/+1
| | | | | | | This is not used and appears to be associated with the faraday board which has been removed. Drop the driver and Kconfig options. Signed-off-by: Simon Glass <sjg@chromium.org>
* usb: Drop unused ehci-faraday driverSimon Glass2023-02-073-150/+0
| | | | | | This is not used. Drop the driver and Kconfig option. Signed-off-by: Simon Glass <sjg@chromium.org>
* armada: usb: net: Drop unused USB driversSimon Glass2023-02-073-129/+0
| | | | | | | These are not used. Drop the drivers and Kconfig option. Also drop an old declaration in the netdev.h header. Signed-off-by: Simon Glass <sjg@chromium.org>
* ARM: tegra: remap clock_osc_freq for all Tegra familySvyatoslav Ryhel2023-02-021-9/+37
| | | | | | | | | | | | | | | | Enum clock_osc_freq was designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20. Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # ASUS TF600T T30 Tested-by: Jonas Schwöbel <jonasschwoebel@yahoo.de> # Surface RT T30 Tested-by: Robert Eckelmann <longnoserob@gmail.com> # ASUS TF101 T20 Tested-by: Agneli <poczt@protonmail.ch> # Toshiba AC100 T20 Tested-by: Thierry Reding <treding@nvidia.com> # T30, T124, T210 Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # LG P895 T30 Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom <twarren@nvidia.com>
* Merge tag 'u-boot-amlogic-20230131' of ↵Tom Rini2023-01-312-0/+36
|\ | | | | | | | | | | | | | | | | | | | | https://source.denx.de/u-boot/custodians/u-boot-amlogic - jethub j100: add rescue boot from microSD - move meson sm command to cmd/meson and add efusedump sub-command - switch dwc2 otg to DM for G12A, GXL & AXG - Add new boards: - Odroid Go Ultra - Odroid-N2L
| * usb: dwc3-meson-gxl: force mode on child add/removalNeil Armstrong2023-01-201-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arch/mach-meson has some custom usb logic, in particular: * on board_usb_init(), we force USB_DR_MODE_PERIPHERAL * on board_usb_cleanup(), we force USB_DR_MODE_HOST With DM_USB_GADGET=y, board_usb_init/cleanup() are no longer used when we call usb_gadget_initialize(). Instead, the generic (from udc-uclass) initialization/release is called, which itself calls the controller driver's probe()/remove(). Therefore, enabling DM_USB_GADGET=y will mean that this mode switching will break. To prepare for enabling DM_USB_GADGET, perform the mode switching when the "amlogic,meson-g12a-usb" (dwc2) driver is probed()/removed() instead. This is achieved via the glue driver, which gets notified each time one of its children is probed()/removed. Note: this change should be harmless without DM_USB_GADGET=y because the amlogic-g12a-usb driver is not probed via driver model. Thanks for Mattijs for the original work at [1]. [1] https://lore.kernel.org/all/20221024-meson-dm-usb-v1-1-2ab077a503b9@baylibre.com/ Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Marek Vasut <marex@denx.de> Link: https://lore.kernel.org/r/20230117-u-boot-usb-gxl-otg-dm-v1-1-2853f6d75b06@linaro.org Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
| * usb: dwc3-meson-g12a: force mode on child add/removalMattijs Korpershoek2023-01-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arch/mach-meson has some custom usb logic, in particular: * on board_usb_init(), we force USB_DR_MODE_PERIPHERAL * on board_usb_cleanup(), we force USB_DR_MODE_HOST With DM_USB_GADGET=y, board_usb_init/cleanup() are no longer used when we call usb_gadget_initialize(). Instead, the generic (from udc-uclass) initialization/release is called, which itself calls the controller driver's probe()/remove(). Therefore, enabling DM_USB_GADGET=y will mean that this mode switching will break. To prepare for enabling DM_USB_GADGET, perform the mode switching when the "amlogic,meson-g12a-usb" (dwc2) driver is probed()/removed() instead. This is achieved via the glue driver, which gets notified each time one of its children is probed()/removed. Note: this change should be harmless without DM_USB_GADGET=y because the amlogic-g12a-usb driver is not probed via driver model. Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20221024-meson-dm-usb-v1-1-2ab077a503b9@baylibre.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
* | usb: xhci: Fix root hub descriptorMark Kettenis2023-01-271-7/+8
| | | | | | | | | | | | | | | | | | | | | | When a system has multiple XHCI controllers, some of the properties described in the descriptor of the root hub (such as the number of ports) might differ between controllers. Fix this by switching from a single global hub descriptor to a hub descriptor per controller. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Marek Vasut <marex@denx.de>
* | usb: xhci: Implement DMA mappingMark Kettenis2023-01-273-62/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An XHCI controller that sits behind an IOMMU needs to map and unmap its memory buffers to do DMA. Implement this by inroducing new xhci_dma_map() and xhci_dma_unmap() helper functions. The xhci_dma_map() function replaces the existing xhci_virt_to_bus() function in the sense that it returns the bus address in the case of simple address translation in the absence of an IOMMU. The xhci_bus_to_virt() function is eliminated by storing the CPU address of the allocated scratchpad memory in struct xhci_ctrl. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Marek Vasut <marex@denx.de>
* | bootstd: Add a new pre-scan priority for bootdevsSimon Glass2023-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | We need extensions to be set up before we start trying to boot any of the bootdevs. Add a new priority before all the others for tht sort of thing. Also add a 'none' option, so that the first one is not 0. While we are here, comment enum bootdev_prio_t fully and expand the test for the 'bootdev hunt' command. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstd: Add a USB hunterSimon Glass2023-01-231-0/+12
| | | | | | | | | | | | | | | | | | Add a hunter for USB which enumerates the bus to find new bootdevs. Update the tests and speed up bootdev_test_prio() while we are here, by dropping the USB delays. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: usb: Mark the device name as alloced when bindingSimon Glass2023-01-231-0/+2
| | | | | | | | | | | | | | Since usb_find_and_bind_driver() allocates the device name it should tell driver about that, to avoid memory leaks. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootstd: Add a default method to get bootflowsSimon Glass2023-01-231-24/+0
| | | | | | | | | | | | | | | | | | | | The code in these functions turns out to often be the same. Add a default get_bootflow() function and allow the drivers to select it by setting the method to NULL. This saves a little code space. Signed-off-by: Simon Glass <sjg@chromium.org>
* | global: Finish CONFIG -> CFG migrationTom Rini2023-01-2010-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | At this point, the remaining places where we have a symbol that is defined as CONFIG_... are in fairly odd locations. While as much dead code has been removed as possible, some of these locations are simply less obvious at first. In other cases, this code is used, but was defined in such a way as to have been missed by earlier checks. Perform a rename of all such remaining symbols to be CFG_... rather than CONFIG_... Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | usb: musb: Rename CONFIG_USB_MUSB_TIMEOUT to MUSB_TIMEOUTTom Rini2023-01-202-6/+4
| | | | | | | | | | | | | | | | | | | | This variable has never been configured to another value at present, and was not converted to Kconfig. Opt instead to rename this to MUSB_TIMEOUT. Cc: Marek Vasut <marex@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Marek Vasut <marex@denx.de>
* | musb-new: omap2430: fix compiling in DM_USB_GADGET configAndreas Kemnade2023-01-181-0/+19
| | | | | | | | | | | | Add the separate IRQ handling function and change the registration. Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
* | musb-new: omap2430: no host data access in gadget modeAndreas Kemnade2023-01-181-18/+16
| | | | | | | | | | | | | | Avoid accessing structures (usb_bus_priv) only present when musb is in host mode. Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
* | image: Move common image code to image_board and commandSimon Glass2023-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | We should use the cmd/ directory for commands rather than for common code used elsewhere in U-Boot. Move the common 'source' code into image-board.c to achieve this. The image_source_script() function needs to call run_command_list() so seems to belong better in the command library. Move and rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | usb: gadget: dwc2_udc_otg: implement pullup()Mattijs Korpershoek2023-01-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pullup is used by the usb framework in order to do software-controlled usb_gadget_connect() and usb_gadget_disconnect(). Implement pullup() for dwc2 using the SOFT_DISCONNECT bit in the dctl register: * when pullup is on, clear SOFT_DISCONNECT * when pullup is off, set SOFT_DISCONNECT This is especially useful when a gadget disconnection is initiated but no board_usb_cleanup() is called. Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>