class SdmmcDevice
Defined at line 30 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
SdmmcDevice wraps a ddk::SdmmcProtocolClient to provide helper methods to the SD/MMC and SDIO
core drivers. It is assumed that the underlying SDMMC protocol driver can handle calls from
different threads, although care should be taken when calling methods that update the RCA
(SdSendRelativeAddr and MmcSetRelativeAddr) or change the signal voltage (SdSwitchUhsVoltage).
These are typically not used outside the probe thread however, so generally no synchronization is
required.
Public Members
static const uint32_t kTryAttempts
static duration kInitialRetryWaitDuration
static const uint32_t kRetryWaitMultiplier
static duration kMaxRetryWaitDuration
Public Methods
void SdmmcDevice (SdmmcRootDevice * root_device, const fuchsia_hardware_sdmmc::SdmmcMetadata & metadata)
Defined at line 37 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
void SdmmcDevice (SdmmcRootDevice * root_device, const ddk::SdmmcProtocolClient & host)
For testing using Banjo.
Defined at line 42 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
void SdmmcDevice (SdmmcRootDevice * root_device, fdf::ClientEnd<fuchsia_hardware_sdmmc::Sdmmc> client_end)
For testing using FIDL.
Defined at line 45 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
bool using_fidl ()
Defined at line 54 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
const sdmmc_host_info_t & host_info ()
Defined at line 55 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
bool UseDma ()
Defined at line 57 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
void SetCurrentVoltage (sdmmc_voltage_t new_voltage)
Update the current voltage field, e.g. after reading the card status registers.
Defined at line 60 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
void SetRequestRetries (uint32_t retries)
Defined at line 62 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
zx_status_t Init (bool use_fidl)
Defined at line 131 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
uint16_t Rca ()
Defined at line 144 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
void ClearRca ()
Defined at line 145 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
zx_status_t RefreshHostInfo ()
Visible for testing.
Defined at line 148 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.h
zx_status_t SdmmcGoIdle ()
SD/MMC shared ops
Defined at line 234 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdmmcSendStatus (uint32_t * status)
Defined at line 243 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdmmcStopTransmission (uint32_t * status)
Defined at line 256 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdmmcWaitForState (uint32_t desired_state)
Defined at line 280 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdmmcIoRequest (fdf::Arenaarena,fidl::VectorView<fuchsia_hardware_sdmmc::wire::SdmmcReq>reqs,sdmmc_buffer_region_t *buffer_region_ptr)
Issues a collection of IO requests. STOP_TRANSMISSION is issued if the request(s) fail.
|buffer_region_ptr| is used for FIDL-to-Banjo request translation.
Defined at line 306 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdSendOpCond (uint32_t flags, uint32_t * ocr)
SD ops
Defined at line 363 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdSendIfCond ()
Defined at line 382 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdSelectCard ()
Defined at line 427 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdSendScr (std::array<uint8_t, 8> & scr)
Defined at line 436 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdSetBusWidth (sdmmc_bus_width_t width)
Defined at line 451 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdSwitchUhsVoltage (uint32_t ocr)
SD/SDIO shared ops
Defined at line 469 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdSendRelativeAddr (uint16_t * card_status)
Defined at line 405 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdioSendOpCond (uint32_t ocr, uint32_t * rocr)
SDIO ops
Defined at line 513 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdioIoRwDirect (boolwrite,uint32_tfn_idx,uint32_treg_addr,uint8_twrite_byte,uint8_t *read_byte)
Defined at line 536 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx::result<uint8_t> SdioIoRwDirect (uint32_tfunction,uint32_taddress,boolsuppress_error_messages)
Read
Defined at line 572 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx::result<uint8_t> SdioIoRwDirect (uint32_tfunction,uint32_taddress,uint8_tbyte,boolread_after_write,boolsuppress_error_messages)
Write
Defined at line 596 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SdioIoRwExtended (uint32_tcaps,boolwrite,uint8_tfn_idx,uint32_treg_addr,boolincr,uint32_tblk_count,uint32_tblk_size,cpp20::span<const sdmmc_buffer_region_t>buffers)
Defined at line 626 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx::result<uint32_t> MmcSendOpCond (bool suppress_error_messages)
MMC ops
Defined at line 676 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcWaitForReadyState (uint32_t ocr)
Defined at line 690 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcAllSendCid (std::array<uint8_t, 16> & cid)
Defined at line 710 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcSetRelativeAddr (uint16_t rca)
Defined at line 727 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcSendCsd (std::array<uint8_t, 16> & csd)
Defined at line 737 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcSendExtCsd (std::array<uint8_t, 512> & ext_csd)
Defined at line 754 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcSleepOrAwake (bool sleep)
Defined at line 775 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcSelectCard (bool select)
Defined at line 798 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t MmcSwitch (uint8_t index, uint8_t value)
Defined at line 811 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t HostInfo (sdmmc_host_info_t * info)
TODO(b/299501583): Migrate these to use FIDL calls.
Wraps ddk::SdmmcProtocolClient methods.
Defined at line 823 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SetSignalVoltage (sdmmc_voltage_t voltage)
Defined at line 845 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SetBusWidth (sdmmc_bus_width_t bus_width)
Defined at line 876 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SetBusFreq (uint32_t bus_freq)
Defined at line 910 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t SetTiming (sdmmc_timing_t timing)
Defined at line 932 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t HwReset ()
Defined at line 990 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t PerformTuning (uint32_t cmd_idx)
Defined at line 1008 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t RegisterInBandInterrupt (fdf::ClientEnd<fuchsia_hardware_sdmmc::InBandInterrupt> client_end)
Defined at line 1026 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
void AckInBandInterrupt ()
Defined at line 1044 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t RegisterVmo (uint32_tvmo_id,uint8_tclient_id,zx::vmovmo,uint64_toffset,uint64_tsize,uint32_tvmo_rights)
Defined at line 1112 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t UnregisterVmo (uint32_tvmo_id,uint8_tclient_id,zx::vmo *out_vmo)
Defined at line 1133 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx_status_t Request (const sdmmc_req_t * req, uint32_t[4] out_response)
Defined at line 1152 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx::result<> EnableCqhci ()
Defined at line 1078 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx::result<> DisableCqhci ()
Defined at line 1095 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
zx::result<InitializeCommandQueueingResources> InitializeCommandQueueing (zx::interrupt virtual_interrupt, zx::eventpair virtual_interrupt_lifeline)
Defined at line 1054 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc
fdf::Logger & logger ()
Defined at line 1179 of file ../../src/devices/block/drivers/sdmmc/sdmmc-device.cc