Регистры Allwinner H616

Сокращения  |  Дерево шин  |  Карта памяти


SMHC_CMD
5.3.5. Command Register - адрес: 0x4020018 0x4021018 0x4022018 (смещение: 0x0018)

Хост-контроллер SD / MMC (SMHC): список регистров



31 ||||||||||||||||| 16
15 ||||||||||||||||| 00

  CMD_LOAD

Bit 31
R/W
0x0

Start Command
This bit is auto cleared when current command is sent. If there is no any
response error happened, a command complete interrupt bit (CMD_OVER) will be set in interrupt register.
You should not write any other command before this bit is cleared.


  Unused

Bits 30 : 29

  VOL_SW

Bit 28
R/W
0x0

Voltage Switch
0: normal command
1: Voltage switch command, set for CMD11 only


  BOOT_ABT

Bit 27
R/W
0x0

Boot Abort
Setting this bit will terminate the boot operation.


  EXP_BOOT_ACK

Bit 26
R/W
0x0

Expect Boot Acknowledge
When software sets this bit along in mandatory boot operation, the
controller expects a boot acknowledge start pattern of 0-1-0 from the selected card.


  BOOT_MOD

Bits 25 : 24
R/W
0x0

Boot Mode
00: Normal command
01: Mandatory Boot operation
10: Alternate Boot operation
11: Reserved


  Unused

Bits 23 : 22

  PRG_CLK

Bit 21
R/W
0x0

Change Clock
0: Normal command
1: Change Card Clock
When this bit is set, controller will change clock domain and clock output. No command will be sent.


  Unused

Bits 20 : 16

  SEND_INIT_SEQ

Bit 15
R/W
0x0

Send Initialization
0: Normal command sending
1: Send initialization sequence before sending this command.


  STOP_ABT_CMD

Bit 14
R/W
0x0

Stop Abort Command
0: Normal command sending
1: Send Stop or Abort command to stop current data transfer in
progress.(CMD12, CMD52 for writing \"I/O Abort\" in SDIO CCCR)


  WAIT_PRE_OVER

Bit 13
R/W
0x0

Wait Data Transfer Over
0: Send command at once, do not care of data transferring
1: Wait for data transfer completion before sending current command


  STOP_CMD_FLAG

Bit 12
R/W
0x0

Send Stop CMD Automatically (CMD12)
0: Do not send stop command at end of data transfer
1: Send stop command automatically at end of data transfer
If set, the SMHC_RESP1 will record the response of auto CMD12.


  TRANS_MODE

Bit 11
R/W
0x0

Transfer Mode
0: Block data transfer command
1: Stream data transfer command


  TRANS_DIR

Bit 10
R/W
0x0

Transfer Direction
0: Read operation
1: Write operation


  DATA_TRANS

Bit 9
R/W
0x0

Data Transfer
0: Without data transfer
1: With data transfer


  CHK_RESP_CRC

Bit 8
R/W
0x0

Check Response CRC
0: Do not check response CRC
1: Check response CRC


  LONG_RESP

Bit 7
R/W
0x0

Response Type
0:Short Response (48 bits)
1:Long Response (136 bits)


  RESP_RCV

Bit 6
R/W
0x0

Response Receive
0: Command without response
1: Command with response


  CMD_IDX

Bits 5 : 0
R/W
0x0

CMD Index
Command index value



Команда U-Boot для чтения регистра

md 4020018 1
md 4021018 1
md 4022018 1



Bit fields structure

typedef union  smhc_cmd
{
  struct
  {
   unsigned cmd_idx : 6;
   unsigned resp_rcv : 1;
   unsigned long_resp : 1;
   unsigned chk_resp_crc : 1;
   unsigned data_trans : 1;
   unsigned trans_dir : 1;
   unsigned trans_mode : 1;
   unsigned stop_cmd_flag : 1;
   unsigned wait_pre_over : 1;
   unsigned stop_abt_cmd : 1;
   unsigned send_init_seq : 1;
   unsigned unused0 : 5;
   unsigned prg_clk : 1;
   unsigned unused1 : 2;
   unsigned boot_mod : 2;
   unsigned exp_boot_ack : 1;
   unsigned boot_abt : 1;
   unsigned vol_sw : 1;
   unsigned unused2 : 2;
   unsigned cmd_load : 1;
  } b;
   unsigned long w;
} SMHC_CMD
   

Allwinner H616 Manual