fuchsia.hardware.sdmmc

Added: HEAD

PROTOCOLS

InBandInterrupt

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

Callback

Request

<EMPTY>

Response

<EMPTY>

Sdmmc

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

AckInBandInterrupt

Request

<EMPTY>

HostInfo

Get host info.

Request

<EMPTY>

Response

NameType
payload Sdmmc_HostInfo_Result

HwReset

Issue a hw reset.

Request

<EMPTY>

Response

NameType
payload Sdmmc_HwReset_Result

PerformTuning

Perform tuning.

Request

NameType
cmd_idx uint32

Response

NameType
payload Sdmmc_PerformTuning_Result

RegisterInBandInterrupt

Register the given callback to be called when an in-band interrupt is received from the card. Before calling the callback the protocol implementation will disable the in-band interrupt in the controller. In-band interrupts can be re-enabled by calling AckInBandInterrupt() once the previous interrupt has been handled by the client.

Request

NameType
interrupt_cb InBandInterrupt

Response

NameType
payload Sdmmc_RegisterInBandInterrupt_Result

RegisterVmo

In the methods below, vmo_id is used to uniquely identify a VMO that will be passed to Request in an SdmmcBufferRegion. VMO IDs are chosen by the caller, and may be any uint32 value. Registers a VMO and transfers ownership to the protocol implementation. vmo_rights is a bit field containing SdmmcVmoRight values, and determines the read/write permissions used by the implementation when pinning or mapping the VMO. The implementation may pin vmo during this call or any time it is used in a request, and may keep it pinned until the VMO is unregistered. client_id may be in [0, SDMMC_MAX_CLIENT_ID] and identifies the ID space for this VMO to be registered in (that is, two different VMOs may use the same ID if they are registered for different clients).

Request

NameType
vmo_id uint32
client_id uint8
vmo handle<vmo>
offset uint64
size uint64
vmo_rights uint32

Response

NameType
payload Sdmmc_RegisterVmo_Result

Request

Perform the requests in order, atomically (i.e., no intervening requests). Furthermore, calls are replied to in the order they are received. If an error occurs, abort any remaining requests. Else, return the response of the last request.

The protocol implementation chooses whether or not to use DMA depending on the properties of the request and the capabilities of the controller.

Clients are responsible for performing the following cache operations:

After read requests:

  • Call zx_cache_flush with ZX_CACHE_FLUSH_DATA | ZX_CACHE_FLUSH_INVALIDATE on buffers that have been mapped by the client.
  • Call zx_vmo_op_range with ZX_VMO_OP_CACHE_CLEAN_INVALIDATE on all other buffers.

Note that writing to any portion of a buffer before Request has returned can corrupt the received data.

Before write requests:

  • Call zx_cache_flush with ZX_CACHE_FLUSH_DATA on buffers that have been mapped by the client.
  • Call zx_vmo_op_range with ZX_VMO_OP_CACHE_CLEAN on all other buffers.

Request

NameType
reqs vector<SdmmcReq>

Response

NameType
payload Sdmmc_Request_Result

SetBusFreq

Set bus frequency, zero means disable the clock to the card.

Request

NameType
bus_freq uint32

Response

NameType
payload Sdmmc_SetBusFreq_Result

SetBusWidth

Set bus width.

Request

NameType
bus_width SdmmcBusWidth

Response

NameType
payload Sdmmc_SetBusWidth_Result

SetSignalVoltage

Set signal voltage.

Request

NameType
voltage SdmmcVoltage

Response

NameType
payload Sdmmc_SetSignalVoltage_Result

SetTiming

Set mmc timing.

Request

NameType
timing SdmmcTiming

Response

NameType
payload Sdmmc_SetTiming_Result

UnregisterVmo

The callee unmaps/unpins the VMO and returns ownership to the caller.

Request

NameType
vmo_id uint32
client_id uint8

Response

NameType
payload Sdmmc_UnregisterVmo_Result

STRUCTS

SdmmcBufferRegion resource

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

FieldTypeDescriptionDefault
buffer SdmmcBuffer No default
offset uint64

Offset into the VMO to start reading or writing. This is relative to the offset passed to RegisterVmo if type is VMO_ID.

No default
size uint64

Number of bytes to read from or write to this buffer region.

No default

SdmmcHostInfo

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

FieldTypeDescriptionDefault
caps uint64

Controller capabilities

No default
max_transfer_size uint64

Maximum data request size

No default
max_transfer_size_non_dma uint64 No default
max_buffer_regions uint64

The number of buffer regions that may be used in a single request.

No default

SdmmcReq resource

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

FieldTypeDescriptionDefault
cmd_idx uint32 No default
cmd_flags uint32 No default
arg uint32 No default
blocksize uint32 No default
suppress_error_messages bool

