跳到主要内容

9. Memory & Storage

9.1 On-Chip Memory

K3 includes the following on-chip memory types:

  • 128KB boot-ROM
  • 512KB SRAM shared by Main CPU and Real CPU

The memory mapping is shown below. K3 on-chip memory mapping

9.2 LPDDR4x/5

9.2.1 Overview

There are two Memory Controllers (DDRCTLs), each combined with a Synopsys DDR PHY. The DDRCTL supports the following SDRAM types:

  • LPDDR4X
  • LPDDR5

The DDRCTL can accept memory access requests from up to 16 application-side host ports. External AMBA AXI manager ports can be connected to subordinate ports of DDRCTL through the standard AMBA 4 AXI bus interfaces. The configuration registers are programmed through the APB software interface.

K3 LPDDR block diagram

9.2.2 Features

9.2.2.1 General Features

  • Each DDRCTL supports up to 32 GB of DDR
  • Supports up to 2 chip selects (CS) / ranks per DDRCTL
  • Scalable and software-controlled 1:4 (LPDDR4) or 1:1:4 (LPDDR5) frequency ratio
  • Flexible address mapper logic to allow application-specific mapping of row, column, bank, and rank bits
  • DDR PHY Interface (DFI) integration with industry-standard PHYs:
    • All control, write data, and read data interface signals
    • Update interface:
      • MC-initiated requests
      • PHY-initiated requests
    • Training: PHY-independent training mode
    • Low-power interface
    • DFI PHY master interface
    • DFI error interface
  • For LPDDR4 protocol:
    • Direct software request control or programmable internal control for ZQ calibration
    • MPC (ZQCal Start/Latch) commands can be issued automatically after Self-Refresh-Powerdown exit
    • ZQ Reset MRW command can be issued through software
    • Dynamic scheduling to optimize bandwidth and latency
  • Read and write buffers in fully associative CAMs, configurable in powers of two, from 16 up to 64 reads and 64 writes
  • Delayed writes for optimum performance on SDRAM data bus
  • Control options to avoid starvation of lower priorities
  • Guaranteed coherency for write-after-read (WAR) and read-after-write (RAW) hazards (always on the HIF interface and on the AXI interface only if appropriate hardware configuration parameter and software register are set)

9.2.2.2 Power Saving and Low-Power Features

  • Automatic SDRAM power-down entry and exit caused by lack of transaction arrival for a programmable time
  • Automatic Clock Stop entry and exit caused by lack of transaction arrival
  • Automatic DDRCTL low-power mode operation caused by lack of transaction arrival for a programmable time through the hardware low-power interface
  • Advanced power-saving design including no unnecessary toggling of command, address, and data pins (RAS/CAS/WE/BA/A hold last state after each command; DQ does not transition on writes when bytes are disabled)
  • Self-refresh entry and exit:
    • Automatic self-refresh entry and exit caused by lack of transaction arrival for a programmable time
    • Self-refresh entry and exit under software control
    • Self-refresh entry and exit using dedicated DDRC hardware low-power interface control (similar to the AMBA 4 AXI protocol low-power control interface)

9.2.2.3 Performance Features

  • For maximum SDRAM efficiency, commands are executed out of order:
    • Read requests are accompanied by a unique token (tag) from HIF
    • Read data is returned with a token (tag) for the SoC to associate the read data with the correct read request
  • Hardware configurable and software programmable Quality-of-Service (QoS) support:
    • Three traffic classes on read commands—high priority reads, variable priority reads, and low priority reads
    • Two traffic classes on write commands—normal priority writes and variable priority writes
    • Port urgent and port throttling control
  • Write combine to allow multiple writes to the same address to be combined into a single write to SDRAM; supported for same starting address
  • 5-clock cycle typical command latency through the DDRCTL (HIF interface)
    • Can be reduced to 4 cycles by choosing not to register DFI outputs (Configuration parameter)
  • Leverages out-of-order requests with CAM to maximize throughput

9.2.2.4 Programmable SDRAM Parameters

  • Configurable maximum SDRAM data-bus width (denoted as “full data-bus width”)
  • Programmable support for all of the following SDRAM data-bus widths:
    • Full data-bus width, or
    • Half of the full data-bus width
  • Paging policy selectable by configuration registers as any of the following:
    • Leave pages open after access, or
    • Close page when there are no further accesses available in the controller for that page, or
    • Auto-precharge with each access, with an optimization for page-close mode which leaves the page open after a flush for read-write and write-read collision cases
  • Explicit SDRAM mode register updates under software control

9.2.2.5 Refresh Control Features

  • Controller-generated auto-refreshes at programmable average intervals.
  • In multi-rank designs, an offset can be applied to the refresh timer for each rank to allow refreshes to expire at different times (this can increase efficiency by allowing traffic to continue to other ranks while a given rank is being refreshed).
  • Ability to group up to eight controller-generated refreshes together to be issued consecutively (this reduces the frequency of page closings, increases overall efficiency).
    • Per-bank refreshes are scheduled for banks with no traffic in the CAM to minimize impact of refreshes on throughput.
  • When controller-generated refreshes are grouped, some refreshes can be issued speculatively when the controller is idle for a programmable period of time.
  • Ability to disable controller-generated auto-refreshes.
  • Ability to issue a refresh through direct software request.
  • Selectable ability to perform per-bank refreshes rather than all-banks refreshes.

9.2.3 Functional Description

9.2.3.1 Arbitration and Scheduling

Port Arbitration (PA)
  • The Port Arbiter (PA) block arbitrates command requests from AXI ports to the HIF of the DDR Controller (DDRC). PA is comprised of multiple tiers of arbitration stages which include:
    • 2-priority level arbitration based on port aging and expired-VPR/expired-VPW commands (timeout - priority0)
    • 2-priority level arbitration for read requests based on DDRC read priorities (HPR/LPR-VPR)
    • 32-priority level arbitration based on internal port aging or 16-priority level arbitration based on external AXI QoS inputs (selectable by hardware parameter)
    • Round-robin arbitration to resolve ports having the same priority after passing all stages of arbitration
Command Scheduling

The command scheduling mechanism in the DDRC allows you to carefully manage the following:

  • Costly read/write bus turnaround
  • Priorities of read requests to generally favor high priority traffic while also preventing starvation of low priority traffic This functionality is implemented in a simple 2-state machine for each traffic type with completely configurable controls. The states of the 2-state machine determine when reads/writes are serviced and the relative priority (high priority versus low priority reads) at any given moment. In this controller, the enhanced RD/WR switching features are always enabled. The key features of the command scheduling mechanism are:
  • During read mode, issue ACT commands proactively for a write request as page preparation in certain conditions so that the write command can be issued soon after switching to write mode (and vice versa).
  • Prefer a page hit on the other direction rather than executing a page-miss command on the current direction to reduce the number of PRE-ACT cycles in certain conditions.
  • Automatically switch to write mode when the Write CAM reaches a certain fill level to avoid a full Write CAM, while keeping read mode to optimize read latency if the WR CAM has enough space.

9.2.3.2 Low-Power and Power-Saving

The DDRCTL supports various methods to save power within the system:

  • Power saving opportunities within the SDRAM. The DDRCTL supports various SDRAM power saving modes such as:
  • Power saving opportunities within the PHY.
  • Power saving opportunities from an external SoC low-power controller driven through an external hardware low-power interface (based on AMBA 4 AXI protocol low-power control interface).
  • Power saving opportunities within the internal module BSM (Bank State Machine), whose clock can be gated while SDRAM is idle.
Precharge Power-Down

When PWRCTL.powerdown_en=1, DDRCTL automatically enters precharge power-down when the period specified by PWRTMG.powerdown_to_x32 has passed while the DDRCTL is idle (except for issuing refreshes). Entering precharge power-down mode involves the following steps:

  1. If there is a self-refresh exit previously, wait for at least one refresh command (or 8 per-bank refresh commands if per-bank refresh is enabled) to all active ranks. Auto-refresh logic must be enabled, or refresh must be issued using direct software requests of refresh command through OPREFCTRL*.rank*_refresh.
  2. Precharging (closing) all open pages. Pages are closed one-at-a-time in no specified order.
  3. Waiting for tRP (row precharge) idle period.
  4. Issuing the command to enter precharge power-down. For multi-rank systems, all chip-selects are asserted so that all ranks enter precharge power-down simultaneously. Power-down entry commands are issued separately for even and odd ranks.
  5. This step occurs only if DFI low-power interface for power-down is enabled (DFILPCFG0.dfi_lp_en_pd). Attempts an entry to low-power mode through DFI low-power interface and with both dfi_lp_ctrl_wakeup and DRAMSET1TMG5.t_cksre set by DFILPTMG0.dfi_lp_wakeup_pd. The low-power entry attempt is delayed with DFITMG0.dfi_t_ctrl_delay + DRAMSET1TMG7.t_cksre clock cycles, this is needed to satisfy SDRAM timings related to disabling clocks when the PHY is programmed to gate the clock to save maximum power.

If the DDRCTL receives a read or write request from the SoC during step 2 or step 3, the power-down entry is immediately canceled. The same is true if PWRCTL.powerdown_en is driven to '0' during step 2 or step 3. Once the power-down entry command is issued, then proper power-down exit is required.

Self-Refresh

The DDRCTL puts the DDR SDRAM devices into Self-Refresh mode in the following cases:

  • When the PWRCTL.selfref_en bit is set and no reads or writes are pending in the DDRCTL for the period specified by PWRTMG.selfref_to_x32. This is referred to as automatic Self-Refresh.
  • When the PHY Master Interface is enabled by setting DFIPHYMSTR.dfi_phymstr_en bit and there is a dfi_phymstr_req coming from the PHY. In this case the DDRC's hif_cmd_stall is not driven high (the controller can accept commands on HIF) and existing controller commands in the DDRC are not executed before the Self-Refresh mode sequence occurs.
  • When the PWRCTL.selfref_sw bit is set and there are no outstanding read or write commands in the DDRC, this is referred to as the software self-refresh entry. This means that the DDRCTL cannot put SDRAM into Self-Refresh as long as write/read commands are being entered into the DDRCTL.
  • When a hardware low-power entry request occurs (on csysreq_ddrc/csysack_ddrc) with cactive_in_ddrc=0, no outstanding commands, and as long as the DDRCTL is not in init or deep sleep mode. This is referred to as an accepted hardware low-power self-refresh entry. When accepted, the DDRC's hif_cmd_stall is driven high to stop new commands from being accepted and existing controller commands in the DDRC are performed before the following sequence occurs.

Entering Self-Refresh mode involves the following steps:

  1. If there is a self-refresh exit previously, wait for at least one refresh command (or 8 per-bank refresh commands if per-bank refresh is enabled) to all active ranks. Auto-refresh logic must be enabled, or refresh must be issued using direct software requests of refresh command through OPREFCTRL*.rank*_refresh.
  2. Precharging (closing) all open pages. Pages are closed one-at-a-time in no specified order.
  3. Waiting for tRP (row precharge) idle period. If a new command is received on the HIF during this time, the self-refresh entry is canceled.
  4. Issuing the command to enter self-refresh mode. For multi-rank systems, all chip-selects are asserted so that all ranks enter self-refresh simultaneously.
  5. If PWRCTL.stay_in_selfref is set to '1' before the SRE command is issued, DDRCTL does not enter the Self-Refresh Power-Down mode. In this case, right after PWRCTL.stay_in_selfref is set to '0', DDRCTL enters the Self-Refresh Power-Down mode. When PWRCTL.stay_in_selfref is '0' before SRE command issued, DDRCTL enters the Self-Refresh Power-Down mode automatically.
  6. If the PHY Master Interface is enabled and dfi_phymstr_req comes before the SRE command is issued, DDRCTL does not enter the Self-Refresh Power-Down mode. In this case, right after dfi_phymstr_req is dropped, DDRCTL enters Self-Refresh Power-Down mode.
  7. This step occurs only if DFI low-power interface for self-refresh is enabled (DFILPCFG0.dfi_lp_en_sr). Attempts an entry to low-power mode through DFI low-power interface with both dfi_lp_ctrl_wakeup and dfi_lp_data_wakeup set by DFILPTMG0.dfi_lp_wakeup_sr. The low-power entry attempt is delayed with DFITMG0.dfi_t_ctrl_delay + DRAMSET1TMG5.t_cksre clock cycles, this is needed to satisfy SDRAM timings related to disabling clocks when the PHY is programmed to gate the clock, to save maximum power.

Note, that STAT.selfref_type register field is 2'b11 if automatic self-refresh feature is the only cause of self-refresh. If software self-refresh or hardware low-power self-refresh occurs, STAT.selfref_type=2'b10.

If Self-refresh entry is triggered by a PHY Master request, this step is skipped because DFI low-power interface is disabled when there is a dfi_phymstr_req.

Automatic self-refresh has the lowest priority followed by both software and hardware low-power self-refresh, PHY Master Interface has the highest priority. A software self-refresh entry means that a self-refresh exit occurs only if a software self-refresh exit occurs. Similarly, a hardware low-power self-refresh entry means a self-refresh exit occurs only if a hardware low-power self-refresh exit occurs.

If both software and hardware low-power self-refresh entry occurs, self-refresh exit occurs only if both software and hardware low-power self-refresh exits occur. A self-refresh entry triggered by a PHY Master request means a self-refresh exit occurs only if the PHY Master request is de-asserted.

Deep Sleep Mode (LPDDR5)

Entering Deep Sleep Mode involves the following steps:

  1. If there is a self-refresh exit previously, wait for at least one refresh command (or 8 per-bank refresh commands if per-bank refresh is enabled) to all active ranks. Auto-refresh logic must be enabled, or refresh must be issued using direct software requests of refresh command through OPREFCTRL*.rank*_refresh.
  2. Precharging (closing) all open pages. Pages are closed one-at-a-time (not in a specified order).
  3. Waiting for tRP (row precharge) idle period.
  4. Issuing the SRE command with DSM=1 to enter Deep Sleep Mode. For multi-rank systems, SRE commands must be sent to all ranks. This happens simultaneously.
  5. This step occurs only if DFI low-power interface for Deep Sleep Mode is enabled (DFILPCFG0.dfi_lp_en_dsm). It attempts an entry to low-power mode through DFI low-power interface with both dfi_lp_ctrl_wakeup and dfi_lp_data_wakeup set by DFILPTMG0.dfi_lp_wakeup_dsm. The low-power entry attempt is delayed with DFITMG0.dfi_t_ctrl_delay + DRAMSET1TMG11.t_ckmpe clock cycles, this is needed to satisfy SDRAM timings related to disabling clocks when the PHY is programmed to gate the clock, to save maximum power.

If the DDRCTL receives a read or write request from the SoC during step 1 or step 2, the Deep Sleep Mode entry is immediately canceled. The same is true if PWRCTL.dsm_en is driven to '0' during step 1 or step 2. Once the Deep Sleep Mode entry command is issued, proper Deep Sleep Mode exit is required as described in the following section.

Assertion of dfi_dram_clk_disable

Assertion of dfi_dram_clk_disable occurs only if PWRTL.en_dfi_dram_clk_disable=1. dfi_dram_clk_disable is also dependent on the operating mode:

  • dfi_dram_clk_disable can be asserted in the following modes:
    • Deep Sleep Mode (LPDDR5 only)
    • Self-refresh power-down
    • Power-down
    • Normal mode This is the "Clock Stop" feature. The timing of the assertion and de-assertion of dfi_dram_clk_disable in various modes is as follows:
  • In Self-Refresh and Self-Refresh power-down:
    • Asserted at least DFITMG0.dfi_t_ctrl_delay + DRAMSET1TMG5.t_cksre - DFITMG1.dfi_t_dram_clk_disable cycles after SRE command.
    • De-asserted at least DFITMG1.dfi_t_dram_clk_enable + DRAMSET1TMG5.t_cksrx - DFITMG0.dfi_t_ctrl_delay cycles before SRX command.
  • In Power-down:
    • Asserted at least DFITMG0.dfi_t_ctrl_delay + DRAMSET1TMG5.t_cksre - DFITMG1.dfi_t_dram_clk_disable cycles after PDE command.
    • De-asserted at least DFITMG1.dfi_t_dram_clk_enable + DRAMSET1TMG5.t_cksrx - DFITMG0.dfi_t_ctrl_delay cycles before PDX command.
  • In Normal mode (Clock Stop):
    • Asserted at least DFITMG0.dfi_t_ctrl_delay - DFITMG0.dfi_t_dram_clk_disable cycles after any command other than SRPDE/PDE/DSME.
    • De-asserted at least DFITMG1.dfi_t_dram_clk_enable + DRAMSET1TMG6.t_ckcsx - DFITMG0.dfi_t_ctrl_delay cycles before any command other than SRPDX/PDX/DSMX.

9.2.3.3 Fast Frequency Change

The DDRCTL supports Fast Frequency Change, using up to four sets of timing registers. The alternative sets of timing registers can be found in REGB_FREQf_CHc registers. These registers may be written while the traffic is in progress using the first set of timing registers, thus reducing the software overhead at the time of frequency change.

9.3 Quad-SPI

9.3.1 Overview

Quad-SPI acts as an interface to external serial flash devices with up to four bidirectional data lines.

9.3.2 Features

  • Flexible sequence engine to support various flash vendor devices
  • Single, dual and quad mode operation
  • DMA supports reading RX buffer data via AMBA AHB bus (64-bit width interface) or IP register space (32-bit access), and filling TX buffer via IP register space (32-bit access)
  • Configurable DMA inner loop size
  • Fifteen interrupt conditions
  • Memory-mapped read access for connected flash devices
  • Programmable sequence engine for future command/protocol changes, and able to support all existing vendor commands and operations
  • Support for all types of addressing
  • Support for standard SPI, Fast, Dual, Dual I/O, Quad, Quad I/O mode
  • Operation up to 102MHz clock frequency

9.3.3 Functional Description

The QSPI block diagram is shown below, where:

  • AHB BUS is used for XIP transfer (not used in current design)
  • APB BUS is used to configure registers and write/read/erase external serial flash.
QSPI block diagram

The different phases of the serial flash access scheme are shown below.

Quad-SPI access phases

The different phases and the I/O driving characteristics of the QuadSPI module are described below:

  • IDLE Serial flash device is not selected, and there is no interaction. All QSPI_DATx signals remain undriven.
  • INSTRUCTION The serial flash device is selected, and the instruction is sent to the serial flash device.
  • ADDRESS The serial flash address is sent to the device.

    Note: This phase is not applicable to all SFM Commands.

  • MODE Mode bytes are sent to the serial flash device, and all QSPI_DATx signals are driven.

    Note: This phase is not applicable to all SFM Commands.

  • DUMMY Dummy clocks are provided to the serial flash device.

    Note: This phase is not applicable to all SFM Commands.

  • DATA Serial flash data is sent to or received from the serial flash device.

    Note: This phase is not applicable to all SFM Commands. QSPI_CS and QSPI_CLK signals are driven permanently throughout all phases.

9.4 eMMC Interface

9.4.1 Overview

The eMMC Interface is a hardware block that acts as a host of the eMMC bus to transfer data between the eMMC card and the internal bus master.

9.4.2 Features

The eMMC interface supports the following features:

  • Compatible with the 8-bit eMMC 5.1 protocol specification
  • Uses the same SD-HCI register set for eMMC transfers, with some vendor-related registers added
  • Supports 1-bit/8-bit MMC and CE-ATA cards
  • Supports the following data transfer types defined in the SD-HCI spec:
    • PIO
    • SDMA
    • ADMA1
    • ADMA2
  • SPI mode is supported for the eMMC card
  • Supports the following speed modes defined in the eMMC 5.1 Specification:
    • Legacy, up to 26MHz, 1.8V signaling
    • High-speed SDR, up to 52MHz, 1.8V signaling
    • High-speed DDR, up to 52MHz, 1.8V signaling
    • HS200, up to 200MHz, 1.8V signaling
    • HS400, up to 400MHz, 1.8V signaling
  • Hardware generation/checking of CRC on all command and data transaction on the card bus
  • 1024 Bytes (2 x 512 Bytes data block) FIFO is used to send and receive data

9.4.3 Block Diagram

eMMC block diagram

9.4.4 Interface Description

eMMC interface signals

The eMMC device transfers data via a configurable number of data bus signals. The communication signals are:

  • CLK

    • Each cycle of this signal directs a one-bit transfer on the command and either a one-bit (1x) or a two-bit transfer (2x) on all the data lines.
    • The frequency may vary between zero and the maximum clock frequency.
  • Data Strobe

    • This signal is generated by the device and used for output in HS400 mode.
    • The frequency of this signal follows the frequency of CLK.
    • For data output, each cycle of this signal directs a two-bit transfer (2x) on the data - one bit for the positive edge and the other bit for the negative edge.
    • For CRC status response output and CMD response output (enabled only in HS400 enhanced strobe mode), the CRC status and CMD Response are latched on the positive edge only, and are don't-care on the negative edge.
  • CMD

    • This signal is a bidirectional command channel used for device initialization and transfer of commands.
    • The CMD signal has two operation modes: open-drain for initialization mode, and push-pull for fast command transfer.
    • Commands are sent from the eMMC host controller to the eMMC device, and responses are sent from the device to the host.
  • DAT0-DAT7

    • These are bidirectional data channels.
    • The DAT signals operate in push-pull mode.
    • Only the device or the host drives these signals at a time.
    • By default, after power-up or reset, only DAT0 is used for data transfer.
    • A wider data bus can be configured for data transfer, using either DAT0-DAT3 or DAT0-DAT7, by the eMMC host controller.
    • The eMMC device includes internal pull-ups for data lines DAT1-DAT7. Immediately after entering the 4-bit mode, the device disconnects the internal pull-ups of lines DAT1, DAT2, and DAT3. Correspondingly, immediately after entering the 8-bit mode, the device disconnects the internal pull-ups of lines DAT1–DAT7.

The signals on the eMMC interface are described below:

NameTypeDescription
CLKIClock
DSO/PPData Strobe
DAT0I/O/PPData
DAT1I/O/PPData
DAT2I/O/PPData
DAT3I/O/PPData
DAT4I/O/PPData
DAT5I/O/PPData
DAT6I/O/PPData
DAT7I/O/PPData
CMDI/O/PP/ODCommand/Response

9.4.5 Registers

This controller instance uses the common SD/SDIO/eMMC register interface. The register definitions are described in Register Section.

9.5 SDIO Interface

9.5.1 Overview

The SDIO Interface is a hardware block that acts as a host of the SD bus to transfer data between the SDIO card and the internal bus master.

9.5.2 Features

The SDIO interface supports the following features:

  • Compatible with the 4-bit SD 3.0 UHS-I protocol specification
  • Consistent with the register set in the SD-HCI spec, with some vendor-related registers added
  • Supports 1-bit/4-bit
  • Supports the following data transfer types defined in the SD-HCI spec:
    • PIO
    • SDMA
    • ADMA1
    • ADMA2
  • Supports the following speed modes defined in the SD 3.0 Specification:
    • Default Speed mode, up to 25MHz, 3.3V signaling
    • High Speed mode, up to 50MHz, 3.3V signaling
    • SDR12, SDR up to 25MHz, 1.8V signaling
    • SDR25, SDR up to 50MHz, 1.8V signaling
    • SDR50, SDR up to 100MHz, 1.8V signaling
    • DDR50, SDR up to 50MHz, 1.8V signaling
    • SDR104, SDR up to 208MHz, 1.8V signaling
  • Hardware generation/checking of CRC on all command and data transaction on the card bus
  • Supports read-wait control in SDIO cards
  • Supports suspend resume in SDIO cards
  • 1024 Bytes (2 x 512 Bytes data block) FIFO is used to send and receive data

