Changes

Jump to navigation Jump to search
580 bytes added ,  11:42, 2 September 2015
Line 67: Line 67:  
===4004800h/4004A00h - SD_CMD - Command and Response/Data Type (R/W)===
 
===4004800h/4004A00h - SD_CMD - Command and Response/Data Type (R/W)===
 
   15    undoc  Unknown/undoc  (read/write-able)
 
   15    undoc  Unknown/undoc  (read/write-able)
   14    undoc  Security Cmd   (0=Normal, 1=Whatever/Security) (sdio?)
+
   14    undoc  Security Cmd(0=Normal, 1=Whatever/Security?) (sdio?)
 
   13    undoc  Data Length    (0=Single Block, 1=Multiple Blocks)
 
   13    undoc  Data Length    (0=Single Block, 1=Multiple Blocks)
 
   12    undoc  Data Direction (0=Write, 1=Read)
 
   12    undoc  Data Direction (0=Write, 1=Read)
 
   11    NTDT    Data Transfer  (0=No data, 1=With data)
 
   11    NTDT    Data Transfer  (0=No data, 1=With data)
   10-8  REP2-0  Response Type  (0..2=Unknown/Reserved, 3=None, 4=48bit,
+
   10-8  REP2-0  Response Type  (0=Auto, 1..2=Unknown/Reserved, 3=None, 4=48bit,
 
                                 5=48bit+Busy, 6=136bit, 7=48bitOcrWithoutCRC7)
 
                                 5=48bit+Busy, 6=136bit, 7=48bitOcrWithoutCRC7)
 
   7-6  CMD1-0  Command Type  (0=CMD, 1=ACMD, 2..3=unknown, maybe GEN WR/RD?)
 
   7-6  CMD1-0  Command Type  (0=CMD, 1=ACMD, 2..3=unknown, maybe GEN WR/RD?)
 
   5-0  CIX    Command Index  (0..3Fh, command index)
 
   5-0  CIX    Command Index  (0..3Fh, command index)
Invalid values can cause ILA error (particulary on setting NTDT for CMD12, or for CMD's Response=None). ILA error will also occur if an old CMD is still busy.<br>
+
Setting Command Type to "ACMD" is automatically sending an APP_CMD prefix prior to the command number. For Multiple Blocks, the hardware supports automatically sending STOP_TRANSMISSION after the last block.<br>
DSi software is always writing just ZERO to bit11-6 though? Maybe the hardware does automatically know which SD/MMC CMDs and ACMDs have data? Or maybe data is always automatically transferred when receiving a data-startbit, or when writing to data register - and bits like NTDT would be needed only for things like proper data timeout handling?
+
DSi software is usually setting Response Type to "Auto", which is causing the hardware to use the correct response/data type for standard SD/MMC commands (bit11-13 are ignored/should be zero when using "Auto"; and maybe same for bit14-15?).<br>
 +
One exception is that the DSi firmware isn't using "Auto" for SDIO commands (maybe the hardware isn't aware of them; or it's unable to distinguish between read/write direction of CMD53, which would require examining the command's PARAM bits).<br>
 +
There might be subtle differences between some SD and MMC commands, unknown if/how "Auto" is working in that cases; unknown if there's a SD-or-MMC mode select bit for that purpose in some configuration register.<br>
 +
Invalid values can cause ILA error (particulary on setting NTDT for CMD12, or for CMD's Response=None). ILA error will also occur if an old CMD is still busy.
    
===4004804h/4004A04h - SD_CMD_PARAM0-1 - Argument (32bit, 2 halfwords) (R/W)===
 
===4004804h/4004A04h - SD_CMD_PARAM0-1 - Argument (32bit, 2 halfwords) (R/W)===
108

edits

Navigation menu