TMS320C6452 DSP
DDR2 Memory Controller
User's Guide
Literature Number: SPRUF85
October 2007
2 SPRUF85 – October 2007
Submit Documentation Feedback
Contents
Preface ............................................................................................................................... 6
1 Introduction ................................................................................................................ 9
1.1 Purpose of the Peripheral ....................................................................................... 9
1.2 Features ........................................................................................................... 9
1.3 Functional Block Diagram ....................................................................................... 9
1.4 Industry Standard(s) Compliance Statement ............................................................... 10
2 Peripheral Architecture .............................................................................................. 11
2.1 Clock Control .................................................................................................... 11
2.2 Memory Map .................................................................................................... 11
2.3 Signal Descriptions ............................................................................................. 11
2.4 Protocol Description(s) ......................................................................................... 13
2.5 Memory Width and Byte Alignment .......................................................................... 18
2.6 Address Mapping ............................................................................................... 19
2.7 DDR2 Memory Controller Interface .......................................................................... 22
2.8 Refresh Scheduling ............................................................................................ 25
2.9 Self-Refresh Mode.............................................................................................. 26
2.10 Reset Considerations .......................................................................................... 26
2.11 DDR2 SDRAM Memory Initialization ......................................................................... 27
2.12 Interrupt Support ................................................................................................ 28
2.13 EDMA Event Support .......................................................................................... 28
2.14 Emulation Considerations ..................................................................................... 28
3 Using the DDR2 Memory Controller ............................................................................. 29
3.1 Connecting the DDR2 Memory Controller to DDR2 SDRAM ............................................. 29
3.2 Configuring DDR2 Memory Controller Registers to Meet DDR2 SDRAM Specifications ............. 33
4 DDR2 Memory Controller Registers ............................................................................. 36
4.1 Module ID and Revision Register (MIDR) ................................................................... 37
4.2 DDR2 Memory Controller Status Register (DMCSTAT) ................................................... 37
4.3 SDRAM Configuration Register (SDCFG) ................................................................... 38
4.4 SDRAM Refresh Control Register (SDRFC) ................................................................ 40
4.5 SDRAM Timing 1 Register (SDTIM1) ........................................................................ 41
4.6 SDRAM Timing 2 Register (SDTIM2) ........................................................................ 43
4.7 Burst Priority Register (BPRIO) ............................................................................... 44
4.8 DDR2 Memory Controller Control Register (DMCCTL) ................................................... 45
SPRUF85 – October 2007 Table of Contents 3
Submit Documentation Feedback
List of Figures
1 DDR2 Memory Controller Block Diagram ............................................................................... 10
2 DDR2 Memory Controller Signals ........................................................................................ 12
3 DDR2 MRS and EMRS Command ...................................................................................... 14
4 Refresh Command ......................................................................................................... 15
5 ACTV Command ........................................................................................................... 15
6 DCAB Command ........................................................................................................... 16
7 DEAC Command ........................................................................................................... 16
8 DDR2 READ Command ................................................................................................... 17
9 DDR2 WRT Command .................................................................................................... 18
10 Byte Alignment .............................................................................................................. 19
11 Logical Address-to-DDR2 SDRAM Address Map for 32-Bit SDRAM ............................................... 19
12 Logical Address-to-DDR2 SDRAM Address Map for 16-bit SDRAM ................................................ 20
13 Logical Address-to-DDR2 SDRAM Address Map ...................................................................... 21
14 DDR2 SDRAM Column, Row, and Bank Access ...................................................................... 22
15 DDR2 Memory Controller FIFO Block Diagram ........................................................................ 23
16 DDR2 Memory Controller Reset Block Diagram ....................................................................... 26
17 Connecting to Two 16-Bit DDR2 SDRAM Devices .................................................................... 30
18 Connecting to a Single 16-Bit DDR2 SDRAM Device ................................................................. 31
19 Connecting to Two 8-Bit DDR2 SDRAM Devices ...................................................................... 32
20 Module ID and Revision Register (MIDR) ............................................................................... 37
21 DDR2 Memory Controller Status Register (DMCSTAT) .............................................................. 37
22 SDRAM Configuration Register (SDCFG) .............................................................................. 38
23 SDRAM Refresh Control Register (SDRFC)............................................................................ 40
24 SDRAM Timing 1 Register (SDTIM1) ................................................................................... 41
25 SDRAM Timing 2 Register (SDTIM2) ................................................................................... 43
26 Burst Priority Register (BPRIO) .......................................................................................... 44
27 DDR2 Memory Controller Control Register (DMCCTL) ............................................................... 45
4 List of Figures SPRUF85 – October 2007
Submit Documentation Feedback
List of Tables
1 DDR2 Memory Controller Signal Descriptions ......................................................................... 12
2 DDR2 SDRAM Commands ............................................................................................... 13
3 Truth Table for DDR2 SDRAM Commands ............................................................................ 13
4 Addressable Memory Ranges ............................................................................................ 18
5 Bank Configuration Register Fields for Address Mapping ............................................................ 19
6 DDR2 Memory Controller FIFO Description ............................................................................ 22
7 Refresh Urgency Levels ................................................................................................... 25
8 Reset Sources .............................................................................................................. 26
9 DDR2 SDRAM Mode Register Configuration ........................................................................... 27
10 DDR2 SDRAM Extended Mode Register 1 Configuration ............................................................ 27
11 SDCFG Configuration ..................................................................................................... 33
12 DDR2 Memory Refresh Specification ................................................................................... 34
13 SDRFC Configuration ...................................................................................................... 34
14 SDTIM1 Configuration ..................................................................................................... 34
15 SDTIM2 Configuration ..................................................................................................... 35
16 DMCCTL Configuration .................................................................................................... 35
17 DDR2 Memory Controller Registers ..................................................................................... 36
18 Module ID and Revision Register (MIDR) Field Descriptions ........................................................ 37
19 DDR2 Memory Controller Status Register (DMCSTAT) Field Descriptions ........................................ 37
20 SDRAM Configuration Register (SDCFG) Field Descriptions ........................................................ 38
21 SDRAM Refresh Control Register (SDRFC) Field Descriptions ..................................................... 40
22 SDRAM Timing 1 Register (SDTIM1) Field Descriptions ............................................................. 41
23 SDRAM Timing 2 Register (SDTIM2) Field Descriptions ............................................................. 43
24 Burst Priority Register (BPRIO) Field Descriptions .................................................................... 44
25 DDR2 Memory Controller Control Register (DMCCTL) Field Descriptions ......................................... 45
SPRUF85 – October 2007 List of Tables 5
Submit Documentation Feedback
About This Manual
Notational Conventions
Preface
SPRUF85 – October 2007
Read This First
This document describes the operation of the DDR2 Memory Controller in the TMS320C6452.
This document uses the following conventions.
• Hexadecimal numbers are shown with the suffix h. For example, the following number is 40
hexadecimal (decimal 64): 40h.
• Registers in this document are shown in figures and described in tables.
– Each register figure shows a rectangle divided into fields that represent the fields of the register.
Each field is labeled with its bit name, its beginning and ending bit numbers above, and its
read/write properties below. A legend explains the notation used for the properties.
– Reserved bits in a register figure designate a bit that is used for future device expansion.
Note: Acronyms 3PSW, CPSW, CPSW_3G, and 3pGSw are interchangeable and all refer to the 3
port gigabit switch.
Related Documents From Texas Instruments
The following documents describe the TMS320C6452 Digital Signal Processor (DSP). Copies of these
documents are available on the Internet at www.ti.com . Tip: Enter the literature number in the search box
provided at www.ti.com .
Data Manual—
SPRS371 — TMS320C6452 Digital Signal Processor Data Manual describes the signals, specifications
and electrical characteristics of the device.
CPU—
SPRU732 — TMS320C64x/C64x+ DSP CPU and Instruction Set Reference Guide describes the CPU
architecture, pipeline, instruction set, and interrupts for the TMS320C64x and TMS320C64x+ digital
signal processors (DSPs) of the TMS320C6000 DSP family. The C64x/C64x+ DSP generation
comprises fixed-point devices in the C6000 DSP platform. The C64x+ DSP is an enhancement of
the C64x DSP with added functionality and an expanded instruction set.
Reference Guides—
SPRUF85 — TMS320C6452 DSP DDR2 Memory Controller User's Guide describes the DDR2 memory
controller in the TMS320C6452 Digital Signal Processor (DSP). The DDR2/mDDR memory
controller is used to interface with JESD79D-2A standard compliant DDR2 SDRAM devices and
standard Mobile DDR SDRAM devices.
SPRUF86 — TMS320C6452 Peripheral Component Interconnect (PCI) User's Guide describes the
peripheral component interconnect (PCI) port in the TMS320C6452 Digital Signal Processor (DSP).
The PCI port supports connection of the C642x DSP to a PCI host via the integrated PCI
master/slave bus interface. The PCI port interfaces to the DSP via the enhanced DMA (EDMA)
controller. This architecture allows for both PCI master and slave transactions, while keeping the
EDMA channel resources available for other applications.
6 Preface SPRUF85 – October 2007
Submit Documentation Feedback
Related Documents From Texas Instruments
SPRUF87 — TMS320C6452 DSP Host Port Interface (UHPI) User's Guide describes the host port
interface (HPI) in the TMS320C6452 Digital Signal Processor (DSP). The HPI is a parallel port
through which a host processor can directly access the CPU memory space. The host device
functions as a master to the interface, which increases ease of access. The host and CPU can
exchange information via internal or external memory. The host also has direct access to
memory-mapped peripherals. Connectivity to the CPU memory space is provided through the
enhanced direct memory access (EDMA) controller.
SPRUF89 — TMS320C6452 DSP VLYNQ Port User's Guide describes the VLYNQ port in the
TMS320C6452 Digital Signal Processor (DSP). The VLYNQ port is a high-speed point-to-point
serial interface for connecting to host processors and other VLYNQ compatible devices. It is a
full-duplex serial bus where transmit and receive operations occur separately and simultaneously
without interference.
SPRUF90 — TMS320C6452 DSP 64-Bit Timer User's Guide describes the operation of the 64-bit timer
in the TMS320C6452 Digital Signal Processor (DSP). The timer can be configured as a
general-purpose 64-bit timer, dual general-purpose 32-bit timers, or a watchdog timer.
SPRUF91 — TTMS320C6452 DSP Multichannel Audio Serial Port (McASP) User's Guide describes
the multichannel audio serial port (McASP) in the TMS320C6452 Digital Signal Processor (DSP).
The McASP functions as a general-purpose audio serial port optimized for the needs of
multichannel audio applications. The McASP is useful for time-division multiplexed (TDM) stream,
Inter-Integrated Sound (I2S) protocols, and intercomponent digital audio interface transmission
(DIT).
SPRUF92 — TMS320C6452 DSP Serial Port Interface (SPI) User's Guide discusses the Serial Port
Interface (SPI) in the TMS320C6452 Digital Signal Processor (DSP). This reference guide provides
the specifications for a 16-bit configurable, synchronous serial peripheral interface. The SPI is a
programmable-length shift register, used for high speed communication between external
peripherals or other DSPs.
SPRUF93 — TMS320C6452 DSP Universal Asynchronous Receiver/Transmitter (UART) User's
Guide describes the universal asynchronous receiver/transmitter (UART) peripheral in the
TMS320C6452 Digital Signal Processor (DSP). The UART peripheral performs serial-to-parallel
conversion on data received from a peripheral device, and parallel-to-serial conversion on data
received from the CPU.
SPRUF94 — TMS320C6452 DSP Inter-Integrated Circuit (I2C) Module User's Guide describes the
inter-integrated circuit (I2C) peripheral in the TMS320C6452 Digital Signal Processor (DSP). The
I2C peripheral provides an interface between the DSP and other devices compliant with the
I2C-bus specification and connected by way of an I2C-bus. External components attached to this
2-wire serial bus can transmit and receive up to 8-bit wide data to and from the DSP through the
I2C peripheral. This document assumes the reader is familiar with the I2C-bus specification.
SPRUF95 — TMS320C6452 DSP General-Purpose Input/Output (GPIO) User's Guide describes the
general-purpose input/output (GPIO) peripheral in the TMS320C6452 Digital Signal Processor
(DSP). The GPIO peripheral provides dedicated general-purpose pins that can be configured as
either inputs or outputs. When configured as an input, you can detect the state of the input by
reading the state of an internal register. When configured as an output, you can write to an internal
register to control the state driven on the output pin.
SPRUF96 — TMS320C6452 DSP Telecom Serial Interface Port (TSIP) User's Guide is a multi-link
serial interface consisting of a maximum of two transmit data signals (or links), two receive data
signals (or links), two frame sync input signals, and two serial clock inputs. Internally the TSIP
offers single channel of timeslot data management and single DMA capability that allow individual
timeslots to be selectively processed.
SPRUF85 – October 2007 Read This First 7
Submit Documentation Feedback
Related Documents From Texas Instruments
SPRUF97 — TMS320C6452 DSP 3 Port Switch (3PSW) Ethernet Subsystem User's Guide describes
the operation of the 3 port switch (3PSW) ethernet subsystem in the TMS320C6452 Digital Signal
Processor (DSP). The 3 port switch gigabit ethernet subsystem provides ethernet packet
communication and can be configured as an ethernet switch. It provides the serial gigabit media
independent interface (SGMII), the management data input output (MDIO) for physical layer device
(PHY) management.
8 Read This First SPRUF85 – October 2007
Submit Documentation Feedback
1 Introduction
This document describes the DDR2 memory controller in the device.
1.1 Purpose of the Peripheral
The DDR2 memory controller is used to interface with JESD79D-2A standard compliant DDR2 SDRAM
devices. Memory types such as DDR1 SDRAM, SDR SDRAM, SBSRAM, and asynchronous memories
are not supported. The DDR2 memory controller SDRAM can be used for program and data storage.
1.2 Features
The DDR2 memory controller supports the following features:
• JESD79D-2A standard compliant DDR2 SDRAM
• 256 Mbyte memory space
• Data bus width of 32 or 16 bits
• CAS latencies: 2, 3, 4, and 5
• Internal banks: 1, 2, 4, and 8
• Burst length: 8
• Burst type: sequential
• 1 CE signal
• Page sizes: 256, 512, 1024, and 2048
• SDRAM auto-initialization
• Self-refresh mode
• Prioritized refresh
• Programmable refresh rate and backlog counter
• Programmable timing parameters
User's Guide
SPRUF85 – October 2007
DSP DDR2 Memory Controller
1.3 Functional Block Diagram
The DDR2 memory controller is the main interface to external DDR2 memory (see Figure 1 ). Master
peripherals, such as the EDMA controller and the CPU can access the DDR2 memory controller through
the switched central resource (SCR). The DDR2 memory controller performs all memory-related
background tasks such as opening and closing banks, refreshes, and command arbitration.
SPRUF85 – October 2007 DSP DDR2 Memory Controller 9
Submit Documentation Feedback
L1 S1 M1 D1
Data path A
Register file A Register file B
D2
Data path B
S2M2 L2
L1 data memory controller
Cache control
Memory protection
Interrupt
and exception
controller
Power control
Instruction decode
16/32−bit instruction dispatch
Instruction fetch
SPLOOP buffer
C64x+ CPU
IDMA
Bandwidth management
Cache control
L1 program memory controller Advanced
event
triggering
(AET)
L2 memory
controller
Bandwidth
management
Memory
protection
registers
Configuration
L1P
cache/SRAM
L1D
cache/SRAM
PLL2
DDR2 memory
EMIFA
Other
peripherals
EDMA
Boot
configuration
Switched central resource
PLL2
L2 memory
controller
controller
memory
External
controller
DMA
Master
DMA
Slave
Cache
control
Bandwidth management
Memory protection
Introduction
Figure 1. DDR2 Memory Controller Block Diagram
1.4 Industry Standard(s) Compliance Statement
The DDR2 memory controller is compliant with the JESD79D-2A DDR2 SDRAM standard with the
exception of the On Die Termination (ODT) feature. The DSP does not include any on-die terminating
resistors. Furthermore, the on-die terminating resistors of the DDR2 SDRAM device must be disabled by
tying the ODT input pin of the DDR2 SDRAM memory to ground.
DSP DDR2 Memory Controller10 SPRUF85 – October 2007
Submit Documentation Feedback
2 Peripheral Architecture
The DDR2 memory controller can gluelessly interface to most standard DDR2 SDRAM devices and
supports such features as self-refresh mode and prioritized refresh. In addition, it provides flexibility
through programmable parameters such as the refresh rate, CAS latency, and many SDRAM timing
parameters.
The following sections describe the architecture of the DDR2 memory controller as well as how to
interface and configure it to perform read and write operations to DDR2 SDRAM devices. Also, Section 3
provides a detailed example of interfacing the DDR2 memory controller to a common DDR2 SDRAM
device.
2.1 Clock Control
The DDR2 memory controller is clocked directly from the output of the second phase-locked loop (PLL2)
of the device. The PLL2 multiplies its input clock by 20. This clock is divided by 2 to generate DDR_CLK.
The frequency of DDR_CLK can be determined by using the following formula:
DDR_CLK frequency = (PLL2 input clock frequency × 20)/2 = PLL2 input clock frequency × 10
The second output clock of the DDR2 memory controller, DDR_CLK, is the inverse of DDR_CLK. For
more information on the PLL2, see the device-specific data manual.
2.2 Memory Map
Please see the device-specific data manual for information describing the device memory map.
Peripheral Architecture
2.3 Signal Descriptions
The DDR2 memory controller signals are shown in Figure 2 and described in Table 1 . The following
features are included:
• The maximum width for the data bus (DDR_D[31:0]) is 32-bits.
• The address bus (DDR_A[13:0]) is 14-bits wide with an additional 3 bank address pins (DDR_BA[2:0]).
• Two differential output clocks (DDR_CLK and DDR_CLK) driven by internal clock sources.
• Command signals: Row and column address strobe ( DDR_RAS and DDR_CAS), write enable strobe
( DDR_WE), data strobe (DDR_DQS[3:0] and DDR_DQS[3:0]), and data mask ( DDR_DQM[3:0]).
• One chip select signal ( DDR_CS) and one clock enable signal (DDR_CKE).
• Two on-die termination output signals (DDR_ODT[1:0]).
SPRUF85 – October 2007 DSP DDR2 Memory Controller 11
Submit Documentation Feedback
DDR_D[31:0]
DDR2
memory
controller
DDR_CLK
DDR_CLK
DDR_CS
DDR_CKE
DDR_RAS
DDR_WE
DDR_DQM[3:0]
DDR_CAS
DDR_BA[2:0]
DDR_DQS[3:0]
DDR_A[13:0]
DDR_VREF
DDR_DQGATE[3:0]
DDR_DQS[3:0]
DDR_ODT[1:0]
Peripheral Architecture
Pin Description
DDR_D[31:0] Bidirectional data bus. Input for data reads and output for data writes.
DDR_A[13:0] External address output.
DDR_CS Active-low chip enable for memory space CE0. DDR_CS is used to enable the DDR2 SDRAM memory
DDR_DQM[3:0] Active-low output data mask.
DDR_CLK/ Differential clock outputs.
DDR_CLK
DDR_CKE Clock enable (used for self-refresh mode).
DDR_CAS Active-low column address strobe.
DDR_RAS Active-low row address strobe.
DDR_WE Active-low write enable.
DDR_DQS[3:0]/ Differential data strobe bidirectional signals.
DDR_DQS[3:0]
DDR_ODT[1:0] On-die termination signals to external DDR2 SDRAM. These pins are reserved for future use and should not
DDR_BA[2:0] Bank-address control outputs.
DDR_DQGATE[3:0] Data strobe gate pins. These pins are used as a timing reference during memory reads. The
DDR_VREF DDR2 Memory Controller reference voltage. This voltage must be supplied externally. See the
DSP DDR2 Memory Controller12 SPRUF85 – October 2007
Figure 2. DDR2 Memory Controller Signals
Table 1. DDR2 Memory Controller Signal Descriptions
device during external memory accesses. DDR_CS pin stays low throughout the operation of the DDR2
memory controller; it never goes high. Note that this behavior does not affect the ability of the DDR2 memory
controller to access DDR2 SDRAM memory devices.
be connected to the DDR2 SDRAM. Note: there are no on-die termination resistors implemented on the die
of this device.
DDR_DQGATE0 and DDR_DQGATE2 pins should be routed out and connected to the DDR_DQGATE1 and
DDR_DQGATE3 pins, respectively. For more routing requirements on these pins, see the device-specific
data manual.
device-specific data manual for more details.
Submit Documentation Feedback
Peripheral Architecture
2.4 Protocol Description(s)
The DDR2 memory controller supports the DDR2 SDRAM commands listed in Table 2 . Table 3 shows the
signal truth table for the DDR2 SDRAM commands.
Table 2. DDR2 SDRAM Commands
Command Function
ACTV Activates the selected bank and row.
DCAB Precharge all command. Deactivates (precharges) all banks.
DEAC Precharge single command. Deactivates (precharges) a single bank.
DESEL Device Deselect.
EMRS Extended Mode Register set. Allows altering the contents of the mode register.
MRS Mode register set. Allows altering the contents of the mode register.
NOP No operation.
Power Down Power down mode.
READ Inputs the starting column address and begins the read operation.
READ with Inputs the starting column address and begins the read operation. The read operation is followed by a
autoprecharge precharge.
REFR Autorefresh cycle.
SLFREFR Self-refresh mode.
WRT Inputs the starting column address and begins the write operation.
WRT with Inputs the starting column address and begins the write operation. The write operation is followed by a
autoprecharge precharge.
Table 3. Truth Table for DDR2 SDRAM Commands
DDR2 SDRAM
Signals CKE CS RAS CAS WE BA[2:0] A[13:11, 9:0] A10
DDR_CKE
DDR2 Memory Previous DDR_BA[2:0
Controller Signals Cycles Current Cycle DDR_CS DDR_RAS DDR_CAS DDR_WE ] DDR_A[13:11, 9:0] DDR_A[10]
ACTV H
DCAB H H L L H L X X L
DEAC H H L L H L Bank X L
MRS H H L L L L BA
EMRS H H L L L L BA OP Code
READ H H L H L H BA Column Address L
READ with H H L H L H BA Column Address H
precharge
WRT H H L H L L BA Column Address L
WRT with precharge H H L H L L BA Column Address L
REFR H H L L L H X X X
SLFREFR H L L L L H X X X
entry
SLFREFR L H H X X X X X X
exit
NOP H X L H H H X X X
DESEL H X H X X X X X X
Power Down entry H L H X X X X X X
Power Down exit L H H X X X X X X
(1)
Legend: H means logic high; L means logic low; X means don't care (either H or L).
(2)
BA refers to the bank address pins (BA[2:0]).
(1)
H L L H H Bank Row Address
(2)
L H H H X X X
L H H H X X X
L H H H X X X
OP Code
SPRUF85 – October 2007 DSP DDR2 Memory Controller 13
Submit Documentation Feedback
COL
MRS/EMRS
BANK
DDR_CLK
DDR_CLK
DDR_CS
DDR_CKE
DDR_RAS
DDR_WE
DDR_CAS
DDR_BA[2:0]
DDR_A[13:0]
Peripheral Architecture
2.4.1 Mode Register Set (MRS and EMRS)
DDR2 SDRAM contains mode and extended mode registers that configure the DDR2 memory for
operation. These registers control burst type, burst length, CAS latency, DLL enable/disable, single-ended
strobe, etc.
The DDR2 memory controller programs the mode and extended mode registers of the DDR2 memory by
issuing MRS and EMRS commands. When the MRS or EMRS command is executed, the value on
DDR_BA[1:0] selects the mode register to be written and the data on DDR_A[12:0] is loaded into the
register. Figure 3 shows the timing for an MRS and EMRS command.
The DDR2 memory controller only issues MRS and EMRS commands during the DDR2 memory controller
initialization sequence. See Section 2.11 for more information.
Figure 3. DDR2 MRS and EMRS Command
2.4.2 Refresh Mode
The DDR2 memory controller issues refresh commands to the DDR2 SDRAM device (Figure 4 ). REFR is
automatically preceded by a DCAB command, ensuring the deactivation of all CE spaces and banks
selected. Following the DCAB command, the DDR2 memory controller begins performing refreshes at a
rate defined by the refresh rate (REFRESH_RATE) bit in the SDRAM refresh control register (SDRFC).
Page information is always invalid before and after a REFR command; thus, a refresh cycle always forces
a page miss. This type of refresh cycle is often called autorefresh. Autorefresh commands may not be
disabled within the DDR2 memory controller. See Section 2.8 for more details on REFR command
scheduling.
14 DSP DDR2 Memory Controller SPRUF85 – October 2007
Submit Documentation Feedback