9.5.3 Registers

This controller instance uses the common SD/SDIO/eMMC register interface. The register definitions are described in Register Section.

9.6 SD Interface

9.6.1 Overview

The SD Interface is a hardware block that acts as a host of the SD bus to transfer data between the SD card and the internal bus master.

9.6.2 Features

The SD interface supports the following features:

  • Compatible with the 4-bit SD 3.0 UHS-I protocol specification
  • Consistent with the register set in the SD-HCI spec, with some vendor-related registers added
  • Supports 1-bit/4-bit SD memory
  • Supports the following data transfer types defined in the SD-HCI spec:
    • PIO
    • SDMA
    • ADMA1
    • ADMA2
  • Supports the following speed modes defined in the SD 3.0 Specification:
    • Default Speed mode, up to 25MHz, 3.3V signaling
    • High Speed mode, up to 50MHz, 3.3V signaling
    • SDR12, SDR up to 25MHz, 1.8V signaling
    • SDR25, SDR up to 50MHz, 1.8V signaling
    • SDR50, SDR up to 100MHz, 1.8V signaling
    • DDR50, SDR up to 50MHz, 1.8V signaling
    • SDR104, SDR up to 208MHz, 1.8V signaling
  • Hardware generation/checking of CRC on all command and data transaction on the card bus
  • Card insertion/removal detection based on GPIO
  • 1024 Bytes (2 x 512 Bytes data block) FIFO is used to send and receive data
  • Supports 3.3V and 1.8V signaling switch

9.6.3 Registers

SD Host Controller Registers:

The base addresses of the Host Controller registers are:

  • SD1: 0xD4280000
  • SD2: 0xD4280800
  • SD3: 0xD4281000
  • SD4: reserved

9.6.3.1 Register Descriptions

SYSTEM ADDRESS REGISTER

SD_SYS_ADDR Offset: 0x0

BitsFieldTypeResetDescription
31:16DMA_ADDR_HRW0x0000DMA Address High.
(1)16 MSb of DMA system buffer starting byte address.
(2) This register is used with the Auto Cmd 23 to set a 32-bit block count value to the argument of cmd23.
This register would hold the upper 16bits of the cmd23 argument.
15:0DMA_ADDR_LRW0x0000DMA Address Low.
(1) 16 LSb of DMA system buffer starting byte address.
(2) This register is used with the Auto Cmd 23 to set a 32-bit block count value to the argument of cmd23.
This register would hold the lower 16bits of the cmd23 argument.
BLOCK SIZE REGISTER

SD_BLOCK_SIZE_CNT Offset: 0x4

BitsFieldTypeResetDescription
31:16BLOCK_COUNTRW0x0000Block Count. The host controller decrements the block count after each block transfer.
0x1 = 1 block.
...
0xFFFF = 65535 blocks.
The current value of block count is reflected in the Current Block Count Register.
15RSVDRO0Reserved for future use
14:12HOST_DMA_BDRYRW0x0Host DMA Buffer Boundary. This field specifies the host memory buffer boundary.
If this boundary is crossed, an interrupt (dma_int) is generated.
This interrupt is reflected in the field in the Normal Interrupt Status Register.
0x0 = 4 KB.
0x1 = 8 KB.
0x2 = 16 KB.
0x3 = 32 KB.
0x4 = 64 KB.
0x5 = 128 KB.
0x6 = 256 KB.
0x7 = 512 KB.
11:0BLOCK_SIZERW0x000Block Size
ARGUMENT REGISTER

SD_ARG Offset: 0x8

BitsFieldTypeResetDescription
31:16ARG_HRW0x0000Argument High. 16 MSb of Command Argument. This value is inserted into 48 bits command token bits[39:24].
15:0ARG_LRW0x0000Argument Low. 16 LSb of Command Argument. This value is inserted into 48 bits command token bits[23:8].
TRANSFER MODE AND COMMAND REGISTER

SD_TRANSFER_MODE_CMD Offset: 0xC

BitsFieldTypeResetDescription
31:30RSVDRO0Reserved for future use
29:24CMD_INDEXRW0x00Command Index. These bits are inserted into command token bits[45:40].
23:22CMD_TYPERW0x0Command Type.
0x0 = Normal command.
0x1 = Suspend command.
0x2 = Resume command.
0x3 = Abort command.
21DATA_PRESENTRW0x0Data Present.
1 = Indicates that data is present and will be transferred using the MMC1_DAT[3:0] line.
0 = Commands using only MMC1_CMD lines or commands with no data transfer but using busy signal on MMC1_DAT[0] line (for example, CMD 38).
20CMD_INDEX_CHK_ENRW0x0Command Index Check Enable.
1 = The host controller checks whether the index field in the response has the same value as the command index.
If not, it is reported as a Command Index Error.
19CMD_CRC_CHK_ENRW0x0Command CRC Check Enable.
1 = The host controller checks the CRC field in the response.
If an error is detected, it is reported as a command CRC error.
The number of bits checked by the CRC field value changes according to the response length.
18RSVDRO0Reserved for future use
17:16RESP_TYPERW0x0Response Type Select for SD/SD in SPI Modes.
For SD mode:
0x0 = No response.
0x1 = Response length is 136 bits.
0x2 = Response length is 48 bits.
0x3 = Response length is 48 bits and check busy after response.
CRC field for R3 and R4 is expected to be all 1 bits.
CRC check should be disabled for these response types.
For SD in SPI mode:
0x0 = Response length is 8 bits.
0x1 = Response length is 16 bits.
0x2 = Response length is 40 bits.
0x3 = Reserved.
15:6RSVDRO0Reserved for future use
5MULTI_BLK_SELRW0x0Multiple Block Select. This bit should be set to 1 only when multiple blocks are to be transferred.
4TO_HOST_DIRRW0x0Data Transfer Direction Select. This bit defines the direction of data transfer on the MMC1_DAT[3:0] lines. This bit is set to 1 by the host driver to transfer data from the SD card to the SD host controller, and it is set to 0 for all other commands.
3:2AUTO_CMD_ENRW0x0Auto CMD Enable. This field determines use of auto command functions.
0x0 = Auto Command disabled.
0x1 = Auto CMD12 Enable.
0x2 = Auto CMD23 Enable.
0x3 = Reserved.
1BLK_CNT_ENRW0x0Block Count Enable. This bit validates the value in the Block Count Register.
0DMA_ENRW0x0DMA Enable. If Programmed Input/Output (PIO) mode is required, this bit should be reset to 0.
RESPONSE REGISTER 0

SD_RESP_0 Offset: 0x10

BitsFieldTypeResetDescription
31:16RESP1RO0x0000Response 1
This register contains bits[39:24] of the response token.
15:0RESP0RO0x0000Response 0
This register contains bits[23:8] of the response token.
RESPONSE REGISTER 1

SD_RESP_1 Offset: 0x14

BitsFieldTypeResetDescription
31:16RESP3RO0x0000Response 3
For a 48-bit response token, this register is don't-care.
For a 136-bit response token, this register contains bits[71:56] of the response token.
15:0RESP2RO0x0000Response 2
For a 48-bit response token, this register is don't-care.
For a 136-bit response token, this register contains bits[55:40] of the response token.
RESPONSE REGISTER 2

SD_RESP_2 Offset: 0x18

BitsFieldTypeResetDescription
31:16RESP5RO0x0000Response 5. For a 48-bit response token, this register is don't-care. For a 136-bit response token, this register contains bits[103:88] of the response token.
15:0RESP4RO0x0000Response 4. For a 48-bit response token, this register is don't-care. For a 136-bit response token, this register contains bits[87:72] of the response token.
RESPONSE REGISTER 3

SD_RESP_3 Offset: 0x1C

BitsFieldTypeResetDescription
31:16RESP7RO0x0000Response 7. For a 48-bit response token, this register is don't-care. For a 136-bit response token, this register contains bits[127:120] of the response token. For Auto CMD12 response, this register contains bits[39:24] of the response token.
15:0RESP6RO0x0000Response 6. For a 48-bit response token, this register is don't-care. For a 136-bit response token, this register contains bits[119:104] of the response token. For Auto CMD12 response, this register contains bits[23:8] of the response token.
BUFFER DATA PORT 01 REGISTER

SD_BUFFER_DATA_PORT_01 Offset: 0x20

BitsFieldTypeResetDescription
31:16CPU_DATA1RW0x0Processor Data 1. 16 MSb of the buffer.
15:0CPU_DATA0RW0x0Processor Data 0. 16 LSb of the buffer.
PRESENT STATE REGISTER 1

SD_PRESENT_STATE_1 Offset: 0x24

BitsFieldTypeResetDescription
31:25RSVDRO0Reserved for future use
24CMD_LEVELRO0x1MMC1_CMD Line Signal Level. This status is used to check the MMC1_CMD line level to recover from errors and for debugging.
23:20DAT_LEVELRO0xFMMC1_DAT[3:0] Line Signal Level. This status is used to check the MMC1_DAT[3:0] line level to recover from errors and for debugging. This is especially useful in detecting the busy signal level from MMC1_DAT[0].
19WRITE_PROTRO0x0Write Protect. This field reflects the position of the write_protect latch on the SD card. This field should be ignored if there is no such feature being provided by the card in use.
18CARD_DETRO0x0Card Detect. This field reflects the value of the MMC1_CD pin. This field is only used for testing.
0 = Card not detected.
1 = Card detected.
17CARD_STABLERO0x0Card Stable. This field is only used for testing. It indicates the debounced value of the card present condition.
0 = Card unstable.
1 = Card stable.
16CARD_INSERTEDRO0x0Card Inserted. This field indicates the presence of an SD card.
0 = Card not inserted.
1 = Card inserted.
15:12RSVDRO0Reserved for future use
11BUFFER_RD_ENRO0x0Buffer Read Enable. This field changes from 0x0 to 0x1 when block data is ready in the buffer and from 0x1 to 0x0 when all the block data is read from the buffer.
10BUFFER_WR_ENRO0x1Buffer Write Enable. This field changes from 0x0 to 0x1 when block data can be written to the buffer. If this bit is set to 0x1, the entire block can be written to the buffer. This field changes from 0x1 to 0x0 when all the block data is written to the buffer.
9RX_ACTIVERO0x0Rx Active. This field indicates read transfer is active.
1 = Set.
8TX_ACTIVERO0x0Tx Active. Indicates that a write transfer is active.
0 = No valid write data exists in the host controller.
1 = Set.
7:4RSVDRO0Reserved for future use
3RETUNING_REQRO0x0Re-Tuning Request. This field provides the status of the sampling clock.
0x0 = Fixed or well tuned sampling clock.
1 = Sampling clock needs re-tuning.
2_DAT_ACTIVERO0x0Data Line Active. This field provides the status of the data line.
0 = Data line is free.
1 = Data line is in use.
1CMD_INHIBIT_DATRO0x0Command Inhibit Data. This field provides the host driver status for issuing data commands.
0 = Data command can be issued.
1 = Data command cannot be issued.
0CMD_INHIBIT_CMDRO0x0Command Inhibit Command. If this bit is 0, it indicates that the MMC1_CMD line is not in use, and the host controller can issue a command using the MMC1_CMD line.
This bit is set after the command register is written. This bit is cleared when the command response is received.
Even if the field is set to 1, commands using only the MMC1_CMD line can be issued if this bit is 0.
Changing from 1 to 0 generates a command complete interrupt in the Normal Interrupt Status Register.
If the host controller cannot issue the command because of a command conflict error, this bit remains 1, and command complete is not set.
HOST CONTROL REGISTER

SD_HOST_CTRL Offset: 0x28

BitsFieldTypeResetDescription
31:27RSVDRO0Reserved for future use
26W_REMOVALRW0x0Wakeup on Card Removal.
1 = Enable wakeup event on card removal detection.
0 = No wakeup event.
25W_INSERTIONRW0x0Wakeup on Card Insertion.
1 = Enable wakeup event on card insertion detection.
0 = No wakeup event.
24W_CARD_INTRW0x0Wakeup on Card Interrupt.
1 = Enable wakeup event on card interrupt detection.
0 = No wakeup event.
23:20RSVDRO0Reserved for future use
19INT_BLK_GAPRW0x0Block Gap Interrupt. This field is only valid for 4-bit mode.
1 = Enables interrupt detection at block gap for multiple block transfers.
18RD_WAIT_CTLRW0x0Read Wait Control. If the card supports read wait, set this bit to enable use of the read wait protocol to stop read data using the MMC1_DAT[2] line by host hardware.
Otherwise, the host controller has to stop the SD clock to hold read data.
When the host driver detects a card insertion, it sets this bit according to the CCCR of the SDIO card. This field is checked only at a block gap.
Within a block, hardware stalls the clock to stop read data if the host cannot accept any more data because of a full FIFO, etc.
When this field is cleared by software, operation continues.
During read wait, software can issue a different command for another operation as long as it does not require the MMC1_DAT[3:0] lines.
To continue the waiting operation, software needs to write 0 to this register.
17CONT_REQRWAC0x0Continue Request. This field is used to restart a transaction that was stopped using .
To cancel stop at the block gap, set the field to 0 and set this field to 1 to restart the transfer.
The host controller automatically clears this field in either of the following cases: in the case of a read transaction, MMC1_DAT[3:0] Line Active changes from 0 to 1 as the read transaction restarts; in the case of a write transaction, Write Transfer Active changes from 0 to 1 as the write transaction restarts.
Therefore, it is not necessary for the host driver to set this bit to 0.
If is set to 1, any write to this bit is ignored.
16STOP_AT_BLOCK_GAP_REQRW0x0Stop at Block Gap Request. This field is used to stop execution of a transaction at the next block gap for both DMA and non-DMA transfers.
Until transfer complete is set to 1, indicating transfer completion, the host driver leaves this bit set to 1.
Clearing both this field and the field does not cause the transaction to restart.
Read Wait is used to stop the read transaction at the block gap.
The host controller stops the clock at the block gap request for a write transfer, but for a read transfer, it stops the clock if is 0.
Otherwise, the host controller issues a Read Wait command to stop read data.
15:12RSVDRO0Reserved for future use
11:9SD_BUS_VLTRW0x0SD Bus Voltage. This field reflects the voltage at operating conditions.
0x7 = 3.3V.
0x6 = 3.0V.
0x5 = 1.8V.
0x0 to 0x4 = Reserved.
8SD_BUS_POWERRW0x0SD Bus Power. This field controls the power going out to the SD card. It will be cleared if one of the following occurs: the sd_bus_vlt and the voltage support in the Capabilities Register 1 do not match or if a card removal state was detected.
7CARD_DET_SRW0x0Card Detect Signal Selection. This field selects the source for card detection.
0 = Card detect input pin.
1 = Card detect test level (for debugging purposes only).
When the source for card detection is switched, the interrupt should be disabled during the switching period by clearing the Normal Interrupt Status Enable Register in order to mask unexpected interrupts being caused by the glitch.
This signal should be disabled via the Normal Interrupt Status Enable Register during debounce period.
6CARD_DET_LRW0x0Card Detect Test Level.
1 = Card inserted.
0 = No card inserted.
5EX_DATA_WIDTHRW0x0This bit controls the 8-bit mode.
0x0 = Data width for bus mode is determined by <DATA_WIDTH>.
0x1 = 8-bit data width.
4:3DMA_SELRW0x0DMA Select. One of the supported DMA modes is selected. The host driver checks DMA mode support using Capabilities Register 1. Use of the selected DMA mode is determined by the field in the Transfer Mode Register.
0x0 = SDMA.
0x1 = ADMA 1.
0x2 = 32-bit address ADMA2.
0x3 = Reserved.
2HI_SPEED_ENRW0x0Extend Data Output Enable.
0 = Normal.
1 = MMC1_CMD and MMC1_DAT[3:0] are driven from rising edge of clock.
1DATA_WIDTHRW0x0Data Width.
1 = 4-bit data mode.
0 = 1-bit data mode, using only MMC1_DAT[0]. Refer to the CE-ATA Register 2 for 8-bit mode support.
0LED_CTRLRW0x0LED Control.
1 = LED on.
0 = LED off.
CLOCK CONTROL REGISTER

SD_CLOCK_CTRL Offset: 0x2C

BitsFieldTypeResetDescription
31:27RSVDRO0Reserved for future use
26SW_RST_DATRWAC0x0Soft Reset for Data Port of Logic
25SW_RST_CMDRWAC0x0Soft Reset for Command Part of Logic
24SW_RST_ALLRWAC0x0Software Reset for All. This reset affects the status, state machine, and FIFOs synchronously. This field also resets all private registers.
23:20RSVDRO0Reserved for future use
19:16TIMEOUT_VALUERW0x0Timeout Value. Determines the interval used to detect timeouts on the MMC1_DAT[3:0] lines.
This timeout is initiated in the following cases: for a read transaction, while waiting for data from the card. This is referred to as the NAC timing value in the SD specification, which specifies the maximum time from a read command to read data (card data access time); for a write transaction, while waiting for data from the AXI slave, AXI master, or processor, or while waiting for the CRC status of a write block.
0x0 = SDCLK x 2^13.
0x1 = SDCLK x 2^14.
...
0xE = SDCLK x 2^27.
(For example, if sd_clk_frequency = base value, which is 200MHz, then timeout base = 50MHz (period = 20ns), and for the 0xE setting, timeout value = 2^27 * 20ns ≈ 2.684 seconds. If sd_clk_freq = base value/4, which is 50MHz, then timeout base = 50MHz/4 = 12.5MHz (period = 80ns), and for the 0xE setting, timeout value = 2^27 * 80ns ≈ 10.73 seconds.)
0xF = Reserved.
For other transactions, there are fixed timeouts defined as follows (unit in SDCLK cycles):
On the card: NCR = 64, maximum timing value from command to response; NID = 64 (5 in specification), maximum timing value from command to OCR response.
On the Host: NRC = 8, minimum timing value from response to next command; NCC = 8, minimum timing value from command to next command; NWR = 2, minimum timing value from data CRC status (from card in write transaction) to next write data in multiple write blocks; NST = 2, minimum timing from STOP command to end of write data.
Refer to the SD specification for more information on these fixed values.
15:8SD_FREQ_SEL_LORW0x00SDCLK Frequency Select Lower bits. This field, along with <SD_FREQ_SEL_HI>, defines the clock divider value used by the host controller.
Therefore, the final SD_FREQ_SEL = {SD_FREQ_SEL_HI[1:0], SD_FREQ_SEL_LO[7:0]}.
The selected value is multiplied by 2 to get the actual divide value.
For example:
SD_FREQ_SEL = 0x00 = Base clock.
SD_FREQ_SEL = 0x01 = Divide by 2 of base clock.
SD_FREQ_SEL = 0x02 = Divide by 4 of base clock.
SD_FREQ_SEL = 0x3 = Divide by 6 of base clock.
...
SD_FREQ_SEL = 0x3FF = Divide by 2046 of base clock.
7:6SD_FREQ_SEL_HIRW0x0SDCLK Frequency Select Upper bits. This field, along with <SD_FREQ_SEL_LO>, defines the clock divider value used by the host controller.
Therefore, the final SD_FREQ_SEL = {SD_FREQ_SEL_HI[1:0], SD_FREQ_SEL_LO[7:0]}.
The selected value is multiplied by 2 to get the actual divide value.
For example:
SD_FREQ_SEL = 0x00 = Base clock.
SD_FREQ_SEL = 0x01 = Divide by 2 of base clock.
SD_FREQ_SEL = 0x02 = Divide by 4 of base clock.
SD_FREQ_SEL = 0x3 = Divide by 6 of base clock.
...
SD_FREQ_SEL = 0x3FF = Divide by 2046 of base clock.
5CLK_GEN_SELRW0x0Clock Generator Select. This field is used to select the clock generator mode.
0x1 = Programmable Clock Mode.
0x0 = Divided Clock mode.
4:3RSVDRO0Reserved for future use
2SD_CLK_ENRW0x0SDCLK Clock Enable. This bit controls the SDCLK to the card. Before using the card, this bit should be set during the initialization phase.
1INT_CLK_STABLERO0x0Internal Clock Stable. This field is set to 1 once the controller detects that the internal clock is stable after setting of the <Internal Clock Enable> field.
0INT_CLK_ENRW0x0Internal Clock Enable. This field controls the SDCLK to the internal logic.
1 = Enable clock.
0 = Disable.
NORMAL INTERRUPT STATUS REGISTER

SD_NORMAL_INT_STATUS Offset: 0x30

