Texas Instruments TMS320C6A816 Series Technical Reference Manual page 1581

C6-integra dsp+arm processors
Table of Contents

Advertisement

www.ti.com
Uint8 regfisByte1;
Uint8 regfisStatus;
Uint8 regfisError;
Uint8 regfisDw1SecNumLbaLow;
Uint8 regfisDw1CylLowLbaMid;
Uint8 regfisDw1CylHighLbahigh;
Uint8 regfisDw1Dev;
Uint8 regfisDw3SecCnt;
}regFis;
typedef struct {
Uint8 sdbfisType;
Uint8 sdbfisByte1;
Uint8 sdbfisStatus;
Uint8 sdbfisError;
}sdbFis;
typedef struct {
Uint32 ufisWord[16];
}uFis;
typedef struct {
Uint32
capSMPS:1;
Uint32
capSSS:1;
Uint32
piPi:2;
Uint32
p0cmdCpd:1;
Uint32
p0cmdEsp:1;
Uint32
p0cmdMpsp:1;
Uint32
p0cmdHpcp:1;
Uint32
rsv:24;
}FirmwareCtrlFeatures;
void initMemory(Uint32 *startAddress, Uint32 length, Uint32 seedWord, Uint32 modifyVal) {
Uint32 I;
*startAddress++ = seedWord;
for (I=0; i<length-1; I++) {
seedWord += modifyVal;
*startAddress++ = seedWord;
}
}
void clearCmdList(void) {
//clear Host to Device (Command FIS) Space
initMemory((Uint32*)CmdLists, (LISTLENGTH*(sizeof(CmdListHeader)/4)), 0, 0);
}
void clearCmdTables(void) {
Uint16 cmdSlot;
for (cmdSlot=0; cmdSlot<LISTLENGTH; cmdSlot++) {
//Clear Command FIS and ATAPI Command Spaces for Command Header X; LISTLENGTH < X < 0
initMemory((Uint32 *)&CmdTable[cmdSlot], (sizeof(CommandFIS)/4)+(sizeof(Atapi)/4), 0,
0);
//Clear PRD Descriptor Locations for Command Header X; LISTLENGTH < X < 0
initMemory((Uint32*)((Uint32)&CmdTable[cmdSlot]+0x80),
(sata_input_filePageSize*(sizeof(PRDT)/4)*sata_input_prdLength), 0, 0);
}
}
void clearRcvFis() {
//clear Receive DMA Setup FIS Space.
initMemory((Uint32*)&RcvFis, (sizeof(DMASetupFis)/4), 0, 0);
//clear Receive PIO Setup FIS Space.
initMemory((Uint32*)((Uint32)&RcvFis+0x20), (sizeof(PIOSetupFis)/4), 0, 0);
//clear Receive Device to Host (D2H) Register FIS Space.
initMemory((Uint32*)((Uint32)&RcvFis+0x40), (sizeof(D2HRegFis)/4), 0, 0);
//clear Set Device Bits FIS Space.
initMemory((Uint32*)((Uint32)&RcvFis+0x58), (sizeof(SetDevBitsFis)/4), 0, 0);
//clear Unknow FIS Space.
initMemory((Uint32*)((Uint32)&RcvFis+0x60), (sizeof(UnknownFis)/4), 0, 0);
}
SPRUGX9 – 15 April 2011
Submit Documentation Feedback
Preliminary
© 2011, Texas Instruments Incorporated
Use Cases
Serial ATA (SATA) Controller
1581

Advertisement

Table of Contents
loading

Table of Contents