Texas Instruments TMS320C6A816 Series Technical Reference Manual page 1582

C6-integra dsp+arm processors
Table of Contents

Advertisement

Use Cases
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) |
// Configure PI[31:0]
sataRegs->PI
// Configure P0CMD[ESP,CPD,MPSP,HPCP=21,20,19,18]
sataRegs->P0CMD |= ((swCtrlFeatures.p0cmdEsp << 21) |
/* 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);
enableRcvFis();
// 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);
1582
Serial ATA (SATA) Controller
Preliminary
(swCtrlFeatures.capSSS
);
|=
(swCtrlFeatures.piPi
(swCtrlFeatures.p0cmdCpd << 20) |
(swCtrlFeatures.p0cmdMpsp << 19)|
(swCtrlFeatures.p0cmdHpcp << 18)
);
//GOASFASTASDEVICE=0,GEN1=1,GEN2=2
// Enable Receive DMA
© 2011, Texas Instruments Incorporated
<< 27)
<< 0);
// =0x00000101
www.ti.com
SPRUGX9 – 15 April 2011
Submit Documentation Feedback

Advertisement

Table of Contents
loading

Table of Contents