BitsFieldTypeResetDescription
31CRC_STATUS_ERRRW1C0x0CRC Status Error
1 = CRC status start bit or CRC status end bit or boot ack status, returned from the card in write transaction has errors
30CPL_TIMEOUT_ERRRW1C0x0Command Completion Signal Timeout Error
This field is applicable for CE-ATA mode only.
1 = A command completion signal timeout occurred
29AXI_RESP_ERRRW1C0x0AXI Bus Response Error
1 = A response other than "OKAY" was received on the AXI bus.
28SPI_ERRRW1C0x0SPI Mode Error
1 = Error occurred in SPI mode for which cause can be determined by reading the <SPI Error Token> field in the SPI Mode Register.
0 = No error has occurred.
27:26RSVDRO0Reserved for future use
25ADMA_ERRRW1C0x0ADMA (Advanced Direct Memory Access) Error
This bit is set when the host controller detects any errors during an ADMA-based data transfer.
The ADMA state at the time an error occurs is saved in the ADMA Error Status Register.
The host controller also generates this interrupt when it detects any invalid descriptor data.
The <ADMA Error State> field in the ADMA Error Status Register indicates the state in which an error occurred.
The host driver may find that a Valid bit is not set at the error descriptor.
1 = Error
0 = No error
24AUTO_CMD12_ERRRW1C0x0Auto CMD12 Error
Occurs when detecting that one of the bits in Auto CMD12 Error Status Register has changed from 0 to 1.
23CUR_LIMIT_ERRRW1C0x0Current Limit Error
This feature is not supported and this bit will always be read as 0.
22RD_DATA_END_BIT_ERRRW1C0x0ReadData End Bit Error
1 = 0 detected at the end bit position of read data which uses the MMC1_DAT[3:0] line or at the end bit position of the CRC status
21RD_DATA_CRC_ERRRW1C0x0Read Data CRC Error
1 = read data which uses the MMC1_DAT[3:0] line transferred or Write CRC status having a value other than 010 detected
20DATA_TIMEOUT_ERRRW1C0x0Data Timeout Error
1 = Set when one of the following is detected: Busy timeout after write CRC status; Write CRC status timeout; Read data timeout
19CMD_INDEX_ERRRW1C0x0Command Index Error
0 = No command index error has occurred in the command response.
1 = Command index error has occurred in the command response.
18CMD_END_BIT_ERRRW1C0x0Command End Bit Error
0 = Detection of end bit of a command response in 1.
1 = Detection of end bit of a command response is 0.
17CMD_CRC_ERRRW1C0x0Command CRC Error
1 = Set in two cases:
- A CRC error is detected in the command response;
- The Host controller detects a MMC1_CMD line conflict by monitoring the MMC1_CMD line when a command is issued. The Host controller will abort the command (stops driving MMC1_CMD line). The <Command Timeout Error> field will also be set to 1 to distinguish MMC1_CMD line conflict.
16CMD_TIMEOUT_ERRRW1C0x0Command Timeout Error
1 = No response is returned within 64 SDCLK cycles from the end bit of the command
15ERR_INTRO0x0Error Interrupt
If any of bits in the Error Interrupt Status Register are set, then this bit is set.
14CQ_INTROC0x0Command Queuing Interrupt
This interrupt is asserted when at least one bit in the CQIS register is set. This interrupt is cleared only by clearing the source interrupt in the CQIS register.
13RSVDRO0Reserved for future use
12RETUNING_INTRW1C0x0Re-tuning Event Interrupt
This status is set if Re-Tuning Request in the <Present State Register> changes from 0x0 to 0x1.
The host controller requests the host driver to perform re-tuning for the next data transfer. The current data transfer can be completed without re-tuning.
11INT_CRW1C0x0This status is set if INT_C is enabled and INT_C# pin is in low level. Writing this bit to 0x1 does not clear this bit. It is cleared by resetting the INT_C interrupt factor. Refer to shared bus control register.
10INT_BRW1C0x0This status is set if INT_B is enabled and INT_B# pin is in low level. Writing this bit to 0x1 does not clear this bit. It is cleared by resetting the INT_B interrupt factor. Refer to shared bus control register.
9INT_ARW1C0x0This status is set if INT_A is enabled and INT_A# pin is in low level. Writing this bit to 0x1 does not clear this bit. It is cleared by resetting the INT_A interrupt factor. Refer to shared bus control register.
8CARD_INTRO0x0Card Interrupt
1 = The host controller detects an interrupt from the card.
7CARD_REM_INTRW1C0x0Card Removal Interrupt
1 = Card removal event detected.
6CARD_INS_INTRW1C0x0Card Insertion Interrupt
1 = Card insertion event detected.
5RX_RDYRW1C0x0Rx Ready
This status is set if the <Buffer Read Enable> field in the Present State Register 1 changes from 0x0 to 0x1.
4TX_RDYRW1C0x1Tx Ready
This status is set if the <Buffer Write Enable> field in the Present State Register 1 changes from 0x0 to 0x1.
3DMA_INTRW1C0x0DMA Interrupt
This status is set if the host controller detects DMA crossing over the <Host DMA Buffer Boundary> field in the Block Size Register.
2BLOCK_GAP_EVTRW1C0x0Block Gap Event
If the <Stop At Block Gap Request> field in the Block Gap Control Register is set, this field is set when a read/write transaction is stopped at a block gap. If the <Stop At Block Gap Request> field is not set to 1, this bit is not set to 1.
1XFER_COMPLETERW1C0x0Transfer Complete
This bit is set when a read/write transaction is completed.
For read transaction, this bit is set at the falling edge of Read Transfer Active Status.
There are two cases in which this occurs:
- data transfer is completed as specified by data length;
- data stopped at the block gap and completed data transfer by setting the <Stop At Block Gap Request> field in the SD Block Gap Control Register field;
For write transaction, this bit is set at the falling edge of the MMC1_DAT[3:0] Line Active status.
There are two cases in which this occurs:
- data transfer is completed as specified by data length and the busy signal released;
- data stopped at the block gap and completed data transfer by setting the <Stop At Block Gap Request> field
0CMD_COMPLETERW1C0x0Command Complete
This bit is set when the end bit of the command response (except Auto CMD12) is received. Note that Command Timeout Error has higher priority than Command Complete.
NORMAL INTERRUPT STATUS ENABLE REGISTER

SD_NORMAL_INT_STATUS_EN Offset: 0x34

BitsFieldTypeResetDescription
31CRC_STATUS_ERR_ENRW0x0CRC Status Error Enable. 0 = Disabled; 1 = Enabled.
30CPL_TIMEOUT_ERR_ENRW0x0CPL Timeout Error Enable. 0 = Disabled; 1 = Enabled.
29AXI_RESP_ERR_ENRW0x0AXI Response Error Enable. 0 = Disabled; 1 = Enabled.
28SPI_ERR_ENRW0x0SPI Error Enable. 0 = Disabled; 1 = Enabled.
27RSVDRO0Reserved for future use
26TUNING_ERR_ENRW0x0Tuning Error Enable. 0 = Disabled; 1 = Enabled.
25ADMA_ERR_ENRW0x0ADMA Error Enable. 0 = Disabled; 1 = Enabled.
24AUTO_CMD12_ERR_ENRW0x0Auto CMD12 Error Enable. 0 = Disabled; 1 = Enabled.
23CUR_LIM_ERR_ENRW0x0Current Limit Error Enable. 0 = Disabled; 1 = Enabled.
22RD_DATA_END_BIT_ERR_ENRW0x0Data End Bit Error Enable. 0 = Disabled; 1 = Enabled.
21RD_DATA_CRC_ERR_ENRW0x0Data CRC Error Enable. 0 = Disabled; 1 = Enabled.
20DATA_TIMEOUT_ERR_ENRW0x0Data Timeout Error Enable. 0 = Disabled; 1 = Enabled.
19CMD_INDEX_ERR_ENRW0x0Command Index Error Enable. 0 = Disabled; 1 = Enabled.
18CMD_END_BIT_ERR_ENRW0x0Command End Bit Error Enable. 0 = Disabled; 1 = Enabled.
17CMD_CRC_ERR_ENRW0x0Command CRC Error Enable. 0 = Disabled; 1 = Enabled.
16CMD_TIMEOUT_ERR_ENRW0x0Command Timeout Error Enable. 0 = Disabled; 1 = Enabled.
15RSVDRO0Reserved for future use
14CQ_STATUS_ENRW0x0Command Queuing Status Enable
13RSVDRO0Reserved for future use
12RETUNE_INT_ENRW0x0Re-tuning Interrupt Enable. 0 = Disabled; 1 = Enabled.
11INT_C_INT_ENRW0x0INT_C Enable. 0 = Disabled; 1 = Enabled.
10INT_B_INT_ENRW0x0INT_B Enable. 0 = Disabled; 1 = Enabled.
9INT_A_INT_ENRW0x0INT_A Enable. 0 = Disabled; 1 = Enabled.
8CARD_INT_ENRW0x0Card Interrupt Enable. 0 = Disabled; 1 = Enabled.
7CARD_REM_ENRW0x0Card Removal Status Enable. 0 = Disabled; 1 = Enabled.
6CARD_INS_ENRW0x0Card Insertion Status Enable. 0 = Disabled; 1 = Enabled.
5RD_RDY_ENRW0x0Buffer Read Ready Enable. 0 = Disabled; 1 = Enabled.
4TX_RDY_ENRW0x0Buffer Write Ready Enable. 0 = Disabled; 1 = Enabled.
3DMA_INT_ENRW0x0DMA Interrupt Enable. 0 = Disabled; 1 = Enabled.
2BLOCK_GAP_EVT_ENRW0x0Block Gap Event Enable. 0 = Disabled; 1 = Enabled.
1XFER_COMPLETE_ENRW0x0Transfer Complete Enable. 0 = Disabled; 1 = Enabled.
0CMD_COMPLETE_ENRW0x0Command Complete Enable. 0 = Disabled; 1 = Enabled.
NORMAL INTERRUPT STATUS INTERRUPT ENABLE REGISTER

SD_NORMAL_INT_STATUS_INT_EN Offset: 0x38

BitsFieldTypeResetDescription
31CRC_STATUS_ERR_INT_ENRW0x0CRC Status Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
30CPL_TIMEOUT_ERR_INT_ENRW0x0CPL Timeout Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
29AXI_RESP_ERR_INT_ENRW0x0AXI Response Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
28SPI_ERR_INT_ENRW0x0SPI Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
27RSVDRO0Reserved for future use
26TUNE_ERR_INT_ENRW0x0Tuning Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
25ADMA_ERR_INT_ENRW0x0ADMA Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
24AUTO_CMD12_ERR_INT_ENRW0x0Auto CMD12 Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
23CUR_LIM_ERR_INT_ENRW0x0Current Limit Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
22RD_DATA_END_BIT_ERR_INT_ENRW0x0Data End Bit Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
21RD_DATA_CRC_ERR_INT_ENRW0x0Data CRC Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
20DATA_TIMEOUT_ERR_INT_ENRW0x0Data Timeout Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
19CMD_INDEX_ERR_INT_ENRW0x0Command Index Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
18CMD_END_BIT_ERR_INT_ENRW0x0Command End Bit Interrupt Error Enable. 0 = Disabled; 1 = Enabled.
17CMD_CRC_ERR_INT_ENRW0x0Command CRC Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
16CMD_TIMEOUT_ERR_INT_ENRW0x0Command Timeout Error Interrupt Enable. 0 = Disabled; 1 = Enabled.
15RSVDRO0Reserved for future use
14CQ_SIGNAL_ENABLERW0x0Command Queuing Signal Enable
13CARD_ASYNC_INT_INT_ENRW0x0SDIO Card Async INT without AXI/SD function clock running Interrupt Enable.
0 = Disabled.
1 = Enabled.
12RETUNE_INT_INT_ENRW0x0Re-Tuning Interrupt Interrupt Enable.
0 = Disabled.
1 = Enabled.
11INT_C_INT_INT_ENRW0x0INT_C Interrupt Interrupt Enable.
0 = Disabled.
1 = Enabled.
10INT_B_INT_INT_ENRW0x0INT_B Interrupt Interrupt Enable.
0 = Disabled.
1 = Enabled.
9INT_A_INT_INT_ENRW0x0INT_A Interrupt Interrupt Enable.
0 = Disabled.
1 = Enabled.
8CARD_INT_INT_ENRW0x0Card Interrupt Interrupt Enable.
0 = Disabled.
1 = Enabled.
7CARD_REM_INT_ENRW0x0Card Removal Interrupt Enable.
0 = Disabled.
1 = Enabled.
6CARD_INS_INT_ENRW0x0Card Insertion Interrupt Enable.
0 = Disabled.
1 = Enabled.
5RX_RDY_INT_ENRW0x0Buffer Read Ready Interrupt Enable.
0 = Disabled.
1 = Enabled.
4TX_RDY_INT_ENRW0x0Buffer Write Ready Interrupt Enable.
0 = Disabled.
1 = Enabled.
3DMA_INT_INT_ENRW0x0DMA Interrupt Interrupt Enable.
0 = Disabled.
1 = Enabled.
2BLOCK_GAP_EVT_INT_ENRW0x0Block Gap Event Interrupt Enable.
0 = Disabled.
1 = Enabled.
1XFER_COMPLETE_INT_ENRW0x0Transfer Complete Interrupt Enable.
0 = Disabled.
1 = Enabled.
0CMD_COMPLETE_INT_ENRW0x0Command Complete Interrupt Enable.
0 = Disabled.
1 = Enabled.
AUTO CMD12 ERROR STATUS REGISTER

SD_AUTO_CMD12_ERROR_STATUS Offset: 0x3C

BitsFieldTypeResetDescription
31PRE_VAL_ENRW0x0Preset Value Enable
0x1 = Automatic selection by Preset Value is enabled.
0x0 = SDCLK and driver strength are controlled by the host driver.
30ASYNC_INT_ENRW0x1Asynchronous Interrupt Enable
This bit can be set to 0x1 if a card supports asynchronous interrupts and <async_int_support> is set to 0x1 in the Capabilities Register.
Asynchronous interrupt is effective when the DAT[1] interrupt is used in 4-bit SD mode (and zero is set to <int_pin_sel> in the Shared Bus Control Register).
If this bit is set to 0x1, the host driver can stop SDCLK during the asynchronous interrupt period to save power.
During this period, the host controller continues to deliver the Card Interrupt to the host when it is asserted by the card.
0x1 = Enabled.
0x0 = Disabled.
29:24RSVDRO0Reserved for future use
23SAMPLING_CLK_SELRW0x0Sampling Clock Select
The host controller uses this bit to select the sampling clock for receiving CMD and DAT.
This bit is set by the tuning procedure and is valid after tuning is completed (when <exe_tuning> is cleared).
Setting 0x1 means that tuning completed successfully, and setting 0x0 means that tuning failed.
Writing 0x1 to this bit is meaningless and ignored. The tuning circuit is reset by writing 0x0.
This bit can be cleared by setting <exe_tuning>.
Once the tuning circuit is reset, it takes time to complete the tuning sequence. Therefore, the host driver should keep this bit at 0x1 to perform a re-tuning sequence in a short time.
This bit must not be changed while the Host Controller is receiving a response or a read data block.
0x1 = Tuned clock is used to sample data.
0x0 = Fixed clock is used to sample data.
22EXE_TUNINGRWAC0x0Execute Tuning.
This bit is set to 0x1 to start the tuning procedure and is automatically cleared when the tuning procedure is completed. The result of tuning is indicated by <sampling_clk_sel>. The tuning procedure is aborted by writing 0x0.
0x1 = Execute Tuning.
0x0 = Not tuned or Tuning completed.
21:20DRV_STRENGTH_SELRW0x0Driver Strength Select.
The Host Controller output driver in 1.8V signaling is selected by this field. In 3.3V signaling, this field is not effective. This field can be set depending on the Driver Type A, C, and D support bits in the Capabilities Register.
This bit depends on the setting of <pre_val_en>. If <pre_val_en> = 0x0, this field is set by the host driver. If <pre_val_en> = 0x1, this field is automatically set to a value specified in one of the Preset Value registers.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
19SDH_V18_ENRW0x01.8V Signaling Enable
0x1 = 1.8V Signaling enable.
0x0 = 3.3V Signaling enable.
18:16UHS_MODE_SELRW0x0UHS Mode Select. This field is used to select one of the UHS-I modes and is effective when <sdh_v18_en> = 0x1.
If <pre_val_en> in the Host Control2 register is set to 0x1, the host controller sets SDCLK Frequency Select, Clock Generator Select in the Clock Control Register, and driver strength select according to the Preset Value registers.
In this case, one of the Preset Value registers is selected by this field.
The host driver should reset <sd_clk_en> before changing this field to avoid generating a clock glitch.
0x0 = SDR12.
0x1 = SDR25.
0x2 = SDR50.
0x3 = SDR104.
0x4 = DDR50.
All other values are Reserved.
For MMC mode, added two backdoor defined modes:
5 (101) = HS200 mode.
6 (110) = HS400 mode.
Normally, software only needs to set Rx114 HS200/HS400 modes.
15:8RSVDRO0Reserved for future use
7CMD_NOT_ISSUEDROC0x0Command Not Issued Due to Auto CMD12 Error
6:5RSVDRO0Reserved for future use
4AUTO_CMD_INDEX_ERRRW1C0x0Auto CMD12 or Auto CMD23 Error
This error occurs if the command index error occurs in response to a command.
0 = Disabled (No error).
1 = Enabled (Error occurred).
3AUTO_CMD_END_BIT_ERRRW1C0x0Auto CMD12 or Auto CMD23 End Bit Error
This error occurs when detecting that the end bit of command response is 0.
0 = Disabled (No error).
1 = Enabled (Error occurred).
2AUTO_CMD_CRC_ERRRW1C0x0Auto CMD12 or Auto CMD23 CRC Error
This error occurs when detecting CRC error in the command response.
0 = Disabled (No error).
1 = Enabled (Error occurred).
1AUTO_CMD_TIMEOUT_ERRRW1C0x0Auto CMD12 or Auto CMD23 Timeout Error
This error occurs if no response is returned within 64 SDCLK cycles from the end bit of command.
0 = Disabled (No error).
1 = Enabled (Error occurred).
0AUTO_CMD12_NOT_EXERW1C0x0Auto CMD12 Not Executed
This error occurs when the host controller cannot issue Auto CMD12 to stop multiple-block data transfer because of an error.
0 = Disabled (No error).
1 = Enabled (Error occurred).
CAPABILITIES REGISTER 1

SD_CAPABILITIES_1 Offset: 0x40

BitsFieldTypeResetDescription
31:30CFG_SLOT_TYPERW0x0Slot Type
This field indicates what type of slot the host controller is connected to.
0x0 = Removable card slot
0x1 = Embedded slot for one device
0x2 = Shared bus slot
0x3 = Reserved
29ASYNC_INT_SUPPORTRO0x1Asynchronous Interrupt Support.
0x1 = Asynchronous Interrupt Supported
0x0 = Asynchronous Interrupt not supported
28SYS_BUS_64_SUPPORTRO0x064-bit System Bus Support
This bit indicates whether the host controller supports a 64-bit system bus.
0x1 = 64-bit system bus supported
0x0 = 64-bit system bus not supported
27RSVDRO0Reserved for future use
26VLG_18_SUPPORTRO0x1Voltage Support 1.8V
This bit indicates whether the host controller supports 1.8V.
0x1 = 1.8V Supported
0x0 = 1.8V not supported
25VLG_30_SUPPORTRO0x0Voltage Support 3.0V
This bit indicates whether the host controller supports 3.0V.
0x1 = 3.0V Supported
0x0 = 3.0V not supported
24VLG_33_SUPPORTRO0x1Voltage Support 3.3V
This bit indicates whether the host controller supports 3.3V.
0x1 = 3.3V Supported
0x0 = 3.3V not supported
23SUS_RES_SUPPORTRO0x1Suspend Resume Support
This bit indicates whether the host controller supports suspend/resume commands.
0x1 = Suspend/Resume Supported
0x0 = Suspend/Resume not supported
22SDMA_SUPPORTRO0x1SDMA Support
This bit indicates whether the host controller supports SDMA.
0x1 = SDMA Supported
0x0 = SDMA not supported
21HI_SPEED_SUPPORTRO0x1High Speed Support
This bit indicates whether the host controller supports high-speed mode (25-50MHz).
0x1 = High speed mode Supported
0x0 = High speed mode not supported
20ADMA1_SUPPORTRO0x1ADMA1 Support
This bit indicates whether the host controller supports ADMA1.
0x1 = ADMA1 Supported
0x0 = ADMA1 not supported
19ADMA2_SUPPORTRO0x1ADMA2 Support
This bit indicates whether the host controller supports ADMA2.
0x1 = ADMA2 Supported
0x0 = ADMA2 not supported
18EX_DATA_WIDTH_SUPPORTRO0x18-bit Support
This bit indicates whether the host controller supports 8-bit bus operation.
0x1 = 8-bit Supported.
0x0 = 8-bit not supported.
17:16MAX_BLK_LENRO0x0Maximum Block Length
The maximum block length in bytes.
0x0 = 512 Bytes.
15:8BASE_FREQRO0x00Base Frequency
The base clock frequency for SDCLK.
0xC8 = 200MHz (actually 198.24MHz).
0x0 means the information is obtained by another method.
7TIMEOUT_UNITRO0x1Timeout Unit
The unit of base clock used to detect timeouts.
1 = MHz.
0 = kHz.
6RSVDRO0Reserved for future use
5:0TIMEOUT_FREQRO0x00Timeout Frequency
This value indicates the base clock frequency used to detect timeouts.
0x32 = 50MHz (actually 49.56MHz).
0x0 means the information is obtained by another method.
CAPABILITIES REGISTER 3

SD_CAPABILITIES_3 Offset: 0x44

BitsFieldTypeResetDescription
31:24RSVDRO0Reserved for future use
23:16CLK_MULTIPLIERRO0x0Clock Multiplier
This field indicates the clock multiplier value of the programmable clock generator.
0x0 means that the host controller does not support a programmable clock generator.
15:14RETUNE_MODESRO0x0Re-tuning modes.
This field selects the re-tuning method and limits the maximum data length.
0x0 = Mode1 = Timer.
0x1 = Mode2 = Timer and Re-Tuning Request.
0x2 = Mode3 = Auto Re-Tuning (for transfer) Timer and Re-Tuning Request.
0x3 = Reserved.
13SDR50_TUNERO0x1Use Tuning for SDR50 mode.
0x1 = SDR50 requires tuning.
0x0 = SDR50 does not require tuning.
12RSVDRO0Reserved for future use
11:8TMR_RETUNERO0xfTimer count for Re-Tuning.
This field indicates the initial value of the Re-Tuning Timer for Modes 1 to 3.
0xF = Get information from another source.
7RSVDRO0Reserved for future use
6DRV_TYPE_DRO0x1Driver Type D Support
0x1 = Driver Type D is supported.
0x0 = Driver Type D is not supported.
5DRV_TYPE_CRO0x1Driver Type C Support
0x1 = Driver Type C is supported.
0x0 = Driver Type C is not supported.
4DRV_TYPE_ARO0x1Driver Type A Support
0x1 = Driver Type A is supported.
0x0 = Driver Type A is not supported.
3RSVDRO0Reserved for future use
2DDR50_SUPPORTRO0x1DDR50 Support
0x1 = DDR50 is supported.
0x0 = DDR50 is not supported.
1SDR104_SUPPORTRO0x1SDR104 Support
0x1 = SDR104 is supported.
0x0 = SDR104 is not supported.
0SDR50_SUPPORTRO0x1SDR50 Support
0x1 = SDR50 is supported.
0x0 = SDR50 is not supported.
MAXIMUM CURRENT REGISTER 1

SD_MAX_CURRENT_1 Offset: 0x48

BitsFieldTypeResetDescription
31:24RSVDRO0Reserved for future use
23:16MAX_CUR_18RO0x0Maximum Current for 1.8V
0x0 = Get information by another method.
0x1 = 4mA.
0x2 = 8mA.
...
0xFF = 1020mA.
15:8MAX_CUR_30RO0x0Maximum Current for 3.0V
0x0 = Get information by another method.
0x1 = 4mA.
0x2 = 8mA.
...
0xF = 1020mA.
7:0MAX_CUR_33RO0x0Maximum Current for 3.3V
0x0 = Get information by another method.
0x1 = 4mA.
0x2 = 8mA.
...
0xF = 1020mA.
MAXIMUM CURRENT REGISTER 3

SD_MAX_CURRENT_3 Offset: 0x4C

BitsFieldTypeResetDescription
31:0RSVDRO0Reserved for future use
FORCE EVENT AUTO CMD12 ERROR REGISTER

SD_FORCE_EVENT_AUTO_CMD12_ERROR Offset: 0x50

