AMBA DDR, LPDDR, and SDR Dynamic Memory Controller DMC-340 Technical Reference Manual (PDFDrive)
AMBA DDR, LPDDR, and SDR Dynamic Memory Controller DMC-340 Technical Reference Manual (PDFDrive)
The Change history table lists the changes made to this book.
Change history
25 August 2005 C Non-Confidential Incorporate erratum. Additional information to Exclusive access on page 2-14.
Proprietary Notice
Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM® in the EU and other
countries, except as otherwise stated below in this proprietary notice. Other brands and names mentioned
herein may be the trademarks of their respective owners.
Neither the whole nor any part of the information contained in, or the product described in, this document
may be adapted or reproduced in any material form except with the prior written permission of the copyright
holder.
The product described in this document is subject to continuous developments and improvements. All
particulars of the product and its use contained in this document are given by ARM in good faith. However,
all warranties implied or expressed, including but not limited to implied warranties of merchantability, or
fitness for purpose, are excluded.
This document is intended only to assist the reader in the use of the product. ARM shall not be liable for any
loss or damage arising from the use of any information in this document, or any error or omission in such
information, or any incorrect use of the product.
Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.
ii Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Confidentiality Status
This document is Non-Confidential. The right to use, copy and disclose this document may be subject to
license restrictions in accordance with the terms of the agreement entered into by ARM and the party that
ARM delivered this document to.
Product Status
Web Address
http://www.arm.com
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. iii
ID111809 Non-Confidential, Unrestricted Access
iv Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Contents
AMBA DDR, LPDDR, and SDR Dynamic Memory
Controller DMC-340 Technical Reference
Manual
Preface
About this book ............................................................................................ xvi
Feedback ...................................................................................................... xx
Chapter 1 Introduction
1.1 About the DMC ........................................................................................... 1-2
1.2 Product revisions ........................................................................................ 1-6
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. v
ID111809 Non-Confidential, Unrestricted Access
Contents
Appendix B Revisions
Glossary
vi Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
List of Tables
AMBA DDR, LPDDR, and SDR Dynamic Memory
Controller DMC-340 Technical Reference
Manual
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. vii
ID111809 Non-Confidential, Unrestricted Access
List of Tables
viii Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
List of Tables
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ix
ID111809 Non-Confidential, Unrestricted Access
List of Tables
x Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
List of Figures
AMBA DDR, LPDDR, and SDR Dynamic Memory
Controller DMC-340 Technical Reference
Manual
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. xi
ID111809 Non-Confidential, Unrestricted Access
List of Figures
Figure 2-17 PRECHARGE to command and AUTO REFRESH to command timing, tRP and tRFC .
2-30
Figure 2-18 ACTIVE to PRECHARGE, and PRECHARGE to PRECHARGE timing, tRAS and tRP .
2-30
Figure 2-19 MODEREG to command timing, tMRD ................................................................... 2-31
Figure 2-20 Self-refresh entry and exit timing, tESR and tXSR ................................................. 2-31
Figure 2-21 Power-down entry and exit timing, tXP ................................................................... 2-31
Figure 2-22 Data output timing, tWTR ....................................................................................... 2-32
Figure 2-23 Data output timing, tDQSS = 1 ............................................................................... 2-32
Figure 2-24 Data input timing ..................................................................................................... 2-33
Figure 2-25 System state transitions .......................................................................................... 2-39
Figure 2-26 Auto power-down .................................................................................................... 2-44
Figure 2-27 Force precharge with zero force precharge time .................................................... 2-44
Figure 2-28 Force precharge after power_dwn_prd time ........................................................... 2-45
Figure 2-29 Auto self-refresh entry ............................................................................................ 2-45
Figure 2-30 DMC in context ....................................................................................................... 2-48
Figure 3-1 Register map ............................................................................................................ 3-2
Figure 3-2 DMC configuration register map ............................................................................... 3-3
Figure 3-3 AXI ID configuration register map ............................................................................. 3-4
Figure 3-4 Chip configuration register map ................................................................................ 3-4
Figure 3-5 User configuration register map ................................................................................ 3-4
Figure 3-6 Component configuration register map ..................................................................... 3-5
Figure 3-7 memc_status Register bit assignments .................................................................... 3-9
Figure 3-8 memc_cmd Register bit assignments ..................................................................... 3-12
Figure 3-9 direct_cmd Register bit assignments ...................................................................... 3-14
Figure 3-10 memory_cfg Register bit assignments .................................................................... 3-16
Figure 3-11 refresh_prd Register bit assignments ..................................................................... 3-19
Figure 3-12 cas_latency Register bit assignments .................................................................... 3-20
Figure 3-13 t_dqss Register bit assignments ............................................................................. 3-21
Figure 3-14 t_mrd Register bit assignments .............................................................................. 3-21
Figure 3-15 t_ras Register bit assignments ............................................................................... 3-22
Figure 3-16 t_rc Register bit assignments ................................................................................. 3-23
Figure 3-17 t_rcd Register bit assignments ............................................................................... 3-24
Figure 3-18 t_rfc Register bit assignments ................................................................................ 3-24
Figure 3-19 t_rp Register bit assignments ................................................................................. 3-25
Figure 3-20 t_rrd Register bit assignments ................................................................................ 3-26
Figure 3-21 t_wr Register bit assignments ................................................................................. 3-27
Figure 3-22 t_wtr Register bit assignments ................................................................................ 3-28
Figure 3-23 t_xp Register bit assignments ................................................................................. 3-28
Figure 3-24 t_xsr Register bit assignments ................................................................................ 3-29
Figure 3-25 t_esr Register bit assignments ............................................................................... 3-30
Figure 3-26 memory_cfg2 Register bit assignments .................................................................. 3-31
Figure 3-27 memory_cfg3 Register bit assignments .................................................................. 3-34
Figure 3-28 update_type Register bit assignments .................................................................... 3-35
Figure 3-29 t_rddata_en Register bit assignments .................................................................... 3-37
Figure 3-30 read_transfer_delay Register bit assignments ....................................................... 3-37
Figure 3-31 id_<n>_cfg Register bit assignments ...................................................................... 3-39
xii Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
List of Figures
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. xiii
ID111809 Non-Confidential, Unrestricted Access
List of Figures
xiv Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Preface
This preface introduces the AMBA DDR, LPDDR, and SDR Dynamic Memory
Controller DMC-340 Technical Reference Manual. It contains the following sections:
• About this book on page xvi
• Feedback on page xx.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. xv
ID111809 Non-Confidential, Unrestricted Access
Preface
The rnpn identifier indicates the revision status of the product described in this book,
where:
rn Identifies the major revision of the product.
pn Identifies the minor revision or modification status of the product.
Intended audience
This book is written for system designers, system integrators, and programmers who are
designing or programming a System-on-Chip (SoC) device that uses the DMC. The
DMC provides an interface between the Advanced eXtensible Interface (AXI™) system
bus and external, off-chip, memory devices.
Chapter 1 Introduction
Read this for an introduction to the DMC and its features.
xvi Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Preface
Appendix B Revisions
Read this for a description of the technical changes between released
issues of this book.
Conventions
Typographical
monospace Denotes text that you can enter at the keyboard, such as
commands, file and program names, and source code.
monospace bold Denotes language keywords when used outside example code.
< and > Enclose replaceable terms for assembler syntax where they appear
in code or code fragments. For example:
MRC p15, 0 <Rd>, <CRn>, <CRm>, <Opcode_2>
Timing diagrams
The figure named Key to timing diagram conventions on page xviii explains the
components used in timing diagrams. Variations, when they occur, have clear labels.
You must not assume any timing information that is not explicit in the diagrams.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. xvii
ID111809 Non-Confidential, Unrestricted Access
Preface
Shaded bus and signal areas are undefined, so the bus or signal can assume any value
within the shaded area at that time. The actual level is unimportant and does not affect
normal operation.
Clock
HIGH to LOW
Transient
HIGH/LOW to HIGH
Bus stable
Bus change
Signals
Signal level The level of an asserted signal depends on whether the signal is
active-HIGH or active-LOW. Asserted means:
• HIGH for active-HIGH signals
• LOW for active-LOW signals.
Additional reading
ARM publications
This book contains information that is specific to the DMC. See the following
documents for other relevant information:
• AMBA DDR, LPDDR, and SDR Dynamic Memory Controller DMC-340
LPDDR-NVM Technical Reference Manual Supplement (ARM DSU 0004)
xviii Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Preface
Note
This book is only delivered if you license the Low-Power Double Data
Rate-Non-Volatile Memory (LPDDR NVM) add-on.
Other publications
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. xix
ID111809 Non-Confidential, Unrestricted Access
Preface
Feedback
ARM welcomes feedback on this product and its documentation.
If you have any comments or suggestions about this product, contact your supplier and
give:
• The product name.
• The product revision or version.
• An explanation with as much information as you can provide. Include symptoms
and diagnostic procedures if appropriate.
Feedback on content
xx Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Chapter 1
Introduction
This chapter introduces the DMC and contains the following sections:
• About the DMC on page 1-2
• Product revisions on page 1-6.
Note
The DMC product designator is either PL340 or DMC-340 and depends on the product
revision as follows:
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 1-1
ID111809 Non-Confidential, Unrestricted Access
Introduction
You can configure the DMC with a number of options, for example:
• the SDRAM or Mobile SDR memory type
• the number of SDRAM or Mobile SDR memory devices
• the maximum SDRAM or Mobile SDR memory width
• the number of outstanding AXI addresses
• the pad interface type, for connection to the PHYsical (PHY) device.
For a complete list of the configurable options, see Features of the DMC on page 1-3.
Note
For differences between revisions, see Product revisions on page 1-6.
The DMC supports the PrimeCell (PL220) External Bus Interface (EBI). This ensures
that you can still use a shared external bus.
1-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Introduction
SDRAM
Processor Control bus
code in
ROM
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 1-3
ID111809 Non-Confidential, Unrestricted Access
Introduction
Note
Synchronous relates to rising edge-aligned clocks.
The DMC can support memory data bus widths of 16-bit, 32-bit, or 64-bit. However,
during configuration of the DMC then it might not permit all of these options depending
on the:
• Configured AXI data bus width.
• Type of memory device, SDR or DDR, that the DMC controls. When the DMC
controls:
SDR devices The memory data bus width must not be less than half of the
AXI data bus width.
DDR devices The memory data bus width must not be less than one
quarter of the AXI data bus width, and no greater than the
AXI data bus width.
1-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Introduction
Table 1-1 shows the memory device widths that you can connect to a DMC depending
on the configured AXI bus width and configured memory data bus width,
MEMWIDTH.
Table 1-1 Supported memory device types for different DMC configurations
Memory interface
AXI data bus width data bus width, SDR device width DDR device width
MEMWIDTH
64-bit - -
64-bit - 64-bit
32-bit a
128-bit 16-bit - -
32-bit - 32-bit
-
64-bit - 64-bit
32-bit a
a. To use devices of this data width you must disable the DMC from using the upper half of the data bus
on the memory interface by setting the memory_width[1:0] tie-off or programming the
memory_width field in the Memory Configuration 2 Register on page 3-30.
For more information, see the AMBA DDR, LPDDR, and SDR Dynamic Memory
Controller DMC-340 Release Note.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 1-5
ID111809 Non-Confidential, Unrestricted Access
Introduction
1-6 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Introduction
• configurable bus width for the arid, awid, bid, rid, and wid
signals, see AXI signals on page A-6.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 1-7
ID111809 Non-Confidential, Unrestricted Access
Introduction
1-8 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Chapter 2
Functional Description
This chapter describes the DMC operation. It contains the following sections:
• Functional overview on page 2-2
• Functional operation on page 2-10.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-1
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Tie-off signals
Note
If the DMC is configured to support a DDR PHY Interface (DFI) pad interface, then the
EBI signals are not available.
2-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
Write address Enables the transfer of the address and all other control data
required for the DMC to carry out an AXI write transaction.
Write data Enables the transfer of write data and validating data byte strobes
to the DMC.
Read address Enables the transfer of the address and all other control data
required for the DMC to carry out an AXI read transaction.
Read data Enables the transfer of read data and response information
associated with a read transaction.
For more information about AMBA AXI, see the AMBA AXI Protocol Specification.
Figure 2-2 on page 2-4 shows the AXI slave interface external connections.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-3
ID111809 Non-Confidential, Unrestricted Access
Functional Description
aclk
Global signals
aresetn
awid[AID_WIDTH–1:0]
awaddr[31:0]
awlen[3:0]
awsize[2:0]
Write address
awburst[1:0] awready
channel
awlock[1:0]
awcache[3:0]
awprot[2:0]
awvalid
wid[AID_WIDTH–1:0]
wdata[AXI_DATA_MSB:0]
Write data
wstrb[AXI_STRB_MSB:0] wready
channel
wlast
wvalid
bid[AID_WIDTH–1:0]
Write response
bready bresp[1:0]
channel
bvalid
arid[AID_WIDTH–1:0]
araddr[31:0]
arlen[3:0]
arsize[2:0]
Read address
arburst[1:0] arready
channel
arlock[1:0]
arcache[3:0]
arprot[2:0]
arvalid
rid[AID_WIDTH–1:0]
rdata[AXI_DATA_MSB:0]
Read data
rready rresp[1:0]
channel
rlast
rvalid
2-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
Note
The arcache and arprot signals are included in the AXI slave interface, only for
completeness. The DMC ignores any information that these signals provide.
The APB slave interface provides access to the internal registers of the DMC.
Figure 2-4 shows the APB interface external connections.
aclk
paddr[31:0]
pclken prdata[31:0]
penable APB pready
psel pslverr
pwdata[31:0]
pwrite
Note
The pslverr output is included for completeness, and the DMC permanently drives it
LOW.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-5
ID111809 Non-Confidential, Unrestricted Access
Functional Description
The tie-off signals initialize various operating parameters of the DMC when it exits the
reset state. Figure 2-5 shows the tie-off signals.
a_gt_m_sync
cke_init
dqm_init
memory_width[1:0] Tie-offs
memory_type[2:0]
read_delay[1:0]
sync
The user signals are general purpose input and output signals that you can control and
monitor by using the registers that the DMC provides. Figure 2-6 shows the user
signals.
user_config[USER_CONFIG_WIDTH–1:0]
user_status[USER_STATUS_WIDTH–1:0] DMC
user_config1[USER_CONFIG_WIDTH–1:0]
The memory interface provides a clean and defined interface between the arbiter and
the pad interface, ensuring that the external memory interface command protocols are
met in accordance with the programmed timings in the register block. See Chapter 3
Programmers Model.
ebibackoff Tie this LOW to indicate that the DMC must not back off from the bus,
if you are not using an External Bus Interface (EBI).
2-6 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
ebigrant Tie this HIGH to indicate that the bus is always granted, if you are not
using an EBI.
The memory interface tracks and controls the state of the external memories using either
an mclk Finite State Machine (FSM) per extended memory or one mclk FSM
depending on the configuration of the DMC. Figure 2-7 shows an mclk domain FSM.
start
POR Reset
Pwr_dpd
See Table 2-5 on page 2-38 for valid system states and Deep Power-Down on
page 2-46.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-7
ID111809 Non-Confidential, Unrestricted Access
Functional Description
add[15:0]
ap
ba[1:0]
dqs_in_<n>
cas_n
dqs_in_n_<n>
cke[MEMORY_CHIPS–1:0]
dq_in[MEMWIDTH–1:0]
clk_out[MEMORY_CHIPS–1:0]
fbclk_in
Legacy pad interface cs_n[MEMORY_CHIPS–1:0]
mclk
data_en
mclkn
dqm[MEMORY_BYTES–1:0]
mclkx2
dqs_out_<n>
mclkx2n
dq_out[MEMWIDTH–1:0]
ras_n
we_n
dfi_address[15:0]
dfi_bank[1:0]
dfi_cas_n
dfi_init_complete dfi_cke[MEMORY_CHIPS–1:0]
dfi_phyupd_req dfi_cs_n[MEMORY_CHIPS–1:0]
dfi_dram_clk_disable[MEMORY_CHIPS–1:0]
dfi_phyupd_type[1:0]
DFI pad interface dfi_phyupd_ack
dfi_rddata[2*MEMWIDTH–1:0] dfi_ras_n
dfi_rddata_valid dfi_rddata_en[MEMORY_BYTES–1:0]
mclk dfi_we_n
dfi_wrdata_en[MEMORY_BYTES–1:0]
dfi_wrdata[2*MEMWIDTH–1:0]
dfi_wrdata_mask[MEMORY_BYTES–1:0]
2-8 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
An AMBA master can use the QoS signal to request that the DMC assigns the minimum
latency to the current read transaction. Figure 2-10 shows the QoS signal.
qos_override[15:0] QoS
2.1.9 EBI
The External Bus Interface (EBI) provides a mechanism for sharing the memory
address and data buses with another memory controller. For more information, see the:
• ARM PrimeCell External Bus Interface (PL220) Technical Reference Manual
• Integrating an External Bus Interface (PL220) with PL3xx Memory Controllers
Application Note.
ebibackoff
EBI ebireq
ebigrant
Note
If the DMC is configured to support a DFI pad interface then the EBI is not available.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-9
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Clocking
Note
mclkn, mclkx2, mclkx2n, dqs_in_<n>, and dqs_in_n_<n> are only available, if the
DMC is configured to contain a legacy pad interface.
2-10 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
aclk domain aclk is in this domain. The aclk domain signals can only be
stopped if the external memories are put in self-refresh mode.
mclk domain All clocks except aclk are in this domain. The mclk signal must
be clocked at the rate of the external memory clock speed. The
mclk domain signals can only be stopped if the external memories
are put in self-refresh mode.
Note
When configured with a legacy pad interface, the DMC provides a separate clock output
for each external memory device.
Reset
You can change both reset signals asynchronously to their respective clock domain.
Internally to the DMC, the deassertion of the aresetn signal is synchronized to aclk, and
the deassertion of the mresetn signal is synchronized to:
• mclk for a DMC configured with DFI
• the mclk, mclkn, mclkx2, and mclkx2n clock signals for a DMC configured with
a legacy pad interface.
The AXI programmers view is of a flat area of memory. The full range of AXI
operations are supported, provided that the memory burst length selected is less than the
read data FIFO depth.
Note
• The read data FIFO depth and write data buffer depth are set during the
configuration process.
For more information, see the AMBA DDR, LPDDR, and SDR Dynamic Memory
Controller DMC-340 Supplement to AMBA Designer (ADR-301) User Guide.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-11
ID111809 Non-Confidential, Unrestricted Access
Functional Description
• Refreshes can be missed if rready is held LOW, or the External Bus Interface
(EBI) is not granted, for longer than one refresh period and the read data FIFO,
command FIFO, and the arbiter queue become full. An OVL error triggers if this
occurs in simulation. Ensure that the device has a sufficiently high system priority
to prevent this.
If the AXI write data channel width is less than the memory data bus transfer rate, then
to minimize memory accesses the DMC delays the memory access, when possible, until
it can transfer the maximum number of data bits to the memory device. If the AXI read
data channel width is less than the memory data bus transfer rate, then after the DMC
reads the memory device it buffers the data to minimize the number of memory
accesses. The memory data bus transfer rate is MEMWIDTH for SDR devices and
2×MEMWIDTH for DDR devices.
Table 2-1 shows the AXI slave attributes and their values.
Attribute a Value
2-12 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
If you connect the AXI slave interface of the DMC to the PrimeCell Interconnect
(PL301) then the following AXI attributes in the PrimeCell Interconnect master
interface require configuring:
Note
• When using the AMBA Designer application to configure a master interface on
the PrimeCell Interconnect (PL301), because AMBA Designer refers to the
parameters of an attached slave then you set the write acceptance capability and
write interleave depth. AMBA Designer uses the value entered to set the write
issuing capability and write interleave capability of the PrimeCell Interconnect.
• The other attributes that Table 2-1 on page 2-12 shows are not applicable when
configuring a PrimeCell Interconnect (PL301).
Early BRESP
To enable early write response timing, the DMC employs write data buffering and can
issue the BRESP transfer before the data has been committed to the memory device.
The response is sent after the last data beat is accepted by the AXI slave interface and
stored in the write data buffer. You can enable this feature by programming the Feature
Control Register on page 3-43. The controller have to maintain the coherency for read
after write and write after write hazards to comply with the AXI ordering model.
Note
For exclusive write accesses, the controller only issues a BRESP transfer after the write
transaction is committed to a memory device.
The base addresses of the external memory devices are programmable using the
chip_cfg<n> registers. See Chip Configuration Register on page 3-39.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-13
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Formatting is as follows:
Exclusive access
In addition to reads and writes, the DMC supports exclusive reads and writes in
accordance with the AMBA AXI Protocol Specification.
Exclusive access monitors implement the exclusive access functionality. Each monitor
can track a single exclusive access. The number of monitors is a configurable option.
If an exclusive write fails, the data mask for the write is forced LOW, so that the data is
not written.
When monitoring an exclusive access, the address of any write from another master is
compared with the monitored address to check that the location is not being updated.
2-14 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
For the purposes of monitoring, address comparison is made using a bit mask derived
in the following fashion.
Consider the byte addresses accessed by a transaction. All the least significant bits, up
to and including, the most significant bit that vary between those addresses are set to
logic zero in the mask. All the stable address bits above this point are set to logic one.
The write transaction accesses the address range 0x104-0x10B. Therefore, address bit 3
is the most significant bit that varies between byte addresses. The bit mask is therefore
formed so that address bits 3 down to 0 are not compared. This has the effect that the
masked write, as far as the monitoring logic has calculated, has accessed the monitored
address. Therefore the exclusive write is marked as having failed.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-15
ID111809 Non-Confidential, Unrestricted Access
Functional Description
b000100000101 0x105
b000100000110 0x106
b000100000111 0x107
b000100001000 0x108
b000100001001 0x109
b000100001010 0x10A
b000100001011 0x10B
This example shows how the logic can introduce false-negatives in exclusive access
monitoring, because in reality the write has not accessed the monitored address. The
implementation has been chosen to reduce design complexity but always provide safe
behavior.
When calculating the address region accessed by the write, the burst type is always
taken to be INCR. Therefore, a wrapped transaction in Example 2-1 on page 2-15 that
wraps down to 0x0 rather than cross the boundary, is treated in the same way. This is the
same for a fixed burst that does not cross the boundary or wrap down to 0x0.
The low-power interface can move the DMC into its Low_power state without the
requirement for any register accesses, see aclk domain state diagram on page 2-19 and
Low-power operation on page 2-37.
For more information about the AXI low-power interface, see the AMBA DDR,
LPDDR, and SDR Dynamic Memory Controller DMC-340 Integration Manual.
2-16 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
For more information about the AMBA APB, see the AMBA 3 APB Protocol
Specification.
The APB interface enables you to access the operating state of the DMC and to program
it with the correct timings and settings for the connected memory type. See Chapter 3
Programmers Model for more information. The APB interface also initializes the
connected memory devices, see Initialization on page 2-34.
Note
• The APB interface only supports 32-bit data accesses. The DMC ignores the
paddr[1:0] bits and therefore byte or halfword accesses are treated as word
accesses.
• The pslverr output is included for completeness. The DMC ties it LOW.
The APB interface is clocked by the same clock as the AXI domain clock, aclk. The
DMC provides a clock enable, pclken, enabling the APB interface to be slowed down
and execute at an integer divisor of aclk.
To enable a clean registered interface to the external infrastructure, the APB interface
always adds a wait state for all reads and writes by driving pready LOW. In the
following instances, a delay of more than one wait state can be generated when a:
• direct command is received and there are outstanding commands that prevent a
new command being stored in the command FIFO
• memory command is received, and a previous memory command has not been
completed.
The only registers that can be accessed when the DMC is not in the Config or
Low_power state are:
• memc_status Register, to read the current state, see Memory Controller Status
Register on page 3-9
• memc_cmd Register, to change state, see Memory Controller Command Register
on page 3-12.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-17
ID111809 Non-Confidential, Unrestricted Access
Functional Description
The DMC enables you to change some of its configuration settings by using the tie-off
signals.
At reset, the value of each tie-off signal controls the respective bits in the memory_cfg2
Register.
After reset you can program the memory_cfg2 Register to make additional changes to
these configuration settings. See Memory Configuration 2 Register on page 3-30.
You can use the following signals as general-purpose control signals for logic external
to the DMC:
user_status[USER_STATUS_WIDTH–1:0]
Use the user_status Register to read the status of these general
purpose inputs. You must tie any unused signals to either HIGH or
LOW. These signals are connected directly to the APB interface
block. Therefore, if they are driven from external logic that is not
clocked by the aclk signal, then external synchronization registers
are required. See User Status Register on page 3-40.
user_config[USER_CONFIG_WIDTH–1:0]
Use the user_config Register to control these general purpose
outputs. If you do not require these signals, leave them
unconnected. See User Config Register on page 3-41.
user_config1[USER_CONFIG_WIDTH–1:0]
Use the user_config1 Register to control these general purpose
outputs. If you do not require these signals, leave them
unconnected. See User Config1 Register on page 3-42.
You can use the following miscellaneous signals for automatic test pattern generator
testing of the DMC:
• rst_bypass
• dft_en_clk_out.
The memory manager tracks and controls the current state of the DMC using the aclk
Finite State Machine (FSM). You can change the state of the controller by programming
the memc_cmd Register, see Memory Controller Command Register on page 3-12.
2-18 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
You can also use the AXI low-power interface to move the controller between the
Ready and Low_power states, see System low-power control on page 2-37.
start
POR Low_power
Reset
Reset Wakeup
Sleep
Reset
Reset Paused
Configure Configure Go
Reset Pause Pause Active_Pause
Reset
Config Go Ready
Note
• If the DMC receives an APB command that is illegal to carry out from the current
state then the DMC ignores it and the aclk FSM stays in the same state.
• If the DMC moves to the Paused state using Active_Pause then it is not permitted
to enter the Config state.
• For the two cycles following Power-On-Reset (POR), do not consider the DMC
to be in the Config state. For this reason, register access restrictions apply.
• You can only use the AXI low-power interface to move in and out of the
Low_power state from the Ready state.
• If the DMC enters the Low_power state using the:
— APB interface then it must also exit the Low_power state using the APB
interface
— AXI low-power interface then it must also exit the Low_power state using
the AXI low-power interface.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-19
ID111809 Non-Confidential, Unrestricted Access
Functional Description
The current status of the aclk FSM controls the functionality of the DMC:
• All the registers are available for writes or reads when the aclk FSM is in the
Config or Low_power state.
• When in the Config state or Low_power state, no AUTO REFRESH commands are
generated. When the Low_power state is entered, the SDRAM memories are put
into self-refresh mode.
• When in the Ready state, not all registers are available, see Chapter 3
Programmers Model.
• Move the DMC to the Paused state by programming the memc_cmd Register and
selecting one of the following commands:
— Pause command.
When a Pause is requested, then the Paused state is only entered when the
DMC is idle.
— Active_Pause command.
When an Active_Pause is requested then the Paused state is entered when
the memory interface is idle but there might still be outstanding transactions
in the arbiter queue.
Note
No AUTO REFRESH commands are generated when in the Config state. If you are changing
register values, it is necessary to enter the Low_power state, because this removes the
risk of the memory maximum refresh time being exceeded.
The DMC management function can issue commands to the memory interface from one
of the following sources:
Direct commands
These are received over the APB interface as a result of a write to the
direct_cmd Register. See Direct Command Register on page 3-13. They
initialize the SDRAM.
The legal commands that the memory manager uses are:
• NOP
• PRECHARGEALL
• AUTO REFRESH
• MODEREG
• extended MODEREG
• Deep Power-Down (DPD).
2-20 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
All data operations are carried out through the AXI slave interface.
If there is a coincident data entry and management entry request, the management entry
takes priority and delays the data entry by one clock cycle.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-21
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Entries are arbitrated with an algorithm that optimizes the efficiency of the external data
bus. You can modify the algorithm to meet any programmed QoS requirement.
To achieve optimum memory bus efficiency entries might be arbitrated out of order
from their arrival time. Entries that cannot be arbitrated because of hazards are removed
from the algorithm until the hazard is cleared.
An arbiter queue entry might not be arbitrated continuously. If a QoS event occurs then
the highest priority entry changes.
Hazard detection
The arbiter entry is flagged as having a dependency if a hazard is detected. There might
be dependencies against a number of other arbiter entries. As the arbiter entries are
invalidated, so the dependencies are reduced until finally, there are no outstanding
dependencies, and the entry is free to start.
Note
There are no Write-After-Read (WAR) hazard checks in the DMC. If an AXI master
requires ordering between reads and writes to certain memory locations, it must wait for
read data before issuing a write to a location it has read from. Similarly, the only RAW
2-22 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
hazard checking is that performed when the write response has been issued. If an AXI
master required ordering between writes and reads to certain memory locations, it must
wait for the write response before issuing the read to the same location.
Write transactions are also excluded from the arbitration algorithm until either:
• a full memory burst worth of data is received
• the write data burst completes
• the write data buffer becomes full
• write data with a different ID is received.
Quality of Service
QoS is defined for the DMC as a method of increasing the arbitration priority of a read
access that requires low-latency read data. See Arbitration on page 2-25 for more
information. The QoS for an AXI read access is determined when the arbiter receives
it. No QoS exists for write accesses.
QoS selection
The allocation of QoS functionality is determined by the arid of the AXI transfer
compared with a 4-bit selection mask defined by the qos_master_bits in the
memory_cfg Register. You can program the 4-bit QoS mask to be either arid[3:0],
arid[4:1], arid[5:2], arid[6:3], arid[7:4] arid[8:5], arid[9:6], or arid[10:7]. After the
DMC applies the 4-bit QoS mask to the arid number, the resulting value <n> provides
the pointer to which id_<n>_cfg Register contains the QoS settings for the read transfer.
For more information, see Memory Configuration Register on page 3-15 and QoS
Configuration Register on page 3-38.
Example 2-2 on page 2-24 shows QoS selection and the impact of the qos_override
signal.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-23
ID111809 Non-Confidential, Unrestricted Access
Functional Description
If you program the qos_master_bits = b010 then this selects arid[5:2] to be the 4-bit
QoS mask. If the DMC receives an AXI transfer with an arid of 0x5A then it applies the
4-bit QoS mask, arid[5:2], giving a value of 0x6. Therefore, the controller uses the
id_6_cfg Register to control the QoS for the transfer.
The controller creates a new arbiter entry for the transfer and assigns it the qos_min and
qos_max values from the id_6_cfg Register. If the qos_enable bit=1 then the controller
applies the QoS settings to the transfer.
The qos_override[15:0] signal enables the controller to assign an arbiter entry with
minimum QoS latency, irrespective of the state of the qos_enable bit. For this example,
if qos_override[6] is HIGH when arvalid and arready are HIGH then the arbiter entry
is assigned minimum QoS latency, even if the qos_enable bit=0.
QoS timeout
If the qos_enable bit for the arid is set in the register bank, the QoS maximum latency
value is decremented every aclk cycle until it reaches zero.
If the entry is still in the queue when the QoS maximum latency value reaches zero, then
the entry becomes high priority. This is called a timeout. Also, any entry in the queue
with a minimum latency QoS also produces a timeout. Minimum latency timeouts have
priority over maximum latency timeouts.
When an entry times out in this way it forces a timeout onto any entries that it has
dependencies against. In normal operation, these entries have already timed out because
they have received the same initial QoS value, but been decrementing for longer. The
highest priority arbiter entry is serviced next.
One special case exists. This is when or if the assertion of the relevant qos_override
signal forces a minimum latency timeout. In this instance, any accesses that the new
entry has dependencies against might not have timed out and are forced to time out so
that the high-priority entry can start as soon as possible. This can include when there is
a read after write hazard, under which circumstance the writes ahead of the read must
also be prioritized.
The DMC provides QoS for the AUTO REFRESH commands by using a simple
increment-decrement counter to keep track of the number of AUTO REFRESH commands
in the arbiter queue.
2-24 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
The arbiter compares the counter to the value of the max_outs_refs field in the
memory_cfg3 Register, see Memory Configuration 3 Register on page 3-34. When the
counter reaches the max_outs_refs value then a refresh timeout is signaled to the arbiter
queue.
A refresh timeout forces all of the AUTO REFRESH queue entries to timeout. This timeout
is sticky, and does not disappear when the number of timeouts drops back below the
max_outs_refs threshold. Instead, it remains asserted until the DMC services all of the
AUTO REFRESH entries. This provides a guaranteed refresh rate in the SDRAM.
Arbitration
The arbitration algorithm, without considering QoS issues, operates in the following
way:
• bank preparation, that is, any memory operations to a closed row
• read or write to open rows, that is, any memory operation to an open row
• manager operations, for example, refreshes.
A particular queue item, that contains either one AXI transaction or manager operation,
cannot appear in two groups. If a read transaction enters the queue to a closed row, it is
made available to the arbiter as a bank preparation operation, and not a read hit. When
the row has been opened, possibly after two bank preparation operations, it is flagged
as a read hit.
Assume chip 0 has recently been refreshed, all rows are closed, and nothing can be
issued for t_rfc.
During t_rfc, the following transactions enter the queue, in the following order:
1. Read, row 1 chip 0 bank 0, transaction 1.
2. Read, row 1 chip 0 bank 0, transaction 2.
3. Read, row 4 chip 0 bank 1, transaction 3.
4. Write, row 1 chip 0 bank 0, transaction 4.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-25
ID111809 Non-Confidential, Unrestricted Access
Functional Description
The cycle numbers in this example can change depending on factors such as schedule
delays, burst lengths, and the command FIFO depth. The following describes the
behavior during each cycle:
Cycle 1 No transactions are marked as either read hit or write hit because all rows
are closed. Instead, all transactions are marked as bank preparations. The
oldest transaction is selected, and transaction 1, row 1 chip 0, bank 0 is
marked as open in the row cache.
Cycle 2 Transactions 1, 2, and 4 are now open row reads or writes. However,
because the ACTIVE command has only recently been issued, they are not
available to the arbiter until schedule_rcd expires. The arbiter therefore
selects the next available bank preparation operation, because the refresh
is the lowest priority. This is transaction 3.
Cycle 3 Transactions 1, 2, and 4 are flagged as read hits, or write hits, because the
delay has now expired, assuming that schedule_rcd was set to 1. Because
a bank preparation operation was performed in the last cycle, the oldest
read hit now becomes the highest priority. Transaction 1 is therefore
arbitrated and removed from the queue.
Cycle 4 Transactions 2, 3, and 4 are now available as read or write hits. The last
cycle was a read operation so bank preparation operations are the highest
priority. However, because there are none to perform, transaction 2 is
arbitrated.
Transaction 5 now arrives, read, row 1 chip 0 bank 0. Because row 1
chip 0 bank 0 is already open, it is flagged as a read hit immediately.
Cycle 6 Transactions 4 and 5 are a write hit and read hit. Transaction 6 is a bank
preparation operation. The last transactions were reads, so the bank
preparation for transaction 6 is selected, and this issues a precharge
because another row in the same bank was open.
2-26 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
Cycle 10 Transaction 6 is now a read hit, and is finally arbitrated as a read hit, and
removed from the queue.
The memory interface is separated from the arbiter using the following configurable
synchronous or asynchronous FIFOs and buffer:
• command FIFO
• read data FIFO
• write data buffer.
Note
Synchronous relates to rising edge-aligned clocks.
The memory interface reads commands from the arbiter using the command FIFO but
only when that command can be executed. The memory interface ensures a command
is only executed when all the inter-command delays, defined in this section, for that
bank or memory device are met.
The memory interface enables multiple banks to be active at any one time. However,
only one bank can be carrying out a data transfer at any one time. If the command at the
head of the command FIFO cannot be executed, then the command pipeline stalls until
it can be executed.
Scheduler
To reduce the occurrence of pipeline stalls, the DMC contains a scheduler that monitors
the activity of the mclk FSMs in the memory interface. The scheduler uses the
information in the schedule fields of the t_rcd, t_rfc and t_rp registers, to prevent the
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-27
ID111809 Non-Confidential, Unrestricted Access
Functional Description
arbiter from issuing commands that can stall the command pipeline. Program the
schedule fields with the amount of delay you require, in aclk cycles. For synchronized
1:1 operation of aclk and mclk, program:
• schedule_rcd = t_rcd–3 in the ACTIVE to Read or Write Timing Register on
page 3-23
• schedule_rfc = t_rfc–3 in the AUTO REFRESH to Command Timing Register on
page 3-24
• schedule_rp = t_rp–3 in the PRECHARGE to Command Timing Register on
page 3-25.
For non-synchronized 1:1 operation, you must scale the schedule_rx fields accordingly.
Note
For the LPDDR NVM add-on, the nvm_schedule_rcd is applied when accessing NVM
chips.
All command control outputs are clocked on the falling edge of the memory clock,
mclk. The relative times between control signals from the memory interface are
maintained when output from the pad interface to the actual SDRAM devices.
Therefore, the timing register values required for a particular SDRAM device can be
determined from that SDRAM device’s data sheet.
Figure 2-13 on page 2-29 to Figure 2-24 on page 2-33 show how the data sheet timings
map on to the DMC timing registers. Figure 3-2 on page 3-3 shows the timing registers.
Note
In Figure 2-13 on page 2-29 to Figure 2-24 on page 2-33:
• The following signals are internal to the DMC:
— command_en
— data_cntl_en
— memif_busy
— pwr_down
— read_en.
• The timings shown are not necessarily the default timing values but are values
that are small enough to show the entire delay in one figure.
Figure 2-13 on page 2-29 shows the command control output timing.
2-28 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
mclk
command_en
Command
Control outputs
Command
Figure 2-14 shows the ACTIVE command to Read or Write command timing, that you
program using the ACTIVE to Read or Write Timing Register on page 3-23.
mclk
command_en
tRCD=4
Command ACTIVE R/W
Figure 2-15 shows ACTIVE to ACTIVE on the same bank, and ACTIVE to AUTO REFRESH
command timing, that you program using the ACTIVE to ACTIVE Timing Register on
page 3-23.
mclk
command_en
tRC=4 tRC=4
Command ACTIVE ACTIVE
Control outputs
Figure 2-15 Same bank ACTIVE to ACTIVE, and ACTIVE to AUTO REFRESH command timing, tRC
Figure 2-16 on page 2-30 shows the ACTIVE to ACTIVE command timing to different
memory banks, that you program using the ACTIVE to ACTIVE Different Bank Timing
Register on page 3-26.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-29
ID111809 Non-Confidential, Unrestricted Access
Functional Description
mclk
command_en
tRRD=4
Command ACTIVE ACTIVE
Control outputs
Activate A Activate B
Figure 2-17 shows the PRECHARGE to command, and AUTO REFRESH timing, that you
program using the PRECHARGE to Command Timing Register on page 3-25 and
AUTO REFRESH to Command Timing Register on page 3-24.
mclk
command_en
tRP=3 tRFC=3 tRFC=3
Command ACTIVE
Control outputs
Figure 2-17 PRECHARGE to command and AUTO REFRESH to command timing, tRP and tRFC
Figure 2-18 shows ACTIVE to PRECHARGE, and PRECHARGE to PRECHARGE timing, that you
program using the ACTIVE to PRECHARGE Timing Register on page 3-22 and
PRECHARGE to Command Timing Register on page 3-25.
mclk
command_en
tRAS=4 tRP=4
Command ACTIVE
PRECHARGE PRECHARGE
Figure 2-18 ACTIVE to PRECHARGE, and PRECHARGE to PRECHARGE timing, tRAS and tRP
Figure 2-19 on page 2-31 shows MODEREG to command timing, that you program using
the MODEREG to Command Timing Register on page 3-21.
2-30 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
mclk
command_en
tMRD=4
Command
Control outputs
MODEREG Command
Figure 2-20 shows self-refresh entry and exit timing, that you program using the
Self-refresh to Command Timing Register on page 3-30 and Exit Self-refresh Timing
Register on page 3-29.
mclk
command_en
tESR=3 tXSR=200 cycles
Command
Control outputs
Figure 2-20 Self-refresh entry and exit timing, tESR and tXSR
Figure 2-21 shows power-down entry and exit timing, that you program using the
Memory Configuration 3 Register on page 3-34 and Exit Power-down Timing Register
on page 3-28.
mclk
command_en
tXP=1
Command Command
Command
Control outputs
Command
memif_busy power_dwn_prd
pwr_down
cke
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-31
ID111809 Non-Confidential, Unrestricted Access
Functional Description
The power_dwn_prd count is timed from the memory interface becoming idle, that is,
after a command delay has timed out or the read data FIFO is emptied. cke is asserted
when the command FIFO is not empty.
Figure 2-22 shows the turnaround time, tWTR, for the memory interface to output a
Write command followed immediately by a Read command. Program this value using
the Write to Read Timing Register on page 3-27.
mclk
command_en
Figure 2-23 shows the relationship between the memory interface outputting a Write
command and the write data, when tDQSS is set to 1 using the Write to DQS Timing
Register on page 3-20. It also highlights the tWR minimum time between a Write and a
PRECHARGE command, that you program using the Write to PRECHARGE Timing
Register on page 3-27.
mclk
command_en
Command Write
PRECHARGE
Control outputs Write
tDQSS=1 tWR=3
data_cntl_en
Figure 2-24 on page 2-33 shows the timing relationship between the Read command
being output from the memory interface and the read data being returned to the memory
interface from the pad interface. Program this timing using the CAS Latency Register
on page 3-19 and the read_delay field in the Memory Configuration 2 Register on
page 3-30.
2-32 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
mclk
command_en
read_en
cas_latency = 3
Read data read_delay = b00 RDATA
available for FIFO read_delay = b01 DATA
Note
The SDR configuration requires read_delay set to zero.
The DMC can be configured to contain one of the following pad interfaces:
• Legacy pad interface
• DFI pad interface on page 2-34.
The legacy pad interface is a replaceable block depending on the type of memory you
are connecting. It provides a register for each external signal.
It is possible that you do not require all of the signals for the external memory devices.
This depends on the memory type that the legacy pad interface block supports.
The legacy pad interface block registers the command signals with clocks that enable
the external memory device timing to be met.
To support a PrimeCell EBI (PL220), the ap precharge bit signal is also an external
signal to the DMC. Having ap separate to the address bus means that PRECHARGEALL
commands to dynamic memory can be carried out when the EBI has granted the
external memory interface to another memory controller.
It is expected, for DDR memory devices, that a Delay-Locked Loop (DLL) is required
to delay the dqs signals coming back from the memories with respect to the dq data bus.
The standard delay for the DQS signals is a quarter clock period of mclk. A DLL is not
included in the DMC.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-33
ID111809 Non-Confidential, Unrestricted Access
Functional Description
If required, you can replace or modify the legacy pad interface for additional
optimization for a particular memory type or target library, or to use a hard macro.
If the legacy pad interface is modified or replaced, it is important that the relative
timings of the control output signals enabled by command_en and data_cntl_en
signals are maintained to ensure the timings carried out in the memory interface block
are still correct at the external memory bus interface. The read_en signal is always
asserted one mclk period before the expected read data. Therefore, the timing of
read_en changes as cas_latency is changed using the APB interface.
When the controller issues a Read command, after a delay of several mclk cycles it
registers the data into the read data FIFO, see Figure 2-24 on page 2-33. This delay is
dependent on the cas_latency and read_delay that are programmed in the CAS Latency
Register on page 3-19 and Memory Configuration 2 Register on page 3-30.
If the DMC is configured to support DFI then it implements a DFI pad interface that
complies with Version 2.1 of the DDR PHY Interface (DFI) Specification.
For the tphy_wrlat Register, the DMC supports only the value of 0, and it is not
programmable.
For more information about t_rddata_en Register, see Read Data Enable Timing
Register on page 3-36.
2.2.11 Initialization
Before you can use the DMC operationally to access external memory, you must move
it to the Config state and then:
• program the DMC configuration and timing registers
• initialize the external memory devices by programming the direct_cmd Register.
You might not have to configure all the DMC registers because some might power-up
to the correct value. See Chapter 3 Programmers Model. For completeness, Table 2-3
on page 2-35 includes all register values.
Note
You might create a deadlock situation if the DMC AXI slave interface is accessed by a
master before that master has configured the DMC using the APB interface. A master
that cannot access the APB interface but accesses the AXI slave interface before the
DMC has been configured is held off until another master configures the DMC.
2-34 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
Controller initialization
Table 2-3 shows an example initialization programming sequence for the controller.
t_rddata_en 0x00000003 Set trddata_en to 3 if the DMC is configured with a DFI pad interface
refresh_prd 0x00000A60 Set auto refresh period to be every 2656 mclk periods
chip_cfg0 0x000000FF Set address for chip 0 to be 0x00XXXXXX, Row Bank Column (RBC) configuration
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-35
ID111809 Non-Confidential, Unrestricted Access
Functional Description
direct_cmd - Sequence of writes to initialize the memory devices, see Table 2-4
memc_cmd 0x00000000 Write the Go command to move the controller to the Ready state
memc_status - Poll the register until the memc_status field returns b01, signifying that the controller is
ready to accept AXI accesses to the memory devices
Table 2-4 shows an example programming sequence for LPDDR, or Mobile DDR,
device initialization.
direct_cmd 0x00080032 MODEREG command, with low address bits = 0x32, to chip 0
If a configured DMC supports more than one memory chip then repeat the sequence in
Table 2-4 but update the chip_nmbr field to select each additional memory chip.
2-36 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
The DMC provides support for low-power operation by supporting the SDRAM
low-power modes of operation:
• automatic closing of rows
• active power-down
• precharge power-down
• automatic self-refresh entry
• self-refresh
• DPD.
Note
All functions have to be included in a configuration.
The DMC provides support for low-power operation in the following ways:
• By using the memc_cmd and memc_status registers, the DMC can place the
memory device in to self-refresh mode under software control. See Memory
Controller Command Register on page 3-12 and Memory Controller Status
Register on page 3-9.
• By using the AXI low-power interface, the DMC can place the memory device in
to self-refresh mode under hardware control.
Additionally, the DMC provides additional power savings through extensive use of
clock gating. This includes clock gating of the external memory clocks by selecting the
stop_mem_clock bit in the memory_cfg Register. See Memory Configuration Register
on page 3-15.
You can also implement the DMC with two power domains:
• APB and AXI, aclk
• memory, mclk.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-37
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Table 2-5 shows the valid system states of the aclk FSM and an mclk FSM. It also
shows the valid power, clock, and reset states in the aclk and mclk domains.
Figure 2-25 on page 2-39 shows the valid transitions, and the text following it explains
how to traverse the system states.
The ranking of system power states, from highest power to lowest power, is as follows:
2-38 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
However, states 8-11 are similar and the recommendation is to use state 11 from this
group if clock-stopping techniques are available. Similarly, states 12 and 13 are similar
and the recommendation is to use state 12 from this pair. Table 2-6 shows a
recommended set of power states.
6 Running
7 Auto power-down
11 Shallow self-refresh
12 Deep self-refresh
18 1 2 3
7 6 5 4
13 12 11 10 9 8
15 14
17 16
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-39
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Note
States 1-5, 9, 14, and 16 are only used as transitional states.
Arc 1 to 2 Apply power to all DMC power domains and ensure that aclk and mclk
are running.
Arc 2 to 3 Assert reset in the aclk domain and the mclk domain.
Arc 3 to 4 Deassert reset in the aclk domain and the mclk domain.
Arc 6 to 5 If you want to reconfigure either the DMC or SDRAM, you must first
write to the memc_cmd Register with the Pause command, and poll the
memc_status Register until the memc_status field returns b10, Paused.
Then you can write to the memc_cmd Register with the Configure
command and poll the memc_status Register until the memc_status field
returns b00, Config. See Memory Controller Command Register on
page 3-12 and Memory Controller Status Register on page 3-9.
2-40 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
Arc 7 to 6 When an SDRAM access command has been received in the mclk
domain, this arc is taken.
Arc 6 to 8 You can take this arc under either hardware or software control:
• To take this arc under software control:
1. Issue the Pause command, or archive the Pause command.
2. Poll for the Paused state.
3. Issue the Sleep command.
• To take this arc under hardware control, use the AXI low-power
interface to request the Low_power state.
Arc 6 to 9 The same as arc 6 to 8 but also stops the mclk domain clock.
Arc 6 to 10 The same as arc 6 to 8 but also stops the aclk domain clock.
Arc 6 to 11 The same as arc 6 to 8 but also stop the mclk and the aclk domain clocks.
Arc 6 to 12 The same as arc 6 to 8 but also stops the mclk domain clock and removes
power from the aclk power domain. This can only be done if the DMC
implementation has separate power domains for aclk and mclk.
Arc 6 to 13 The same as arc 6 to 8 but also removes power from the aclk power
domain. This can only be done if the DMC implementation has separate
power domains for aclk and mclk.
Arc 8 to 6 You can take this arc under either hardware or software control:
• To take this arc under software control:
1. Issue the Wakeup command using the memc_cmd Register.
2. Poll the memc_status Register for the Paused state.
3. Issue the Go command and poll for the Ready state.
• To take this arc under hardware control, use the AXI low-power
interface to bring the DMC out of the Low_power state.
Arc 9 to 6 The same as arc 8 to 6 but you must first start the mclk domain clock.
Arc 10 to 6 The same as arc 8 to 6 but you must first start the aclk domain clock.
Arc 11 to 6 The same as arc 8 to 6 but you must first start both the aclk and mclk
domain clocks.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-41
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Arc 18 to 6 When an SDRAM access command has been received in the mclk
domain, this arc is taken.
Note
When power is applied to the aclk domain, when leaving state 1, the aclk FSM moves
to the Config state. When power is applied to the aclk domain, when leaving states 12
or 13, the aclk FSM moves to the Low_power state.
Dynamic low-power mode control operates when the DMC is in the Ready state.
The functionality that Table 2-7 on page 2-43 shows is dependant on whether the DMC
is configured to have a single global cke or a cke per memory device. The functionality
works for each cke signal, when using a:
global cke All memory devices must be idle.
local cke A single memory device can enter a low-power mode of operation.
Note
• Prior to enabling any power-down functionality, such as force precharge, you
must ensure that the initialization process of the memory device is complete.
2-42 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
Table 2-7 shows the dynamic low-power modes operation. The force precharge and
auto self-refresh entry functionality are configurable and programmable, therefore a
DMC configuration requires the functionality to be included before you can enable it,
by programming the memory_cfg Register. See Memory Configuration Register on
page 3-15.
Auto power-down
This feature enables the controller to negate cke, or dfi_cke, if a memory device is idle
for a time period of power_dwn_prd mclk cycles. This puts the memory device into
either active power-down mode or precharge power-down mode, depending on whether
the device has any open rows.
You can enable this feature by programming the auto_power_down bit in the
memory_cfg Register, see Memory Configuration Register on page 3-15. Program the
power_dwn_prd field to set the idle time period, in mclk cycles.
Figure 2-26 on page 2-44 shows the time after completion of a command to a memory
chip until the controller puts that chip into power-down mode. Power-down affects all
the banks of a chip, therefore there might be cases whereby some banks of a chip enters
precharge power-down. However, it would normally be expected for at least one bank
to enter active power-down.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-43
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Active
Open row power-down Open row
cas
cke
power_dwn_prd
Force precharge
Force precharge logic automatically generates a PRECHARGE for an idle activated bank. If
a bank has been activated and has executed a data access then subsequently, if no more
data accesses are executed for fp_time, then a force precharge is generated to close that
idle bank. The aclk clock decrements the force precharge counters.
Figure 2-27 shows the time after completion of a command to a memory chip until the
DMC places that chip into active power-down or precharge power-down. When
fp_enable is set with fp_time set to zero then the equivalent functionality of
auto-precharge commands is achieved.
Precharge
Open row Access Closed row power-down Closed row Open row
cas
ras
we
cke
power_dwn_prd
Figure 2-28 on page 2-45 shows the time after completion of a command to a memory
chip until the DMC places that chip into precharge power-down mode. To ensure
precharge power-down mode for every bank, you must set fp_time to less than
power_dwn_prd – 3 for synchronous 1:1 clocking and scaled accordingly for different
clocking modes. For example if mclk is running 2 times slower than aclk then fp_time
must be:
2-44 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
When running asynchronously the fp_time must be scaled to ensure it must always be
less than power_dwn_prd – 3. This ensures that a PRECHARGE always occurs before the
cke signal is negated.
Precharge
Open row Access Closed row power-down Closed row Open row
cas
ras
we
cke
power_dwn_prd
fp_time
Auto self-refresh entry operates in the same way as auto power-down but instead of
negating cke the DMC generates an auto self-refresh entry for a memory device
command.
Note
The DMC does not support auto self-refresh entry if it is configured for global cke.
Figure 2-29 shows the time after completion of a command to a memory chip, until the
DMC places that chip into self-refresh mode.
Open row Access Closed row Self-refresh Closed row Open row
cas
ras
we
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-45
ID111809 Non-Confidential, Unrestricted Access
Functional Description
Table 2-7 on page 2-43 shows the DMC can only put a chip into self-refresh mode if the
force precharge logic and auto self-refresh logic is configured and enabled. This
guarantees that if a self-refresh command is generated all the banks of a chip have been
previously precharged. When the auto self-refresh command logic is configured a
10-bit prescalar for each power_dwn_prd counter is generated. If the prescale field in
the memory_cfg3 Register is programmed to zero then the prescalar does not affect the
power-down counter. See Memory Configuration 3 Register on page 3-34.
A prescalar is auto-generated because for some memory types there is a relatively long
time for a memory chip to exit self-refresh mode and it stalls the command FIFO.
Therefore, because the penalty for exiting self-refresh mode is large, you can program
a chip select to be idle for a much longer time before entering self-refresh mode when
compared to the other power-down modes.
Even if auto self-refresh entry is disabled, if the prescalar is programmed, then the
power-down counter uses this value.
Deep Power-Down
Deep power-down puts one or more of the memory devices in to deep power-down
mode, if the DMC is configured with local cke. A DMC configuration with global cke
puts all of the memory devices into DPD simultaneously.
To ensure that no refreshes are generated for a memory device that is in deep
power-down mode, then after the controller issues a DPD command you must decrement
the active_chips field, in the memory_cfg Register. This means that DPD mode can only
be entered from the most significant chip select of a configuration downwards.
Note
The system architect must ensure that:
• No data transactions are sent to a memory device that is in deep power-down
mode.
• Software tracks which memory devices are in deep power-down mode. The
controller does not contain a register that provides the operating mode of an
SDRAM.
With the controller in the Ready state, perform the following steps to move one or more
memory devices in to deep power-down mode:
2-46 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
5. Write to the direct_cmd Register with the PRECHARGEALL command. Program the
chip_nmbr field to be the highest chip select that is active.
6. Write to the direct_cmd Register with the DPD command and set the chip_nmbr
field to the value from step 5. The chip_nmbr field selects which SDRAM enters
deep power-down mode.
Note
If the controller is configured with global cke then the controller moves all the
SDRAMs to deep power-down mode, irrespective of the chip_nmbr field value.
The controller must then remain in Config state until the memory devices are
removed from deep power-down mode.
7. If the controller is configured with local cke then repeat steps 5 and 6 if you
require other SDRAMs to enter deep power-down mode.
Note
If all the SDRAMs are in deep power-down mode then the controller must remain in
Config state until one of the memory devices is removed from deep power-down mode.
With the controller in the Ready state, perform the following steps to remove one or
more memory devices from deep power-down mode:
Note
If all of the memory devices are in deep power-down mode then the controller must be
in the Config state and you can ignore steps 1-4.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-47
ID111809 Non-Confidential, Unrestricted Access
Functional Description
5. Write to the direct_cmd Register with the NOP command. Program the chip_nmbr
field to be the lowest chip select that is in deep power-down mode.
Note
• A chip select must have the active_chips field set before providing the NOP
command.
• If the controller is configured with global cke then the controller removes
all the SDRAMs from deep power-down mode, irrespective of the
chip_nmbr field.
6. If the controller is configured with local cke then repeat step 5 if you require other
SDRAMs to exit from deep power-down mode.
When a memory device exits from deep power-down mode, you must initialize the
device prior to it being accessible to the system software. For examples see LPDDR
device initialization on page 2-36.
The DMC provides very minimal support related to the security goals as set out in the
TrustZone technology. This document outlines the limitations of the controller and the
support it requires from other peripherals to meet the security goals of TrustZone
technology.
AXI-APB DDR
ARM bridge SDR
processor DMC or
AXI LPDR
infrastructure
DMA
controller On-chip
ROM
2-48 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Functional Description
The DMC has an AXI slave interface and an APB interface. The APB interface has to
be placed in a location which is only addressable by the Secure world. The AXI slave
interface can be addressed by both the Secure and Non-secure world.
The DMC does not distinguish between secure read or write data transactions and
non-secure access on its AXI or APB interfaces.
Note
Secure memory and non-secure memory only refer to access control of memory
locations as set out in the TrustZone technology.
Non-secure memory
All memory locations addressed through the DMC are not
protected by TrustZone technology and they are accessible to
either the Secure or Non-secure worlds. The AXI and APB
interfaces of the DMC are mapped to be accessible by the Secure
and Non-secure worlds.
APB interface
When any of the regions addressed by an DMC are made secure on the AXI slave
interface, then the control of the mapping of the memories at the DMC has to be made
equally secure by ensuring that only the Secure world can access the APB interface.
The DMC does not distinguish between Secure and Non-secure world access to the AXI
slave interface. Memory transactions are not aborted. It does not make the read data as
null when a non-secure read request tries to access a secure memory region. Write
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 2-49
ID111809 Non-Confidential, Unrestricted Access
Functional Description
strobes are not disabled when a non-secure write request tries to access a secure
memory region. Therefore the AXI slave interface has to be access controlled to meet
the security goals of TrustZone technology.
Memory regions
The DMC can support a maximum of four chip-selects (memory devices). It supports
32-bits of AXI address bus. Hence it can access up to 4 GBytes of data. This memory
range can be divided into multiple memory regions up to a maximum of four. This is
defined by individual chip_<n>_cfg registers that are programmable through the APB
interface. Each of the individual chip_<n>_cfg registers has an address match field and
an address mask field.
Chip configuration Register can only be read or written in the Config or Low_power
states. See Chip Configuration Register on page 3-39.
It is possible to define overlapping memory regions. This can result in two different
AXI addresses mapping to the same memory region. Therefore overlapping memory
regions must not be defined and control of the mapping of the memories at the DMC
must be made secure by ensuring that only the Secure world can access the APB
interface.
If the DMC receives an AXI access that does not map to a chip select then the controller
performs the access to chip select 0. If the memory device that connects to chip select
0 contains secure data then it is possible for a master in Non-secure state to access that
data. To prevent this security violation from occurring, you must ensure that the
interconnect or system that connects to the controller, can only issue accesses that map
directly to a chip select.
The programmable voltage and frequency sources inside a system must stay within
specification, so the device that controls the voltage and frequency must be secured by
TrustZone access control techniques.
Caution
2-50 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Chapter 3
Programmers Model
This chapter describes the DMC registers and provides information for programming
the device. It contains the following sections:
• About the programmers model on page 3-2
• Register summary on page 3-6
• Register descriptions on page 3-9.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-1
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
The register map of the DMC spans a 4KB region, see Figure 3-1.
0xFFC
Component configuration
0xFE0
Integration test
0xE00
User-defined signals
0x300
Chip configuration
0x200
AXI ID configuration
0x100
DMC configuration
0x000
In Figure 3-1 the register map consists of the following main blocks:
• DMC configuration on page 3-3
• AXI ID configuration on page 3-4
3-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
DMC configuration
read_transfer_delay
0x07C
Timing
registers
t_rddata_en
0x05C
update_type
0x058
Reserved
0x054
memory_cfg3
0x050
memory_cfg2
0x04C
t_esr
0x048
t_xsr
0x044
t_xp
0x040
t_wtr
0x03C
t_wr
0x038
t_rrd
0x034
Timing t_rp
0x030
registers t_rfc
0x02C
t_rcd
0x028
t_rc
0x024
t_ras
0x020
t_mrd
0x01C
t_dqss
0x018
cas_latency
0x014
refresh_prd
0x010
memory_cfg
0x00C
direct_cmd
0x008
memc_cmd
0x004
memc_status
0x000
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-3
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
AXI ID configuration
id_15_cfg
0x13C
.
.
.
id_1_cfg
0x104
id_0_cfg
0x100
Chip configuration
chip_cfg3
0x20C
chip_cfg2
0x208
chip_cfg1
0x204
chip_cfg0
0x200
Figure 3-5 shows the memory map for the Feature Control Register and the following
user signals:
• user_config1[]
• user_config0[]
• user_status[].
feature_ctrl
0x30C
user_config1
0x308
user_config
0x304
user_status
0x300
3-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
Integration test
Use these registers to verify correct integration of the DMC within a system, by
enabling non-AMBA signals to be set and read.
Component configuration
pcell_id_3
0xFFC
pcell_id_2
0xFF8
pcell_id_1
0xFF4
pcell_id_0
0xFF0
periph_id_3
0xFEC
periph_id_2
0xFE8
periph_id_1
0xFE4
periph_id_0
0xFE0
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-5
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
0x028 t_rcd RW 0x0000001D ACTIVE to Read or Write Timing Register on page 3-23
3-6 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
0x05C t_rddata_en c RW 0x00000000 Read Data Enable Timing Register on page 3-36
0xE00 int_cfg For more information about these registers, see Chapter 4 Programmers Model for
0xE04 int_inputs Test.
0xE08 int_outputs
a. Dependent on configuration.
b. Dependent on tie-off signal values.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-7
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
c. This register is only present when the DMC is configured to implement a DDR PHY Interface (DFI), otherwise reads are
undefined, write as zero.
d. The presence of this register depends on the number of chip selects that a configured controller supports. If a controller does
not implement the register then reads are undefined, write as zero.
e. Dependent on the revision of the DMC, see Peripheral Identification Register 2 on page 3-46.
3-8 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
Usage constraints Not accessible in the Reset or Power-On Reset (POR) state.
31 12 11 10 9 8 7 6 4 3 2 1 0
Undefined
banks_bit1
exclusive_monitors
banks_bit0
memory_chips
memory_support
max_memory_width
memc_status
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-9
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[12] banks_bit1 Use with banks_bit0 bit, to identify the number of banks that the DMC supports on each
memory device. See Table 3-3 on page 3-11.
[11:10] exclusive_monitors Returns the number of exclusive access monitor resources implemented in the DMC:
b00 = 0 monitors
b01 = 1 monitor
b10 = 2 monitors
b11 = 4 monitors.
[9] banks_bit0 Use with banks_bit1 bit, to identify the number of banks that the DMC supports on each
memory device. See Table 3-3 on page 3-11.
[8:7] memory_chips Returns the number of chip selects that the DMC supports:
b00 = 1 chip
b01 = 2 chips
b10 = 3 chips
b11 = 4 chips.
3-10 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
[6:4] memory_support Returns the type of SDRAM that the DMC supports:
b000 = SDR SDRAM
b001 = DDR SDRAM
b010 = eDRAM
b011 = LPDDR SDRAM, also known as mobile DDR SDRAM
b100 = either:
• combined SDR-DDR-LPDDR SDRAM for legacy pad interface configurations
• combined DDR-LPDDR SDRAM for DFI pad interface configurations.
b101-b111 = reserved.
If SDR SDRAM, eDRAM, or LPDDR SDRAM is supported then the DMC ignores the
cas_half_cycle bit in the CAS Latency Register on page 3-19.
[3:2] max_memory_width Returns the value of MEMWIDTH, that is, the memory data bus width of the pad
interface that is set during configuration of the DMC:
b00 = 16-bit
b01 = 32-bit
b10 = 64-bit
b11 = reserved.
b00 4
b01 2a
b10 Reserved
b11 Reserved
a. Two banks per memory chip is only applicable for eDRAM configurations.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-11
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
Usage constraints Not accessible in the Reset or Power-On Reset (POR) state.
31 3 2 0
Undefined
memc_cmd
[2:0] memc_cmd Use the following commands to change the state of the DMC:
b000 = Go
b001 = Sleep
b010 = Wakeup
b011 = Pause
b100 = Configure
b111 = Active_Pause.
If the controller receives a command to change state and a previous command to change state has
not completed then it holds pready LOW until the new command can be carried out.
For more information about the state transitions, see aclk domain state diagram on page 2-19.
Note
• Active_Pause command puts the DMC into the Paused state without draining the
arbiter queue. This enables you to move the controller to the Low_power state, to
change configuration settings such as memory frequency or timing register
values, without requiring coordination between masters in a multi-master system.
3-12 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
• If you use the Active_Pause command to put the DMC in the Low_power state
then you must not remove power from the DMC because this results in data loss
and violation of the AXI protocol.
• The DMC does not issue refreshes when in the Config state. Therefore, ARM
recommends that you make register updates with the controller in Low_power
state because this ensures that the memory is put into self-refresh mode, rather
than the Config state when the memory contains valid data.
The direct_cmd Register therefore enables any initialization sequence that an external
memory device might require. The only timing information associated with the
direct_cmd Register are the command delays that are programmed in the timing
registers. Figure 3-2 on page 3-3 shows the timing registers. Therefore, if an
initialization sequence requires additional delays between commands, they must be
timed by the master driving the initialization sequence.
Figure 3-9 on page 3-14 shows the direct_cmd Register bit assignments.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-13
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
31 23 22 21 20 19 18 17 16 15 14 13 0
Undefined addr_13_to_0
ext_mem_cmd Undefined
chip_nmbr bank_addr
memory_cmd
[17:16] bank_addr Bits mapped to external memory bank address bits, ba[1:0] or dfi_bank[1:0], when DMC
issues a MODEREG command
[13:0] addr_13_to_0 Bits mapped to external memory address bits, add[13:0] or dfi_address[13:0], when DMC
issues a MODEREG command
Table 3-6 shows the memory command encoding from the setting of the ext_mem_cmd
and memory_cmd bits.
0 b00 PRECHARGEALL.
3-14 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
0 b11 NOP.
A NOP command asserts all chip selects that are set as active_chips when the
chip_nmbr is set to 0. The active_chips field is in the Memory Configuration
Register.
If chip_nmbr is set to:
• 1, only cs_n[1] is asserted
• 2, only cs_n[2] is asserted
• 3, only cs_n[3] is asserted.
1 b00 DPD.
1 b01 -a
1 b10 -a
1 b11 -a
a. Illegal combination that might cause undefined behavior.
Figure 3-10 on page 3-16 shows the memory_cfg Register bit assignments.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-15
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
31 30 24 23 22 21 20 19 18 17 15 14 13 12 7 6 5 3 2 0
[31] sr_enable If a DMC is configured to include auto self-refresh entry functionality then this bit
enables the function:
0 = auto self-refresh entry is disabled.
1 = auto self-refresh entry is enabled. See Low-power operation on page 2-37.
Note
Do not enable auto self-refresh entry if a DMC is configured to provide a global cke.
If a DMC configuration excludes auto self-refresh entry functionality then reads are
undefined, write as zero.
[30:24] fp_time This field is valid only when DMC is configured to include force precharge
functionality. The value programmed into this field must indicate the timeout after which
force precharge command is applied. See Low-power operation on page 2-37.
If a DMC configuration excludes force precharge functionality then reads are undefined,
write as zero.
[23] fp_enable If a DMC is configured to include force precharge functionality then this bit enables the
function:
0 = force precharge is disabled.
1 = force precharge is enabled. See Low-power operation on page 2-37.
If a DMC configuration excludes force precharge functionality then reads are undefined,
write as zero.
3-16 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
[22:21] active_chips Enables the DMC to generate refresh commands for the following number of memory
chips:
b00 = 1 chip
b01 = 2 chips
b10 = 3 chips
b11 = 4 chips.
It is only possible to generate commands up to and including the number of chips in the
configuration that the memc_status Register defines, see Memory Controller Status
Register on page 3-9.
[20:18] qos_master_bits Controls which bits of the arid bus are used by the DMC when it selects the QoS value
for the AXI read transfer:
b000 = arid[3:0]
b001 = arid[4:1]
b010 = arid[5:2]
b011 = arid[6:3]
b100 = arid[7:4]
b101-b111 = reserved.
[17:15] memory_burst Controls how many data accesses that the DMC performs to SDRAM, for each Read or
Write command:
b000 = Burst 1
b001 = Burst 2
b010 = Burst 4
b011 = Burst 8
b100 = Burst 16
b101-b111 = reserved.
The chosen burst value must also be programmed into the mode register of the SDRAM
using the direct_cmd Register. See Direct Command Register on page 3-13.
[14] stop_mem_clock When enabled, the memory clock is dynamically stopped when not performing an access
to the SDRAM.
[13] auto_power_down When this is set, the memory interface automatically places the SDRAM into
power-down state by deasserting cke when the command FIFO has been empty for
power_dwn_prd memory clock cycles.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-17
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[12:7] power_dwn_prd Number of memory clock cycles for auto power-down of the SDRAM.
You must only change this field when either:
• auto_power_down bit is 0
• DMC is in the Low_power state.
The value programmed in this field must be greater than the programmed cas_latency,
see CAS Latency Register on page 3-19.
[6] ap_bit Encodes the position of the auto-precharge bit in the memory address:
0 = address bit 10
1 = address bit 8.
[5:3] row_bits Encodes the number of bits of the AXI address that comprise the row address:
b000 = 11 bits
b001 = 12 bits
b010 = 13 bits
b011 = 14 bits
b100 = 15 bits
b101 = 16 bits
b110-b111 = reserved.
The combination of row size, column size, BRC or RBC, and memory width must ensure
that neither the MSB of the row address nor the MSB of the bank address exceed address
range [27:0].
[2:0] column_bits Encodes the number of bits of the AXI address that comprise the column address:
b000 = 8 bits
b001 = 9 bits
b010 = 10 bits
b011 = 11 bits
b100 = 12 bits
b101-b111 = reserved.
3-18 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
31 15 14 0
Undefined refresh_prd
[14:0] refresh_prd Memory refresh period in memory clock cycles. Supported values are 0-32767.
Purpose Controls the CAS latency time in memory clock cycles, see
Figure 2-24 on page 2-33.
Figure 3-12 on page 3-20 shows the cas_latency Register bit assignments.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-19
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
Note
The value of the CAS latency in the cas_latency Register must be identical to the CAS
latency that you write to the memory device, using the direct_cmd Register.
31 4 3 1 0
cas_
Undefined
latency
cas_half_cycle
[3:1] cas_latency CAS latency in mclk cycles. Supported values are 2-3.
[0] cas_half_cycle If you require a CAS latency of 2.5 then set this bit to 1, provided that:
• the DMC accesses DDR devices
• cas_latency field =2.
Otherwise, you must set this bit to 0.
Figure 3-13 on page 3-21 shows the t_dqss Register bit assignments.
3-20 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
31 2 1 0
Undefined
t_dqss
[0] t_dqss Sets tDQSS, the Write to DQS time delay in memory clock cycles. Supported values are 0-1.
Note
When tDQSS is set to 0, then the controller supports only SDR SDRAM.
31 7 6 0
Undefined t_mrd
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-21
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[6:0] t_mrd Sets tMRD, the time delay in mclk cycles, for the DMC to issue a command after it issues a MODEREG
command. Supported values are 0-127.
31 4 3 0
Undefined t_ras
[3:0] t_ras Sets tRAS, the ACTIVE to PRECHARGE delay in memory clock cycles. Supported values are 1-15.
3-22 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
31 4 3 0
Undefined t_rc
[3:0] t_rc Sets tRC, the ACTIVE bank x to ACTIVE bank x delay in memory clock cycles. Supported values are 1-15.
Figure 3-17 on page 3-24 shows the t_rcd Register bit assignments.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-23
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
31 6 5 3 2 0
Undefined t_rcd
schedule_rcd
[5:3] schedule_rcd Sets the RAS to CAS delay in aclk cycles minus 3. For more information, see Scheduler on
page 2-27. Supported values are 0-7.
[2:0] t_rcd Sets tRCD, the RAS to CAS delay in memory clock cycles. Supported values are 1-7.
31 10 9 5 4 0
3-24 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
[9:5] schedule_rfc Sets the AUTO REFRESH to command delay in aclk cycles minus 3. Supported values are 0-31. For
more information, see Scheduler on page 2-27.
[4:0] t_rfc Sets tRFC, the AUTO REFRESH to command delay in memory clock cycles. Supported values are
1-31.
Purpose Controls the PRECHARGE to RAS delay in memory clock cycles, see
Figure 2-17 on page 2-30 and Figure 2-18 on page 2-30.
31 6 5 3 2 0
Undefined t_rp
schedule_rp
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-25
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[5:3] schedule_rp Sets the PRECHARGE to RAS delay in aclk cycles minus 3. Supported values are 0-7. For more
information, see Scheduler on page 2-27.
[2:0] t_rp Sets tRP, the PRECHARGE to RAS delay in memory clock cycles. Supported values are 1-7.
31 4 3 0
Undefined t_rrd
[3:0] t_rrd Sets tRRD, the ACTIVE bank x to ACTIVE bank y delay in memory clock cycles. Supported values are 1-15.
3-26 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
Purpose Controls the Write to PRECHARGE delay in memory clock cycles, see
Figure 2-23 on page 2-32.
31 3 2 0
Undefined t_wr
[2:0] t_wr Sets tWR, the Write to PRECHARGE delay in memory clock cycles. Supported values are 1-7.
Purpose Controls the Write to Read delay in memory clock cycles, see
Figure 2-22 on page 2-32.
Figure 3-22 on page 3-28 shows the t_wtr Register bit assignments.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-27
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
31 3 2 0
Undefined t_wtr
[2:0] t_wtr Sets tWTR, the Write to Read command delay in memory clock cycles. Supported values are 1-7.
31 8 7 0
Undefined t_xp
3-28 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
[7:0] t_xp Sets tXP, the exit power-down to command delay in memory clock cycles. Supported values are 1-255.
31 8 7 0
Undefined t_xsr
[7:0] t_xsr Sets tXSR, the exit self-refresh to command delay in memory clock cycles. Supported values are 1-255.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-29
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
31 8 7 0
Undefined t_esr
[7:0] t_esr Sets the self-refresh to command delay in memory clock cycles. Supported values are 1-255.
Purpose Controls the operation of the DMC. Enables you to override the
configuration set by the tie-off signals, see Tie-offs on page A-3.
Figure 3-26 on page 3-31 shows the memory_cfg2 Register bit assignments.
3-30 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
31 11 10 9 8 6 5 4 3 2 1 0
Undefined
read_delay
memory_protocol
memory_width
cke_init
dqm_init
clock_cfg
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-31
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[10:9] read_delay This field varies the number of mclk cycles before the controller captures the read data,
from the memory device, into the memory clock domain. Supported values are 0-2.
The default value is set by the state of read_delay[1:0], when aresetn goes HIGH.
3-32 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
[5:4] memory_width This field controls if the DMC uses the configured memory data bus width,
MEMWIDTH, or only the lower half of the configured memory data bus width. The DMC
permits the following bit settings depending on the value of configured memory data bus
width, MEMWIDTH:
MEMWIDTH=16
Set this field to b00. The memory data bus width remains unaltered at 16
bits.
MEMWIDTH=32
Set this field to either:
• b00. After deassertion of mresetn, the controller uses the lower 16
bits of the pad interface.
• b01. After deassertion of mresetn, the controller uses the entire 32
bits of the pad interface.
MEMWIDTH=64
Set this field to either:
• b01. After deassertion of mresetn, the controller uses the lower 32
bits of the pad interface.
• b10. After deassertion of mresetn, the controller uses the entire 64
bits of the pad interface.
The default value is set by the state of memory_width[1:0], when aresetn goes HIGH.
Note
Selecting a memory width that the configured DMC does not support can result in
Unpredictable behavior. For more information, see Supported memory widths on
page 1-4.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-33
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[3] cke_init If the DMC contains a DFI pad interface then this bit is reserved. Otherwise, for a legacy
pad interface, it sets the state of cke[MEMORY_CHIPS–1:0] when mresetn is
deasserted.
The default value is set by the state of cke_init, when aresetn goes HIGH.
[2] dqm_init If the DMC contains a DFI pad interface then this bit is reserved. Otherwise, for a legacy
pad interface, it sets the state of the dqm[MEMORY_BYTES–1:0] outputs when
mresetn is deasserted.
The default value is set by the state of dqm_init, when aresetn goes HIGH.
31 13 12 3 2 0
Undefined prescale
max_outs_refs
3-34 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
[12:3] prescale Prescalar counter value. Supported values are 0-1023. See Auto self-refresh entry on
page 2-45.
[2:0] max_outs_refs Maximum number of outstanding refresh commands. Supported values are 1-7. See QoS for
AUTO REFRESH on page 2-24.
Purpose Controls how the DMC responds when it receives any of the four
possible update type requests from a PHY device.
31 8 7 6 5 4 3 2 1 0
Undefined
phyupd_type_11
phyupd_type_10
phyupd_type_01
phyupd_type_00
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-35
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[7:6] phyupd_type_11 Controls how the DMC responds to a DFI update request type 3, that is, when the PHY sets
dfi_phyupd_type[1:0] to b11:
b00 = Put the memory devices in self-refresh mode then stall the DFI
b01 = Stall the DFI
b10-b11 = Reserved.
[5:4] phyupd_type_10 Controls how the DMC responds to a DFI update request type 2, that is, when the PHY sets
dfi_phyupd_type[1:0] to b10:
b00 = Put the memory devices in self-refresh mode then stall the DFI
b01 = Stall the DFI
b10-b11 = Reserved.
[3:2] phyupd_type_01 Controls how the DMC responds to a DFI update request type 1, that is, when the PHY sets
dfi_phyupd_type[1:0] to b01:
b00 = Put the memory devices in self-refresh mode then stall the DFI
b01 = Stall the DFI
b10-b11 = Reserved.
[1:0] phyupd_type_00 Controls how the DMC responds to a DFI update request type 0, that is, when the PHY sets
dfi_phyupd_type[1:0] to b00:
b00 = Put the memory devices in self-refresh mode then stall the DFI
b01 = Stall the DFI
b10-b11 = Reserved.
Purpose Controls the trddata_en timing parameter on the DFI pad interface.
Figure 3-29 on page 3-37 shows the t_rddata_en Register bit assignments.
3-36 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
31 4 3 0
Undefined t_rddata_en
[3:0] t_rddata_en After a DMC issues a Read command from the DFI pad interface then this field sets the number
of mclk cycles before dfi_rddata_en[MEMORY_BYTES–1:0] goes HIGH.
The valid values for this field depend on the cas_latency setting and the limits are:
Minimum cas_latency–1
Maximum cas_latency+6
For example, if cas_latency = 3, then set this field to any value between b0010 and b1001.
31 2 1 0
Undefined
read_transfer_delay
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-37
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
[1:0] read_transfer_delay When the controller performs back-to-back reads to different memory devices then this
field controls the number of idle mclk cycles that the controller inserts between the reads:
b00 = reserved
b01 = one idle cycle, this is the default
b10 = two idle cycles
b11 = reserved.
Note
• The controller inserts idle cycles to prevent bus contention from occurring,
otherwise the second memory device can start driving the DQS bus prior to the first
memory device releasing control of the DQS bus.
• One idle cycle is sufficient for most memory types. However, for some of the
recently introduced LPDDR devices, for example LPDDR-400, then two idle
cycles are usually required.
Purpose Sets the parameters for QoS <n>. Where <n> is a value from 0 to
15 and is the result of applying the 4-bit QoS mask to the arid[]
bus.
Figure 3-31 on page 3-39 shows the id_<n>_cfg Register bit assignments.
3-38 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
31 10 9 2 1 0
Undefined qos_max<n>
qos_min<n>
qos_enable<n>
[9:2] qos_max<n> Sets the maximum QoS value. Supported values are 0-255.
[0] qos_enable<n> When set, the DMC can apply QoS to a read transfer if the masking of the arid[] bits with
the programmed QoS mask produces a value of <n>. For more information, see Quality of
Service on page 2-23.
Figure 3-32 on page 3-40 shows the chip_cfg<n> Register bit assignments.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-39
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
31 17 16 15 8 7 0
address_fmt<n>
[16] address_fmt<n> Selects the memory organization as decoded from the AXI address:
0 = Row, Bank, Column (RBC) organization
1 = Bank, Row, Column (BRC) organization.
[15:8] address_match<n> The controller applies the address_mask<n> field to the AXI address bits, [31:24], that
is awaddr[31:24] or araddr[31:24]. The controller compares the result against this field
and if a match occurs then it selects memory device <n>. See Formatting from AXI
address channels on page 2-14.
[7:0] address_mask<n> Controls which AXI address bits, [31:24], the DMC compares when it receives an AXI
transfer:
Bit [x] = 0 DMC excludes AXI address bit [24+x] from the comparison
Bit [x] = 1 DMC includes AXI address bit [24+x] in the comparison.
Note
If a configured controller supports two or more memory devices then you must take care
to ensure that for all AXI addresses, you program the various address_match and
address_mask fields so that the controller can only assert a single memory chip select.
Otherwise, Unpredictable behavior might occur.
3-40 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
USER_STATUS_WIDTH USER_STATUS_WIDTH–1
31 0
Undefined user_status
a. If USER_STATUS_WIDTH is configured to be 32 then none of the bits in this register are undefined.
USER_CONFIG_WIDTH USER_CONFIG_WIDTH–1
31 0
Undefined user_config
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-41
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
a. If USER_CONFIG_WIDTH is configured to be 32 then none of the bits in this register are undefined.
USER_CONFIG_WIDTH USER_CONFIG_WIDTH–1
31 0
Undefined user_config1
a. If USER_CONFIG_WIDTH is configured to be 32 then none of the bits in this register are undefined.
3-42 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
31 1 0
Undefined
stop_early_bresp
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-43
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
These registers can conceptually be treated as a single register that holds a 32-bit
peripheral ID value. Figure 3-37 shows the correspondence between bits [7:0] of the
periph_id registers and the conceptual 32-bit Peripheral ID Register.
7 4 3 0 7 4 3 0 7 4 3 0 7 0
customer part_
Reserved revision designer_1 designer_0 part_ number_0
modified number_1
designer part number
Table 3-34 shows the register bit assignments for the conceptual 32-bit peripheral ID
Register.
[31:28] - Reserved.
[11:0] part_number Identifies the peripheral. The part number for the DMC is 0x340.
3-44 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
The periph_id_0 Register is hard-coded and the fields in the register control the reset
value. Table 3-35 shows the register bit assignments.
The periph_id_1 Register is hard-coded and the fields in the register control the reset
value. Table 3-36 shows the register bit assignments.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-45
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
The periph_id_2 Register is hard-coded and the fields in the register control the reset
value. Table 3-37 shows the register bit assignments.
The periph_id_3 Register is hard-coded and the fields in the register control the reset
value. Table 3-38 shows the register bit assignments.
3-46 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model
These registers can be treated conceptually as a single register that holds a 32-bit
Component identification value. You can use the register for automatic BIOS
configuration.
31 24 23 16 15 8 7 0
7 0 7 0 7 0 7 0
pcell_id_3 pcell_id_2 pcell_id_1 pcell_id_0
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 3-47
ID111809 Non-Confidential, Unrestricted Access
Programmers Model
3-48 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Chapter 4
Programmers Model for Test
This chapter describes the additional logic for functional verification and production
testing. It contains the following section:
• Integration test registers on page 4-2.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 4-1
ID111809 Non-Confidential, Unrestricted Access
Programmers Model for Test
int_outputs
0xE08
int_inputs
0xE04
int_cfg
0xE00
Table 4-1 shows the integration test registers in base offset order.
4-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model for Test
Usage constraints Only accessible in Config state. ARM recommends that it is only
accessed for integration testing or production testing.
31 1 0
Undefined
int_test_en
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 4-3
ID111809 Non-Confidential, Unrestricted Access
Programmers Model for Test
31 24 23 8 7 4 3 2 1 0
use_ebi
ebibackoff
ebigrant
csysreq
[3] use_ebi Returns the status of the use_ebi input if the DMC supports an EBI
4-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Programmers Model for Test
[2] ebibackoff Returns the status of the ebibackoff input if the DMC supports an EBI
[1] ebigrant Returns the status of the ebigrant input if the DMC supports an EBI
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 4-5
ID111809 Non-Confidential, Unrestricted Access
Programmers Model for Test
31 3 2 1 0
Undefined
ebireq_int
csysack_int
cactive_int
[2] ebireq_int Controls the state of the ebireq output if the DMC supports an EBI
4-6 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Chapter 5
Device Driver
This chapter introduces the device driver operation. It contains the following section:
• Sample device driver on page 5-2
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 5-1
ID111809 Non-Confidential, Unrestricted Access
Device Driver
1. Initialization of the timing control registers. See DMC configuration register map
on page 3-3. Depending on the configuration of the controller then you might
need to initialize the following register fields:
• cas latency
• cas_half_cycle
• t_dqss
• t_mrd
• t_ras
• t_rc
• t_rcd
• schedule_rcd
• t_rfc
• schedule_rfc
• t_rp
• schedule_rp
• t_rrd
• t_wr
• t_wtr
• t_xp
• t_xsr
• t_esr
• read_transfer_delay
• update_type and t_rddata_en for DFI configurations.
5-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Device Driver
• power_dwn_prd
• auto_power_down
• stop_mem_clock
• memory_burst
• qos_master_bits.
3. Program the refresh period in the refresh_prd Register. See Refresh Period
Register on page 3-19.
5. Program the QoS settings you require in to the id_<n>_cfg registers. See QoS
Configuration Register on page 3-38.
5. Program the direct_cmd Register so that the DMC issues two AUTO REFRESH
commands.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. 5-3
ID111809 Non-Confidential, Unrestricted Access
Device Driver
You can change the state of the controller by programming the memc_cmd Register. See
memc_cmd Register bit assignments on page 3-12. A typical sequence is:
1. Read the memc_status Register to check the status of the controller. See Memory
Controller Status Register on page 3-9.
2. When the controller is in the Config state you can initialize the controller as
Memory controller initialization on page 5-2 describes.
3. Program the memc_cmd Register with the Go command to move the controller to
the Ready state.
5-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Appendix A
Signal Descriptions
This chapter describes the AMBA AXI, AMBA APB, and module-specific non-AMBA
signals that the DMC provides. It contains the following sections:
• Clock and reset signals on page A-2
• Miscellaneous signals on page A-3
• AXI signals on page A-6
• APB signals on page A-10
• Pad interface signals on page A-11
• EBI signals on page A-14.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. A-1
ID111809 Non-Confidential, Unrestricted Access
Signal Descriptions
aresetn Input Reset source aclk domain reset signal. This signal is active LOW.
cclken Input Bus clock Clock enable for the AXI low-power interface.
mclkn a Input Clock source Mandatory clock for pad interface block.
mclkx2 a Input Clock source Optional clock for pad interface block.
mclkx2n a Input Clock source Optional clock for pad interface block.
mresetn Input Reset source Reset for mclk domain. This signal is active LOW.
pclken Input Bus clock Clock enable for the APB interface.
a. This signal is not available when the DMC is configured to implement a DDR PHY Interface
(DFI) pad interface.
A-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Signal Descriptions
A.2.1 QoS
qos_override[15:0] Input External When one or more bits are HIGH, coincident with arvalid and arready,
control logic and when the arid match bits are equivalent to the qos_override bit(s),
then the QoS for the read access is forced to minimum latency. For more
information, see Quality of Service on page 2-23.
A.2.2 Tie-offs
a_gt_m_sync Input Tie-off When aresetn is deasserted, the state of this signal sets the value of the
clock_cfg [1] bit in the memory_cfg2 Register. See Memory
Configuration 2 Register on page 3-30.
Set this signal HIGH if aclk is greater than mclk and is synchronous.
cke_init Input Tie-off When aresetn is deasserted, the state of this signal sets the value of the
cke_init bit in the memory_cfg2 Register. See Memory Configuration 2
Register on page 3-30.
This signal is only available when the DMC is configured to provide a
legacy pad interface.
dqm_init Input Tie-off When aresetn is deasserted, the state of this signal sets the value of the
dqm_init bit in the memory_cfg2 Register. See Memory Configuration 2
Register on page 3-30.
This signal is only available when the DMC is configured to provide a
legacy pad interface.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. A-3
ID111809 Non-Confidential, Unrestricted Access
Signal Descriptions
memory_width[1:0] Input Tie-off When aresetn is deasserted, the state of this signal sets the value of the
memory_width field in the memory_cfg2 Register. See Memory
Configuration 2 Register on page 3-30.
memory_type[2:0] Input Tie-off When aresetn is deasserted, the state of this signal sets the value of the
memory_protocol field in the memory_cfg2 Register. See Memory
Configuration 2 Register on page 3-30.
You must set this signal to select a memory protocol that the configured
DMC supports. The memory_protocol field shows the possible bit
encodings, see Memory Configuration 2 Register on page 3-30.
read_delay[1:0] Input Tie-off When aresetn is deasserted, the state of this signal sets the value of the
read_delay field in the memory_cfg2 Register. See Memory
Configuration 2 Register on page 3-30.
sync Input Tie-off When aresetn is deasserted, the state of this signal sets the value of the
clock_cfg [0] bit in the memory_cfg2 Register. See Memory
Configuration 2 Register on page 3-30.
Set this signal HIGH if aclk is synchronous to mclk.
Set this signal LOW if aclk is asynchronous to mclk.
use_ebi a Input Tie-off Set this signal HIGH if the memory interface of the DMC connects to a
PrimeCell External Bus Interface (PL220).
a. This signal is not present when the DMC is configured to implement a DFI pad interface.
A-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Signal Descriptions
These are general purpose I/O signals that you can use to control external devices, such
as a Delay-Locked Loop (DLL). Table A-4 shows the user signals.
Source or
Signal Type Description
destination
user_status[USER_STATUS_WIDTH–1:0] Input External General purpose input signals that are read
control logic using the User Status Register on
page 3-40
dft_en_clk_out Input Tie-off This signal is used for Automatic Test Pattern Generator (ATPG) testing only
rst_bypass Input Tie-off This signal is used for ATPG testing only
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. A-5
ID111809 Non-Confidential, Unrestricted Access
Signal Descriptions
awaddr[31:0] AWADDR
awburst[1:0] AWBURST[1:0]
awcache[3:0] b AWCACHE[3:0]
awid[AID_WIDTH–1:0] c AWID[AID_WIDTH–1:0]
awlen[3:0] AWLEN[3:0]
awlock[1:0] AWLOCK[1:0]
awprot[2:0] b AWPROT[2:0]
awready AWREADY
awsize[2:0] AWSIZE[2:0]
awvalid AWVALID
a. For a description of these signals, see the AMBA AXI Protocol v1.0 Specification.
b. The DMC ignores any information that it receives on these signals.
c. The value of AID_WIDTH is set during configuration of the DMC.
A-6 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Signal Descriptions
wdata[AXI_DATA_MSB:0] b WDATA
wid[AID_WIDTH–1:0] b WID[AID_WIDTH-1:0]
wlast WLAST
wready WREADY
wstrb[AXI_STRB_MSB:0] b WSTRB
wvalid WVALID
a. For a description of these signals, see the AMBA AXI Protocol v1.0 Specification.
b. The value of AXI_DATA_MSB and AID_WIDTH are set during configuration
of the DMC. AXI_STRB_MSB=AXI_DATA_MSB÷8.
bid[AID_WIDTH–1:0] b BID[AID_WIDTH-1:0]
bready BREADY
bresp[1:0] c BRESP[1:0]
bvalid BVALID
a. For a description of these signals, see the AMBA AXI Protocol v1.0 Specification.
b. The value of AID_WIDTH is set during configuration of the DMC.
c. The DMC ties bresp[1] LOW and therefore it only provides OKAY or EXOKAY
responses.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. A-7
ID111809 Non-Confidential, Unrestricted Access
Signal Descriptions
araddr[31:0] ARADDR[31:0]
arburst[1:0] ARBURST[1:0]
arcache[3:0] b ARCACHE[3:0]
arid[AID_WIDTH–1:0] c ARID[AID_WIDTH-1:0]
arlen[3:0] ARLEN[3:0]
arlock[1:0] ARLOCK[1:0]
arprot[2:0] b ARPROT[2:0]
arready ARREADY
arsize[2:0] ARSIZE[2:0]
arvalid ARVALID
a. For a description of these signals, see the AMBA AXI Protocol v1.0 Specification.
b. The DMC ignores any information that it receives on these signals.
c. The value of AID_WIDTH is set during configuration of the DMC.
A-8 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Signal Descriptions
rdata[AXI_DATA_MSB:0] b RDATA
rid[AID_WIDTH–1:0] b RID[AID_WIDTH-1:0]
rlast RLAST
rready c RREADY
rresp[1:0] d RRESP[1:0]
rvalid RVALID
a. For a description of these signals, see the AMBA AXI Protocol v1.0 Specification.
b. The value of AXI_DATA_MSB and AID_WIDTH are set during configuration of the DMC.
c. It is possible for refreshes to be missed if rready is held LOW for longer than one refresh
period, and the read data FIFO, command FIFO, and arbiter queue become full. An OVL error
is triggered if this occurs in simulation. Ensure that the device has a sufficiently high system
priority to prevent this.
d. The DMC ties rresp[1] LOW and therefore it only provides OKAY or EXOKAY responses.
cactive CACTIVE
csysack CSYSACK
csysreq CSYSREQ
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. A-9
ID111809 Non-Confidential, Unrestricted Access
Signal Descriptions
paddr[31:0] b PADDR
penable PENABLE
prdata[31:0] PRDATA
pready PREADY
psel PSELx
pslverr c PSLVERR
pwdata[31:0] PWDATA
pwrite PWRITE
a. For a description of these signals, see the AMBA 3 APB Protocol Specification.
b. The DMC uses bits [11:2]. It ignores bits [31:12] and bits [1:0].
c. The DMC ties pslverr LOW.
A-10 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Signal Descriptions
Source or
Signal Type Description
destination
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. A-11
ID111809 Non-Confidential, Unrestricted Access
Signal Descriptions
Source or
Signal Type Description
destination
a. cke can be configured to be a global cke for all memory devices or a local cke for each memory device.
b. MEMORY_CHIPS is the number of chip selects and is set during configuration of the DMC.
c. MEMORY_BYTES is the data width of the external memory bus in bytes and is set during
configuration of the DMC.
d. MEMWIDTH is the data width of the external memory bus in bits and is set during configuration of
the DMC.
Table A-14 on page A-13 shows the DFI pad interface signals. For a description of
these signals, see the DDR PHY Interface (DFI) Specification .
A-12 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Signal Descriptions
dfi_bank[1:0] Output
dfi_cas_n Output
dfi_cke[MEMORY_CHIPS–1:0]a Output
dfi_cs_n[MEMORY_CHIPS–1:0] a Output
dfi_dram_clk_disable[MEMORY_CHIPS–1:0] b Output
dfi_init_complete Input
dfi_phyupd_ack Output
dfi_phyupd_req Input
dfi_phyupd_type[1:0] Input
dfi_ras_n Output
dfi_rddata_en[MEMORY_BYTES–1:0] b Output
dfi_rddata[MEMWIDTH–1:0] c Input
dfi_rddata_valid d Input
dfi_we_n Output
dfi_wrdata_en[MEMORY_BYTES–1:0] b Output
dfi_wrdata[MEMWIDTH–1:0] c Output
dfi_wrdata_mask[MEMORY_BYTES–1:0] b Output
a. MEMORY_CHIPS is the number of chip selects and is set during configuration of the DMC.
b. MEMORY_BYTES is the data width of the external memory bus in bytes and is set during
configuration of the DMC.
c. MEMWIDTH is the data width of the external memory bus in bits and is set during configuration of
the DMC.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. A-13
ID111809 Non-Confidential, Unrestricted Access
Signal Descriptions
Note
The EBI is only present when the DMC is configured to implement a legacy pad
interface.
Source or
Signal Type Description
destination
ebibackoff Input DMC External memory bus access backoff. The EBI backoff signal goes HIGH when
the PrimeCell EBI (PL220) wants to remove the DMC from the memory bus so
that another memory controller can be granted the memory bus.
ebigrant Input DMC External memory bus grant. This signal goes HIGH when the EBI (PL220)
grants the external memory bus to the DMC.
ebireq Output External External memory bus request. The DMC sets this signal HIGH when it requests
access to the memory bus.
A-14 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Appendix B
Revisions
This appendix describes the technical changes between released issues of this book.
Added the DDR PHY Interface (DFI) pad interface feature Throughout book r4p0
including the DFI signals and registers
Updated description of the supported memory data bus Supported memory widths on page 1-4 All revisions
widths
Removed support for 64-bit SDRAMs Table 1-1 on page 1-5 r4p0
Updated AXI slave interface attributes and added read AXI slave interface attributes on All revisions
interleave depth page 2-12
Updated bus widths for arprot, awprot, arcache, and • Figure 2-2 on page 2-4 All revisions
awcache • AXI signals on page A-6
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. B-1
ID111809 Non-Confidential, Unrestricted Access
Revisions
Added configurable bus width for the user_status, Throughout book r4p0
user_config, and user_config1 signals
Added configurable bus width for the arid, awid, bid, rid, Throughout book r4p0
and wid signals
Added early write response feature Early BRESP on page 2-13 r4p0
Added Read After Write hazard Hazard detection on page 2-22 r4p0
Updated listing of the dynamic low-power modes operation Table 2-7 on page 2-43 All revisions
and removed the illegal bit combinations
Removed restriction of issuing the NOP command when the • Controller management r4p0
controller includes the NVM plug-in operations on page 2-18
• Deep Power-Down on page 2-46
• Table 3-6 on page 3-14
Support for moving all of the memory devices to the deep Deep Power-Down on page 2-46 r4p0
power-down mode
Added a new section TrustZone Support for DMC TrustZone technology support on r4p0
page 2-48
Added supported bit, or field, values to the timing registers Chapter 3 Programmers Model All revisions
Updated the function description for fp_time bit Table 3-7 on page 3-16 r4p0
B-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Revisions
Updated description of the sr_enable, fp_time, and Memory Configuration Register on All revisions
fp_enable bits page 3-15
Updated description of the cas_half_cycle bit CAS Latency Register on page 3-19 All revisions
Added the feature_ctrl Register Feature Control Register on page 3-43 r4p0
Updated the most significant byte of the conceptual • Figure 3-37 on page 3-44 All revisions
peripheral ID register • Table 3-34 on page 3-44
Added requirement to set cactive and csysack HIGH when Integration Configuration Register on All revisions
the controller exits integration test mode page 4-3
Updated register description and added an _int suffix to each Integration Outputs Register on page 4-6 All revisions
bit name
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. B-3
ID111809 Non-Confidential, Unrestricted Access
Revisions
Replaced the old Device Driver section with new content Chapter 5 Device Driver r4p0
Updated description of the tie-off signals Tie-offs on page A-3 All revisions
Added note about using EBI when DFI is implemented EBI signals on page A-14 r4p0
B-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Glossary
This glossary describes some of the terms used in technical documents from ARM.
The AXI protocol also includes optional extensions to cover signaling for low-power
operation.
AXI is targeted at high performance, high clock frequency system designs and includes
a number of features that make it very suitable for high speed sub-micron interconnect.
Advanced Microcontroller Bus Architecture (AMBA)
A family of protocol specifications that describe a strategy for the interconnect. AMBA
is the ARM open standard for on-chip buses. It is an on-chip bus specification that
describes a strategy for the interconnection and management of functional blocks that
make up a System-on-Chip (SoC). It aids in the development of embedded processors
with one or more CPUs or signal processors and multiple peripherals. AMBA
complements a reusable design methodology by defining a common backbone for SoC
modules.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. Glossary-1
ID111809 Non-Confidential, Unrestricted Access
Glossary
AXI terminology The following AXI terms are general. They apply to both masters and slaves:
Active transfer
A transfer for which the xVALID1 handshake has asserted, but for which
xREADY has not yet asserted.
Glossary-2 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Glossary
Completed transfer
A transfer for which the xVALID/xREADY handshake is complete.
Transmit An initiator driving the payload and asserting the relevant xVALID
signal.
The following AXI terms are master interface attributes. To obtain optimum
performance, they must be specified for all components with an AXI master interface:
Read ID capability
The maximum number of different ARID values that a master interface
can generate for all active read transactions at any one time.
Read ID width
The number of bits in the ARID bus.
Write ID capability
The maximum number of different AWID values that a master interface
can generate for all active write transactions at any one time.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. Glossary-3
ID111809 Non-Confidential, Unrestricted Access
Glossary
Write ID width
The number of bits in the AWID and WID buses.
The following AXI terms are slave interface attributes. To obtain optimum
performance, they must be specified for all components with an AXI slave interface:
Glossary-4 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809
Glossary
Burst A group of transfers to consecutive addresses. Because the addresses are consecutive,
there is no requirement to supply an address for any of the transfers after the first one.
This increases the speed at which the group of transfers can occur. Bursts over AMBA
are controlled using signals to indicate the length of the burst and how the addresses are
incremented.
ARM DDI 0331G Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. Glossary-5
ID111809 Non-Confidential, Unrestricted Access
Glossary
Glossary-6 Copyright © 2004-2007, 2009 ARM Limited. All rights reserved. ARM DDI 0331G
Non-Confidential, Unrestricted Access ID111809