AT2LP response to the 13 cases given in the mass storage spec in case of interfacing with an IDE controller

Question: How does the AT2LP react to the 13 cases given in the mass storage spec in case it is interfaced with an IDE controller?

 

Answer:

The AT2LP follows the mass storage spec. The response of AT2LP, when interfaced with an IDE controller, to the 13 cases given in the mass storage spec, can be seen by going through the firmware of CY4611 FX2 to ATA reference design. The phase error is passed as a parameter to the function that returns the CSW packet only when the sector count mentioned in the READ/WRITE command contradicts with the data transfer length mentioned in the command header.

Find below the table that sums up AT2LP’s response to the 13 Cases in case it is interfaced with an IDE device. In case there is a difference in expectation between the host and drive, the endpoint is stalled, and the status byte depends on whether the drive detects an error or not.

                                                                                                                                                                                                                                                               
   

     Case

  
   

     bCSWStatus

  
   

     Endpoint 2/6 Status

  
   

     Hn = Dn

  
   

     0x00 or 0x01

  
   

     Normal Operation

  
   

     Hn < Di

  
   

     0x00 or 0x01

  
   

     EP6 Stalled

  
   

     Hn < Do

  
   

     0x00 or 0x01

  
   

     EP6 Stalled

  
   

     Hi > Dn

  
   

     0x00 or 0x01

  
   

     EP6 Stalled

  
   

     Hi > Di

  
   

     0x00 or 0x01

  
   

     EP6 Stalled

  
   

     Hi = Di

  
   

     0x00 or 0x01

  
   

     Normal Operation

  
   

     Hi < Di

  
   

     0x02

  
   

     PHASE ERROR RESPONSE

  
   

     Hi <> Do

  
   

     0x00 or 0x01

  
   

     EP6 Stalled

  
   

     Ho > Dn

  
   

     0x00 or 0x01

  
   

     EP2 Stalled

  
   

     Ho <> Di

  
   

     0x00 or 0x01

  
   

     EP2 Stalled

  
   

     Ho > Do

  
   

     0x00 or 0x01

  
   

     EP2 Stalled

  
   

     Ho = Do

  
   

     0x00 or 0x01

  
   

     Normal Operation

  
   

     Ho < Do

  
   

     0x02

  
   

     PHASE ERROR RESPONSE