BitsFieldTypeResetDescription
31F_CRC_STATUS_ERRWO0x0Force Event for CRC Status Error
When 1 is written at this location, it sets the <CRC Status Error> field in the Error Interrupt Status Register.
30F_CPL_TIMEOUT_ERRWO0x0Force Event for CPL Timeout Error
When 1 is written at this location, it sets the <Command Completion Signal Timeout Error> field in the Error Interrupt Status Register.
29F_AXI_RESP_ERRWO0x0Force Event for AXI Response Bit Error
When 1 is written at this location, it sets the <AXI Bus Response Error> field in the Error Interrupt Status Register.
28F_SPI_ERRWO0x0Force Event for SPI Error
When 1 is written at this location, it sets the <SPI Mode Error> field in the Error Interrupt Status Register.
27:26RSVDRO0Reserved for future use
25F_ADMA_ERRWO0x0Force Event for ADMA Error
When 1 is written at this location, it sets the <ADMA Error> field in the Error Interrupt Status Register.
24F_ACMD12_ERRWO0x0Force Event for Auto CMD12 Error
When 1 is written at this location, it sets the <Auto CMD12 Error> field in the Error Interrupt Status Register.
23F_CURRENT_ERRWO0x0Force Event for Current Limit Error
When 1 is written at this location, it sets the <Current Limit Error> field in the Error Interrupt Status Register.
22F_DAT_END_BIT_ERRWO0x0Force Event for Data End Bit Error
When 1 is written at this location, it sets the <Read Data End Bit Error> field in the Error Interrupt Status Register.
21F_DAT_CRC_ERRWO0x0Force Event for Data CRC Error
When 1 is written at this location, it sets the <Read Data CRC Error> field in the Error Interrupt Status Register.
20F_DAT_TO_ERRWO0x0Force Event for Data Timeout Error
When 1 is written at this location, it sets the <Read Data CRC Error> field in the Error Interrupt Status Register.
19F_CMD_INDEX_ERRWO0x0Force Event for Command Index Error
When 1 is written at this location, it sets the <Data Timeout Error> field in the Error Interrupt Status Register.
18F_CMD_END_BIT_ERRWO0x0Force Event for Command End Bit Error
When 1 is written at this location, it sets the <Command Index Error> field in the Error Interrupt Status Register.
17F_CMD_CRC_ERRWO0x0Force Event for Command CRC Error
When 1 is written at this location, it sets the <Command CRC Error> field in the Error Interrupt Status Register.
16F_CMD_TO_ERRWO0x0Force Event for Command Timeout Error
When 1 is written at this location, it sets the <Command Timeout Error> field in the Error Interrupt Status Register.
15:8RSVDRO0Reserved for future use
7F_ACMD12_ISSUE_ERRWO0x0Force Event for Command not Issued by Auto Cmd12 Error
When 1 is written at this location, it sets the <Command Not Issued Due to Auto CMD12 Error> field in the Auto CMD12 Error Status Register.
6:5RSVDRO0Reserved for future use
4F_ACMD_INDEX_ERRWO0x0Force Event for Auto CMD Index Error
When 1 is written at this location, it sets the <Auto CMD Error> field in the Auto CMD Error Status Register.
3F__ACMD_EBIT_ERRWO0x0Force Event for Auto CMD End Bit Error
When 1 is written at this location, it sets the <Auto CMD End Bit Error> field in the Auto CMD Error Status Register.
2F_ACMD_CRC_ERRWO0x0Force Event for Auto CMD CRC Error
When 1 is written at this location, it sets the <Auto CMD CRC Error> field in the Auto CMD Error Status Register.
1F_ACMD_TO_ERRWO0x0Force Event for Auto CMD Timeout Error
When 1 is written at this location, it sets the <Auto CMD Timeout Error> field in the Auto CMD Error Status Register.
0F_ACMD12_NEXE_ERRWO0x0Force Event for Auto CMD12 Not Executed Error
When 1 is written at this location, it sets the <Auto CMD12 Not Executed> field in the Auto CMD12 Error Status Register.
ADMA ERROR STATUS REGISTER

SD_ADMA_ERROR_STATUS Offset: 0x54

BitsFieldTypeResetDescription
31:3RSVDRO0Reserved for future use
2ADMA_LEN_ERRRW0x0ADMA Length Mismatch Error
This error occurs in the following two cases:
1:0ADMA_STATERW0x0ADMA Error State
This field indicates the state of ADMA when an error occurred during ADMA transfer. This field never indicates 0x2 because ADMA never stops in this state.
ADMA SYSTEM ADDRESS REGISTER 1

SD_ADMA_SYS_ADDR_1 Offset: 0x58

BitsFieldTypeResetDescription
31:16ADMA_SYS_ADDRRW0x0ADMA System Address
This register holds the byte address of the executing command in the Descriptor table.
At the start of ADMA, this register should be programmed to point to the start address of the Descriptor table.
This register is incremented whenever a descriptor line is fetched.
When an ADMA Error Interrupt is generated, this register holds a valid Descriptor address depending on the ADMA state.
15:0ADMA_SYS_ADDRRW0x0ADMA System Address
This register holds the byte address of the executing command in the Descriptor table.
At the start of ADMA, this register should be programmed to point to the start address of the Descriptor table.
This register is incremented whenever a descriptor line is fetched.
When an ADMA Error Interrupt is generated, this register holds a valid Descriptor address depending on the ADMA state.
ADMA SYSTEM ADDRESS REGISTER 3

SD_ADMA_SYS_ADDR_3 Offset: 0x5C

BitsFieldTypeResetDescription
31:16ADMA_SYS_ADDRRW0x0ADMA System Address
This register holds the byte address of the executing command in the Descriptor table.
At the start of ADMA, this register should be programmed to point to the start address of the Descriptor table.
This register is incremented whenever a descriptor line is fetched.
When an ADMA Error Interrupt is generated, this register holds a valid Descriptor address depending on the ADMA state.
15:0ADMA_SYS_ADDRRW0x0ADMA System Address
This register holds the byte address of the executing command in the Descriptor table.
At the start of ADMA, this register should be programmed to point to the start address of the Descriptor table.
This register is incremented whenever a descriptor line is fetched.
When an ADMA Error Interrupt is generated, this register holds a valid Descriptor address depending on the ADMA state.
PRESET VALUE REGISTER FOR INITIALIZATION

PRESET_VALUE_FOR_INIT Offset: 0x60

BitsFieldTypeResetDescription
31:30DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported in 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
29:27RSVDRO0Reserved for future use
26CLKGEN_SEL_VALRO0x0Clock Generator Select Value.
This bit is effective when the host controller supports a programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
25:16SDCLK_FREQ_SEL_VALRO0x004SDCLK Frequency Select Value.
10-bit preset value used to set <sdclk_freq_sel> in the Clock Control register.
15:14DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported in 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
13:11RSVDRO0Reserved for future use
10CLKGEN_SEL_VALRO0x0Clock Generator Select Value.
This bit is effective when the host controller supports a programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
9:0SDCLK_FREQ_SEL_VALRO0x100SDCLK Frequency Select Value
10-bit preset value used to set <sdclk_freq_sel> in the Clock Control register.
PRESET VALUE REGISTER FOR HIGH SPEED

PRESET_VALUE_FOR_HS Offset: 0x64

BitsFieldTypeResetDescription
31:30DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported in 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
29:27RSVDRO0Reserved for future use
26CLKGEN_SEL_VALRO0x0Clock Generator Select Value
This bit is effective when the host controller supports a programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
25:16SDCLK_FREQ_SEL_VALRO0x004SDCLK Frequency Select Value
10-bit preset value used to set <sdclk_freq_sel> in the Clock Control register.
15:14DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported in 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
13:11RSVDRO0Reserved for future use
10CLKGEN_SEL_VALRO0x0Clock Generator Select Value
This bit is effective when the host controller supports a programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
9:0SDCLK_FREQ_SEL_VALRO0x002SDCLK Frequency Select Value
10-bit preset value used to set <sdclk_freq_sel> in the Clock Control register.
PRESET VALUE REGISTER FOR SDR25

PRESET_VALUE_FOR_SDR25 Offset: 0x68

BitsFieldTypeResetDescription
31:30DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported in 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
29:27RSVDRO0Reserved for future use
26CLKGEN_SEL_VALRO0x0Clock Generator Select Value
This bit is effective when the host controller supports a programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
25:16SDCLK_FREQ_SEL_VALRO0x001SDCLK Frequency Select Value
10-bit preset value used to set <sdclk_freq_sel> in the Clock Control register.
15:14DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported in 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
13:11RSVDRO0Reserved for future use
10CLKGEN_SEL_VALRO0x0Clock Generator Select Value
This bit is effective when the host controller supports a programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
9:0SDCLK_FREQ_SEL_VALRO0x002SDCLK Frequency Select Value
10-bit preset value used to set <sdclk_freq_sel> in the Clock Control register.
PRESET VALUE REGISTER FOR SDR104

PRESET_VALUE_FOR_SDR104 Offset: 0x6C

BitsFieldTypeResetDescription
31:30DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported in 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
29:27RSVDRO0Reserved for future use
26CLKGEN_SEL_VALRO0x0Clock Generator Select Value
This bit is effective when the host controller supports a programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
25:16SDCLK_FREQ_SEL_VALRO0x002SDCLK Frequency Select Value
10-bit preset value to set <sdclk_freq_sel> in the Clock Control register.
15:14DRV_STRENGTH_VALRO0x0Driver Strength Select Value
Driver strength is supported by 1.8V signaling bus speed modes. This field is meaningless for 3.3V signaling.
0x0 = Driver Type B.
0x1 = Driver Type A.
0x2 = Driver Type C.
0x3 = Driver Type D.
13:11RSVDRO0Reserved for future use
10CLKGEN_SEL_VALRO0x0Clock Generator Select Value
This bit is effective when Host Controller supports programmable clock generator.
0x1 = Programmable clock generator.
0x0 = Divided clock.
9:0SDCLK_FREQ_SEL_VALRO0x0SDCLK Frequency Select Value
10-bit preset value to set <sdclk_freq_sel> in the Clock Control register.
SHARED BUS CONTROL REGISTER

SHARED_BUS_CTRL Offset: 0xE0

BitsFieldTypeResetDescription
31RSVDRO0Reserved for future use
30:24BEND_PWR_CTRLRW0x0Back-End Power Control
Each bit of this field controls back-end power supply for an embedded device. Host interface voltage is not controlled by this field. The number of devices supported is specified by <num_clk_pins> and a maximum of 7 devices can be controlled.
Each bit corresponds to each device. bit[24] corresponds to Device 1 and bit[30] corresponds to device 7.
The function of each bit is:
0x0 = Back-end power is off.
0x1 = Back-end power is supplied.
23RSVDRO0Reserved for future use
22:20INT_PIN_SELRW0x0Interrupt Pin Select
Interrupt pin inputs are enabled by this field. Enabling an unsupported interrupt pin has no effect.
0x0 = Interrupt is detected by interrupt cycle.
19RSVDRO0Reserved for future use
18:16CLK_PIN_SELRW0x0Clock Pin Select
One of the clock pin outputs is selected by this field.
0x0 = Clock Pins are disabled.
15RSVDRO0Reserved for future use
14:8BUS_WIDTH_PRESETRO0x0Bus Width Preset
This field defines the bus width preset for devices on a shared bus.
0x0 = Bus width defined by <data_transfer_width>.
0x1 = 8-bit mode.
7:6RSVDRO0Reserved for future use
5:4NUM_INT_PINSRO0x0Number of interrupt input pins
This field defines the number of interrupt input pins supported on the shared bus system.
0x0 = Interrupt input pins are not supported.
3RSVDRO0Reserved for future use
2:0NUM_CLK_PINSRO0x0Number of clock pins
This field indicates the supported clock pins used to select one of the devices on the shared bus.
0x0 = Shared bus is not supported.
SLOT INTERRUPT STATUS REGISTER

SD_SLOT_INT_STATUS Offset: 0xFC

BitsFieldTypeResetDescription
31:24VENDOR_VERRO0x0Version Number
23:16SD_VERRO0x2SD Host Specification Number
0x0 = Supports version 1.0.
0x1 = Supports version 2.0.
0x2 = Supports version 3.0.
All other values are reserved.
15:2RSVDRO0Reserved for future use
1SLOT_INT1RO0x0Interrupt Line for Slot 1
0SLOT_INT0RO0x0Interrupt Line for Slot 0
SD HOST CTRL VENDOR ID/PROJECT ID/VERSION ID REGISTER

SDHC_VID_PID Offset: 0x100

BitsFieldTypeResetDescription
31:28VERSION_IDRO0x10x1 means the first IP version in project "Aquila".
27:20PROJECT_IDRO0x10x1 means the first project, "Aquila," for vendor ASR.
19:0VENDOR_IDRO0xa1312Represents the vendor name "ASR" and contains three fields. Each field uses one or two hexadecimal digits to represent the English character's position in the alphabet.
bit[19:16]: a (A, 10th letter of the alphabet)
bit[15:8]: 0x13 (S, 19th letter of the alphabet)
bit[7:0]: 0x12 (R, 18th letter of the alphabet)
SDHC OPEARTION CONTROL REGISTER (CLOCK AND BURST SIZE SETUP REGISTER)

SDHC_OP_CTRL Offset: 0x104

BitsFieldTypeResetDescription
31:16RSVDRO0Reserved for future use
15WR_OSTDGRW0x0This field controls the outstanding write requests on AXI.
0x0 = Allow outstanding requests on AXI.
0x1 = Do not allow outstanding requests on AXI.
14RD_OSTDGRW0x0This field controls the outstanding read requests on AXI.
0x0 = Allow outstanding requests on AXI.
0x1 = Do not allow outstanding requests on AXI.
13:8RSVDRO0Reserved for future use
7WR_ENDIANRW0x1Write Endian
Data being written to the card is in the following format.
1 = Little Endian.
0 = Big Endian.
6RD_ENDIANRW0x1Read Endian
Data being read from the card is in the following format.
1 = Little Endian.
0 = Big Endian.
5AXI_NON_POST_WRRW0x0AXI Non-post Write
1 = All AXI master write requests are non-post write.
0 = Only the last request is issued as non-post write.
4PRIORITYRW0x0This is a static bit that is passed along as the most significant bit of the ID when AXI requests are made. This bit should be changed only before and after completion of a data command, and not in between.
0x0 = Low priority.
0x1 = High priority.
3:2DMA_SIZERW0x3FIFO Threshold
This field sets the FIFO threshold for the internal FSM to generate a DMA request to the AXI master. Supports only 256 bytes.
1:0BRST_SIZERW0x2DMA Burst Size on the AXI Fabric
Supports only 128 bytes.
SDHC OPERATION EXTEND CTRL REGISTER

SDHC_OP_EXT_REG Offset: 0x108

BitsFieldTypeResetDescription
31CEN_DEASSERTRW0x0Backdoor control bit to deassert the DPSRAM CENA/CENB port. By setting this bit, software gives DPSRAM CLKPA/CLKPB some extra clock cycles.
0 = CEN deasserted disable.
1 = CEN deasserted enable.
30:28ARM_EMARW0x7ARM Artisan SRAM extra time for memory read and write
000 is the fastest, and 111 is the slowest
27:26ARM_EMAWRW0x1ARM Artisan SRAM delay for the write operation by extending the internal write pulse.
00 is the fastest, and 11 is the slowest
25ARM_EMASRW0x0This field extends the pulse width of the ARM Artisan SRAM sense-amplifier enable signal. The default setting is low, but when driven high, the pulse is extended.
24ARM_RET1NRW0x1Retention mode 1 enable, active low.
23:20RSVDRO0Reserved for future use
19:16PRE_GATE_CLK_CNTRW0x9This field controls the number of clock cycles provided before clock gating is enabled on the sd_clk I/O pad.
15AUTOCMD12_XFER_ENABLERW0x0This is a backdoor enable bit.
When software performs CMD25 with Auto CMD12, two transfer interrupt generation conditions can be triggered: one is the write-operation busy-bit check, and the other is completion of the normal data transfer with Auto CMD12.
In theory, only completion of the busy-bit check generates the transfer complete interrupt.
If software wants to enable the other interrupt trigger condition, set this bit to 1.
By default, software can keep this bit at 0.
14PDLVMCRW0x0This field controls a power-down function for the internal 64x64 memory.
13PDFVSSMRW0x0This field controls a power-down function for the internal 64x64 memory.
12FORCE_CLK_ONRW0x0Force SD I/O Pad Clock On
Setting this field to 0x1 overrides the SD Clock I/O pad clock gate and forces the clock on.
This field is meant to be used in conjunction with the <OVRRD_CLK_OEN> field.
Bit [11]   Bit [12]   Setting
0              --              <Force SD I/O Pad Clock On> setting is ignored (not used)
1              0              Clocks are forced off
1              1              Clocks are forced on
11OVRRD_CLK_OENRW0x0Override Pad Clock Output Enable
Setting this field to 0x1 overrides the SD Pad clock output enable.
This field is meant to be used in conjunction with the <FORCE_CLK_ON> field.
Bit [11]   Bit [12]   Setting
0              --              <Force SD I/O Pad Clock On> setting is ignored (not used)
1              0              Clocks are forced off
1              1              Clocks are forced on
10CLK_OE_USE_POSRW0x10 = Use the internal clock falling-edge output (to eliminate the clock-signal tri-state issue).
1 = Use the internal clock rising-edge output.
This field controls whether the SD/eMMC bus CLK PAD output enable signal uses the clock rising-edge output or the clock falling-edge output.
Note: if software sets Rx160[31] = 1, the host runs in legacy mode and uses the external PHY only as GPIO.
In this condition, the bus clock signal is output directly to the PHY I/O through the test-mode interfaces, so it is recommended that software clear this bit.
9CLK_GATE_ONRW0x0Clock Gate On
0 = Enable dynamic clock gate.
1 = Enable clock free running.
This field affects all clock gates in the SD design if the <Clock Gate Ctl> field is set to 1.
8CLK_GATE_CTLRW0x0Clock Gate Ctl
0 = Disable software clock gating override.
1 = Enable software clock gating override.
7USE_DAT3RW0x0This field allows the card detect functionality to be detected using the DAT[3] pin.
0x0 = Use dedicated pin.
0x1 = Use DAT[3].
6PDWNRW0x0Power Down
This bit controls the Power Down port on the internal 2 port 64x64 FIFO.
5FIFO_CSRW0x0FIFO CS
This field should be written to 0x1 before any toggling of the PDWN bit.
4FIFO_CLKRW0x0FIFO Clock
This field should be set to 0x1 before any toggling of the PDWN bit.
3:2WTCRW0x0WTC
This field is used for FIFO speed setting.
1:0RTCRW0x0RTC
This field is used for FIFO speed setting.
SDHC LEGACY CTRL PARAMETERS REGISTER

SDHC_LEGACY_CTRL_REG Offset: 0x10C

BitsFieldTypeResetDescription
31:24GEN_PAD_CLK_CNTRW0x4aPad Clock Count
This field should be used in conjunction with <gen_pad_clk_on>.
This field configures the number of clock cycles generated on the IO pad. The default value of 0x4a will generate 75 clock cycles.
23:14RSVDRO0Reserved for future use
13:9SPI_ERR_TOKENRW0x0SPI Error Token
This is the SPI Error token received in command response when SPI mode is enabled.
8SPI_ENRW0x0Enable SPI Mode
This field indicates that SPI mode has been enabled. This will cause the host controller to drive the signals on the interface in accordance with SPI protocol.
1 = SPI mode enabled.
0 = SPI mode disabled.
7RSVDRO0Reserved for future use
6GEN_PAD_CLK_ONRWAC0x0Generate Pad Clock
This bit should be set in conjunction with the field <gen_pad_clk_cnt>. Setting this bit to 0x1 will generate the programmed number of clock cycles on the IO pad.
5SQU_FULL_CHKRW0x0SQU Full Check
This bit should be set to 0x1 only when a certain piece of memory in SQU is used in FIFO mode and a "read" transaction is going to be performed on the SD device.
4SQU_EMPTY_CHKRW0x0SQU Empty Check
This bit should be set to 0x1 only when a certain piece of memory in SQU is used in FIFO mode and a "write" transaction is going to be performed on the SD device.
3BOOT_ACKRW0x0Boot Ack
If boot ACK mode is enabled in the MMC device, this field should be written to 0x1 before issuing the alternate boot CMD0.
2INAND_SELRW0x1When the driver programs the highest byte of Rx0C, the registers related to the host DAT/CMD lines are reset.
0x1 = Enable soft reset when a command is triggered.
0x0 = Disable soft reset when a command is triggered.
1ASYNC_IO_ENRW0x0Asynchronous Read Interface Enable
This bit enables the asynchronous latching of input data.
0x1 = Async interface is enabled. The clock used to latch the input data and the internal logic clock are asynchronous.
0x0 = Async interface is disabled.
0PIO_RDFCRW0x1PIO mode read-operation FIFO check.
0x0 = Check whether all FIFO data has been read by the CPU. If not, the bus clock stops and the state stops at the beginning of the block read, then waits until all FIFO data for the last block has been read by the CPU. After that, the next block of data starts transferring (although with this method, the clock stop is still not in the block gap).
0x1 = Do not check whether the PIO-mode FIFO has been read by the CPU. It is recommended that software set this bit to 1 before using PIO mode. In very high-speed bus modes such as HS200/SDR104, software must set this bit.
SDHC LEGACY CTRL FOR CEATA DEVICE REGISTER

SDHC_LEGACY_CEATA_REG Offset: 0x110

BitsFieldTypeResetDescription
31:30RSVDRO0Reserved for future use
29:16CPL_TIMEOUTRW0x3FFFCommand Completion Signal Timeout Value
15:3RSVDRO0Reserved for future use
2CHK_CPLRW0x0Check Command Completion Signal
When this field is set to 0x1 and the <CE-ATA Card> field is set to 1, indication is sent to the host controller to check for command completion signal from the CE-ATA card.
1SND_CPLRW0x0Send Command Completion Disable Signal
When this field is set to 1 and the <CE-ATA Card> field is set to 1, indication is sent to the host controller to send the command completion disable signal to the CE-ATA card.
0CEATA_CARDRW0x0CE-ATA Card
1 = CE-ATA Card mode.
0 = Non CE-ATA card mode.
SDHC MMC DEVICE CTRL REGISTERS

SDHC_MMC_CTRL_REG Offset: 0x114

BitsFieldTypeResetDescription
31:24DAT_LEVELRO0xFFMMC1_DAT[7:0] Line Signal Level
This status is used to check the MMC_DAT[7:0] line level for error recovery and debugging. This is especially useful for detecting the busy signal level on MMC_DAT[0]. The lower 4 bits are the same as Rx26[7:4].
23:13RSVDRO0Reserved for future use
12MMC_CARDRW0x0MMC Card
1 = MMC Card mode.
0 = SD Card mode.
11MMC_RESETNRW0x1MMC Resetn
This bit controls the value of the pin MMC_RESETN going to the eMMC device.
10MMC_HS200RW0x0This bit is set when the host reads the DEVICE_TYPE[196] field of the Extended CSD register in the MMC card and the card supports HS200 mode. Set this bit before the host clock changes to 200MHz; see Chapter 6.6.4 of the eMMC 4.5 spec.
1 = MMC HS200 mode enabled.
0 = MMC HS200 mode disabled. Other backdoor registers can be used to enable HS200 mode; refer to the Rx3E registers.
9MMC_HS400RW0x0This bit is set when the host reads the DEVICE_TYPE[196] field of the Extended CSD register in the MMC card and the card supports HS400 mode. Set this bit before the host clock changes to 200MHz; follow the eMMC 5.0 spec.
1 = MMC HS400 mode enabled.
0 = MMC HS400 mode disabled. Other backdoor registers can be used to enable HS200 mode; refer to the Rx3E registers.
8ENHANCE_STROBE_ENRW0x0This bit controls whether the host/PHY uses the (delayed) strobe signal to sample the CMD response. This feature is for the enhanced HS400 mode in the eMMC 5.1 spec. Software should check the device-related EXT register to decide whether the host/PHY should support this feature.
7RSVDRO0Reserved for future use
6CPL_COMPLETERW1C0x0cpl_complete
This bit is set to 1 when a command completion signal is detected and the <cpl_complete Enable> field has been set to 1.
This field is cleared by writing 0x1.
A write of 0x0 has no effect.
5CPL_COMPLETE_ENRW0x0cpl_complete Enable
1 = When this bit is set to 0x1, it enables the cpl_complete bit to be set to 0x1 when a command completion signal is detected.
4CPL_COMPLETE_INT_ENRW0x0cpl_complete Interrupt Enable
1 = An interrupt will be generated whenever the <cpl_complete> field is set.
3RSVDRO0Reserved for future use
2MISC_INTRW1C0x0misc_int
This status bit is set to 1 when the programmed number of clocks in <gen_pad_clk_cnt> has completed and the <misc_int_en> field has been set to 0x1.
This field is cleared by writing 0x1.
A write of 0x0 has no effect.
1MISC_INT_ENRW0x0misc_int status enable
1 = When this bit is set to 0x1, it enables the misc_int bit to be set to 0x1 when the programmed number of clocks has been generated on the pad.
0MISC_INT_INT_ENRW0x0misc_int Interrupt Enable
0x1 = An interrupt will be generated whenever the <misc_int> field is set to 0x1.
SDHC RX CONFIGURATION REGISTER

