![Texas Instruments AM1808 Скачать руководство пользователя страница 1369](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581369.webp)
Use Cases
1369
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Serial ATA (SATA) Controller
if(chceckSysMemorySize())
for(;;);
// If program stays here, need to fix alignment issue.
// Clear all allocated System Memory
clearCmdList();
// Clear Cmd List allocated within Sys Mem
clearCmdTables();
// Clear Cmd Tables allocated within Sys Mem
clearRcvFis();
// Clear Receive FIS allocated within Sys Mem
clearDmaBuffers();
// Clear all DMA Buffers
// Make sure that both DMAs (Cmd List and Rcv FIS) are not running.
if (placeHbaInIdle())
invokeHBAReset();
// If unable to shut one or both DMAs, Perform HBA Reset.
performFirmwareInit();
//Start the Disk Drive (spin it up)
if(spinUpDeviceAndWaitForInitToComplete())
while(1); // Stay here if device signature does not match.
//DMA Settings get affected by RESET
cfgDmaSetting();
initIntAndClearFlags();
// Disable CCC, Initialize 1ms Time, Clear Int and Flags
if(intHandlingMethod == USE_INT_HANDLER) { //
USE_POLLING or USE_INT_HANDLER
// Setup Interrupt Handler
intIsrFlag=0;
sata_intc_setup();
// Configure Interrupt Handler
enableDisableInt(PORTint, ENABLE, 0xFFC000FF); // enableDisableInt(int type, intState,
specificField)
// int type=GLOBALint or PORTint
// intState=DISABLE or ENABLE
enableDisableInt(GLOBALint, ENABLE, 0); // enableDisableInt(int type, intState,
specificField)
// int type=GLOBALint or PORTint
// intState=DISABLE or ENABLE
// specificField = Don't Care for
GLOBALint
debugInt=0;
} else
enableDisableInt(PORTint, ENABLE, 0xFFC000FF); // enableDisableInt(int type, intState,
specificField)
// int type=GLOBALint or PORTint
// intState=DISABLE or ENABLE
// Initialize Golden Data
initMemory((Uint32 *)&prdTableDataBuff[0],
(sata_input_prdLength*sata_input_prd_dataBuffLen/4), 0x12345678, 0x01010101);
// Invalidate Read Data Buffer
initMemory((Uint32 *)&prdTableDataBuff[1],
(sata_input_prdLength*sata_input_prd_dataBuffLen/4), 0xDEADDEAD, 0x00000000);
return(0);
}