Use Cases
1355
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Serial ATA (SATA) Controller
#define WAIT_1_MILLISECOND
(1)
#define ONE_MS_VALUE
(1)
// Number of CPU Cycles needed to generate a millisecond
wait time.
#define DMA_BURST_LENGTH
(0x9)
// [0x0 - 0x9] Burst=2^(–1) i.e., 0x8=> 2^(9-
1)=256
#define DMA_TRANSACTION_SIZE
(0x4)
// [0x0 - 0xA] TransSize=2^n i.e., 0xA=> 2^10=1024
/////////////////////////////////////////////////////////////////////////////////////////////
// Maximum of 32 commands slots per port exist where each command occupies 8 DWs (64 Bytes).
// The structure 'CmdListHeader' defines a single command header definition.
// The start of the first Command List &CmdListHeader[0] needs to be programmed onto P0CLB.
//
// Command List Base Address should be 1K Byte Aligned.
typedef struct {
Uint32 CmdLen:5;
//bits[4:0]
Uint32 Atapi:1;
//bit[5]
Uint32 Write:1;
//bit[6]
Uint32 Prefetch:1; //bit[7]
Uint32 Reset:1;
//bit[8]
Uint32 Bist:1;
//bit[9]
Uint32 Rok:1;
//bit[10]
Uint32 Rsv:1;
//bit[11]
Uint32 Pmp:4;
//bits[15:12]
Uint32 Prdtl:16;
//bits[31:16]
}CmdListHeaderW0;
typedef struct {
Uint32 PrdByteCnt; //bits[31:0]
}CmdListHeaderW1;
typedef struct {
//
Uint32 CmdTableAddLowRsv:7; //bit[6:0]
//
Uint32 CmdTableAddLow:25;
//bits[31:7]
Uint32 CmdTableAddLow;
//bits[31:7]
}CmdListHeaderW2;
typedef struct {
Uint32 CmdTableAddHigh;
//bits[31:0]
}CmdListHeaderW3;
typedef struct {
CmdListHeaderW0 DW0;
CmdListHeaderW1 DW1;
CmdListHeaderW2 DW2;
CmdListHeaderW3 DW3;
Uint32
DW4;
Uint32
DW5;
Uint32
DW6;
Uint32
DW7;
} CmdListHeader;
typedef struct {
Uint32 B0FisType:8;//bits[7:0]
Uint32 BYTE1:8;
//bits[15:8]
Uint32 B2Cmd:8;
//bits[23:16]
Uint32 B3Feature:8;//bits[31:24]
}CmdFisWord0;
typedef struct {
Uint32 B0LbaLow:8; //bits[7:0]