SDHC_RX_CFG_REG Offset: 0x118

BitsFieldTypeResetDescription
31:28RSVDRO0Reserved for future use
27:18TUNING_DLY_INCRW0x0When HW auto-tuning is being performed, the host controller takes over control of the delay value programmed in the delay element. This field defines the value by which the delay is incremented for each step.
17:8SDCLK_DELAYRW0x0This field controls the delay value to the delay element.
7:4RSVDRO0Reserved for future use
3:2SDCLK_SEL1RW0x0This field is used for Rx data/CMD sample clock selection.
This field controls the second mux selection.
0x0 = Select clock from GPIO pad feedback.
0x1 = Select the clock output from DDL. For software tuning, software should set this field to 0x1.
0x2, 0x3 = Select internal clock.
1:0SDCLK_SEL0RW0x0This field is used for the software tuning process.
This field controls the first mux selection.
0x0 = Select clock from pad.
0x1 = Select inverted clock from pad.
0x2 = Select internal clock.
0x3 = Select inverted internal clock.
SDHC TX CONFIGURATION REGISTER

SDHC_TX_CFG_REG Offset: 0x11C

BitsFieldTypeResetDescription
31TX_MUX_SELRW0x0TX output clock selection.
0x0 = Select clock from inverter of base clock input.
0x1 = Select clock from DDLL output clock.
30TX_INT_CLK_SELRW0x0TX output clock selection.
0x0 = Select clock from the original inverter of base clock or DDLL output clock.
0x1 = Select clock from the inverter of the internal working clock. This guarantees hold time in default-speed mode or high-speed mode.
29TX_DLINE_SRC_SELRW0x0TX delay-line clock source selection.
0x0 = Select the base clock as the TX delay-line input source clock.
0x1 = Select the internal working clock as the TX delay-line input source clock. Normally, this bit only works in HS200 mode, but if DDR mode needs TX tuning, this TX delay-line input clock source bit should be forced to 0.
28:26RSVDRO0Reserved for future use
25:16TX_HOLD_DELAY1RW0x37This field controls the delay value for the TX delay element in SDR104 mode.
15:10RSVDRO0Reserved for future use
9:0TX_HOLD_DELAY0RW0xc5This field controls the delay value for the TX delay element for all modes other than SDR104 mode.
SDHC HW TUNING CONFIGURATION REGISTER

SDHC_HWTUNE_CFG_REG Offset: 0x120

BitsFieldTypeResetDescription
31:30RSVDRO0Reserved for future use
29:20TUNING_CLK_DLYRO0x0This RO field indicates the final DDLL delay counter value after tuning completes. During the tuning process, this field increases step by step, so it normally has no meaning if read during HW tuning.
19:10TUNING_WD_CNTRW0x0aThis field controls the tuning success window width. If the number of successful tuning attempts is >= TUNING_WD_CNT, tuning is successful, and HW chooses the middle of the window as the final tuning DDLL delay counter value. The default is 10 times per the spec requirement; the driver can adjust the total tuning count according to actual conditions.
9:0TUNING_TT_CNTRW0x27This field controls the total number of tuning attempts. The default is 40 times per the spec requirement; the driver can adjust the total tuning count according to actual conditions. The total tuning count equals TUNING_TT_CNT + 1.
SDHC HW TUNING CONFIGURATION2 REGISTER

SDHC_HWTUNE_CFG2_REG Offset: 0x124

BitsFieldTypeResetDescription
31:30RSVDRO0Reserved for future use
29:20TUNING_CLK_DLYRO0x0This RO field indicates the final DDLL delay counter value after tuning completes. During the tuning process, this field increases step by step, so it normally has no meaning if read during HW tuning.
19:10TUNING_WD_CNTRW0x0aThis field controls the tuning success window width. If the number of successful tuning attempts is >= TUNING_WD_CNT, tuning is successful, and HW chooses the middle of the window as the final tuning DDLL delay counter value. The default is 10 times per the spec requirement; the driver can adjust the total tuning count according to actual conditions.
9:0TUNING_TT_CNTRW0x27This field controls the total number of tuning attempts. The default is 40 times per the spec requirement; the driver can adjust the total tuning count according to actual conditions. The total tuning count equals TUNING_TT_CNT + 1.
SDHC ROUND TRIP(TRANSIMIT TO RECEIVE) TIMING PARAM REGSITER

SDHC_ROUNDTRIP_TIMING_REG Offset: 0x128

BitsFieldTypeResetDescription
31:28RSVDRO0Reserved for future use
27:24DATA0BUSY_WAIT_CYCLESRW0x2This field controls how many cycles after the end bit of CRC status in a write operation the host checks the DATA0 busy signal. Normally, only HS200/SDR104/HS400 should use this field.
23:20RSVDRO0Reserved for future use
19:16WRDATA0_WAIT_CYCLESRW0x5This field is valid only when bit[2], bit[1], or bit[0] of this register is set for the corresponding speed mode.
If bit[1] or bit[0] is set, this field indicates how many cycles the host controller internal DATA FSM should wait during the bus driving direction turnaround from the DATA0 end bit to the start bit of CRC status when performing a bus write operation.
15:12RSVDRO0Reserved for future use
11:8CMD2RESP_WAIT_CYCLESRW0x5This field is valid only when bit[2], bit[1], or bit[0] of this register is set for the corresponding speed mode.
If bit[1] or bit[0] is set, this field indicates how many clock cycles the host controller internal CMD FSM should wait during the bus driving direction turnaround from the CMD end bit to the response start bit.
7:3RSVDRO0Reserved for future use
2TRS2RCV_PARAM_EN2RW0x0This field controls whether, in HS400 mode, software is enabled to control the wait cycles inserted during the CMD/DATA transmit-to-receive direction turnaround period.
In theory, HS400 mode needs this enabled because of PHY output and input DLL latency.
1TRS2RCV_PARAM_EN1RW0x0This field controls whether, in DDR50/SDR50 mode, software is enabled to control the wait cycles inserted during the CMD/DATA transmit-to-receive direction turnaround period.
0TRS2RCV_PARAM_EN0RW0x0This field controls whether, in HS200/SDR104 mode, software is enabled to control the wait cycles inserted during the CMD/DATA transmit-to-receive direction turnaround period.
SDHC GPIO CFG REGISTER

SDHC_GPIO_CFG_REG Offset: 0x12C

BitsFieldTypeResetDescription
31:16SDHC_GPORO0x0Value to be driven to the GPO pins. Software programs these 16 bits, and the value is shown on the GPO output ports on the SDHC top module.
15:0SDHC_GPIRO0x0Value on GPI input ports. These 16-bit fields are read-only.
SDHC DELAYLINE CONTROL REGISTER

SDHC_DLINE_CTRL_REG Offset: 0x130

BitsFieldTypeResetDescription
31:24TX_DLINE_CODERW0x0Delay-line DTC delay control signals. Software programs this field for the tuning process. For the detailed delay-line equation, refer to the delay-line documentation.
23:16RX_DLINE_CODERW0x0Delay-line DTC delay control signals. Software programs this field for the tuning process. For the detailed delay-line equation, refer to the delay-line documentation.
15:1RSVDRO0Reserved for future use
0DLINE_PURW0x0Power-up signal:
0 = Power down.
1 = Power up.
The time period from when the Power up signal is set to when the internal regulator output voltage becomes stable is about 100ns.
SDHC DELAYLINE CFG REGISTER

SDHC_DLINE_CFG_REG Offset: 0x134

