
Preliminary
Use Cases
www.ti.com
myCmdFis.cfisDw2SecNumLbaLowExp=0x00;
myCmdFis.cfisDw2CylLowLbaMidExp=0x00;
myCmdFis.cfisDw2CylHighLbahighExp=0x00;
myCmdFis.cfisDw2FeatureExp=0x00;
myCmdFis.cfisDw3SecCntExp=0x00;
// Invalidate for future use.
Dev28bitLbaAddress = 0xFFFFFFFF;
return(0);
}
void buildCmdFis(CommandTable *CmdSlotNum) {
//
+----------+----------+--------------+-----------+
// DW0|
FEATURE | COMMAND
| c r r r port |FISTYPE 27h|
//
+----------+----------+--------------+-----------+
// DW1|
DEVICE
| LBA HIGH |
LBA MID
|
LBA LOW
|
//
+----------+----------+--------------+-----------+
// DW2|FETURESexp|LBAHIGHexp|
LBAMIDexp
| LBALOWexp |
//
+----------+----------+--------------+-----------+
// DW3| CONTROL
| RESERVED | SEC CNTexp
|
SEC CNT
|
//
+----------+----------+--------------+-----------+
// DW4| RESERVED | RESERVED |
RESERVED
| RESERVED
|
//
+----------+----------+--------------+-----------+
CmdSlotNum->cfis.DW0.B0FisType=0x27;
CmdSlotNum->cfis.DW0.BYTE1=myCmdFis.cfisByte1;
//Make Sure the 'C' bit
field is correctly set or cleared.
CmdSlotNum->cfis.DW0.B2Cmd=myCmdFis.cfisCmd;
CmdSlotNum->cfis.DW0.B3Feature=myCmdFis.cfisFeature;
CmdSlotNum->cfis.DW1.B0LbaLow=myCmdFis.cfisDw1SecNumLbaLow;
CmdSlotNum->cfis.DW1.B1LbaMid=myCmdFis.cfisDw1CylLowLbaMid;
CmdSlotNum->cfis.DW1.B2LbaHigh=myCmdFis.cfisDw1CylHighLbahigh;
CmdSlotNum->cfis.DW1.B3Device=myCmdFis.cfisDw1Dev;
//Make Sure 48-Bit or 28-Bit
Addressing is indicated here.
CmdSlotNum->cfis.DW2.B0LbaLowExp=myCmdFis.cfisDw2SecNumLbaLowExp;
//0x0;
CmdSlotNum->cfis.DW2.B1LbaMidExp=myCmdFis.cfisDw2CylLowLbaMidExp;
//0x0;
CmdSlotNum->cfis.DW2.B2LbaHighExp=myCmdFis.cfisDw2CylHighLbahighExp; //0x0;
CmdSlotNum->cfis.DW2.B3FeatureExp=myCmdFis.cfisDw2FeatureExp;
//0x0;
CmdSlotNum->cfis.DW3.B0SecCnt=myCmdFis.cfisDw3SecCnt;
CmdSlotNum->cfis.DW3.B1SecCntExp=myCmdFis.cfisDw3SecCntExp;
//0x0;
CmdSlotNum->cfis.DW3.B2Rsv=0x0;
CmdSlotNum->cfis.DW3.B3Control=myCmdFis.cfisDw3Ctrl;
CmdSlotNum->cfis.DW4.DWResv=0x0;
}
char startCmdListProcessing(void) {
// Make sure that a device is present and HBA has established communications.
while ((sataRegs->P0SSTS & AHCI_PxSCTL_PxSSTS_DET) !=0x3);
// Clear P0SERR.DIAG.X (RWC bit field) so that the P0TFD is updated by HBA.
// Make sure it is cleared.
sataRegs->P0SERR |= 0x04000000;
// Make sure the Command List is not Running.
if (sataRegs->P0CMD & AHCI_PxCMD_CR)
return(1);
//
Task file regs and look for Device ready status.
while ((sataRegs->P0TFD & AHCI_PxTFD_STS_BSY_DRQ_ERR) != 0);
// Make sure the the Receive FIS DMA is running.
if ((sataRegs->P0CMD & (AHCI_PxCMD_FRE | AHCI_PxCMD_FRE)) !=
(AHCI_PxCMD_FRE | AHCI_PxCMD_FRE))
return(1);
// Enable the Cmd List DMA Engine.
sataRegs->P0CMD |= AHCI_PxCMD_ST;
// Wait here a bit until the Command List DMA Engine has started to run
1586
Serial ATA (SATA) Controller
SPRUGX9 – 15 April 2011
© 2011, Texas Instruments Incorporated
Содержание TMS320C6A816 Series
Страница 2: ...Preliminary 2 SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 92: ...92 Read This First SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1122: ...1122 Multichannel Audio Serial Port McASP SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1562: ...1562 Real Time Clock RTC SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1658: ...1658 Timers SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1750: ...1750 UART IrDA CIR Module SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...
Страница 1984: ...1984 Universal Serial Bus USB SPRUGX9 15 April 2011 Submit Documentation Feedback 2011 Texas Instruments Incorporated...