History log of /fuchsia/zircon/system/dev/usb/xhci/xhci.c
Revision Date Author Comments
# babe1cf5 25-Jul-2018 Adam Barth <abarth@chromium.org>

[sync] Apply C API rubric to libsync

Test: No behavior change
Change-Id: I30a413f7fb5d3f4e741e5204532b82e73595c086


# 47cff597 26-Jun-2018 George Kulakowski <kulakowski@google.com>

[clock] zx_clock_get(ZX_CLOCK_MONOTONIC) -> zx_clock_get_monotonic()

Test: no functional change

Change-Id: Iaa513c521d96b178458acc707be3646067971701


# f0b943bd 05-May-2018 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Disable xdc_bind error message when not on x64

Change-Id: Ic6e5e2c28cf1b3c855a671c2c8ed32e89f2e1a0d


# 684b9dd5 11-Apr-2018 Jocelyn Dang <jocelyndang@google.com>

[dev][xdc] Beginnings of XHCI Debug Capability.

Polling / transfers left to future CL.

Change-Id: Ic8ab93d1fa4449781356237468d17f09468fba52


# ebda1ba3 12-Apr-2018 Jocelyn Dang <jocelyndang@google.com>

[dev][xhci] Generalize extended capability searching logic into
xhci_get_next_ext_cap.

This is as we also need to search for the debug capability in the XDC
driver.

Change-Id: I4eab6a107f5b4b32a0775acc3cc24e85fe80b47a


# 3c408ac3 03-Apr-2018 Todd Eisenberger <teisenbe@google.com>

[dev][xhci] Switch to using io_buffer_physmap

io_buffer_physmap_range has dubious lifetime management, which will be
resolved soon. However, the resolution will force bookkeeping on the
caller, which is unncessary in this usecase.

Change-Id: I92a7028ecd2eb758beb29032d3521818b12d0e53


# d14bfadf 20-Mar-2018 Todd Eisenberger <teisenbe@google.com>

[ddk][io-buffer] Rename callsites of io_buffer_init*_with_bti

ZX-1804 #comment Move all zircon callsites to final name

Change-Id: Ie35de5654841e84653582126dc1f976664c0f49d


# 2516534d 23-Mar-2018 Jocelyn Dang <jocelyndang@google.com>

[dev][usb][xhci] Modify transfer ring and event ring init
to take the ring pointer and bti handle rather than xhci struct.

Would like to reuse these components for xhci debug capability,
but don't want to share the same xhci structure.

Change-Id: I440036a24483855e6618e9477682ec45100f4650


# e412a045 15-Mar-2018 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Fix some problems in driver shut-down path:

- Free our BTI handle last, so we don't fail unpinning when releasing io_buffers.

- Shut down the device enumeration thread before stopping the controller.
Otherwise we hang when trying to clean up device slots

Change-Id: I11ab688ba67c0ab46241f5478523b527e81b6604


# 397ed1f0 13-Mar-2018 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Switch to io_buffer_init_with_bti()

Change-Id: I8aeaafe864c003689760c4233072db4fb4b82108


# d76f2897 10-Mar-2018 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Always use cached buffers on x86

ZX-1816

Change-Id: I239271271230fa6b4c36f62c269e7d9ef942c61e


# 5806fbc8 07-Mar-2018 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Use uncached io_buffers and eliminate cache flushing/invalidating

Now we only need a memory barrier before ringing the doorbell
after queueing new requests in the command ring.

Change-Id: Ie7e2a6c8761fc624c2c5e143636ffc71cec25aad


# 80860fb7 01-Mar-2018 Jocelyn Dang <jocelyndang@google.com>

[dev][usb-xhci] Fix bug with passing the number of interrupts to set_irq_mode.

xhci->num_interrupts is not initialized until after interrupts are
configured, so we can't use it in the call to set_irq_mode.

ZX-1789 #done

Change-Id: Ic4b7ca65698332f2d56365ec7730b92d6e821ef0


# dfe61352 06-Feb-2018 Todd Eisenberger <teisenbe@google.com>

[ddk][io-buffer] Improve safety of io_buffer_phys()

Populating the io_buffer_t's phys field for non-contiguous buffers is a
set-up for accidentally issuing DMA to incorrect addresses, since
io_buffer_phys() will still work. This patch causes io_buffer_phys()
to trip a ZX_DEBUG_ASSERT if it is used on a non-contiguous buffer.

Change-Id: I7dbae4a7d3b548a96b19c5e596c17d058004980b


# ec9928ea 22-Jan-2018 Adam Barth <abarth@google.com>

[syscalls] Rename zx_time_get to zx_clock_get