BitsFieldTypeResetDescription
31:24RSVDRO0Reserved for future use
23:16TX_DLINE_REGRW0x0Set delay line parameter for tuned clock in HS200 and DDR52 mode.
<7:3>: Reserved reg bits
<2>: Bypass delay code synchronization (default: 1'b0)
<1:0>: Delay step per code:
  2'b00 : 28.14ps
  2'b01 : 37.9ps
  2'b10 : 42.91ps
  2'b11 : 52.76ps
15:8RSVDRO0Reserved for future use
7:0RX_DLINE_REGRW0x1FSet delay line parameter for tuned clock in HS200 and DDR52 mode.
<7:3>: Reserved reg bits
<2>: Bypass delay code synchronization (default: 1'b0)
<1:0>: Delay step per code:
  2'b00 : 28.14ps
  2'b01 : 37.9ps
  2'b10 : 42.91ps
  2'b11 : 52.76ps
SDHC PHY CONTROL REGISTER

SDHC_PHY_CTRL_REG Offset: 0x160

BitsFieldTypeResetDescription
31HOST_LEGACY_MODERW0x0This field is a backdoor register that allows software to use the old legacy-topology host mode.
By default, because of eMMC5 PHY/host topology changes, the clock generation logic moves into the PHY, and the PHY outputs the working clock to the host.
If software sets this bit, the following are true:
1. Host will use internal clock divider to generate clock.
2. Affects software/HW RX tuning; the host uses the Rx118/Rx130 setting for DLL slave delay-line control. Otherwise, it keeps using the newly added Rx168 setting for DLL slave delay-line control.
3. The host treats the PHY only as GPIO, using only the PHY test-mode interface signals TDI/TDO/TDOE to output/input data/CMD/CLK.
4. If software sets host_legacy_mode, it is recommended not to support HS400 mode; the base clock frequency should be set to ≤200MHz and only up to HS200 mode.
5. TBD: Whether to add backdoor delayline in RX/TX tuning path for clock tuning not using PHY internal delayline.

0x0 = Host legacy mode disabled (default: use the new external eMMC5.0/SD PHY topology).
0x1 = Host legacy mode enable.
30:24RSVDRO0Reserved for future use
23:16PHY_DCHNL_STATUSRO0x01Current PHY 8-data-channel enable status. On reset, HW logic enables the 1-bit mode data channel by default.
15:8PHY_DCHNL_SWRW0x0Software-programmed 8-data-channel enable signals. Each bit represents one data channel. The meaning of each bit value is as follows:
0x1 = This data channel is enabled.
0x0 = This data channel is disabled.
Note: CMD channel is always enabled inside PHY.
7:3RSVDRO0Reserved for future use
2PHY_DCHNL_SELRW0x0PHY 8-data-channel software-enable selection. If software wants to control PHY data-channel function enable, it should first set this bit and then set the corresponding bits in bit[15:8].
0x1 = PHY data-channel function enable is controlled by the software-programmed register bits in bit[15:8]. If this bit is set, software should set bit[15:8] before using the PHY for data transfer.
0x0 = PHY data-channel function enable is automatically controlled by host hardware logic.
In this mode, software can read bit[23:16] for the current HW data-channel control status.
Normally, for the eMMC protocol, host HW automatically sets 8 data-channel function enables during initialization; for the SD protocol, HW sets 4 data-channel function enables during initialization.
1PHY_PLL_LOCKRW0x0When software follows the PHY programming sequence, after software enables the PHY input source clock from APMU offset 0xE0, software should also program this bit to 1 so the PHY knows the internal 400MHz input clock source is stable.
0x1 = PHY 400MHz clock source input stable signal.
0x0 = PHY 400MHz clock source input unstable.
0PHY_FUNC_ENRW0x0PHY function enable signal. The PHY uses this enable signal for internal circuit reset.
If the host core logic enters lower-power mode, power gating (udr_latch) should keep phy_en = 0.
For normal operation, software should configure the other PHY-related settings before setting this bit and using the PHY.
0x1 = PHY function enable / PHY power up.
0x0 = PHY function disable / PHY enter lower power mode.
SDHC PHY FUNCTION CONFIGURATION REGISTER

SDHC_PHY_FUNC_REG Offset: 0x164

BitsFieldTypeResetDescription
31:19RSVDRO0Reserved for future use
18RX_USE_STROBERO0x0From host, indicates HS400 DDR mode.
rx_use_strobe = (uhs_mode[2:0] == 110b) | hs400_mode | enhance_strobe_en.
17RX_USE_DLYLINERO0x0From host, indicates HS200 or SDR104. The host also has a backdoor register (bit3) for setting this bit in SDR50/DDR50(52) modes.
16TX_USE_INVERTRO0x0This field is set when one of the below two conditions is met:
1. Rx3E<2:0> is set to all SDR mode.
2. Rx118<30> = 0 is set. (Note: Rx118<30> set to 1 only affects PHY Test mode output paths (TDO/TDOE) signals; all functional output data/cmd and output enable signals are controlled by PHY logic).
15HS200_USE_RFIFORW0x1Controls whether SW enables CMD line RFIFO when running at HS200/HS400 mode:
0x0 = Disable CMD line use of RFIFO in HS200/HS400 (default: HS200 mode uses Delayline output clock to sample data and directly sampled again by host internal core clock).
0x1 = Enable CMD line RFIFO in HS200/HS400 (if enabled, delayline output clock sampled data will go to Async FIFO, then pop out of FIFO and go to host).
14RX_DIS_CKSTOPRW0x0Due to PHY addition, input data latency increases. This backdoor register disables stopping clock behavior in the middle of a data block when FIFO overflow conditions occur; only permits stopping clock at block gaps.
This field is actually a backdoor register for only SDR25/HS50/DDR50 or lower modes, since for HS200/HS400 higher modes, the SPEC claims the bus clock cannot stop in the middle of a data block.
13PHY_TDI_SELRW0x1Controls PHY test mode input signal TDI source selection:
0x0 = TDI will be sampled by PHY internal clock signal (normally same as host working clock cclk_in from PHY).
0x1 = TDI directly from PHY internal IO pad DI port.
12TX_CKOUT_REVERSERW0x0Backdoor register to control whether host controller reverses the output data phase:
0x0 = Keep original design clock odd/even output phase (odd phase always 0, even phase = card_clk_en).
0x1 = Reverse odd phase data to even output port, reverse even phase data to odd output port.
11TX_DDR_REVERSERW0x0Backdoor register to control whether host controller reverses the output data phase:
0x0 = Keep original design data odd/even output phase.
0x1 = Reverse odd phase data to even output port, reverse even phase data to odd output port.
10RX_DDR_BKENRW0x0Backdoor register to control DDR mode RX direction (whenever DDR50 mode). Forces PHY to use delayline output clock's both edges to sample bus data in PHY, and then output dqin_o[7:0] and dqin_e[7:0] to host. Delayline's input clock is cki.
0x1 = Backdoor mode is enabled.
0x0 = Backdoor mode is disabled.
9RFIFO_BYPASSRW0x0If set, Host will bypass PHY interface Read FIFO on HS400 mode. Otherwise, host will use ck_rx_cmd to directly sample CMD in certain modes. Normally, RFIFO is needed in HS400 mode since the internal clock is async with PHY output data/CMD Rx clock.
Note: This bit only works at HS400 mode. For tuning mode using free-running clock cases, DATA/CMD Async read path can choose data async FIFO put in host RX interface (use async_io_en, Rx10C<1>).
8CMD_USE_EVENRW0x1Indicates whether CMD uses 3/4T DS sampled signal as controller input when in enhanced HS400 mode. Default uses 1/4T DS sampled signal.
7PHY_TEST_ENRW0x0PHY test mode enable signal, controls pad output and output enable signals' source:
If PHY_TEST_EN=1, Test mode enabled (PHY bypass mode) - Pad output is controlled directly by TDO (output data) and TDOE (output enable) from host normal function.
This field has a different meaning than Rx160<31> host_legacy_mode. host_legacy_mode has strong effects, but this field only affects data/cmd/clk input/output paths.
If SW sets this bit, only item 3 of Rx160<31>=1 takes effect:
0x1 = Host will treat PHY just as GPIO, only using PHY test mode interface signals TDI/TDO/TDOE to output/input data/CMD/CLK.
0x0 = Host will use EMMC normal function data/cmd/clk paths.
Note: Recommended SW to set this bit in Bootrom for safety purposes.
APMU also has a backdoor register which can configure PHY to enter bypass mode, but setting APMU registers will let TDO/TDOE come from other MFPI functions, not the EMMC controller.
If SW wants to use this mode, it assumes PHY internal clock generation logic is OK.
This bit is not suitable for DDR mode backup methods; otherwise, please use Rx160<31> for using the whole pure backup method
(just using PHY's IO pad).
6:4PHY_MODE_STATUSRO0x0These 3 bits reflect current PHY working mode selection in host design:
If PHY_MODE_SWEN = 1, this field value equals PHY_MODE_SW[2:0].
If PHY_MODE_SWEN = 0, this field value equals HW internal logic controlled signal PHY_MODE_HW[2:0].
3:1PHY_MODE_SWRW0x0These 3 bits only work when SW sets PHY_MODE_SWEN=1. SW can program these 3 bits to force host controller to use "PHY_MODE_SW" field and ignore host internal HW generated mode selection signal "PHY_MODE_HW":
0x000 = MMC default speed mode (≤26MHz), SD DS/SDR12/SDR25 (≤50MHz).
0x001 = MMC HS mode (≤50MHz, SDR protocol), SD mode SDR50 (≤100MHz).
0x010 = DDR50 (or DDR52).
0x011 = HS200 (or SDR104).
0x100 = HS400.
0x101 = HS400 CMD enhanced mode.
All other values are Reserved.
0PHY_MODE_SWENRW0x0This bit gives SW the ability to control PHY working mode selection. If set, SW should synchronously set bit[3:1] (PHY_MODE_SW).
SDHC PHY DLL CONFIGURATION REGISTER

SDHC_PHY_DLLCFG_REG Offset: 0x168

BitsFieldTypeResetDescription
31DLL_ENABLERW0x0Enable DLL.
0 = DLL function disabled (power down).
1 = DLL function enabled (power up).
30DLL_DELAY_SRCRW0x0PHY internal dedicated delay-line input clock source selection.
0: The delay-line input clock defaults to PCLK (bus clock feedback) as the source.
1: Provides another option for the PHY to change the delay-line input clock source to the PHY internal cki (cclk_in). This option normally works only in HS200 mode for the host manual tuning method.
29DLL_REFRESH_SWRW0x01 = Software requests a manual update of the DLL_REFRESH signal.
0 = Software keeps the manual-update DLL_REFRESH signal invalid.
28DLL_REFRESH_SWENRW0x01 = Software controls enabling of the manual-update DLL_REFRESH signal.
0 = Host HW controls the manual-update DLL_REFRESH signal.
27DLL_REFRESH_ENABLERW0x11 = The host controller generates the DLL_REFRESH signal to manually adjust the delay of the strobe signal.
0 = DLL_REFRESH signal will be always 0.
26:16RSVDRO0Reserved for future use
15:8DLL_DELAY_CTRLRW0x0PHY DLL slave delay-line tuning delay-value control for HS400 mode if the PHY does not use the internal DLL master counter value to update the DLL slave.
This field only works when dll_reg1<1> (Rx168<1>) = 1.
Note: Due to the new eMMC5.x topology, the DLL slave delay line is inside the PHY.
Therefore, if the old topology is used with host_legacy_mode (Rx160<31>=1), or for HS200/DDR50 tuning,
use the Rx114/Rx130/Rx134 registers to control the HW/software tuning process.
7:6DLL_VREG_CTRLRW0x1DLL regulator output voltage control
5:4DLL_FULLDLY_RANGERW0x1DLL delayline full delay range
3:2DLL_PREDLY_NUMRW0x1DLL delayline Pre-delay numbers
1DLL_BYPASS_ENABLERW0x0DLL Master Bypass Enable for HS400:
1 = DLL master is bypassed, and DLL_DELAY_CTRL directly controls the slave DLL.
0 = DLL on. Use delay value from master DLL.
0DLL_REFRESH_METHODRW0x0DLL master code refresh method:
1 = Always refreshed by ck_refresh synchronized to filter clock.
0 = Before locked: refreshed by ck_refresh. After locked: refreshed by host generated dll_refresh rising edge.
SDHC PHY DLL CONFIGURATION1 REGISTER

SDHC_PHY_DLLCFG1_REG Offset: 0x16C

BitsFieldTypeResetDescription
31:24DLL_REG4_CTRLRW0x00For detailed bits, refer to the analog PHY pinlist descriptions for 'dll_reg4'
23:16DLL_REG3_CTRLRW0x0eFor detailed bits, refer to the analog PHY pinlist descriptions for 'dll_reg3'
15:8DLL_REG2_CTRLRW0x4aFor detailed bits, refer to the analog PHY pinlist descriptions for 'dll_reg2'
7:0DLL_REG1_CTRLRW0x00For detailed bits, refer to the analog PHY pinlist descriptions for 'dll_reg1'
SDHC PHY DLL STATUS & RESERVED CONFIGURATION REGISTER

SDHC_PHY_DLLSTS_REG Offset: 0x170

BitsFieldTypeResetDescription
31:16RSVDRO0Reserved for future use
15:8PHY_WORK_MODERO0x0This field indicates the current PHY working-mode flags from PHY output signal rdo_reg2<7:0>:
<7>: SDR26
<6>: SDR52
<5>: DDR52
<4>: HS200
<3>: HS400
<2>: cmd__extd_mode
<1>: start_dll
<0>: dll_error
7:2RSVDRO0Reserved for future use
1DLL_REFRESH_STATERO0x0This bit indicates the refresh-signal state in DLL manual-refresh mode. This bit is valid only when DLL_REFRESH_EN is set.
0: No refresh.
1: Manual refresh state (from DLL_REFRESH_HW host HW control logic).
0DLL_LOCK_STATERO0x0This bit indicates whether the master DLL is in the LOCK state.
0: UNLOCK state.
1: LOCK state.
Only if dll_lk is 1'b1, the RX path works in HS400 and HS400_extend mode.
SDHC PHY DLL STATUS1 REGISTER

SDHC_PHY_DLLSTS1_REG Offset: 0x174

BitsFieldTypeResetDescription
31:24RSVDRO0Reserved for future use
23:16DLL_MASTER_DELAYRO0x0The latest delay value for the delay line in the master DLL.
Unit: 1 Delay unit.
Note: This field always reflects the up-to-date value no matter whether DLL is locked or not.
15:8RSVDRO0Reserved for future use
7:0DLL_SLAVE_DELAYRO0x0This field reflects the delay value currently used for the strobe signal, or the final delay value used by the software/HW tuning process.
SDHC PHY PAD CONFIGURATION REGISTER

SDHC_PHY_PADCFG_REG Offset: 0x178

BitsFieldTypeResetDescription
31:22RSVDRO0Reserved for future use
21:20CLK_PURW0x0CLK pull-up 2-bit resistor selection:
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
19:18DS_PURW0x0DS pull-up 2-bit resistor selection:
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
17:16CMD_PURW0x2CMD pull-up 2-bit resistor selection:
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
15:14RSVDRO0Reserved for future use
13:12CLK_PDRW0x2CLK pull-down 2-bit resistor selection:
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
11:10DS_PDRW0x2DS pull-down 2-bit resistor selection:
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
9:8CMD_PDRW0x0CMD pull-down 2-bit resistor selection:
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
7RSVDRO0Reserved for future use
6IO_DRV_HZRW0x0This backdoor bit can enable the bus I/O high-Z state after the analog eMMC PHY fixes the AutoCMD23 timeout issue (I/O floating or uncontrollable) when PHY_EN switches.
1'b1 = Enable High-Z state.
1'b0 = Disable High-Z state.
5RX_BIASRW0x11'b0 = High current mode.
1'b1 = Low current mode.
4:3SLEW_RATERW0x0PAD slew-rate control:
00 = low.
01 = medium.
10 = high.
11 = very high.
2:0DRIVE_SELRW0x4Drive nominal impedance selection:
000 = high-Z.
001 = 200.
010 = 100.
011 = 66.
100 = 50.
101 = 40.
110 = 33.
111 = 33.
SDHC PHY PAD CONFIGURATION1 REGISTER

SDHC_PHY_PADCFG1_REG Offset: 0x17C

BitsFieldTypeResetDescription
31:16DQX_PURW0xaaaaDQ pull-up resistor value selection. Every two bits represent one I/O (x represents 7~0).
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
15:0DQX_PDRW0x0DQ pull-down resistor value selection. Every two bits represent one I/O (x represents 7~0).
00 = high-Z.
01 = 50K ohms.
10 = 40K ohms.
11 = 33K ohms.
SDHC PHY LOOPBACK CONTROL REGISTER

SDHC_PHY_LBCTRL_REG Offset: 0x180

BitsFieldTypeResetDescription
31CLEAR_LB_ERR_STATUSWO0x0Write 1 to clear the SDHC_PHY_LBSTS_REG register.
30:3RSVDRO0Reserved for future use
2START_STUCK0_DET_CLKRWAC0x0After the operation finishes, check the EMMC_LB_Err_Status register.
1START_STUCK1_DET_CLKRWAC0x0After the operation finishes, check the EMMC_LB_Err_Status register.
0LB_TEST_TRIGGERRWAC0x0Start loopback testing immediately. Before setting this bit, the host driver should program the SDHC_PHY_LBCNT_REG register (offset: 0x188).
When the SDHC_PHY_LBCNT_REG register reaches 0, loopback testing stops and this bit is cleared automatically.
Takes effect only when Loopback Mode Enable is set.
SDHC PHY LOOPBACK FUNCTION CONFIGURATION REGISTER

SDHC_PHY_LBFUNC_REG Offset: 0x184

BitsFieldTypeResetDescription
31:28RSVDRO0Reserved for future use
27:24LB_DS_CNTRW0x0This field represents the total latency from TX to RX through the PHY loopback path.
Software should program this field to synchronize with the PHY characteristics.
It is recommended that software set this field to 5 in HS400 or HS200 with RFIFO mode; for other modes, set it to 4.
Note: This field should be > 1.
23:20LB_FILTER_CNTRW0x0Do not compare the first LB_FILTER_CNT data bits or the last LB_FILTER_CNT data bits when performing loopback testing.
19:17RSVDRO0Reserved for future use
16LB_CMD_MASKRW0x0If set, the corresponding path does not perform the loopback test.
15:8LB_DQ_MASKRW0x0If set, the corresponding path does not perform the loopback test.
7:4RSVDRO0Reserved for future use
3LB_INVERT_CLKRW0x0Normally, when loopback test is triggered and data pattern starts to be driven, Ckout_e will become 1 and Ckout_o stays at 0.
If this bit is set, Ckout_e will become 1 and Ckout_o stays at 0.
(Note: Description logic appears identical to normal state in source, likely implies inversion behavior.)
Only valid when bit[28] is set.
2CLK_PASSTH_DSRW0x0Loopback mode requires the host to send the clock control signals wr_ck_o/wr_ck_e/wr_ck_oe to the PHY:
0: No need to output clock control signals to the PHY.
For the HS400-mode DS test, since DS in loopback comes from the PHY internal free-running clock cki, no clock control signals are needed.
1: For other working modes with loopback enabled, this bit should be set.
In loopback mode, wr_ck_oe is 1T earlier than wr_ck_o/wr_ck_e.
1LB_PATTERN_SELRW0x00: Use programmable 32-bit pattern.
1: PRBS7.
0LB_MODE_ENRW0x0Enter Loopback Mode. Normally, the host driver should change this bit only when no other operation is in progress.
SDHC PHY LOOPBACK COMPARISON COUNT REGISTER

SDHC_PHY_LBCNT_REG Offset: 0x188

BitsFieldTypeResetDescription
31:0LB_COMP_CNTRW0x0This field records how many bits are to be compared for the current loopback test.
After loopback testing starts, the host controller decrements this register until it reaches 0.
Note that after software writes this field, the host dynamically controls this counter value.
During the loopback test process, this counter may change cycle by cycle.
SDHC PHY LOOPBACK ERROR STATUS REGISTER

SDHC_PHY_LBSTS_REG Offset: 0x18C

BitsFieldTypeResetDescription
31:22RSVDRO0Reserved for future use
21LB_CLK_STUCK0_ERRROC0x0CLK path is stuck at 0
20LB_CLK_STUCK1_ERRROC0x0CLK path is stuck at 1
19:18RSVDRO0Reserved for future use
17LB_CMD_EVEN_ERRROC0x0If set, the CMD line path does not pass loopback testing
16LB_CMD_ODD_ERRROC0x0If set, the CMD line path does not pass loopback testing
15:8LB_DQ_EVEN_ERRROC0x0If set, the corresponding data path does not pass loopback testing
7:0LB_DQ_ODD_ERRROC0x0If set, the corresponding data path does not pass loopback testing
SDHC PHY LOOPBACK DATA PATTERN CONFIGURATION REGISTER

SDHC_PHY_LBDATA_REG Offset: 0x190

BitsFieldTypeResetDescription
31LB_PATTERN_RSTWO0x0Reset data pattern FIFO.
30LB_PATTERN_WRITEWO0x0Push a new data pattern into FIFO.
29:18RSVDRO0Reserved for future use
17:16LB_CMD_PATTERNRW0x0bit[17:16]: even/odd pattern for the CMD line.
15:0LB_DATA_PATTERNRW0x0bit[7:0]: odd data pattern for the data line
bit[15:8]: even data pattern for the data line
SDHC COMMAND QUEUE BUS DEBUG CONTROL REGISTERS

CQE_CQBDCTRL_REG0 Offset: 0x1F0

BitsFieldTypeResetDescription
31CQE_FSM_RSTRW0x0A backdoor register that allows software to force the CQE state machine to a stable IDLE state if HW encounters a problem.
Write 1: Force the CQE FSM into the IDLE state.
Write 0: Has no effect.
30:4RSVDRO0Reserved for future use
3:0CQE_DEBUG_SELRW0x0This 4-bit field indicates which internal 32-bit debug bus signals are shown in the 0x1F4 register:
[0000]: slot index and FSM information
[0001]: slot index information
[0010]: internal task slot fetch signals
[0011]: internal task ready signals
This field is for HW designer debug purposes.
SDHC COMMAND QUEUE DEBUG INFORMATION CONTENT REGISTERS

CQE_CQBDCTRL_REG1 Offset: 0x1F4

BitsFieldTypeResetDescription
31:0CQE_DEBUG_INFORO0x032-bit debug signal information output to software.
Note that these register values may change cycle by cycle because the CQE HW internal logic may still be running while software reads this value.
See 0x1F0<3:0> to check which 32-bit debug bus information will be selected for output to this field.
SDHC COMMAND QUEUE VERSION REGISTERS

CQE_CQVER_REG Offset: 0x200

BitsFieldTypeResetDescription
31:12RSVDRO0Reserved for future use
11:8EMMC_MAJOR_VERRO0x5eMMC Major Version Number (digit left of decimal point), in BCD format
7:4EMMC_MINOR_VERRO0x1eMMC Minor Version Number (digit right of decimal point), in BCD format
3:0EMMC_VER_SUFFIXRO0x0eMMC Version Suffix (2nd digit right of decimal point), in BCD format
SDHC COMMAND QUEUE CAPABILITIES REGISTERS

CQE_CQCAP_REG Offset: 0x204

BitsFieldTypeResetDescription
31:16RSVDRO0Reserved for future use
15:12INTERNAL_TIMER_CLKFREQ_MULTIRO0x3ITCFMUL and ITCFVAL indicate the frequency of the clock used for interrupt coalescing timer and for determining the SQS polling period. See ITCFVAL definition for details.
Field Value Description:
0h = 0.001 MHz.
1h = 0.01 MHz.
2h = 0.1 MHz.
3h = 1 MHz.
4h = 10 MHz.
Other values are reserved.
11:10RSVDRO0Reserved for future use
9:0INTERNAL_TIMER_CLKFREQRO0x19ITCFMUL and ITCFVAL indicate the frequency of the clock used for interrupt coalescing timer and for determining the polling period when using periodic SEND_QUEUE_STATUS (CMD13) polling.
The clock frequency is calculated as ITCFVAL × ITCFMUL.
Example: To encode 19.2 MHz, ITCFVAL shall be C0h (= 192 decimal) and ITCFMUL shall be 2h (0.1 MHz): 192 × 0.1 MHz = 19.2 MHz.
SDHC COMMAND QUEUE CONFIG REGISTERS

CQE_CQCFG_REG Offset: 0x208

BitsFieldTypeResetDescription
31:13RSVDRO0Reserved for future use
12DCMD_ENABLERW0x0This bit indicates to the hardware whether the Task Descriptor in slot #31 of the TDL is a Data Transfer Task Descriptor or a Direct Command Task Descriptor.
CQE uses this bit when a task is issued in slot #31 to determine how to decode the Task Descriptor.
Bit Value Description:
1 = Task descriptor in slot #31 is a DCMD Task Descriptor.
0 = Task descriptor in slot #31 is a Data Transfer Task Descriptor.
11:9RSVDRO0Reserved for future use
8TASK_DESC_SIZERW0x0This bit indicates whether the task descriptor size is 128 bits or 64 bits, as detailed in the Data Structures section.
This bit can only be configured when the Command Queuing Enable bit is 0 (command queuing is disabled).
Bit Value Description:
1 = Task descriptor size is 128 bits.
0 = Task descriptor size is 64 bits.
7:1RSVDRO0Reserved for future use
0CQE_ENABLERW0x0Software shall write '1' to this bit to enable command queuing mode (that is, enable CQE).
When this bit is 0, CQE is disabled and software controls the eMMC bus using the legacy eMMC host controller.
Before software writes '1' to this bit, it shall verify that the eMMC host controller is in the idle state and that no commands or data transfers are ongoing.
When software wants to exit command queuing mode, it shall clear all previous tasks, if any exist, before setting this bit to 0.
SDHC COMMAND QUEUE CONTROL REGISTERS

CQE_CQCTL_REG Offset: 0x20C

BitsFieldTypeResetDescription
31:9RSVDRO0Reserved for future use
8CLR_ALL_TASKSRWAC0x0Software shall write '1' to this bit when it wants to clear all tasks sent to the device.
This bit can only be written when CQE is in the halt state (that is, the Halt bit is 1).
When software writes '1', the register value is updated to 1, and CQE shall reset the CQTDBR register and all other context information for all unfinished tasks.
CQE then clears this bit. Software should poll this bit until it is cleared back to 0 and may then resume normal operation by clearing the Halt bit.
Note: CQE does not communicate to the device that the tasks were cleared.
It is software's responsibility to order the device to discard the tasks in its queue using the CMDQ_TASK_MGMT command.
Writing '0' to this register has no effect.
7:1RSVDRO0Reserved for future use
0HALTRO0x0Host software shall write '1' to the Halt control bit (in the corresponding control register) when it wants to acquire software control over the eMMC bus and disable CQE from issuing commands on the bus (for example, to issue a Discard Task command, CMDQ_TASK_MGMT).
When software requests a halt, CQE shall complete the ongoing task if such a task is in progress.
Once the task is complete and CQE is in the idle state, CQE shall not issue new commands and shall indicate this to software by setting this bit to '1'.
Software may poll this bit until it is set to '1', and only then may it send commands on the eMMC bus.
To exit the halt state (that is, resume CQE activity), software shall clear this bit (write '0').
Writing '0' when the value is already '0' has no effect.
SDHC COMMAND QUEUE INTERRUPT STATUS REGISTERS

CQE_CQIS_REG Offset: 0x210

BitsFieldTypeResetDescription
31:6RSVDRO0Reserved for future use
5INVALID_CRYPTO_CFG_ERRRW1C0x0Indicates an invalid crypto configuration error. Write 1 to clear.
4GENERAL_CRYPTO_ERRRW1C0x0Indicates a general crypto error. Write 1 to clear.
3TASK_CLEAREDRW1C0x0This status bit is asserted (if CQISTE.TCL=1) when a task-clear operation is completed by CQE.
The completed operation may be either an individual task clear (CQTCLR) or a clear-all-tasks operation (CQCTL).
2RESP_ERR_DETECTEDRW1C0x0This status bit is asserted (if CQISTE.RED=1) when a response is received with an error bit set in the device status field.
The contents of the device status field are listed in Section 6.13.
Software uses the CQRMEM register to configure which device status bit fields may trigger an interrupt and which are masked.
1TASK_COMPLETERW1C0x0This status bit is asserted (if CQISTE.TCC=1) when at least one of the following two conditions is met:
1. A task is completed and the INT bit is set in its Task Descriptor.
2. An interrupt is caused by the interrupt coalescing logic.
0HALT_COMPLETERW1C0x0This status bit is asserted (if CQISTE.HAC=1) when the Halt bit in the CQCTL register transitions from 0 to 1,
indicating that the host controller has completed its current task and has entered the halt state.
SDHC COMMAND QUEUE INTERRUPT ENABLE REGISTERS

CQE_CQISTE_REG Offset: 0x214

BitsFieldTypeResetDescription
31:4RSVDRO0Reserved for future use
3TASK_CLEARED_ENRW0x0Enable bit for Task Cleared interrupt.
1 = CQIS.TCL will be set when its interrupt condition is active.
0 = CQIS.TCL is disabled.
2RESP_ERR_DETECTED_ENRW0x0Enable bit for Response Error Detected interrupt.
1 = CQIS.RED will be set when its interrupt condition is active.
0 = CQIS.RED is disabled.
1TASK_COMPLETE_ENRW0x0Enable bit for Task Complete interrupt.
1 = CQIS.TCC will be set when its interrupt condition is active.
0 = CQIS.TCC is disabled.
0HALT_COMPLETE_ENRW0x0Enable bit for Halt Complete interrupt.
1 = CQIS.HAC will be set when its interrupt condition is active.
0 = CQIS.HAC is disabled.
SDHC COMMAND QUEUE INTERRUPT SIGNAL ENABLE REGISTERS

CQE_CQISGE_REG Offset: 0x218

BitsFieldTypeResetDescription
31:4RSVDRO0Reserved for future use
3TASK_CLEARED_SIG_ENRW0x0When set and CQIS.TCL is asserted, the CQE shall generate an interrupt.
2RESP_ERR_DETECTED_SIG_ENRW0x0When set and CQIS.RED is asserted, the CQE shall generate an interrupt.
1TASK_COMPLETE_SIG_ENRW0x0When set and CQIS.TCC is asserted, the CQE shall generate an interrupt.
0HALT_COMPLETE_SIG_ENRW0x0When set and CQIS.HAC is asserted, the CQE shall generate an interrupt.
SDHC COMMAND QUEUE INTERRUPT COALESCING REGISTERS

CQE_CQIC_REG Offset: 0x21C

BitsFieldTypeResetDescription
31INT_COALESCING_ENRW0x0When set to '0' by software, command responses are neither counted nor timed.
Interrupts are still triggered by completion of tasks with INT=1 in the Task Descriptor.
When set to '1', the interrupt coalescing mechanism is enabled and coalesced interrupts are generated.
30:21RSVDRO0Reserved for future use
20INT_COALESCING_STATUSRO0x0This bit indicates to software whether any tasks (with INT=0) have completed and counted towards interrupt coalescing (i.e., ICSB is set if and only if IC counter > 0).
Bit Value Description:
1 = At least one task completion has been counted
(IC counter > 0).
0 = No task completions have occurred since last counter reset
(IC counter = 0).
19:17RSVDRO0Reserved for future use
16CNT_TIMER_RSTWO0x0When the host driver writes '1', the interrupt coalescing timer and counter are reset.
15IC_CNT_TRSH_WRITE_ENWO0x0When software writes '1', the ICCTH value is updated with the contents written in the same cycle.
When software writes '0', the value in ICCTH is not updated.
NOTE: Write operations to ICCTH are only allowed when the task queue is empty.
14:13RSVDRO0Reserved for future use
12:8IC_CNT_THRESHOLDRW0x0Software uses this field to configure the number of task completions (only tasks with INT=0 in the Task Descriptor) required to generate an interrupt.
Counter Operation: As data transfer tasks with INT=0 complete, they are counted by CQE.
The counter is reset by software during the interrupt service routine.
The counter stops counting when it reaches the value configured in ICCTH.
The maximum allowed value is 31.
NOTE: When ICCTH is 0, task completions are not counted, and counting-based interrupts are not generated.
In order to write to this field, the ICCTHWEN bit must be set at the same write operation.
7IC_TIMEOUT_ENWO0x0When software writes '1', the ICTOVAL value is updated with the contents written in the same cycle.
When software writes '0', the value in ICTOVAL is not updated.
NOTE: Write operations to ICTOVAL are only allowed when the task queue is empty.
6:0IC_TIMEOUT_VALUERW0x0Software uses this field to configure the maximum time allowed between the completion of a task on the bus and the generation of an interrupt.
Timer Operation: The timer is reset by software during the interrupt service routine.
It starts running when a data transfer task with INT=0 is completed, after the timer was reset.
When the timer reaches the value configured in ICTOVAL field it generates an interrupt and stops.
The timer's unit is equal to 1024 clock periods of the clock whose frequency is specified in the Internal Timer Clock Frequency field (CQCAP register).
The minimum value is 01h (1024 clock periods) and the maximum value is 7Fh (1271024 clock periods).
Example: A CQCAP field value of 0 indicates a 19.2 MHz clock frequency (period = 52.08 ns).
If the setting in ICTOVAL is 10h, the calculated polling period is 16
1024*52.08ns = 853.33 us.
NOTE: When ICTOVAL is 0, the timer is not running, and timer-based interrupts are not generated.
In order to write to this field, the ICTOVALWEN bit must be set at the same write operation.
SDHC COMMAND QUEUE TASK DESCRIPTOR LIST BASE ADDRESS REGISTERS

CQE_CQTDLBA_REG Offset: 0x220

BitsFieldTypeResetDescription
31:0CQE_CQTDL_BARW0x0This register stores the LSBs (bits 31:0) of the byte address of the head of the Task Descriptor List in system memory.
The size of the task descriptor list is 32 * (Task Descriptor size + Transfer Descriptor size) as configured by the Host driver.
Alignment Requirement: This address shall be set on a 1 KByte boundary.
The lower 10 bits of this register shall be set to 0 by software
and shall be ignored by CQE.
SDHC COMMAND QUEUE TASK DESCRIPTOR LIST UPPER BASE ADDRESS REGISTERS

CQE_CQTDLBAU_REG Offset: 0x224

BitsFieldTypeResetDescription
31:0CQE_CQTDL_BAURW0x0This register stores the upper bits (bits 63:32) of the byte address of the head of the Task Descriptor List in system memory.
The size of the task descriptor list is 32 * (Task Descriptor size + Transfer Descriptor size) as configured by the Host driver.
Alignment Requirement: This address shall be set on a 1 KByte boundary.
The lower 10 bits of the full 64-bit address (which corresponds to bits [9:0] of this register)
shall be set to 0 by software and shall be ignored by CQE.
SDHC COMMAND QUEUE TASK DOORBELL REGISTERS

CQE_CQTDBR_REG Offset: 0x228

BitsFieldTypeResetDescription
31:0CQE_DOORBELL_REGRW1S0x0Software shall configure TDLBA and TDLBAU, and enable CQE in CQCFG before using this register.
Writing 1 to bit n of this register triggers CQE to start processing the task encoded in slot n of the Task Descriptor List (TDL).
CQE always processes tasks in order according to the order submitted to the list by CQTDBR write transactions.
Task Processing:
- Data Transfer tasks: CQE reads the Task Descriptor and sends QUEUED_TASK_PARAMS (CMD44) and QUEUED_TASK_ADDRESS (CMD45) commands to the device.
- DCMD tasks: (in slot #31, when enabled) CQE reads the Task Descriptor and generates the command encoded by its index and argument.
Bit Clearing Conditions:
a) When a task execution is completed (with success or error)
b) The task is cleared using the CQTCLR register
c) All tasks are cleared using the CQCTL register
d) CQE is disabled using the CQCFG register
Batch Submission:
Software may initiate multiple tasks at the same time by writing 1 to multiple bits of this register in the same transaction.
In this case:
- CQE shall process the tasks in order of the task index, starting with the lowest index.
- If one or more tasks in the batch are marked with QBR, the ordering of execution will be based on said processing order.
Note: Writing 0 by software has no effect on the hardware
and does not change the value of the register bit.
SDHC COMMAND QUEUE TASK COMPLETE NOTIFICATION REGISTERS

CQE_CQTCN_REG Offset: 0x22C

BitsFieldTypeResetDescription
31:0CQE_TCN_REGRW1C0x0CQE shall set bit n of this register (at the same time it clears bit n of CQTDBR) when task execution is completed (with success or error).
When receiving an interrupt for task completion, software may read this register to determine which tasks have finished.
After reading this register, software may clear the relevant bit fields
by writing '1' to the corresponding bits.
SDHC COMMAND QUEUE DEVICE QUEUE STATUS REGISTERS

CQE_CQDQS_REG Offset: 0x230

BitsFieldTypeResetDescription
31:0DEVICE_QUEUE_STATUSRO0x0Each time the host controller receives a Queue Status Register (QSR) from the device, it updates this register with the status-command response, reflecting the device's current queue status.
SDHC COMMAND QUEUE DEVICE PENDING TASKS REGISTERS

CQE_CQDPT_REG Offset: 0x234

BitsFieldTypeResetDescription
31:0CQE_DPT_REGRO0x0Bit n of this register is set if and only if QUEUED_TASK_PARAMS (CMD44) and QUEUED_TASK_ADDRESS (CMD45) were sent for this specific task, and the task has not yet been executed.
State Transitions: The CQE sets this bit after receiving a successful response for CMD45.
It clears this bit once the task has completed execution.
Usage in Task Discard:
Software must read this register during the task-discard procedure (when the controller is halted) to determine if the task is currently queued in the device.
- If the task is queued (bit is set), the driver sends a CMDQ_TASK_MGMT (CMD48) to the device to order the discard.
- Then, software clears the task in the CQE.
- Only after these steps should software order the CQE to resume operation using the CQCTL register.
SDHC COMMAND QUEUE TASK CLEAR REGISTERS

