summaryrefslogtreecommitdiff
path: root/sys/dev/usb/controller
Commit message (Collapse)AuthorAgeFilesLines
* No need to stop XHCI endpoints in disabled state.Hans Petter Selasky2020-12-231-0/+2
| | | | | | | | | | Some AMD XHCI implementations apparently assert a permanent internal failure if this happens. Submitted by: ali.abdallah@suse.com PR: 251503 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Use __containerof() instead of home-rolled versions.John Baldwin2020-12-174-8/+4
| | | | | | | | | | Reviewed by: imp, hselasky Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27582 Notes: svn path=/head/; revision=368741
* When doing a USB alternate setting on an USB interface we need toHans Petter Selasky2020-11-121-0/+15
| | | | | | | | | | | re-configure the XHCI endpoint context. Differential Revision: https://reviews.freebsd.org/D27174 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367614
* Plug minor memory leak in dwc3 USB2/USB3 controller.Emmanuel Vadot2020-11-041-0/+1
| | | | | | | | | | OF_getprop_alloc called earlier requires corresponding OF_prop_free to release allocated memory. Submitted by: kjopek@gmail.com Differential Revision: https://reviews.freebsd.org/D27085 Notes: svn path=/head/; revision=367338
* xhci: Handle the case when MSI-X BAR is the same as IO BAR.Konstantin Belousov2020-10-231-13/+21
| | | | | | | | | | | | | | | | | | | PCIe allows for MSI-X BAR to be either dedicated, or MSI-X Table may be co-located in some functional BAR. In the later case xhci(4) is unable to allocate active resource for the table because BAR is already activated. Handle it by checking for this special case, and not try to alloc resource if MSI-X BAR is IO. Reported and tested by: emaste Reviewed by: emaste, hselasky Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D26913 Notes: svn path=/head/; revision=366978
* Fix for use of the XHCI driver on Cortex-A72 by adding a missing cacheHans Petter Selasky2020-09-191-0/+13
| | | | | | | | | | | | flush operation before writing to the XHCI_ERSTBA_LO/HI register(s). PR: 237666 Discussed with: Mark Millard <marklmi@yahoo.com> MFC after: 1 week Sponsored by: Mellanox Technologies // Nvidia Notes: svn path=/head/; revision=365918
* musb/allwinner: add support for configuring phy as well as device modeAndriy Gapon2020-09-071-3/+67
| | | | | | | | | | | | | | | | | | | | | At least on Orange Pi PC Plus even the host mode does not work without enabling the phy and setting it to the host mode. The driver will now parse dr_mode property and will try to configure itself and the phy accordingly. OTG mode is not supported yet, so it is treated as the device / peripheral mode. The phy is enabled -- powered on -- only for the host mode. The device mode requires support from a phy driver, e.g., aw_usbphy on Allwinner platform. aw_usbphy does not support the device mode, so it cannnot work yet. MFC after: 6 weeks Notes: svn path=/head/; revision=365402
* musb/allwinner: add H3 supportAndriy Gapon2020-09-071-3/+21
| | | | | | | MFC after: 6 weeks Notes: svn path=/head/; revision=365401
* musb/allwinner: apply register filter in awusbdrd_bs_r_2() as wellAndriy Gapon2020-09-071-0/+2
| | | | | | | | | | | | | Otherwise, I get this panic: panic: awusbdrd_reg: Invalid register 0x342 It looks that musb code both writes and reads at least MUSB2_REG_TXDBDIS. MFC after: 5 weeks X-MFC after: r365399 Notes: svn path=/head/; revision=365400
* fixup r365398: add a missed file with all the new Allwinner musb_otg codeAndriy Gapon2020-09-071-0/+543
| | | | | | | | | Obtained from: andrew MFC after: 5 weeks X-MFC with: r365398 Notes: svn path=/head/; revision=365399
* usb: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0117-336/+2
| | | | Notes: svn path=/head/; revision=365084
* Fully revert r364379.Hans Petter Selasky2020-09-012-0/+14
| | | | | | | | | | | | | | | The "Intel Sunrise Point-LP USB 3.0 controller" doesn't update the wMaxPacket field in the control endpoint context automatically causing a BABBLE error code on the initial first USB device descriptor read, when the bMaxPacketSize is not 8 bytes. Reported by: wulf@ PR: 248784 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=365029
* Fix regression after r364379.Hans Petter Selasky2020-08-201-3/+1
| | | | | | | | | | | | | | | The AMD's Ryzen 3 3200g XHCI controllers apparently need the evaluate control endpoint context command, but we don't need to issue this command when the bMaxPacketSize is received after the read of the USB device descriptor, because this part should be handled automatically. PR: 248784 Tested by: emaste, hselasky MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364433
* Avoid evaluating the XHCI control endpoint context.Hans Petter Selasky2020-08-192-15/+3
| | | | | | | | | | | | | | The XHCI specification says that the XHCI controller should detect reception of the USB device descriptors, and automatically update the max packet size in the control endpoint context. Differential Revision: https://reviews.freebsd.org/D26104 Reviewed by: kp@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364379
* Check the XHCI endpoint state before issuing XHCI endpoint commands.Hans Petter Selasky2020-08-181-10/+36
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D26064 Reviewed by: kp@ and bz@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364347
* Handle Raspberry Pi 4 xhci firmware loading.Andrew Turner2020-08-032-8/+7
| | | | | | | | | | | | | The newer hardware revisions of the Raspberry Pi 4 removed the ability of the VIA VL805 xhci controller to load its own firmware. Instead the firmware must be installed at the appropriate time by the VideoCore coprocessor. Submitted by: Robert Crowston <crowston_protonmail.com> Differential Revision: https://reviews.freebsd.org/D25261 Notes: svn path=/head/; revision=363795
* Add dwc_otg_acpiAndrew Turner2020-06-303-26/+215
| | | | | | | | | | | | | | Create an acpi attachment for the DWC USB OTG device. This is present in the Raspberry Pi 4 in the USB-C port normally used to power the board. Some firmware presents the kernel with ACPI tables rather than FDT so we need an ACPI attachment. Submitted by: Greg V <greg_unrelenting.technology> Approved by: hselasky (removal of All rights reserved) Differential Revision: https://reviews.freebsd.org/D25203 Notes: svn path=/head/; revision=362803
* Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because weHans Petter Selasky2020-04-181-17/+0
| | | | | | | | | | | | | | don't implement link power management, LPM. This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0 transactions. Submitted by: Horse Ma <Shichun.Ma@dell.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=360075
* arm: Fix duplicate ehci DRIVER_MODULEEmmanuel Vadot2020-04-162-4/+4
| | | | | | | | | | | | Name each ehci driver uniquely. This remove the warning printed at each arm boot : module_register: cannot register simplebus/ehci from kernel; already loaded from kernel A similar fix was done in r333074 but imx_ehci wasn't renamed and generic_ehci wasn't present at that time. Notes: svn path=/head/; revision=360013
* Remove the power bit from the super speed root hub port status registerHans Petter Selasky2020-03-081-7/+4
| | | | | | | | | | | | | | | because it clobbers the super speed link status when a device is in super speed mode. Currently the power bit is not needed for anything in the USB hub driver. This fixes USB warm reset for super speed devices. Tested by: Shichun.Ma@dell.com MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=358738
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)Pawel Biernacki2020-02-1511-11/+20
| | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Reviewed by: hselasky, kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23632 Notes: svn path=/head/; revision=357972
* Add USB host controller PCI ID's for Hygon.Hans Petter Selasky2020-02-103-0/+11
| | | | | | | | | Differential Revision: https://reviews.freebsd.org/D23564 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=357726
* Revert r356598 for now because it breaks some AMD based XHCI controllers.Hans Petter Selasky2020-01-111-16/+0
| | | | | | | | | Reported by: jkim @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356632
* Check the XHCI endpoint state before stopping any endpoint.Hans Petter Selasky2020-01-101-0/+16
| | | | | | | | | | | | This avoids getting the XHCI_TRB_ERROR_CONTEXT_STATE error code from the XHCI controller when the endpoint is disabled or already stopped. Suggested by: Shichun.Ma@dell.com MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356598
* Define the XHCI endpoint states.Hans Petter Selasky2020-01-101-0/+8
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356597
* dwc_otg: fix fdt attachment for newer bcm2708-usb nodesKyle Evans2020-01-091-3/+23
| | | | | | | | | | | | | | | | | The newer versions of RPi FDT flipped the order of the interrupts specification and added an 'interrupt-names' property for driver aide in finding the correct interrupt, rather than assuming the positions. Use it if it's available, or fallback to the old method if there is no interrupt-names property with a usb value. This has been tested with both old RPi3B FDT and new RPi3B FDT, USB again works on the latter. Reported by: Tom Yan <tom.ty89 gmail com> MFC after: 3 days Notes: svn path=/head/; revision=356564
* Fix a XHCI driver issue with Intel's Gemini Lake SOC.Hans Petter Selasky2020-01-092-8/+25
| | | | | | | | | | | | | | | | | | | Do not configure any endpoint twice, but instead keep track of which endpoints are configured on a per device basis, and use an evaluate endpoint context command instead. When changing the configuration make sure all endpoints get deconfigured and the configured endpoint mask is reset. This fixes an issue where an endpoint might stop working if there is an error and the endpoint needs to be reconfigured as a part of the error recovery mechanism in the FreeBSD USB stack. Tested by: Shichun.Ma@dell.com MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356545
* Regularize my copyright noticeWarner Losh2019-12-041-1/+1
| | | | | | | | | | | | o Remove All Rights Reserved from my notices o imp@FreeBSD.org everywhere o regularize punctiation, eliminate date ranges o Make sure that it's clear that I don't claim All Rights reserved by listing All Rights Reserved on same line as other copyright holders (but not me). Other such holders are also listed last where it's clear. Notes: svn path=/head/; revision=355394
* Remove "all rights reserved" from copyright for the file I own.Emmanuel Vadot2019-12-031-1/+0
| | | | | | | | Some of the files have both me and Jared McNeill and he gave me permission to remove it from his files too. Notes: svn path=/head/; revision=355357
* Add some IDs of Intel Wildcat Point-LP.Alexander Motin2019-11-261-0/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=355113
* generic_ehci_fdt: Fix compile when EXT_RESOURCES isn't presentEmmanuel Vadot2019-11-091-1/+2
| | | | Notes: svn path=/head/; revision=354573
* dwc3: Use a pair of ()'s around arguments for some macrosEmmanuel Vadot2019-10-161-2/+2
| | | | | | | | | Reported by: hselasky MFC after: 1 week X-MFC-With: r353533 Notes: svn path=/head/; revision=353642
* arm64: Add Synopsys DWC3 driverEmmanuel Vadot2019-10-142-0/+465
| | | | | | | | | | This add a driver for the Synopsys DWC3 driver found on multiple SoCs. It only supports host mode for now. MFC after: 1 month Notes: svn path=/head/; revision=353533
* Make control endpoint quirk for xhci(4) configurable.Hans Petter Selasky2019-10-071-1/+5
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=353273
* Split out the attachment from the generic-ehci driverEmmanuel Vadot2019-10-034-28/+387
| | | | | | | | | | | | Create an attachment file for the existing ACPI attachment, and create a new FDT attachment for the generic-ehci driver. Submitted by: andrew (Original version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19389 Notes: svn path=/head/; revision=353062
* generic_ehci: Enable all phys and resetsEmmanuel Vadot2019-10-011-23/+49
| | | | | | | | The number of phys and resets is not defined and it controller dependent so enable/disable every one of them. Notes: svn path=/head/; revision=352944
* generic_ohci: Look for the phy based on the idEmmanuel Vadot2019-10-011-1/+4
| | | | | | | | phy-names was never in the bindings schema even if it was present in some DTS. Get the optional phy based on its ID. Notes: svn path=/head/; revision=352940
* Add quirk for XHCI(4) controllers to support USB control transfersHans Petter Selasky2019-09-201-0/+3
| | | | | | | | | | | | | | | above 1Kbyte. It might look like some XHCI(4) controllers do not support when the USB control transfer is split using a link TRB. The next NORMAL TRB after the link TRB is simply failing with XHCI error code 4. The quirk ensures we allocate a 64Kbyte buffer so that the data stage TRB is not broken with a link TRB. Found at: EuroBSDcon 2019 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=352556
* The maximum TD size is 31 and not 15.Hans Petter Selasky2019-09-201-1/+1
| | | | | | | | | Found at: EuroBSDcon 2019 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=352554
* Correct PCI device ID for XHCI USB controller.Hans Petter Selasky2019-08-071-1/+1
| | | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=350675
* In xhci(4) there is no stream ID in the completion TRB.Hans Petter Selasky2019-06-041-13/+13
| | | | | | | | | | | Instead iterate all the stream IDs in stream mode to find the matching USB transfer. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=348604
* Add support for USB 3.0 XHCI via ACPIEmmanuel Vadot2019-05-084-68/+283
| | | | | | | | | | | | Ampere eMAG systems have XHCI just described in ACPI, not on PCI. Submitted by: Greg V <greg@unrelenting.technology> Reviewed by: andrew MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19986 Notes: svn path=/head/; revision=347343
* Remove superfluous USB keyword.Hans Petter Selasky2019-04-151-1/+1
| | | | | | | | | Discussed with: danfe@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=346248
* Fix spelling.Hans Petter Selasky2019-04-151-1/+1
| | | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=346229
* Add new USB PCI ID.Hans Petter Selasky2019-03-281-0/+2
| | | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=345633
* xhci_mv: Move the driver to generic_xhciEmmanuel Vadot2019-02-271-0/+16
| | | | | | | | | | | | | Marvell XHCI is in fact generic-xhci, so move the driver and add the compatible string. While here, get and enable the phy if the dtb provide one. The xhci bindings state that phys should be in a 'phys' property but Marvell DTS uses 'usb-phy', only add support for 'usb-phy' for now. Sponsored-by: Rubicon Communications, LCC ("Netgate") Notes: svn path=/head/; revision=344634
* usb_nop_xceiv: Add support for this pseudo deviceEmmanuel Vadot2019-02-271-0/+211
| | | | | | | | | | This is a "fake" phy that handle regulator, clocks and reset gpio. Only clock and regulator is supported for now. Sponsored-by: Rubicon Communications, LCC ("Netgate") Notes: svn path=/head/; revision=344633
* Remove obsolete controllerWarner Losh2019-02-051-214/+0
| | | | | | | | We removed support for the super-old samsung s3xxxx parts, but this is a straggler. Remove it too. Notes: svn path=/head/; revision=343812
* Remove All Rights ReservedWarner Losh2019-02-052-4/+3
| | | | | | | | Remove the all rights reserved clause from my copyright, and make other minor tweaks needed where that might have created ambiguity. Notes: svn path=/head/; revision=343811
* Sometimes the complete split packet may be queued too early and theHans Petter Selasky2018-11-071-0/+13
| | | | | | | | | | | transaction translator will return a NAK. Ignore this message and retry the complete split instead. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=340212