
Functional Example of MMC/SD Communication
MOTOROLA
Multimedia Card/Secure Digital Host Controller
17-11
17.5.3 Protection Management
Three write-protect methods are supported in the host for MMC/SD cards: card internal write protect (the
card’s responsibility), mechanical write protect switch (the host’s responsibility only), and password
protection card lock operation.
17.5.3.1 Card Internal Write Protection
Card data can be protected against erasure or writing. The entire card can be permanently write protected
by the manufacturer or content provider by setting the permanent or temporary write-protect bits in the
CSD. For cards that support the write protection of groups of sectors by setting the WP_GRP_ENABLE
bit in the CSD, portions of the data can be protected (in units of WP_GRP_SIZE sectors as specified in the
CSD), and the write protection can be changed by the application. The SET_WRITE_PROT command sets
the write protection of the addressed write-protect group, and the CLR_WRITE_PROT command clears
the write protection of the addressed write-protect group.
The SEND_WRITE_PROT command is similar to a single block read command. The card sends a data
block containing 32 write-protection bits (representing 32 write-protect groups starting at the specified
address) followed by 16 CRC bits. The address field in the write-protect commands is a group address in
byte units. The card ignores all LSBs below the group size.
17.5.3.2 Mechanical Write Protect Switch
The user can use a mechanical sliding tablet on the side of the card to indicate whether a given card is write
protected or not. If the sliding tablet is positioned such that the window is open, the card is write protected.
If the window is closed, the card is not write protected.
A properly matched switch on the socket side indicates to the host whether the card is write protected or
not. It is the responsibility of the host to protect the card. The position of the write-protect switch is
unknown to the internal circuitry of the card.
17.5.3.3 Password Protection
The password protection feature enables the host to lock a card when providing a password, which later
can be used for unlocking the card. The password and its size are kept in the 128-bit PWD and 8-bit
PWD_LEN registers, respectively. These registers are non-volatile so that a power cycle will not erase
them.
Locked cards respond to (and execute) all commands in the “basic” command class (class 0) and “l(fā)ock
card” command class. Thus, the host is allowed to reset, initialize, select, query for status, and so on, but
not to access data on the card. If the password was previously set (the value of PWD_LEN is not 0), the
card is locked automatically after power on. Similar to the existing CSD and CID register write commands,
the lock/unlock command is available only in transfer state. This means that it does not include an address
argument, and the card has to be selected before being used. The card lock/unlock command has the
structure and bus transaction type of a regular single block write command. The transferred data block
includes all the required information of the command (password setting mode, PWD itself, card
lock/unlock, and so on).
Table 17-3 describes the structure of the command data block.
Table 17-3. Structure of Command Data Block
Byte Number
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0
Rsv
ERASE
LOCK_
UNLOCK
CLR_PWD
SET_PWD
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.