CQE_CQTCLR_REG Offset: 0x238

BitsFieldTypeResetDescription
31:0CQE_CQTCLR_REGRW0x0Writing '1' to bit n of this register orders the Command Queue Engine (CQE) to clear a task which software has previously issued.
Constraint: This bit can only be written when the CQE is in the Halt state, as indicated by the Halt bit in the CQCFG register.
Operation: When software writes '1' to a bit, CQE updates the value to '1' and starts clearing the data structures related to the task.
Once the clear operation is complete, CQE clears the corresponding bit fields (sets them to '0') in both CQTCLR and CQTDBR.
Software should poll the CQTCLR register until the bit is cleared to verify that the operation is complete.
Scope: Writing to this register only clears the task in the CQE and does not impact the device.
To discard the task in the device, host software must send a CMDQ_TASK_MGMT command while the CQE is still in the Halt state.
Limitations: Host drivers are not allowed to use this register to clear multiple tasks simultaneously.
Clearing multiple tasks must be done using the CQCTL register.
Note: Writing '0' to a register bit has no effect.
SDHC COMMAND QUEUE SEND STATUS CONFIGURATION REGISTERS1

CQE_CQSSC1_REG Offset: 0x240

BitsFieldTypeResetDescription
31:20RSVDRO0Reserved for future use.
19:16SQS_BLK_CNTRW0x1This field configures when the Command Queue Engine (CQE) sends the SEND_QUEUE_STATUS (CMD13) command to check the device's task queue status during a data transfer.
Value n: The CQE sends the status command on the CMD line during the transfer of data block number BLOCK_CNT - n, where BLOCK_CNT is the total number of blocks in the current transaction.
Value 0: The SEND_QUEUE_STATUS command is not sent during the data transaction.
It is deferred until the data lines are idle.
Value 1: The status command is sent during the last block of the transaction.
15:0SQS_TIMERRW0x1000This field sets the polling period for periodic SEND_QUEUE_STATUS (CMD13) operations when tasks are pending in the device but no data transfer is active.
Mechanism: If a SEND_QUEUE_STATUS response indicates no task is ready, the CQE waits for the configured time before issuing the next command.
Units: Clock periods of the internal timer clock (frequency defined in the CQCAP register).
Range: Minimum 0x0001 (1 clock period) to Maximum 0xFFFF (65,535 clock periods).
Default: 4,096 clock periods.
Example: A CQCAP field value of 0 indicates a 19.2 MHz clock frequency (period = 52.08 ns).
If the setting in CQSSC1.CIT is 1000h, the calculated polling period is 4096 * 52.08 ns = 213.33 us.
SDHC COMMAND QUEUE SEND STATUS CONFIGURATION REGISTERS2

CQE_CQSSC2_REG Offset: 0x244

BitsFieldTypeResetDescription
31:16RSVDRO0Reserved for future use.
15:0SQS_RCARW0x0This field holds the 16-bit RCA value used in the argument of the SEND_QUEUE_STATUS (CMD13) command.
Operation: CQE shall copy this field to bits 31:16 of the argument when transmitting the SEND_QUEUE_STATUS (CMD13) command.
SDHC COMMAND QUEUE COMMAND RESPONSE FOR DIRECT-COMMAND TASK REGISTERS

CQE_CQCRDCT_REG Offset: 0x248

BitsFieldTypeResetDescription
31:0DCMD_LAST_RESPRO0x0This register contains the response of the command generated by the last direct-command (DCMD) task that was sent.
Update Mechanism: CQE shall update this register when it receives the response for a DCMD task.
Validity Condition: This register is considered valid only after bit 31 of CQTDBR register is cleared by CQE.
SDHC COMMAND QUEUE RESPONSE MODE ERROR MASK REGISTERS

CQE_CQRMEM_REG Offset: 0x250

BitsFieldTypeResetDescription
31:0RED_MASKRW0xFDF9A080Interrupt mask for device status bits received in R1/R1b responses.
Bit i Behavior:
1: Generates a RED interrupt if bit i is set in the device status.
0: Ignores bit i in the device status.
The reset value enables interrupts for all standard "Error" type bits.
Note: CMD13 (SQS) responses, which encode the Queue Status Register (QSR),
are ignored by this logic.
SDHC COMMAND QUEUE TASK ERROR INFORMATION REGISTERS

CQE_CQTERRI_REG Offset: 0x254

BitsFieldTypeResetDescription
31DAT_ERR_FIELD_VALIDRO0x0This bit is updated when an error is detected by CQE or indicated by the eMMC controller.
If a data transfer is in progress when the error is detected/indicated, the bit is set to 1.
If no data transfer is in progress when the error is detected/indicated,
the bit is cleared to 0.
30RSVDRO0Reserved for future use.
29:24DAT_XFER_ERR_TASK_IDRO0x0This field indicates the ID of the task that was executed on the data lines when an error occurred.
The field is updated if a data transfer is in progress when an error is detected by CQE
or indicated by the eMMC controller.
23:22RSVDRO0Reserved for future use.
21:16DAT_ERR_CMD_INDEXRO0x0This field indicates the index of the command that was executed on the data lines when an error occurred.
The index shall be set to EXECUTE_READ_TASK (CMD46) or EXECUTE_WRITE_TASK (CMD47) according to the data direction.
The field is updated if a data transfer is in progress when an error is detected by CQE
or indicated by the eMMC controller.
15RESP_ERR_FIELD_VALIDRO0x0This bit is updated when an error is detected by CQE or indicated by the eMMC controller.
If a command transaction is in progress when the error is detected/indicated, the bit is set to 1.
If no command transaction is in progress when the error is detected/indicated,
the bit is cleared to 0.
14:13RSVDRO0Reserved for future use.
12:8RESP_ERR_TASK_IDRO0x0This field indicates the ID of the task that was executed on the command line when an error occurred.
The field is updated if a command transaction is in progress when an error is detected by CQE
or indicated by the eMMC controller.
7:6RSVDRO0Reserved for future use.
5:0RESP_ERR_CMD_INDEXRO0x0This field indicates the index of the command that was executed on the command line when an error occurred.
The field is updated if a command transaction is in progress when an error is detected by CQE
or indicated by the eMMC controller.
SDHC COMMAND QUEUE COMMAND RESPONSE INDEX REGISTERS

CQE_CQCRI_REG Offset: 0x258

BitsFieldTypeResetDescription
31:6RSVDRO0Reserved for future use.
5:0LCMD_RESP_INDEXRO0x0This field stores the index of the last received command response. CQE shall update the value every time a command response is received.
SDHC COMMAND QUEUE COMMAND RESPONSE ARGUMENT REGISTERS

CQE_CQCRA_REG Offset: 0x25C

BitsFieldTypeResetDescription
31:0LCMD_RESP_ARGURO0x0This field stores the argument of the last received command. CQE shall update the value every time a command response is received.

9.7 UFS Interface

9.7.1 Overview

UFS (Universal Flash Storage) is a high-performance serial storage interface standard widely used in mobile and embedded systems. It comprises several protocol layers between real applications and physical devices. The UFS host controller is a hardware block that acts as a bridge, exchanging data between the UFS device and system memory.

9.7.2 Features

  • Compliant with MIPI UniPro v1.61 specification.
  • Compliant with M-PHY v3.0 specification.
  • Supports up to 2 Tx lanes and 2 Rx lanes, with up to HS-GEAR3 5.8 Gbps per lane.
  • Supports standard low-power Hibernate entry/exit, which can reduce power consumption for the host and devices.
  • Compliant with UFS HCI v2.1 specification.
  • Compatible with AXI3 protocol:
    • Supports a maximum burst length of 128 Bytes.
    • Supports a maximum of eight AXI outstanding requests.
  • Supports AHB slave interface for accessing UFS host registers.
  • Supports 32 transfer request slots and 8 task management slots for multiple commands and tasks.

9.7.3 Block Diagram

The principal components of the UFS host controller are the System Bus Interface Unit, UFS Host Controller Interface, UFS Transport Protocol Layer, UFS Host Registers, Device Management Entity (DME), Transport Layer, Network Layer, Data Link Layer, PHY Adapter Layer, and M-PHY Interface. The functional block diagram of the UFS host controller is shown below.

9.7.4 UFS Operation

This section describes a few fundamental operations including host controller initialization, write data operation, and read data operation.

9.7.4.1 Host Controller Initialization

When the host controller comes out of power-up reset, all registers are in their power-on default state, and the link is inactive. The following sequence describes the operations that the host software performs to initialize the host controller:

  1. Write a 1 to the HCE register in order to enable the host controller. This triggers an autonomous basic initialization of the local UIC layer. The initialization sequence shall consist of a DME_RESET and a DME_ENABLE command. During the basic initialization sequence, the HCE is read as 0.
  2. Wait until HCE reads as 1 before continuing. This indicates that the basic initialization sequence is complete.
  3. Send DME_LINKSTARTUP command to start the link startup procedure. When this register bit is not written as 1, DME_RESET and DME_ENABLE are written by software through the registers.

The following figure shows the link startup process.

9.7.4.2 Write Data Operation

  1. Host software builds a write command. The command shall have a PRD table that describes a scatter/gather list of the memory buffers to send data.
  2. After the command is built, host SW sets the corresponding DBR bit to 1 to notify the host controller that the command is available for processing.
  3. Depending on the command type, the host controller invokes the corresponding protocol engine to process the command. The UniPro protocol engine may break the command UPIU into one or more UniPro T_PDUs and send them to the target UFS device, then wait for a "Ready to Transfer" UPIU from the target UFS device indicating that it is ready to accept data from the host.
  4. Once the "Ready to Transfer" UPIU is received, the protocol engine wraps the data with Data-out UPIUs and sends it to the target UFS device. The protocol engine sends the data from the memory buffer as provided in the PRD table (that is, the scatter/gather list). The protocol engine waits for the "Ready to Transfer" UPIU before it sends a Data-out UPIU to the target device.
  5. When the data transfer is completed, the protocol engine waits for a response UPIU from the target UFS device that provides a status on the transfer. Once the response UPIU arrives at the host, the controller stores the Response UPIU in the response buffer of the corresponding transfer request descriptor and updates the completion status (and extended status data if necessary within the UTP protocol).
  6. Afterward, it updates the corresponding status register and generates an interrupt if the host software requested it.

9.7.4.3 Read Data Operation

  1. Host software builds a read command. The command shall have a PRD table that describes a scatter/gather list of the memory buffers to receive data.
  2. After the command is built, host SW sets the corresponding DBR bit to 1 to notify the host controller that the command is available for processing.
  3. Depending on the command type, the host controller invokes the corresponding protocol engine to process the command. The UniPro protocol engine may break the command UPIU into one or more UniPro T_PDUs and send them to the target UFS device, then wait for a Data-in UPIU from the target UFS device.
  4. The controller writes the received data into the host memory buffers described by the PRDT entries. The controller continues receiving Data-In UPIUs until the transfer described by the PRDT is complete. Once the transfer is complete, the protocol engine waits for a Response UPIU from the target device.
  5. Afterward, it updates the corresponding status register and generates an interrupt if the host software requested it.

In order to correctly transfer data between the UFS device and system memory, the UFS host software must properly maintain both the host memory space and IO memory/register space, which is shown in the figure below.

9.7.5 Registers

9.7.5.1 Register Descriptions (UFS Host Controller)

The base address of UFS Host Controller Registers is: 0xC0E00000.

HOST CONTROLLER CAPABILITIES REGISTER

HOST_CONTROLLER_CAPABILITIES Offset:0x0

BitsFieldTypeResetDescription
31:29RSVDRO0Reserved for future use.
28CSRO0x0Indicates whether the host controller supports cryptographic operations.
27RSVDRO0Reserved for future use.
26UICDMETMSRO0x1Indicates whether the host controller supports the UniPro DME_TEST_MODE.req SAP primitive.
25OODDSRO0x0The number of crypto capabilities that the host controller provides. The values allowed are between 1 and 255.
2464ASRO0x1Indicates whether the host controller can access 64-bit data structures.
23AUTOH8RO0x1Indicates whether the host controller supports auto-hibernation.
22:19RSVDRO0Reserved for future use.
18:16NUTMRSRO0x70-based value indicating the number of slots provided by the UTP Task Management Request List.
A minimum of 1 and maximum of 8 slots may be supported.
15:8NORTTRO0x2Indicates whether the host controller supports auto-hibernation.
7:5RSVDRO0Reserved for future use.
4:0NUTRSRO0x1fIndicates whether the host controller supports auto-hibernation.
UFS VERSION REGISTER(VER)

UFS_VERSION Offset:0x8

BitsFieldTypeResetDescription
31:16RSVDRO0Reserved for future use.
15:8MJRRO0x2Major version in BCD format.
7:4MNRRO0x0Minor version in BCD format.
3:0VSRO0x0Version suffix in BCD format.
HOST CONTROLLER IDENTIFICATION DESCRIPTOR - PRODUCT ID REGISTER(HCPID)

HOST_CONTROLLER_IDENTIFICATION_DESCRIPTOR_PRODUCT_ID Offset:0x10

BitsFieldTypeResetDescription
31:0PIDRO0x0Product ID assigned to the host controller by the host controller manufacturer. This is vendor-specific.
HOST CONTROLLER IDENTIFICATION DESCRIPTOR - MANUFACTURER ID REGISTER(HCMID)

HOST_CONTROLLER_IDENTIFICATION_DESCRIPTOR_MANUFACTURER_ID Offset:0x14

BitsFieldTypeResetDescription
31:16RSVDRO0Reserved for future use.
15:8BIRO0x0This field contains the index value of the bank that contains the Manufacturer Identification Code. The BI value shall be equal to the number of continuation fields that precede the MIC, as specified by [JEDECJEP106].
7:0MICRO0x0Manufacturer Identification Code as defined by JEDEC in the Standard Manufacturer's Identification Code [JEDEC-JEP106].
AUTO-HIBERNATE IDLE TIMER REGISTER(AHIT)

AUTO_HIBERNATE_IDLE_TIMER Offset:0x18

BitsFieldTypeResetDescription
31:13RSVDRO0Reserved for future use.
12:10BIRW0x0Timer scale:
000 - Value times 1 us.
001 - Value times 10 us.
010 - Value times 100 us.
011 - Value times 1 ms.
100 - Value times 10 ms.
101 - Value times 100 ms.
110 - 111 - reserved.
9:0AH8ITVRO0x0This is the time that the UFS subsystem must remain idle before the UFS host controller may autonomously put the UniPro link into the Hibernate state.
INTERRUPT STATUS REGISTER(IS)

INTERRUPT_STATUS Offset:0x20

BitsFieldTypeResetDescription
31TFRDRWC0x0This field indicates that message reception was completed.
30TFTDRWC0x0This field indicates that the programmed number of messages in the message count register has been transmitted. In the case of infinite transfer, it will be asserted after tstsrc_on is disabled.
29TFEIRWC0x0This field indicates an error has been generated in the test destination.
28:18RSVDRO0Reserved for future use.
17SBFESRWC0x0Indicates that the host controller encountered a system bus error that it cannot recover from, such as a bad software pointer.
Host software shall reset the device and the host controller whenever this error occurs.
The host controller is RESET by setting register HCE Register (offset 0x34) to '0'.
16HCFESRWC0x0Indicates that the host controller encountered a fatal error that it cannot recover from.
When the error occurs, the host controller stops and both UTRRSR and UTMRRSR are cleared to '0' by the host controller.
If this error occurs, host software should reset the controller by setting the HCE register (offset 0x34) to '0'.
15:13RSVDRO0Reserved for future use.
12UTPESRWC0x0Indicates that the host controller encountered an error at the UTP layer that it cannot recover from.
When the error occurs, the host controller updates the UTP error-code field within the Host Controller Status register.
It is up to host software to decide how to handle the error condition.
11DFESRWC0x0Indicates that the host controller encountered a fatal error from the device that it cannot recover from.
If this error occurs, host software should reset only the device or reset the host controller by setting the HCE register (offset 0x34) to '0' and resetting the device.
10UCCSRWC0x0This bit is set to '1' by the host controller upon completion of a UIC command.
9UTMRCSRWC0x0This bit is set to '1' by the host controller upon completion of a task management function whose UTMRD.I bit is set.
8ULSSRWC0x0Indicates that the link start-up process has been initiated by the remote end of the link. This bit corresponds to the UniPro DME_LINKSTARTUP.ind SAP primitive.
7ULLSRWC0x0This indicates a condition where the remote end is trying to re-establish a link and the link is lost.
This bit corresponds to the UniPro DME_LINKLOST.ind SAP primitive.
If this error occurs, host software should reset the controller by setting the HCE register (offset 0x34) to '0'.
6UHESRWC0x0When the hibernate entry process is initiated by host software, this field indicates that the UniPro hibernate entry process has completed. If the process is successful, the link state changes to the Hibernate state. Register HCS.UPMCRS indicates the status of the hibernation entry process.
5UHXSRWC0x0When the hibernate exit process is initiated by host software, this field indicates that the link has exited the UniPro Hibernate state. Register HCS.UPMCRS indicates the status of the hibernation exit process.
4UPMSRWC0x0Indicates that the UniPro/PA/DL part of the power-mode change has completed. Register HCS.UPMCRS contains the power-mode change status. This bit corresponds to the UniPro DME_POWER_MODE.ind SAP primitive.
3UTMSRWC0x0Indicates that the peer UniPro stack has been set to a given UniPro test mode. This bit corresponds to the UniPro DME_TEST_MODE.ind SAP primitive.
2UERWC0x0Indicates that a layer in the UniPro stack has encountered an error condition.
Register HCS.UEC contains the error code for the condition.
Error code in any of the following registers asserts this error:
Host UIC Error Code PHY Adapter Layer (UECPA) - 0x038
Host UIC Error Code Data Link Layer (UECDL) - 0x03C
Host UIC Error Code Network Layer (UECN) - 0x040
Host UIC Error Code Transport Layer (UECT) - 0x044
Host UIC Error Code DME (UECDME) - 0x048
1UDEPRIRWC0x0Indicates that the attached device has issued a DME_ENDPOINTRESET indication, which is not allowed. The recovery mechanism for DME ENDPOINT RESET is implementation-specific. No automatic reset shall be performed, and it is up to the DME user to respond accordingly.
0UTRCSRWC0x0This bit is set to '1' by the host controller upon one of the following:
Completion of a UTP transfer request with its UTRD Interrupt bit set to '1'
Interrupt caused by the UTR interrupt aggregation logic
INTERRUPT ENABLE REGISTER(IE)

INTERRUPT_ENABLE Offset:0x24

BitsFieldTypeResetDescription
31TFRDERWC0x0When set and IS.TFRD is set, the controller shall generate an interrupt.
30TFTDERWC0x0When set and IS.TFTD is set, the controller shall generate an interrupt.
29TFEIERWC0x0This field indicates an error has been generated in the test destination.
28:18RSVDRO0Reserved for future use.
17SBFEERWC0x0When set and IS.SBFES is set, the controller shall generate an interrupt.
16HCFEERWC0x0When set and IS.HCFES is set, the controller shall generate an interrupt.
15:13RSVDRO0Reserved for future use.
12UTPEERWC0x0When set and IS.UTPES is set, the controller shall generate an interrupt.
11DFEERWC0x0When set and IS.DFES is set, the host controller shall generate an interrupt.
10UCCERWC0x0When set and IS.UCCS is set, the host controller shall generate an interrupt.
9UTMRCERWC0x0When set and IS.UTMRCS is set, the host controller shall generate an interrupt.
8ULSSERWC0x0When set and IS.ULSS is set, the controller shall generate an interrupt.
7ULLSERWC0x0When set and IS.ULLS is set, the controller shall generate an interrupt.
6UHESERWC0x0When set and IS.UHES is set, the controller shall generate an interrupt.
5UHXSERWC0x0When set and IS.UHXS is set, the controller shall generate an interrupt.
4UPMSERWC0x0When set and IS.UPMS is set, the controller shall generate an interrupt.
3UTMSERWC0x0When set and IS.UTMS is set, the controller shall generate an interrupt.
2UEERWC0x0When set and IS.UE is set, the controller shall generate an interrupt.
1UDEPRIERWC0x0When set and IS.UDEPRI is set, the controller shall generate an interrupt.
0UTRCERWC0x0When set and IS.UTRCS is set, the host controller shall generate an interrupt.
HOST CONTROLLER STATUS REGISTER(HCS)

HOST_CONTROLLER_STATUS Offset:0x30

BitsFieldTypeResetDescription
31:12UTP_ERROR_STATUSRO0x0The following fields are provided by the host controller for an error condition detected within the UTP layer.
They are valid only when UTPES is set.
They are automatically reset by the host controller when UTPES is cleared:
Bit[31:24] - Target LUN of UTP error (TLUNUTPE): The LUN of the command during whose execution a UTP error occurs.
Bit[23:16] - Task Tag of UTP error (TTAGUTPE): The Task Tag of the command during whose execution a UTP error occurs.
Bit[15:12] - UTP Error Code (UTPEC): Indicates the error code of a UTP layer error:
  0h - Reserved.
  1h - Invalid UPIU type.
  2h-Fh - Reserved.
11RSVDRO0Reserved for future use.
10:8UPMCRSRO0x0Indicates the status of a UIC layer request for power-mode change:
  0h - PWR_OK. The request was accepted.
  1h - PWR_LOCAL. The local request was successfully applied.
  2h - PWR_REMOTE. The remote request was successfully applied.
  3h - PWR_BUSY. The request was aborted due to concurrent requests.
  4h - PWR_ERROR_CAP. The request was rejected because the requested configuration exceeded the Link’s capabilities.
  5h - PWR_FATAL_ERROR. The request was aborted due to a communication problem. The Link may be inoperable.
  6h - 7h Reserved.
7:4RSVDRO0Reserved for future use.
3UCRDYRO0x1This field indicates whether the host controller is ready to process a UIC command. Host software shall set UICCMD only if HCS.UCRDY is set to '1'.
2UTMRLRDYRO0x0This field is set to '1' when the host controller is ready to process Task Management requests.
This field is cleared to '0' by the host controller when one of the following conditions occurs:
- The device presence is not detected;
- UTP Task Management Request List is full;
- There is an error with host controller or device that is not command specific.
Host software shall only set the UTMRLRSR register if HCS.UTMRLRDY is set to '1'.
1UTRLRDYRO0x0This field indicates whether the host controller is ready to process a UTP Transfer Request.
This field is cleared to '0' by the host controller when one of the following conditions occurs:
- The device presence is not detected;
- UTP Transfer Request List is full;
- There is an error with host controller or device that is not command specific.
Host software shall only set the UTRLRSR bit to '1' if HCS.UTRLRDY is set to '1'.
0DPRO0x0This field is set to '1' when a UFS device is attached to the controller.
This field is cleared to '0' when no UFS device is attached to this controller.
Set to '0': 1) After reset, and
2) When the link is lost, indicated by no UFS device being detected or the host controller being unable to communicate successfully with the attached device.
Set to '1': When the return code is "SUCCESS" in the response to the DME_LINKSTARTUP UIC CMD during host-controller initialization, when a UFS device is detected on the physical link attached to the controller.
HOST CONTROLLER ENABLE REGISTER(HCE)

HOST_CONTROLLER_ENABLE Offset:0x34

