summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci.h
AgeCommit message (Collapse)Author
2018-10-29fsl/usb: Workaround for USB erratum-A005275Chris Packham
Workaround makes FS as default mode on all affected socs. Add support to check erratum-A005275 validity for an soc. This info is required to determine whether a given soc is affected by this erratum. Add quirk for this erratum "has_fsl_erratum_a005275" . This quirk is used to enable workaround for the errata Force FS mode as default by: - making EPS as FS - setting PFSC bit to disable HS chirping This workaround can be disabled by mentioning "no_erratum_a005275" in hwconfig string Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: York Sun <york.sun@nxp.com>
2018-08-28usb: ehci: Make the PHY handling genericMarek Vasut
Pull out the EHCI PHY functions into the ehci-hcd.c to let other EHCI drivers use them. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-11-26usb: ehci: Fix accessors for big-endian platforms and descriptorsAlexey Brodkin
Commit 9000eddbae0d ("drivers/usb/ehci: Use platform-specific accessors") broke USB 2.0 on big-endian platforms because for them writel/readl() does automatic conversion of BE data to LE. Proper implementation requires to use "raw" variant of these accessors which read/write data without messing with endianess. While at it replace cpu_to_be32() to be32_to_cpu() in readl() to keep sane semantics. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Marek Vasut <marex@denx.de> Reported-by: Vladimir Boroda <boroda@yahoo.com>
2017-07-28usb: ehci: Get rid of CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTSBin Meng
EHC reports supported maximum number of ports in the HCSPARAMS register, so it's unnecessary to use a hardcoded config option CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
2017-06-17drivers/usb/ehci: Use platform-specific accessorsAlexey Brodkin
Current implementation doesn't allow utilization of platform-specific reads and writes. But some arches or platforms may want to use their accessors that do some extra work like adding barriers for data serialization etc. Interesting enough OHCI accessors already do that so just aligning EHCI to it now. This is a resend of http://patchwork.ozlabs.org/patch/726714/ Back in the day this patch broke some PPC and Sandbox boards as they we missing inclusion of "asm/io.h". Those missing items were fixed with: 1) http://patchwork.ozlabs.org/patch/751397/ 2) http://patchwork.ozlabs.org/patch/771099/ So now it should be safe to apply this patch. FWIW TravisCI builds everything with all 3 patches in place, see https://travis-ci.org/abrodkin/u-boot/builds/239563813 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Acked-by: Marek Vasut <marex@denx.de>
2016-04-01ehci-hcd: Add init_after_resetMateusz Kulikowski
Some host controllers need addidional initialization after ehci_reset() In non-dm implementation it is possible to use CONFIG_EHCI_HCD_INIT_AFTER_RESET. This patch adds similar option to ehci drivers using dm. Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2016-02-24usb: ehci: Be explicit about the BE IO accessorsMarek Vasut
Add explicit cpu_to_be32()/be32_to_cpu() conversion to BE EHCI I/O accessors to align them with their LE counterpart. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com>
2015-09-07usb: ehci: remember init modeStephen Warren
When an EHCI device is registered in device mode, the HW isn't actually initialized at all, and hence isn't left in a running state. Consequently, when the device is deregistered, ehci_shutdown() will fail, since the HW bits it expects to see set in response to its shutdown requests will not be sent, and the message "EHCI failed to shut down host controller." will be printed. Fix ehci-hcd.c to remember whether the device was registered in host or device mode, and only call ehci_shutdown() for host mode registrations. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2015-07-21usb: Update some EHCI driver licenses to use SPDXSimon Glass
A few drivers still write out the license in full. Fix these. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Add driver model support to EHCISimon Glass
Add a way for EHCI controller drivers to support driver model. Drivers can call ehci_register() to register themselves in their probe() methods. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Drop the EHCI weak functionsSimon Glass
These are a pain with driver model because we might have different EHCI drivers which want to implement them differently. Now that they use consistent function signatures, we can in good conscience move them to a struct. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de> Fix non-driver-model EHCI to set up the EHCI operations correctly: Signed-off-by: Tom Rini <trini@konsulko.com>
2015-04-18dm: usb: Refactor EHCI initSimon Glass
Move the bulk of the code in usb_lowlevel_init() into a separate function which will also be used by driver model. Keep the CONFIG options out of this function by providing a tweak flag for Faraday. We need to avoid using CONFIG options in driver model code where possible, since it makes it impossible to use multiple controllers in that code where they have different options. The CONFIG_EHCI_HCD_INIT_AFTER_RESET option is also kept out of the common init function. With driver model the controller will be able to perform this extra init itself after registering with the EHCI layer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Pass EHCI controller pointer to ehci_get_portsc_register()Simon Glass
Adjust this function so that it is passed an EHCI controller pointer so that implementations can look up their controller. This makes the weak functions use a consistent API. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Pass EHCI controller pointer to ehci_set_usbmode()Simon Glass
Adjust this function so that it is passed an EHCI controller pointer so that implementations can look up their controller. This makes the weak functions use a consistent API. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Pass EHCI controller pointer to ehci_powerup_fixup()Simon Glass
Adjust this function so that it is passed an EHCI controller pointer so that implementations can look up their controller. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Allow ECHI to hold private data for the controllerSimon Glass
Add a private data pointer that clients of EHCI can use to access their private information. This establishes a link between struct ehci_ctrl and its associated controller data structure. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Pass EHCI controller pointer to ehci_get_port_speed()Simon Glass
Adjust this function so that it is passed an EHCI controller pointer so that implementations can look up their controller. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2015-04-18dm: usb: Move all the EHCI weak functions together and declare themSimon Glass
Put these at the top of the file so they are in one place. Also add function prototypes to the header file to avoid call site mismatches. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2014-11-07usb: ehci: fix Interrupt on Doorbell flag of USBCMDMasahiro Yamada
CMD_IAAD (Interrupt on Async Advance Doorbell) is bit 6, not bit 5. While we are here, sort the flags. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-10-06usb: ehci: Make periodic_schedules a per controller variableHans de Goede
Periodic schedules tracks how many int_queue-s are active, and decides whether or not to en/disable the periodic schedule based on this. This is clearly a per controller thing. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-10-20usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init.Troy Kisky
This paramter will later be used to initialize OTG ports in host or device mode. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2013-10-20usb: Move 'bmRequestType' USB device request macros from EHCI headerVivek Gautam
Macros defining bmRequestType field of USB device request, given in table 9.2 USB 2.0 spec, are rather generic macros which can be further used by other Host controller stacks. So moving them to usb_defs header. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Cc: Julius Werner <jwerner@chromium.org> Cc: Simon Glass <sjg@chromium.org> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Dan Murphy <dmurphy@ti.com> Cc: Marek Vasut <marex@denx.de>
2013-07-29usb: ehci: Split out struct ehci_ctrl definitionMarek Vasut
Move the struct ehci_ctrl defition from ehci-hcd.c into ehci.h so it can be re-used by drivers. In particular, the mv_udc driver can benefit from this move. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Lei Wen <leiwen@marvell.com> Cc: Otavio Salvador <otavio@ossystems.com.br> Cc: Stefano Babic <sbabic@denx.de>
2013-03-18usb: ehci: Fix aliasing issue in EHCI interrupt codeVincent Palatin
The interrupt endpoint handling code stores the buffer pointer in the QH padding field. We need to make it the size of a pointer to avoid strict aliasing issue with the compiler. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-18usb: ehci: Support interrupt transfers via periodic listPatrick Georgi
Interrupt transfers aren't meant to be used from the async list (the EHCI spec indicates trouble with low/full-speed intr on async). Build a periodic list instead, and provide an API to make use of it. Then, use that API from the existing interrupt transfer API. This provides support for USB keyboards using EHCI. Use timeouts to ensure we cannot get stuck in the keyboard scanning if something wrong happens (USB device unplugged or fatal I/O error) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Julius Werner <jwerner@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-15usb: ehci: rework to take advantage of new lowlevel interfaceLucas Stach
Kill off ehci-core.h It was used to specify some static controller data. To support more than one controller being active at any time we have to carry the controller data ourselfes. Change the ehci interface accordingly. NOTE: OMAP implemented the ehci stuff a bit backwards and should be fixed to do the same thing as other platforms. But the change for now is at least compile clean. Signed-off-by: Lucas Stach <dev@lynxeye.de> Reviewed-by: Marek Vasut <marex@denx.de>
2012-09-01ehci: cosmetic: Define used constantsBenoît Thébaudeau
Make some light cosmetic code cleanup by the way. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Marek Vasut <marex@denx.de> Cc: Ilya Yanok <ilya.yanok@cogentembedded.com> Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2012-09-01ehci: cosmetic: Define the number of qt_buffersBenoît Thébaudeau
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Marek Vasut <marex@denx.de> Cc: Ilya Yanok <ilya.yanok@cogentembedded.com> Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2012-03-29usb: Add support for txfifo thresholdSimon Glass
CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning field in the EHCI controller on reset. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Tom Warren <twarren@nvidia.com>
2011-09-04USB: Remove __attribute__ ((packed)) for struct ehci_hccr and ehci_hcorJason Kridner
Remove __attribute__ ((packed)) to prevent byte access to soc registers in some gcc versions. Having patches to enable ehci for the BeagleBoard lying around for several months, this one was the show-stopper. Switched to align(4), rather than remove the attribute, per suggestion from Alexander. Credits have to go to Laine Walker-Avina <lwalkera@ieee.org> for finding the problem. Signed-off-by: Jason Kridner <jkridner@beagleboard.org> Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com> Cc: Alexander Holler <holler@ahsoftware.de> Cc: Sandeep Paulraj <s-paulraj@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2010-10-22USB: fix Queue Element Transfer Descriptor changesWolfgang Denk
Commit 3ed1607 "USB: sync Queue Element Transfer Descriptor against EHCI spec" added an "__attribute__ ((aligned (32)))" to the declaration of struct qTD, as used for example in the Linux kernel as well. However, it turns out that this attribute causes errors in "usb start" (like "ERROR: NOT USB_CONFIG_DESC 7b" and similar). Drop the attribute again. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Dan Lykowski <lykowdk@gmail.com> Cc: Remy Bohmer <linux@bohmer.net> Cc: Stefano Babic <sbabic@denx.de>
2010-10-20USB: sync Queue Element Transfer Descriptor against EHCI specWolfgang Denk
Appendix B "EHCI 64-Bit Data Structures" of the "Enhanced Host Controller Interface Specification for Universal Serial Bus" (Rev. 1.0, March 12, 2002) defines additional fields which were missing in U-Boot's struct qTD; as these are also present in recent versions of struct ehci_qtd in the Linux kernel, we add them here, too. This fixes some nasty memory corruption problems. Reported-by: Dan Lykowski <lykowdk@gmail.com> See http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/76942 Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Remy Bohmer <linux@bohmer.net> Cc: Dan Lykowski <lykowdk@gmail.com> Cc: Stefano Babic <sbabic@denx.de> Tested-by: Stefano Babic <sbabic@denx.de>
2010-10-18MPC5121: Add USB EHCI supportDamien Dusha
Signed-off-by: Francesco Rendine <francesco.rendine@valueteam.com> Signed-off-by: Damien Dusha <d.dusha@gmail.com> Signed-off-by: Anatolij Gustschin <agust@denx.de> Coding style cleanup; slight file restructuring. Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Remy Bohmer <linux@bohmer.net>
2009-04-06drivers/usb: regorganisationJean-Christophe PLAGNIOL-VILLARD
move to linux usb driver organisation as following drivers/usb/gadget drivers/usb/host drivers/usb/musb Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Remy Bohmer <linux@bohmer.net>