This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SATA DMA write on the C6748 dev board

Hi,

I'm aware of the code examples but cannot get them to work and would like to get a simple example working by writing to the SATA controller registers.  I'm ok with being pointed to the examples but please refer to specific places in response to my questions.

I've gotten the SATA PHY to lock and the initial handshaking with the SATA drive seems to be working.  Now I'm trying to get a single block DMA write to the drive working.   I've got some questions that I hope will help me to get the write working.

1. The P0SERR register doesn't seem to be behaving as described in the manual.  It should be Read/write-1 to clear and the DIAG_X bit anyways seems to be acting as a R/W bit.  I have checked the TESTR register but it is 0.  Is this an errata?

2. After I initialize and establish the connection with the SATA drive I get 

P0SSTS  is 0x113
P0TFD is 0x150
P0SIG is 0x101

The value of P0SSTS seems correct since I asked to set up a GEN1 connection.  However, I don't understand the values in P0TFD or P0SIG.  Can you explain if these are correct?

3.  When I set up the command FIS data structure there are a couple fields that I am not sure what values to use.  For the 'Device' field all I could see in the reference manual pseudocode was 'DEVICE_REG_USE_LBA_ADDRESSING | (Uint8)(Dev28bitLbaAddress>>24)' - which from the driver source code seems to be 0x40 with the least significant 4 bits being the top four address bits??  Or maybe it's 0x4f?    I'm also not sure about the Command field  - it seems to be 0xCA for a DMA write but I'm not sure about this?

4. I suspect that perhaps my my DMA might be working but it's being cached in the SATA buffer.  Is there a way of properly shutting down the SATA controller to make sure that this doesn't impact me?

Thanks for your help!

Phil