BitsFieldTypeResetDescription
31:1RSVDRO0Reserved for future use.
0HCERW0x0Host Controller Enable (HCE):
- When HCE is '0' and software writes '1', the host controller hardware shall execute the initialization procedure, including reset of the host UTP and UIC layers.
When the initialization process is complete, the host controller sets the register to '1'.
- When HCE is '1' and software writes '0', the host controller disables the host controller hardware and the attached device.
The host controller clears the register to '0' after completing the disable operation.
Software shall wait until HCE = '0' to conclude host-controller disable.
HOST UIC ERROR CODE PHY ADAPTER LAYER REGISTER(HECPA)

HOST_UIC_ERROR_CODE_PHY_ADAPTER_LAYER Offset:0x38

BitsFieldTypeResetDescription
31ERRROC0x0Indicates whether an error was generated by the PHY Adapter Layer.
30:5RSVDRO0Reserved for future use.
4:0ECRW0x0Error code generated when IS.UE and UECPA.ERR are set to '1'.
Bit Description:
  00 - Error reported by the M-PHY layer: PHY error on Lane 0.
  01 - Error reported by the M-PHY layer: PHY error on Lane 1.
  02 - Error reported by the M-PHY layer: PHY error on Lane 2.
  03 - Error reported by the M-PHY layer: PHY error on Lane 3.
  04 - Generic PHY Adapter error: This should be the LINERESET indication.
It is categorized as "ERROR" (not FATAL).
Software is informed that MPHY has been reset and that all M-PHY attributes (that are not handled by UniPro) need to be restored in order to keep the link optimized.

HOST_UIC_ERROR_CODE_DATA_LINK_LAYER Offset:0x3C

BitsFieldTypeResetDescription
31ERRROC0x0Indicates whether an error was generated by the Data Link Layer.
30:15RSVDRO0Reserved for future use.
14:0ECROC0x0Error code generated when IS.UE and UECDL.ERR are set to '1'.
Bit Description:
  00 - NAC_RECEIVED.
  01 - TCx_REPLAY_TIMER_EXPIRED.
  02 - AFCx_REQUEST_TIMER_EXPIRED.
  03 - FCx_PROTECTION_TIMER_EXPIRED.
  04 - CRC_ERROR.
  05 - RX_BUFFER_OVERFLOW.
  06 - MAX_FRAME_LENGTH_EXCEEDED.
  07 - WRONG_SEQUENCE_NUMBER.
  08 - AFC_FRAME_SYNTAX_ERROR.
  09 - NAC_FRAME_SYNTAX_ERROR.
  10 - EOF_SYNTAX_ERROR.
  11 - FRAME_SYNTAX_ERROR.
  12 - BAD_CTRL_SYMBOL_TYPE.
  13 - PA_INIT_ERROR.
  14 - PA_ERROR_IND_RECEIVED.
HOST UIC ERROR CODE NETWORK LAYER REGISTER(UECN)

HOST_UIC_ERROR_CODE_NETWORK_LAYER Offset:0x40

BitsFieldTypeResetDescription
31ERRROC0x0Indicates whether an error was generated by the Network Layer.
30:4RSVDRO0Reserved for future use.
3:0ECROC0x0Error code generated when IS.UE and UECN.ERR are set to '1'.
Bit Description:
  00 - UNSUPPORTED_HEADER_TYPE.
  01 - BAD_DEVICEID_ENC.
  02 - LHDR_TRAP_PACKET_DROPPING.
  03 - MAX_N_PDU_LENGTH_EXCEEDED.
HOST UIC ERROR CODE NETWORK LAYER REGISTER(UECT)

HOST_UIC_ERROR_CODE_TRANSPORT_LAYER Offset:0x44

BitsFieldTypeResetDescription
31ERRROC0x0Indicates whether an error was generated by the Transport Layer.
30:8RSVDRO0Reserved for future use.
7:0ECROC0x0Error code generated when IS.UE and UECT.ERR are set to '1'.
Bit Description:
  00 - UNSUPPORTED_HEADER_TYPE.
  01 - UNKNOWN_CPORTID.
  02 - NO_CONNECTION_RX.
  03 - Reserved.
  04 - BAD_TC.
  05 - E2E_CREDIT_OVERFLOW.
  06 - Reserved.
  07 - MAX_T_PDU_LENGTH_EXCEEDED.
HOST UIC ERROR CODE DME REGISTER(UECDME)

HOST_UIC_ERROR_CODE_DME Offset:0x48

BitsFieldTypeResetDescription
31ERRROC0x0Indicates whether an error was generated by the DME.
30:1RSVDRO0Reserved for future use.
0ECROC0x0Error code generated when IS.UE and UECDME.ERR are set to '1'.
Bit Description:
  00 - Generic DME error.
UTP TRANSFER REQUEST INTERRUPT AGGREGATION CONTROL REGISTER(UTRIACR)

UTP_TRANSFER_REQUEST_INTERRUPT_AGGREGATION_CONTROL Offset:0x4C

BitsFieldTypeResetDescription
31IAENRW0x0When set to '0' by host software, command responses are neither counted nor timed.
Interrupts are still triggered by responses to Interrupt Commands.
When set to '1', the interrupt aggregation mechanism is enabled and aggregation-based interrupts are generated.
Bit Value Description:
  0 - Disable.
  1 - Enable.
30:25RSVDRO0Reserved for future use.
24IAPWENWO0x0When host software writes '1', the values in IACTH and IATOVAL are updated with the contents written in the same cycle.
When host software writes '0', the values in IACTH and IATOVAL are not updated.
23:21RSVDRO0Reserved for future use.
20IASBRO0x0This bit indicates to host software whether any responses have been received and counted toward interrupt aggregation.
That is, IASB is set if the IA counter > 0.
Bit Value Description:
  0 - No commands have been received since the last counter reset (IA counter == 0).
  1 - At least one command has been received and counted (IA counter > 0).
19:17RSVDRO0Reserved for future use.
16CTRWO0x0When host software writes '1', the interrupt aggregation timer and counter are reset.
It is recommended that host software use this field to reset the timer and counter each time it services newly received UTP responses.
15:13RSVDRO0Reserved for future use.
12:8IACTHRW0x0Host software uses this field to configure the number of responses required to generate an interrupt.
Counter Operation: As UTP responses are received by the host controller, they are counted.
The counter is reset by software during the interrupt service routine.
It increments with every response to a Regular Transfer Request Command received by the host controller.
The counter stops counting when it reaches the value configured in IACTH and sets the IS.UTRCS bit.
The maximum allowed value is 31.
7:0IATOVALRW0x0Host software uses this field to configure the maximum time allowed between a response arriving at the host controller and the generation of an interrupt.
Timer Operation: The timer is reset by software during the interrupt service routine.
It starts running when the host controller receives the first response to a Regular Transfer Request Command after the timer was reset.
The timer stops when it reaches the value configured in the IATOVAL field, and the IS.UTRCS bit is set.
UTP TRANSFER REQUEST LIST BASE ADDRESS REGISTER

UTP_TRANSFER_REQUEST_LIST_BASE_ADDRESS Offset:0x50

BitsFieldTypeResetDescription
31:10UTRLBARW0x0Indicates the 32-bit physical base address for the UTP Transfer Request list.
This base is used when fetching commands for execution.
The structure pointed to by this address range is 1 KB in length.
This address shall be 1 KB aligned, as indicated by bits 9:0 being read-only.
9:0RSVDRO0Reserved for future use.
UTP TRANSFER REQUEST LIST BASE ADDRESS UPPER 32BITS REGISTER

UTP_TRANSFER_REQUEST_LIST_BASE_ADDRESS_UPPER_32BITS Offset:0x54

BitsFieldTypeResetDescription
31:10UTRLBAURW0x0Indicates the upper 32-bit physical base address for the UTP Transfer Request list.
This base is used when fetching commands for execution.
9:0RSVDRO0Reserved for future use.
UTP TRANSFER REQUEST LIST DOOR BELL REGISTER

UTP_TRANSFER_REQUEST_LIST_DOOR_BELL Offset:0x58

BitsFieldTypeResetDescription
31:0UTRLDBRRWS0x0This field is bit-significant.
Each bit corresponds to a slot in the UTP Transfer Request List, where bit 0 corresponds to request slot 0.
This field is set by host software to indicate to the host controller that a transfer request has been built in system memory for a transfer request slot and may be ready for execution.
When a transfer request is completed (with success or error), the corresponding bit is cleared to '0' by the host controller.
Bits in this field shall only be set to '1' by host software when UTRLRSR is set to '1'.
The host controller always processes transfer requests in order according to the order submitted to the list.
In the case of multiple commands with a single doorbell-register write (batch mode), the dispatch order for these transfer requests by the host controller is based on their index in the list.
A transfer with a lower index value is executed before a transfer request with a higher index value.
This field is also cleared when UTRLRSR is written from a '1' to a '0' by host software.
UTP TRANSFER REQUEST LIST CLEAR REGISTER

UTP_TRANSFER_REQUEST_LIST_CLEAR Offset:0x5C

BitsFieldTypeResetDescription
31:0UTRLCLRWO0x0This field is bit-significant.
Each bit corresponds to a slot in the UTP Transfer Request List, where bit 0 corresponds to request slot 0.
A bit in this field is set to '0' by host software to indicate to the host controller that a transfer request slot is cleared.
The host controller shall immediately free any resources associated with the request slot and shall set the associated bit in UTRLDBR to '0'.
The host software indicates no change to request slots by setting the associated bits in this field to '1'.
Bits in this field shall only be set to '1' or '0' by host software when UTRLRSR is set to '1'.
The host software shall use this field only when a UTP Transfer Request is expected to not be completed, e.g., when the host software receives a "FUNCTION COMPLETE" Task Management response which means a Transfer Request was aborted, or in case of a system bus error, such as an invalid UTRD.
UTP TRANSFER REQUEST LIST RUN STOP REGISTER

UTP_TRANSFER_REQUEST_LIST_RUN_STOP Offset:0x60

BitsFieldTypeResetDescription
31:1RSVDRO0Reserved for future use.
0UTRLRSRRW0x0When set to '1', the host controller may process the list. The host controller starts processing the list at entry 0.
The host controller continues processing the list as long as this bit is set to '1'.
When cleared to '0', the host controller shall continue to complete all the outstanding transfer requests in the list and then stop.
This bit shall only be set to '1' when HCS.UTRLRDY is set to '1'.
UTP TRANSFER REQUEST LIST COMPLETION NOTIFICATION REGISTER(UTRLCNR)

UTP_TRANSFER_REQUEST_LIST_NOTIFICATION Offset:0x64

BitsFieldTypeResetDescription
31:0UTRLCNRRWC0x0This field is bit-significant.
Each bit corresponds to a slot in the UTP Transfer Request List, where bit 0 corresponds to request slot 0.
A bit in this field is set to '1' by the host controller when a transfer request from the associated transfer request slot has completed (with success or error).
The host controller sets the bit at the same time it clears the bit with the same index in UTRLDBR.
Host software is expected to clear the bit by writing '1' to it after processing the completed task.
Clearing a bit in this register shall have no effect on the hardware, other than changing the value of this register.
The host controller shall clear this register when UTRLRSR is written from a '0' to a '1' by host software.
UTP TASK MANAGEMENT REQUEST LIST BASE ADDRESS REGISTER

UTP_TASK_MANAGEMENT_REQUEST_LIST_BASE_ADDRESS Offset: 0x70

BitsFieldTypeResetDescription
31:10UTMRLBARW0x0Indicates the 32-bit physical base address for the UTP Task Management list.
This base is used when fetching Task Management Functions for execution.
The structure pointed to by this address range is 640 Bytes in length.
This address shall be 1KB aligned as indicated by bits 9:0 being read-only.
9:0RSVDRO0Reserved for future use.
UTP TASK MANAGEMENT REQUEST LIST BASE ADDRESS UPPER 32-BITS REGISTER

UTP_TASK_MANAGEMENT_REQUEST_LIST_BASE_ADDRESS_UPPER_32BITS Offset: 0x74

BitsFieldTypeResetDescription
31:0UTMRLBAURW0x0Indicates the upper 32 bits of the physical base address for the list.
This base is used when fetching task-management functions for execution.
UTP TASK MANAGEMENT REQUEST LIST DOOR BELL REGISTER(UTMRLDBR)

UTP_TASK_MANAGEMENT_REQUEST_LIST_DOOR_BELL Offset: 0x78

BitsFieldTypeResetDescription
31:8RSVDRO0Reserved for future use.
7:0UTMRLDBRRWS0x0This field is bit-significant.
Each bit corresponds to a task-management request slot in the list, where bit 0 corresponds to task slot 0.
This field is set by host software to indicate to the host controller that a task management request has been built in system memory and may be ready for execution.
When a task management request is completed (with success or error), the corresponding bit is cleared to '0' by the host controller.
Bits in this field shall only be set to '1' by host software when UTMRLRSR is set to '1'.
The host controller always processes task-management requests in order according to the order submitted to the list.
In the case of multiple requests with a single doorbell-register write (batch mode), the dispatch order for these requests by the host controller is based on their index in the list.
A task-management request with a lower index value is executed before a task-management request with a higher index value.
This field is also cleared when UTMRLRSR is written from a '1' to a '0' by host software.
UTP TASK MANAGEMENT REQUEST LIST CLEAR REGISTER(UTMRLCLR)

UTP_TASK_MANAGEMENT_REQUEST_LIST_CLEAR Offset: 0x7C

BitsFieldTypeResetDescription
31:8RSVDRO0Reserved for future use.
7:0UTMRLCLRRWS0x0This field is bit-significant.
Each bit corresponds to a slot in the task-management request list, where bit 0 corresponds to slot 0.
A bit in this field is set to '0' by host software to indicate to the host controller that a task management request slot is cleared.
The host controller shall immediately free any resources associated with the task-management request slot and shall set the associated bit in UTMRLDBR to '0'.
The host software indicates no change to task management request slots by setting the associated bits in this field to '1'.
Bits in this field shall only be set to '1' or '0' by host software when UTMRLRSR is set to '1'.
The host software shall use this field only when a UTP Task Management Request is expected to not be completed, e.g., in case of a system bus error, such as an invalid UTMRD.
UTP TASK MANAGEMENT REQUEST LIST RUN STOP REGISTER(UTMRLRSR)

UTP_TASK_MANAGEMENT_REQUEST_LIST_RUN_STOP Offset: 0x80

BitsFieldTypeResetDescription
31:1RSVDRO0Reserved for future use.
0UTMRLRSRRW0x0When set to '1', the host controller may process the list.
The host controller starts processing the list at entry 0.
The host controller continues to process the list as long as this bit is set to '1'.
When cleared to '0', the host controller shall continue to complete all the outstanding task management requests in the list and then stop.
This bit shall only be set to '1' when HCS.UTMRLRDY is set to '1'.
UIC COMMAND REGISTER(UICCMD)

UIC_COMMAND Offset: 0x90

BitsFieldTypeResetDescription
31:8RSVDRO0Reserved for future use.
7:0CMDOPRW0x0Indicates the opcode of a UIC command to be dispatched to the local UIC layer.
When this register is set, the host controller shall take the values of UICCMDARGx as the corresponding parameters (input and output) that are part of the UIC command.
UIC COMMAND ARGUMENT 1 REGISTER(UICCMDARG1)

UIC_COMMAND_ARGUMENT_1 Offset: 0x94

BitsFieldTypeResetDescription
31:0ARG1RW0x0This register contains the value for the 1st argument of the UIC command, if applicable.
UIC COMMAND ARGUMENT 2 REGISTER(UICCMDARG2)

UIC_COMMAND_ARGUMENT_2 Offset: 0x98

BitsFieldTypeResetDescription
31:0ARG1RW0x0This register contains the value for the 2nd argument of the UIC command, if applicable.
UIC COMMAND ARGUMENT 3 REGISTER(UICCMDARG3)

UIC_COMMAND_ARGUMENT_3 Offset: 0x9C

BitsFieldTypeResetDescription
31:0ARG1RW0x0This register contains the value for the 3rd argument of the UIC command, if applicable.
SYS1CLK 1US REGISTER

SYS1CLK_1US Offset: 0xC0

BitsFieldTypeResetDescription
31:9RSVDRO0Reserved for future use.
8:0SYS1CLK_1US_REGRW0x12cThis register value represents the number of SYS1 clock cycles required for 1 microsecond.
For example, if the frequency is 300 MHz (period = 0.003 µs), then the number of clock cycles required is 1 / 0.003 = 300 cycles.
This value, when multiplied by the corresponding timeout attribute, gives the actual timeout value.
TX SYMBOL CLK NS 1US REGISTER

TX_SYMBOL_CLK_NS_1US Offset: 0xC4

BitsFieldTypeResetDescription
31:24RSVDRO0Reserved for future use.
23:10CLK_NS_REGRW0x5This register value represents the period of the system clock in nanoseconds.
For example:
If the frequency is 200 MHz, then the period of one system clock is 5 ns.
9:0RSVDRO0Reserved for future use.
LOCAL CPORT ID REGISTER

LOCAL_CPORT_ID Offset: 0xC8

BitsFieldTypeResetDescription
31:11RSVDRO0Reserved for future use.
10:0CLK_NS_REGRW0x0This field contains the ID value of the local CPort.
PA ERROR CODE REGISTER

PA_ERROR_CODE Offset: 0xCC

BitsFieldTypeResetDescription
31:4RSVDRO0Reserved for future use.
3:0PA_ERR_CODEROC0x0This field indicates the error type when the 14th bit of the Host UIC Error Code Data Link Layer at offset 0x03C is set.
Bit Description:
0 - BAD PHY SYMBOL.
1 - UNMAPPED_PHY_ESC_SYMBOL.
2 - UNEXPECTED_PHY_ESC_SYMBOL.
3 - BAD_PA_PARAM.
RETRY TIMER REGISTER

RETRY_TIMER Offset: 0xD0

BitsFieldTypeResetDescription
31:0RETRY_TIMERRW0x2When a NAC frame is received for the transmitted data frame or the replay timer in the DL layer expires, the data frame must be re-transmitted.
This register contains the count for the number of retries to be performed.
When this count is reached, the DL signals a retry error, which is mapped to the Device Fatal Error Status (DFES) in the Interrupt Status register (IS, offset 0x020h).
PA LINKSTARTUP TIMER REGISTER

PA_LINKSTARTUP_TIMER Offset: 0xD8

BitsFieldTypeResetDescription
31:28RSVDRO0Reserved for future use.
27:0PA_LINK_STARTUP_TIMERRW0x1CA38CEThis register value represents the number of system clock cycles required for 100 milliseconds.
For example: If the frequency is 300 MHz (3.33 ns period), then the number of clock cycles required for 100 ms is calculated as:
100 ms / 3.33 ns ≈ 30,030,030 cycles.

9.7.5.2 Register Descriptions (UFS Management)

The base address of UFS MNG Register is: 0xC0E01B00

UFS MPHY RESET CONTROL REGISTER

UFS_MPHY_RST_CTRL Offset:0x0

BitsFieldTypeResetDescription
31:2RSVDRO0Reserved for future use.
1HOST2MPHY_RSTN_CORERW0x0MPHY core logic reset signal:
0 = Reset asserted
1 = Reset deasserted
This signal resets only the core logic in the MPHY hierarchy, excluding RX/TX and Analog registers.
0HOST2MPHY_RSTNRW0x0MPHY all logic reset signal:
0 = Reset asserted
1 = Reset deasserted
This signal resets all logic in the MPHY hierarchy.
UFS MPHY POWER UP CONTROL REGISTER

UFS_MPHY_PU_CTRL Offset:0x4

BitsFieldTypeResetDescription
31MPHY_PLL_LOCKRO0x0MPHY PLL lock status directly from analog PHY.
30:12RSVDRO0Reserved for future use.
11:10MPHY_REF_CLK_SELRW0x2MPHY reference-clock frequency selections:
00 = 26 MHz
01 = 19.2 MHz
10 = 38.4 MHz
11 = 52 MHz
9:8MPHY_HB8_RX_RESETRW0x0Direct reset control in host space for the MPHY Hibern8 detectors on RX LANE1 and LANE0.
(The MPHY internal space also has certain register bits to configure power-up.)
0 = Reset deasserted
1 = Reset asserted
7RSVDRO0Reserved for future use.
6:5MPHY_HB8_PU_RXRW0x0Direct power-up control in host space for the MPHY Hibern8 detectors on RX LANE1 and LANE0.
(The MPHY internal space also has certain register bits to configure power-up.)
0 = Power down
1 = Power up enable
4:3MPHY_PU_RXRW0x0Direct power-up control in host space for MPHY RX LANE1 and LANE0.
(The MPHY internal space also has certain register bits to configure MPHY RX lane power-up.)
0 = Power down
1 = Power up enable
2:1MPHY_PU_TXRW0x0Direct power-up control in host space for MPHY TX LANE1 and LANE0.
(The MPHY internal space also has certain register bits to configure MPHY TX lane power-up.)
0 = Power down
1 = Power up enable
0MPHY_PU_PLLRW0x0Direct MPHY PLL power-up control in host space.
(The MPHY internal space also has certain register bits to configure MPHY PLL power-up.)
0 = Power down
1 = Power up enable
UFS MPHY BACKDOOR CONTROL REGISTER

UFS_MPHY_BACKDOOR_CTRL Offset:0x8

BitsFieldTypeResetDescription
31:1RSVDRO0Reserved for future use.
0HOST_ACCESS_ENRW0x0Backdoor register control that allows software to directly configure MPHY analog registers (ATOP registers) from the host AXI slave space.
If this bit is set to 1, software can use base address 0xC0A8_1C00 to access MPHY analog registers.
Note: Certain register offsets are mapped using bits [9:2] (8-bit offset address).
For example, if the analog PHY register offset in ATOP is 0xC1 and this bit is set to 1, software should access 0xC0A8_1F40 to reach register 0xC1.
The lower two bits of the address are always 2'b0, meaning all mapped ATOP registers in the 0xC0A8_1C00 space must be 4-byte aligned.
Since ATOP registers are only 8-bit wide, only BE[0] (Byte Enable 0) will be valid in the AXI slave interface.

Values:
0 = Host direct access to analog PHY registers via backdoor is disabled.
Analog PHY registers must still be configured through the standard RMMI interface at TX LANE0.
1 = Host direct access to analog PHY registers via backdoor is enabled.
Analog PHY registers can be directly accessed from the UFS Host AXI slave space at 0xC0A8_1C00.
UFS DEVICE IO CONTROL REGISTER

UFS_DEVICE_IO_CTRL Offset:0xC

BitsFieldTypeResetDescription
31:19RSVDRO0Reserved for future use.
18:16STM_BUS_SELRW0x0STM debug-signal group selection.
15:9RSVDRO0Reserved for future use.
8REFCLK_OERW0x0UFS Device REF_CLK output enable control register:
0 = Disable REF_CLK output to UFS device
1 = Enable REF_CLK output to UFS device
7:2RSVDRO0Reserved for future use.
1BYPASS_RST_N_EARLYRW0x0UFS Device RST_N IO control register:
0 = Enable reset_in_n_early to reset UFS device function
1 = Bypass reset_in_n_early reset of UFS device function
0HW_RST_NRW0x0UFS Device RST_N IO control register:
0 = Reset asserted
1 = Reset deasserted