[Galaxy Note II, Galaxy S III Developer Discussion ] E:V:A:
Does someone know what CMD60 and CMD61 does?

According to THIS old (2006) EE-Times article, it seem that they are connected

with CE-ATA interface, to provide backward compatibility when the eMMC chips

are used in a CF+ configuration. I guess it could also be involved when they

are used in a SSD RAID configuration. But this should be confirmed... Here's

what they say. [Attention, the EE-Times bastards only allow you to see 2-pages!]

CE-ATA is based primarily on a combination of the MMC electrical interface

standard and on an optimized subset of the ATA command protocol. CE-ATA

specifications include:

Scalable transfer rates up to 52 MB/s

Low pin count with six or ten interface signals, depending on data transfer rate requirements

A streamlined ATA command set — only five commands

Five MMC commands, two exclusively developed for CE-ATA

A simple protocol

MMC commands in CE-ATA scope

CE-ATA utilizes five MMC commands during the course of normal execution.

Resets are performed using the “GO_IDLE_STATE (CMD0)”, aborting an ATA command

is done by issuing “STOP_TRANSMISSION (CMD12)”, byte-wise access to the ATA

taskfile register is achieved using “FAST_IO (CMD39)”, issuance of an ATA

command or access to the status and control registers is executed by

“RW_MULTIPLE_REGISTER (CMD60)”, and ATA command data transfer is achieved

using “RW_MULTIPLE_BLOCK (CMD61)”.

CMD60 and CMD61 are MMC commands newly defined by CE-ATA for efficient ATA

command execution. CE-ATA utilizes the same MMC command sequence for

initialization as traditional MMC devices. The ATA operation occurs within the

MMC “TRAN” state.

ATA processing on MMC

CE-ATA maps the streamlined ATA command set onto the MMC interface. The ATA

taskfile is mapped onto the MMC register space starting at MMC address zero as

outlined in Figure 1. To accommodate future capacity growth, and to ensure

that large transfers can be done, 48-bit addressing is accommodated from the

start. Transferring a single song from the device typically requires more than

128KB of data, which is the maximum transfer size with only 28-bit LBA

addressing.

...

CMD60 : RW multiple register

CMD60 allows multiple registers to be read/written in a single transaction

sequence. Using CMD60, an ATA command can be issued using a single MMC

command. Alternatively, software may have to execute up to 13 individual

taskfile register writes with "FAST_IO" in order to issue a single ATA

command.

CMD61 : RW multiple block

CMD61 is used to transfer the data for an ATA command (like READ DMA EXT).

Data transfer for media access commands must be multiples of the CE-ATA sector

size that is a minimum of 4KB. Each transfer is broken into multiple MMC data

blocks that are 512 bytes, 1KB, or 4KB in size as negotiated between the host

and the device.

​

The question is why they have included CMD60 in movinand.c, since it is never

actually used anywhere, as far as I can see.

So perhaps it has a different use altogether...

[SIZE=2]int mmc_vendor_cmd60(unsigned int arg) {
int err;
struct mmc_host *host = ffu_mmc_host();
unsigned int claim = 0;
int resp;
struct mmc_command cmd = {0};

if( host ) {
claim = host->claimed;
cmd.opcode = 60;
cmd.arg = arg;
cmd.flags = MMC_RSP_SPI_R1B;

host->claimed = 1;
err = mmc_wait_for_cmd(host, &cmd, 3);
host->claimed = claim;
if (err) {
printk(KERN_ALERT"FFU : CMD60 error with arg : %x\n",arg);
return err;
}

do{ mmc_send_status(&resp); }while(resp != 0x900);
return 0;
}
return -1;
}[/SIZE]