Preliminary
Use Cases
www.ti.com
void clearDmaBuffers(void) {
//Clear PRD Data Buffer Memory
initMemory((Uint32 *)prdTableDataBuff, (LISTLENGTH*PRDLENGTH*DATABUFFERLEN/4), 0, 0);
}
void performFirmwareInit(void) {
/* Firmware Initialization*/
//
Make sure you perform a Single Write in one operation of all HwInit Fields
//
initialization defined within a single register
sataRegs->CAP |= ((swCtrlFeatures.capSMPS << 28) |
(swCtrlFeatures.capSSS
<< 27)
);
// Configure PI[31:0]
sataRegs->PI
|=
(swCtrlFeatures.piPi
<< 0);
// Configure P0CMD[ESP,CPD,MPSP,HPCP=21,20,19,18]
sataRegs->P0CMD |= ((swCtrlFeatures.p0cmdEsp << 21) |
(swCtrlFeatures.p0cmdCpd << 20) |
(swCtrlFeatures.p0cmdMpsp << 19)|
(swCtrlFeatures.p0cmdHpcp << 18)
);
/* Software Initialization*/
// Initialize PHY and DMA Parameters (Corresponding to Gen1/2i timing)
sataRegs->P0PHYCR = 0x80182048;
initBaseAddresses(); // Initialize Command List (P0CLB) and Receive FIS (P0FS)
// Configure Line Speed.
setSataSpeed(DESIRED_SPEED);
//GOASFASTASDEVICE=0,GEN1=1,GEN2=2
enableRcvFis();
// Enable Receive DMA
// The below are general Semaphores/Flags used and want to make sure they are initialized.
// 28 Bit LBA Address of Device. 0xFFFFFFFF is used by test S/W to indicate that it is not
initialized
Dev28bitLbaAddress = 0xFFFFFFFF; // S/W needs to initialize this variable prior to calling
//_INT_DRIVEN_TEST_ is defined within the Project File
#ifdef _INT_DRIVEN_TEST_
intHandlingMethod = USE_INT_HANDLER;
#else
intHandlingMethod = USE_POLLING;
#endif
}
char spinUpDeviceAndWaitForInitToComplete(void) {
// Make sure that the HBA is in a Listen Mode prior to Spinning Up Device
//
Following Configuration is not allowed.
//
[P0SCTL.DET, P0CMD.SUD] = [1,1] NOT Allowed.
if((sataRegs->P0SCTL & AHCI_PxSCTL_PxSSTS_DET) != 0)
sataRegs->P0SCTL &= ~(0xf << AHCI_PxSCTL_PxSSTS_DET_SHIFT);
// Clear P0SERR.DIAG.X (RWC bit field) so that the P0TFD is updated by HBA.
sataRegs->P0SERR |= 0x04000000;
// Spin Up Device.
sataRegs->P0CMD |= (1 << AHCI_PxCMD_SUD_SHIFT);
// Wait for Device Detection or/and Speed Negotiation to take place and finish.
while ((sataRegs->P0SSTS & AHCI_PxSCTL_PxSSTS_DET) !=0x3);
// Device would send its status and and default Task file regs content (signature)
// when finished with Power Up: Look for Device ready status.
while ((sataRegs->P0TFD & AHCI_PxTFD_STS_BSY_DRQ_ERR) != 0);
// Make sure that the expected Device signature is received.
if (sataRegs->P0SIG != AHCI_P0SIG_SIG_ATA_DEV_GOOD_STAT) // LBAhigh:LBAmid:LBAlow:SECcnt
return(1);
// =0x00000101
1582
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...