History log of /fuchsia/zircon/system/dev/block/imx-sdhci/imx-sdhci.c
Revision Date Author Comments
# 29fdd04b 26-Sep-2018 Suraj Malhotra <surajmalhotra@google.com>

[imx-sdhci] Migrate to use mmio_buffer_t.

Tested: Compiles.
Change-Id: If4141bf64ee81ca60af14bc3f4b564c696e267ef


# 6c2ccb39 19-Sep-2018 Mike Voydanoff <voydanoff@google.com>

[gpio] Refactor the GPIO protocol

This is a first step in a move toward using protocols to represent
individual resources. A similar change will be made to the I2C protocol
to bring it in line with how I2C is used on x86 platforms.

From the client's point of view, an instance of the ZX_PROTOCOL_GPIO
protocol now represents a single pin. The protocol remains the same,
except the "uint32_t index" has been removed from all the protocol functions.

For devices that have only one GPIO resource assigned to them, the driver
can simply call device_get_protocol() to access the GPIO protocol for the pin.
To for devices with more than one GPIO pins, a new API in the platform bus called
pdev_get_protocol() must be used instead.

In addition, we add a new protocol ZX_PROTOCOL_GPIO_IMPL, which is now
implemented by the GPIO drivers. This protocol is essentially the same as
the old GPIO protocol, except "index" has been renamed "pin".
Board drivers may use this protocol directly when doing low level system
configuration, specifying pin numbers directly.

TEST: Booted on VIM2 and Hikey.
On VIM2, USB, display, ethernet and the GPIO test driver are working properly
On Hikey, the system boots and USB is functional.

Change-Id: I44f1bc11ad9793543361a2d19d7a2de4458c334b


# 6f12bca8 14-Sep-2018 Ruchira Ravoori <ravoorir@google.com>

[zircon][sdio]Perform tuning when setting ultra high speed

Currently on VIM2, at times, the wifi chipset does not run all the way.
This is mainly being attributed to power issues. Although not related,
switching to ultra-high speed in sdio is disabled as a safety measure
until the wifi stack is more stable. This changeset adds tuning
procedure when switching to ultra-high speed. Tuning procedure helps
determine any read delays required and the right frequency when the
ultra-high speed is re-enabled.

Test: On vim2, enabled ultra high speed and verified the wifi functionality.

Change-Id: I32f0dbafbcdde32c7d220e38a1c43fc57e492284


# 0d63d40e 11-Sep-2018 Ruchira Ravoori <ravoorir@google.com>

[zircon][sdio] Publish max transfer size for pio mode

Currently, the low level controller driver publishes the max transfer size depending
on whether it supports DMA. For ex: the aml-sd-emmc driver publishes to
sdio, the max_transfer_size as "4096 * 512" if the hw supports dma or "1024" if the
hardware does not support dma. With SDIO, the upper level driver can choose
whether or not it wants to use dma. In the case where dma is supported
by the host, but the upper layer does not want it, we refer to max_transfer_size of
dma mode and we end up feeding the controller with more than what it can
submit in one command. This changeset always publishes the max_transfer_size of pio
mode. When sdio sees that the upper layer does not want to use dma, it
uses the max_transfer_size of pio mode to submit the request.

Test: On vim2, Added a test function to submit a large read and saw that the right
max size was picked up. Prior to this change, the calculation of num_blocks is wrong
and hence the command fails when it reaches the controller.

ZX-2598 #Done

Change-Id: Ibd9461812b4a1c7be9c393a117780eeffa83dcd6


# 46813018 10-Sep-2018 Ruchira Ravoori <ravoorir@google.com>

[zircon][sdio] Remove get_oob_irq proto op from sdmmc and sdio protocols

Recent changes in platform bus, allows configuration of gpio pins from child
drivers and not just the board drivers. The handling of the oob irq is moved
to the wifi driver where it belongs. This changeset removes the unnecessary
protocol from sdmmc and sdhci as it is no longer needed.

Test: fx full-build.

Change-Id: Iac2f84e83c92ff05087093e9b753e9dac56a5f5e


# 2d20e548 04-Sep-2018 Mike Voydanoff <voydanoff@google.com>

[ddk][gpio] Break gpio_config() API into two functions

gpio_config_in() is used to configure a pin for input, while
gpio_config_out() is used to configure a pin for output.
gpio_config_out() now takes an initial value for the pin,
so the configuration and value can be set atomically to avoid a
race condition or glitch between setting it as output and writing the value.

Also removed some unnecessary GPIO configuration flags.
Now we only have flags for configuring the pull-up in gpio_config_in().
gpio_get_interrupt() uses interrupt handle flags for configuring edge vs level triggered,
so we don't need GPIO_* flags for these.

TEST: manual testing on VIM2, astro and gauss

ZX-2564 #in progress
ZX-2465 #in progress

Change-Id: I280c489ba951ca5953c0a2d57135c3482dd96c37


