5.4.19. MMC component

The MMC component models a MultiMedia Card (MMC) device. The MMC component implementation is a simple MMC, compatible with MMCA specification version 3.31. The MMC component is provided as source code, permitting you to extend functionality if required. Further information about the MMC device can be obtained from the MultiMedia Card Association, www.mmca.org.

When paired with a PL180_MCI component, the MMC device model provides emulation of a flexible, persistent storage mechanism. The MMC component uses a file on the host PC to simulate the storage device. The size of this backing store file determines the reported size of the MMC device. As small sections of this file are paged in by the model, large filesystems can be modeled while making efficient use of host PC memory. The backing store file contains a FAT filesystem. The file format is a direct bit copy of an SD card file system image.

The MMC component does not model card insertion or removal. Instead the card is modeled as having already been inserted at system instantiation time.

The following commands are supported by the MMC component:

The MMC_SET_BLOCKLEN command is supported, but the implementation is based on 512 byte blocks.

The following erase commands (Class 5) are supported, but have no effect on the disk backing storage:

The following commands are not supported by the MMC component:

Stream read and write commands (Classes 1 and 3) are not supported:

Block oriented write protection commands (Class 6) are unsupported:

Lock card commands (Class 7) and application-specific commands (Class 8) are unsupported:

I/O mode commands (Class 9) are unsupported:

Reserved commands are not supported. If a reserved command is used, the MMC ST_ER_B_ILLEGAL_COMMAND bit is set.

The view of the component in System Canvas is shown in Figure 5.40.

Figure 5.40. MMC in System Canvas

MMC in System Canvas

This component is written in LISA+.

Ports

Table 5.66 provides a brief description of the ports.

Table 5.66. MMC ports

NamePort protocolTypeDescription
card_presentStateSignalMasterUsed to signal whether an MMC image is loaded. It is set if an image is loaded, and is clear if no image is loaded.
clk_inClockSignalSlaveMaster clock input.
mmcMMC_ProtocolSlaveThe MMC slave port.

Additional protocols

The MMC component uses the MMC_Protocol. See MMC_Protocol.

Parameters

Table 5.67 provides a description of the configuration parameters for the MMC component. Parameters are provided to permit configuration of a number of attributes reflected in the CID and CSD registers. See Registers. You can customize the component further by modifying the MMC model source code directly.

Table 5.67. MMC configuration parameters

Parameter nameDescriptionTypeAllowed valueDefault value
p_fast_accessControls whether MMC card block reads and writes have a simulated delay, or are completed as fast as possible.Booleantrue/falsetrue
p_mmc_fileFile used for the MMC component backing storeStringvalid filenamemmc.dat
p_prodNameCard ID product nameStringsix character stringARMmmc
p_prodRevCard ID product revisionInteger-0x1
p_manidCard ID manufacturer IDInteger-0x2[a]
p_OEMidCard ID OEM IDInteger-0x0000
p_sernumCard serial numberInteger-0xCA4D0001

[a] This is equivalent to “Sandisk”.


Registers

Table 5.68 provides a description of the configuration registers for the MMC component. For a full definition of MMC registers, see the MMCA System Summary documentation. Device-specific register information can also be obtained from MMC vendors.

The MMC component registers are not memory-mapped. Instead, they are accessed using relevant MMC commands. The MMC component model makes the registers available through a CADI interface. Modification of these registers through CADI is not recommended, but not prohibited. For example, modifying the card ID (CID) registers can be useful when experimenting with drivers, but direct modification of the STATUS_REG register is likely to put the card model into an indeterminate state.

Table 5.68. MMC registers

Register nameOffsetDescription
OCR_REG0x000Operating conditions register
CID_REG00x004Card ID bits 127:96
CID_REG10x005Card ID bits 95:64
CID_REG20x006Card ID bits 63:32
CID_REG30x007Card ID bits 31:0
CSD_REG00x008Card specific data bits 127:96
CSD_REG10x009Card specific data bits 95:64
CSD_REG20x00aCard specific data bits 63:32
CSD_REG30x00bCard specific data bit 31:0
RCA_REG0x00cRelative card address register
DSR_REG0x00dDriver stage register
BLOCKLEN_REG0x00eBlock length
STATUS_REG0x00fCard status
BLOCK_COUNT_REG0x010Block count

Debug features

The MMC component provides a CADI interface for viewing internal registers. See Registers. Command tracing can be enabled within the component at compile time by modifying the MMC_TRACE macro in the MMC.lisa file. This sends command and event trace to standard output. You can use this trace output to help with debugging device driver and controller-to-card protocol issues.

Verification and testing

The MMC component has been tested in conjunction with the ARM MMC reference model. The component has been tested in the VE example with Boot Monitor and Linux drivers.

Performance

The MMC component is not expected to significantly affect the performance of a PV system.

Library dependencies

The MMC component has no dependencies on external libraries.

Copyright © 2008-2013 ARM. All rights reserved.ARM DUI 0423O
Non-ConfidentialID060613