Preliminary
www.ti.com
Use Cases
16.3.1
General Utilities: Structures and Subroutines Sample Program Uses
/* Allocating memory for Command List. The structure pointed to by this
address range is 1K-bytes in length and must be 1K-byte aligned.
Note that each command header occupies 32 bytes of memory and 32
command headers require 1024 bytes of memory.
*/
#pragma DATA_SECTION(CmdLists,
OCMCRAM0);
#pragma DATA_ALIGN(CmdLists, 1024);
CmdListHeader CmdLists[32]={0};
/* Indicates the 32-bit physical address of the command table, which
contains
the command FIS,
ATAPI Command,
andPRD table.
This address must be aligned to a 128-bytes of memory,
*/
#pragma DATA_SECTION(CmdTable,
OCMCRAM0);
#pragma DATA_ALIGN(CmdTable, 128);
CommandTable CmdTable[LISTLENGTH];
/* Indicates the 32-bit base physical address for received FISes. The
structure pointed to by this address range is 256 bytes in length
and must be 256-byte aligned.
*/
#pragma DATA_SECTION(RcvFis,
OCMCRAM0);
#pragma DATA_ALIGN(RcvFis, 256);
ReceiveFis RcvFis;
#pragma DATA_SECTION(prdTableDataBuff,
OCMCRAM0);
unsigned char prdTableDataBuff[LISTLENGTH][PRDLENGTH][DATABUFFERLEN];
#define NUMOFPORTS
(2)
// Supports Two HBA Ports. However it can support up to
//
15 additional Ports, per HBA Port, for a combined total of 30 Port
Multiplier
//
Ports (PMP) capable of attaching to 30 devices.
#define LISTLENGTH
(2)
// Max Command Header Per Port is 32
#define WRITE_CMD_SLOT
(0)
// Value used here should be <= LISTLENGTH-1
#define READ_CMD_SLOT
(1)
// Value used here should be <= LISTLENGTH-1
// WARNING. PRDLENGTH can not be greater than 8 for this program.
//
See Note captured by the area when memory has been reserved for
//
within sata_utilities.c for Command Table "CmdTable" for
//
more information.
#if 1
#define _MAX_DATA_TRANSFER_
// Define this in project file when needed.
#endif
#ifndef _MAX_DATA_TRANSFER_
// 512 Bytes Data Size within 2 PRD Descriptors.
#define PRDLENGTH
(2)
// Max PRD Length is 65535 per port.
#define DATABUFFERLEN (256)
// DMA Data Buffer Length
#else // Max Data Size Transfer 8K Bytes within 2 PRD Descriptors
#define PRDLENGTH
(2)
// Max PRD Length is 65535 per port.
#define DATABUFFERLEN (2*4096)
// DMA Data Buffer Length
#endif
#if ((PRDLENGTH > 8) | (WRITE_CMD_SLOT > LISTLENGTH-1) | (READ_CMD_SLT > LISTLENGTH-1))
#error PRDLENGTH ENTRY ERROR - PROGRAM HARD CODED FOR MAX VALUE OF 8 - CMD SLOT ENTRY ERROR
#endif
#define DESIRED_SPEED
(GEN1)
// GOASFASTASDEVICE, GEN1, GEN2
#define DEVICE_LBA_ADDRESS
(0x00000002) // Dev28bitLbaAddress = 28-Bit LBA Address
#define WAIT_500_MILLISECONDS
(50)
// This should be set to 500 once the ONE_MS_VALUE is
programmed correctly.
#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
1575
SPRUGX9 – 15 April 2011
Serial ATA (SATA) Controller
© 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...