# 6223ccf6 27-Aug-2018 Andres Oportus <andresoportus@google.com>

[nxp][imx8m][block][emmc] Fix max DMA descriptor length

The descriptor max length is 0xFFFF in bytes, not 0x10000.
We operate at the page granularity on DMA setup/configuration,
hence we use 0x10000-0x1000 instead of 0x10000-1.

Test: This command succeeds consistently
iotime read fifo /dev/sys/platform/09:01:3/imx-sdhci/sdmmc/block/part-000/block 65536 65536

Change-Id: If3f264b43c2a1c1619df6490858fe645e38f57f0


# 20e0650d 17-Aug-2018 Andres Oportus <andresoportus@google.com>

[nxp][imx8m][block][emmc] Fix DMA transfers

Invalidate the memory used by the DMA VMO to avoid
reading old cached data.

Test: Read GPT via lsblk in imx8.

Change-Id: I9c696593ef49da7b6745f3d522a1f68491048a8c


# 39c942b0 15-Aug-2018 Andres Oportus <andresoportus@google.com>

[nxp][imx8m][block][emmc] Disable DMA

Workarounds boot failure.

ZX-2499 #done Workaround boot failure by disabling DMA

Test: Boot on imx8m and try lsblk
Change-Id: Ibec4fdd7f36f110dbab3e0037497cb1a743c1d95


# 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


# 9721f892 22-Jun-2018 Ruchira Ravoori <ravoorir@google.com>

[zircon][sdmmc] Avoid passing down the block op to controllers

aml-sd-emmc controller and possibly sdhci will be used for sdio
transactions as well. This means that the requests to the controller
may come either from block drivers or from a driver in the stack of sdio
devices (For ex: wifi).This changeset avoids passing down the block op
data structure down to the controllers for setting up the dma descs.
Instead, for a dma data transaction, we pass on the vmo, vmo offset that
we got from the block op.

Test: A quick dd test on EMMC on vim2 and Eve. I will follow it up with
iochk while review is in progress

Change-Id: I899aa7f32a39b464fe9fd0a33fa5d386b719cc68


# 0c9112ee 20-Jun-2018 Ruchira Ravoori <ravoorir@google.com>

[zircon][sdio] Add support to get oob irq handle

This changeset adds support to get the out-of-bandwidth irq handle for
SDIO. The irq needs to be accessed by the upper layers in sdio driver
stack but the gpio information is at the board level. In future we
need to think of a way to access the interrupt directly in the upper
layer without the involvement of the controller.

Test: Sanity check of EMMC on pixelbook, VIM2, sdio on estelle

Change-Id: I39919f79e006e598172db91f6d02855b8986f816


# 183aad29 15-Jun-2018 Brian Swetland <swetland@google.com>

[ddk] drivers should not link libfdio directly

Fix up most of the offenders. fvm and zxcrypt remain.

Test: Verified build builds and runtests runs.

Change-Id: I9444370198357f40f0b2ebfe978cd9c45166855a


# 379f22fa 06-Jun-2018 Adam Barth <abarth@google.com>

[fdio] Move headers into lib/fdio/...

Change-Id: Ie8d74e716da913bf6e2672c4acf8cd67b4962b7f


# d1c2ec67 01-Jun-2018 Sean Klein <smklein@google.com>

[block] Avoid using zero to indicate 'max_transfer_size'

Using zero for this values made it easy to cause arithmetic
bugs which assumes max_transfer_size will be larger than the
block size. These bugs have occurred historically.

Instead, adopt the pattern already in-use by the NVME driver:
simply use an unrealistically large value to signify this
value, and canonicalize it within the ddk's public interface.

ZX-2197 #comment In Progress

Change-Id: I80a6cf2c9e79db96d67f3a5a6811bd4764dfed75


# 28a91748 08-May-2018 Payam Moradshahi <payamm@google.com>

[nxp][imx8m][block][sdhci] Clean up and a couple of bug fixes for ADMA2

Change-Id: I19bd3d9d858647829cd2d0aff5c27f513ce1c5c2


# 63081b5f 07-May-2018 Payam Moradshahi <payamm@google.com>

[nxp][imx8m][block][sdhci] Add DMA support

Change-Id: Ie0cb665d124e774633f9466f7bdd958a5259aef8


# 7969884b 04-May-2018 Payam Moradshahi <payamm@google.com>

[nxp][imx8m][sdhci] Enable Interrupt mode

Change-Id: If54f83cb49399e13ae6554041bd11cc2603ba1f8


# 75ba7900 01-May-2018 Payam Moradshahi <payamm@google.com>

[nxp][imx8m][block][emmc] Initial support for eMMC on iMX8M
TODO: Add support for Interrupt mode
TODO: Add support for DMA (ADMA)
TODO: Add support for HS400

Change-Id: If73883b76f8b031575f8f52a0c41e54a8fd17196