Entry | |
---|---|
R0 | Bits 0 – 7 = slot number |
Bits 8 – 15 = bus number | |
Bit 16 set => check busy after response (use for R1B) | |
Bit 17 set => command CRC check enabled (use for R1, R1B, R2, R4 (MMC), R5 (MMC), R5 (SDIO), R6, R7) | |
Bit 18 set => command index check enabled (use for R1, R1B, R4 (MMC), R5 (MMC), R5 (SDIO), R6, R7) | |
Bit 19 set => test response word for R1-style errors (use for R1, R1B) | |
Bit 20 set => test response word for R5-style errors (use for R5 (SDIO)) | |
Bits 24 – 25 = transfer direction (0 = no data transfer, 1 = read, 2 = write) | |
Bit 26 set => scatter transfer | |
Bit 27 set => don’t poll for escape during foreground transfers | |
Bit 28 reserved – bits 26-29 are equivalent to bits 5-8 for FileCore DiscOps | |
Bit 29 set => background transfer | |
R1 | Length of command and response block, must be 8, 12 or 23 |
R2 | Pointer to command and response block |
R3 | RAM ptr for start of transfer or pointer to scatter list of address length pairs if bit 26 of R0 is set |
R4 | Length of transfer (in bytes) – must be 0 if no data transfer is specified in R0 bits 24-25, and must not be 0 otherwise |
R5 | If bit 29 of R0 is clear, this is timeout in centiseconds or 0 for no timeout |
If bit 29 of R0 is set, this is the value to pass in R5 to the callback routine | |
R6 | Address of callback routine, if bit 26 of R0 is set |
R7 | Value to pass in R12 to the callback routine, if bit 26 of R0 is set |
Exit | |
---|---|
If error was detected, | |
R0 | Pointer to error block |
R4 | Updated to number of bytes not transferred |
V set | |
If foreground transfer completed successfully, | |
R0 | 0 (consider as a flags word with all bits reserved) |
R4 | 0 |
V clear | |
If background transfer has started, | |
R0 | 0 (consider as a flags word with all bits reserved) |
R1 | operation handle, can be used to cancel the operation using SDIO_Control |
V clear |
R2 Offset | Meaning |
---|---|
0 | Command index |
1 | Flags: |
Bit 0 set => this is an application command (i.e. precede this command with a CMD55) | |
Bit 1 set => issue automatic CMD12 to terminate multiple-block data transfer command | |
Bits 4 – 7 = log2 of the data transfer block split size (block length used is the lesser of R4 and this number) | |
Other bits reserved, should be 0 | |
2 | RCA (relative card address) for application commands, otherwise 0 |
4 | Bits 8 – 39 of the command argument |
8 | Buffer space filled in on exit with the response bytes (if any) excluding the index and CRC bytes |
This SWI is used to perform low-level operations.
This SWI is reentrant when used to specify a background transfer, otherwise not reentrant.
The scatter list is not updated (in other words, it behaves more like the low-level SCSISwitch API than the backward-compatible SCSIDriver API). FileCore-style wrapping is accepted (ie if an address entry is between &FFFF0000 and &FFFFFFFF, and the length field is 0, then that should be treated as an instruction to push the scatter list pointer backwards by an offset of up to 64K).
The callback operates as follows:
For most commands, the space required at R2+8 will be 4 bytes, but for R2 it will be 15 bytes, and a few commands (such as GO_IDLE_STATE) have no response at all.