7 May 2012 18:21
[ata] wait_for_bsy vs. wait_for_rdy: ATA spec interpretation
Jonas Wielicki <j.wielicki <at> sotecware.net>
2012-05-07 16:21:06 GMT
2012-05-07 16:21:06 GMT
Hi folks,
(heh, I hope this won't be too long, but its essentially just a short
question with a „bit“ of context)
I'm still messing with ATA code to debug further SSD issues. Now I
stumbled across what rockbox code does before command issuing. Basically
its like this:
(1) Select the device
(2) wait_for_rdy
(2a) wait_for_bsy (or return with error)
(2a.i) wait until STATUS_BSY is cleared (or timeout)
(2a) wait until STATUS_RDY is set (or timeout)
(3) Setup parameters and issue the command
(see firmware/ata.c, searching for ATA_SELECT for reference, its done at
several places)
However, ATA spec draft 5 (section 9.3, its at page 236 in the version I
have) has the following state graph for the bus idle mode (i.e. before a
command is being executed):
Check_Status:
BSY = 0 & DRQ = 0 & wrong device selected
=> Device_Select
BSY = 0 & DRQ = 0 & correct device selected
=> Write_parameters
BSY = 1 or DRQ = 1
=> Check_Status
(Continue reading)
RSS Feed