If true, the SDMMC driver should reduce the log level of any error messages that this request produces. This will be set on requests for which errors are expected or not fatal.

No default
client_id uint8

The client ID for this request. Only VMOs registered with this client may be present in buffers below.

No default
buffers vector<SdmmcBufferRegion> No default

Sdmmc_HostInfo_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

FieldTypeDescriptionDefault
info SdmmcHostInfo No default

Sdmmc_HwReset_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_PerformTuning_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_RegisterInBandInterrupt_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_RegisterVmo_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_Request_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

FieldTypeDescriptionDefault
response uint32[4] No default

Sdmmc_SetBusFreq_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_SetBusWidth_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_SetSignalVoltage_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_SetTiming_Response

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

<EMPTY>

Sdmmc_UnregisterVmo_Response resource

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

FieldTypeDescriptionDefault
vmo handle<vmo> No default

ENUMS

SdmmcBusWidth strict

Type: uint8

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

NameValueDescription
0
1
2
3

SdmmcTiming strict

Type: uint8

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

NameValueDescription
0
1
2
3
4
5
6
7
8
9
10

SdmmcVoltage strict

Type: uint8

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

NameValueDescription
0
1
2

TABLES

SdmmcMetadata

Defined in fuchsia.hardware.sdmmc/metadata.fidl

OrdinalFieldTypeDescription
max_frequency uint32

Maximum bus operating frequency. The SDMMC core driver will cap the bus frequency to this level. The default value is UINT32_MAX if no metadata is specified.

speed_capabilities SdmmcHostPrefs

Host-specific speed capabilities. The default value is 0 (no flags) if no metadata is specified.

enable_cache bool

If true, utilize the on-device volatile cache. The default value is true if no metadata is specified. Ignored if the attached device or inserted card does not have storage.

removable bool

If true, this SDMMC controller corresponds to a removable card slot that may have an MMC/SD/SDIO card inserted or removed at any time. In this case, failure to probe during driver initialization is not considered fatal. The default value is false if no metadata is specified.

max_command_packing uint32

Use command packing (batching) up to this many commands. If zero, command packing is disabled. The default value is 16 if no metadata is specified. Ignored if the attached device or inserted card does not support command packing.

use_fidl bool

complete. If true, use the FIDL SDMMC protocol. If false, use the Banjo SDMMC protocol. The default value is true if no metadata is specified.

UNIONS

SdmmcBuffer strict resource

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
vmo_id uint32

The ID of a VMO that was previously registered.

vmo handle<vmo>

An unregistered VMO of which the protocol implementation does not take ownership. The VMO is pinned upon entering Request and is unpinned before returning.

Sdmmc_HostInfo_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_HostInfo_Response
err zx/Status

Sdmmc_HwReset_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_HwReset_Response
err zx/Status

Sdmmc_PerformTuning_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_PerformTuning_Response
err zx/Status

Sdmmc_RegisterInBandInterrupt_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_RegisterInBandInterrupt_Response
err zx/Status

Sdmmc_RegisterVmo_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_RegisterVmo_Response
err zx/Status

Sdmmc_Request_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_Request_Response
err zx/Status

Sdmmc_SetBusFreq_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_SetBusFreq_Response
err zx/Status

Sdmmc_SetBusWidth_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_SetBusWidth_Response
err zx/Status

Sdmmc_SetSignalVoltage_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_SetSignalVoltage_Response
err zx/Status

Sdmmc_SetTiming_Result strict

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_SetTiming_Response
err zx/Status

Sdmmc_UnregisterVmo_Result strict resource

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

OrdinalVariantTypeDescription
response Sdmmc_UnregisterVmo_Response
err zx/Status

BITS

SdmmcHostCap strict

Type: uint64

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

NameValueDescription
1
2
4
8
16
32
64
128

The host does not require tuning for SDR50.

SdmmcHostPrefs strict

Type: uint64

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

NameValueDescription
1
2
4

SdmmcVmoRight strict

Type: uint32

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

NameValueDescription
1
2

CONSTANTS

NameValueTypeDescription
SDMMC_MAX_CLIENT_ID 7 uint8

The max value of client_id fields below. There is no known need for more than eight clients at the moment, however if that changes later this value will be increased.

SDMMC_PAGES_COUNT 512 uint64

number of pages per request - 2M per request matches DMA_DESC_COUNT in dev/block/sdhci (PAGE_SIZE / sizeof(zx_paddr_t))

SERVICES

SdmmcService

Defined in fuchsia.hardware.sdmmc/sdmmc.fidl

NameTypeTransport
sdmmc fuchsia.hardware.sdmmc/Sdmmc Driver