This change frees up the get() method in for a zx_time_t accessor in the
zx::time class.

Change-Id: Ia4cdc7e3e558df5ba0cfeedb27a442abf4d6f305


# ac25dd9e 13-Dec-2017 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Two DMA cache management fixes:

- Invalidate device context buffer after allocating it so the VM system's
zeroing of the buffer does not interfere with the controller writing to it

- Add two missing xhci_cache_flush() in xhci_handle-enumerate_device()

Fixes USB breakage on ARM that was introduced by
https://fuchsia-review.googlesource.com/c/zircon/+/103016

Change-Id: Id50cfe9a4dcd3927b2f7d695662963290206319d


# c92e74a1 16-Nov-2017 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Use zx_cache_flush instead of zx_vmo_op_range for cache management

Change-Id: I261246de12f4c915b485dfb15830d084658e9ffc


# f4b2ff04 23-Oct-2017 Brian Swetland <swetland@google.com>

[ddk] rename dprintf() to zxlogf() to avoid conflicts

dprintf is still defined by ddk/debug.h but with a deprecation warning

Change-Id: I00b34803571c468007e069c1da6a292feba2bc3c


# 6c1c3542 20-Oct-2017 Mike Voydanoff <voydanoff@google.com>

[dev][xhci] XHCI interrupt handling fixes

- Don't update event ring dequeue pointer and clear the
event handler busy flag until we have processed all the new events
in the event ring.

- Always clear the interrupt pending flag in the IMAN register

- Don't bother clearing the EINT and PCD bits in the USBSTS register.
According to the XHCI specification, clearing these bits aren't needed
for acknowledging interrupts.

- Use the port status change event instead of the USBSTS_PCD bit
for handling root hub events.

This makes USB more stable on Gauss and might help with ZX-1221

Change-Id: Ie927b6e019930a69c7f0c4f5907153a6c944cdbc


# 7ca7be57 04-Oct-2017 Jocelyn Dang <jocelyndang@google.com>

[dev][usb] Migrate xhci to usb_request.

Change-Id: Ifd0ceb3f033d530e70c88fc80321cf9fc0be8f40


# b16728f1 10-Oct-2017 Jocelyn Dang <jocelyndang@google.com>

[ddk][io-buffer] Add io_buffer_physmap for storing physical pages
of non contiguous buffers.

Renamed original io_buffer_physmap to io_buffer_physmap_range.

Will add a way of iterating over it in usb request in a future CL.

Change-Id: Iab8c8621cfe0ec4a63a8dbe7c7d6a09d8e0bd44a


# 5df8e9e6 17-Sep-2017 Mike Voydanoff <voydanoff@google.com>

[dev][usb-xhci] Fix xhci driver unbind path

This is needed for shutting down xhci when switching from host
to peripheral role.

Change-Id: I83b154060374ef9c94fee4c994e5919f382f2679


# a18aea8b 15-Sep-2017 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Clean and invalidate caches as necessary on non-x86 platforms

Also made VMOs for event rings and device contexts read-only

Change-Id: I1aee51c7ba4515523219826fc0b013d6771e514b


# cd2905eb 14-Sep-2017 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Use io-buffers instead of raw VMOs for DMA memory

Change-Id: Iec8c48ae077dd3f6ff789d861d872446d2f3d28c


# f6b7bc31 14-Sep-2017 Mike Voydanoff <voydanoff@google.com>

[dev][usb][xhci] Add support for binding to a platform device

We will use this for XHCI support on platforms with dwc3 IP.

Change-Id: I2414ba9d6e7b1ecbf82506b9163480cc3dfe9212


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# bc6afa00 07-Sep-2017 Mike Voydanoff <voydanoff@google.com>

[dev][xhci] Switch to new DDK dprintf() logging calls

Change-Id: I629e2b486de24749fb217e63d4ca40cb39b14390


# 0ab8844d 26-Jul-2017 Jocelyn Dang <jocelyndang@google.com>

[usb][xhci] Use two interrupts / completers, isoch transfers are sent to
HIGH_PRIORITY thread.

MG-937 #comment

Change-Id: Ibaa2eb3c2fea12164d141966ef8f18d48688ccf1


# d07baedb 30-Jun-2017 Mike Voydanoff <voydanoff@google.com>

[usb] add support for canceling and timing out transactions

Added usb_cancel_all() to the USB protocol, which cancels all
pending iotxns on an endpoint.

The "timeout" parameter to usb_control() is now being honored.

Also replaced the "enabled", "halted" and endpoint flags with
a new xhci_ep_state_t enum.

To avoid confusion, the endpoint state in the hardware's endpoint context
has been renamed from EP_STATE_* to EP_CTX_STATE_* and the accessor
has been renamed to xhci_get_ep_ctx_state()

Change-Id: Id4daafc88c4767e8723deeed373b5321440469b9


# 0dd96c32 02-Aug-2017 Jocelyn Dang <jocelyndang@google.com>

[xhci] Fix interruptor typo

Change-Id: I325b8d492ea4b30acd08330173968f979fc8be05


# 0667c964 19-Jul-2017 Jocelyn Dang <jocelyndang@google.com>

[xhci] move bus mastering to after stopping controller.

Reapplies commit 4a8ec2834232150c830a65306fa997fa7640d977 which was reverted
by a164c3bde4d317919192831f8d97c7547ec8b4a9.

The original change was causing a large stall in boot due to bus mastering
being disabled on boot. https://fuchsia-review.googlesource.com/#/c/41110/
resolves that issue.

MG-928 #done

Change-Id: I5efd58eb42c3407e41a5528ae30b8bcffd6c119c


# a164c3bd 19-Jul-2017 Jocelyn Dang <jocelyndang@google.com>

Revert "[xhci] move bus mastering to after stopping controller."

This reverts commit 4a8ec2834232150c830a65306fa997fa7640d977, was causing a slowdown on boot

Change-Id: I28b688285352f2e93dc5b019a91afe99ccf3c162


# 4a8ec283 18-Jul-2017 Jocelyn Dang <jocelyndang@google.com>

[xhci] move bus mastering to after stopping controller.

MG-928 #done

Change-Id: Ifc6bb9d53f65f60a0f7510e36d68f608fea4c106


# f99fcc8f 28-Jun-2017 Tim Kilbourn <tkilbourn@google.com>

[usb] Set the interrupter modulation interval

The default was 1ms, which is a little slow for bulk ethernet transfers.

Change-Id: I5e4b74cc613a93ab2516bd65a99427613e46487a


# a5f1bef5 29-Jun-2017 Mike Voydanoff <voydanoff@google.com>

[usb] Revert changes related to canceling USB transactions

These changes introduced a number of bugs and need more work.

Squashed commit of:

Revert "[usb] add support for canceling and timing out transactions"

This reverts commit b986f57f0d5776585086d1eb6a99d65cdcff2486.

Revert "[dev][usb-xhci] Endpoint state cleanup work"

This reverts commit 5d8c3e1594c0f8161c1e2ca8e80533d0e83f5c8e.

Revert "[dev][usb-xhci] Cleanup completing transactions when stopping an endpoint"

This reverts commit cdbc4364957bc9c3067caba54adfb73fae887f03.

Change-Id: I1ab9ba1fbc06ba9e992ec71bb41ecf2465e72e29


# 5d8c3e15 28-Jun-2017 Mike Voydanoff <voydanoff@google.com>

[dev][usb-xhci] Endpoint state cleanup work

Replace the "enabled", "halted" and "stopped_reason" endpoint flags with
a new xhci_ep_state_t enum.

To avoid confusion, the endpoint state in the hardware's endpoint context
has been renamed from EP_STATE_* to EP_CTX_STATE_* and the accessor
has been renamed to xhci_get_ep_ctx_state()

Change-Id: I195d688948d4ca65db395205e35f52145893d400


# 82c01fd2 26-Jun-2017 Mike Voydanoff <voydanoff@google.com>

[udev][usb-xhci] Add support for timing out controller commands

In particular, we now time out and retry "address device" commands
during initial device setup.
This fixes problems enumerating devices that do not respond to the
first SET_ADDRESS control request.

Change-Id: Ic0d7c8804bdeed8e90c7338f9dfc061fbe16940f


# 245474ee 22-Jun-2017 Mike Voydanoff <voydanoff@google.com>

[udev][usb-xhci] Recover from stalls during device enumeration

The asix-88179 based Plugable USB ethernet/hub combo has an intermittent problem
where the initial get device descriptor command will fail, resulting in the
USB 2.0 side of the hub not to enumerate.
Catching this and clearing the stall allows us to recover.

Also added accessor for reading endpoint state from the endpoint context.

Change-Id: I33a1f78513c55fd2d16d44d8dfaac979ccfc2b23


# b2d14526 09-Jun-2017 Tim Kilbourn <tkilbourn@google.com>

[dev][usb] Use new magenta error names

Change-Id: Ie4901fe957ee96cf7c7d425a948c1b66a0d3a0f3


# 9f5cd55f 07-Jun-2017 Brian Swetland <swetland@google.com>

[udev][usb-xhci] rename

Change-Id: I9301fac7ba04cb881cbc84cc4d34f9a3061ed848