Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ARM PrimeCell multiport memory controller technical reference manual.pdf
Скачиваний:
20
Добавлен:
23.08.2013
Размер:
1.79 Mб
Скачать

Dynamic Memory Controller

6.4Dynamic memory controller command descriptions

The dynamic memory controller block in the PrimeCell MPMC supports the SDRAM memory commands shown in Table 6-47 and Table 6-48.

The commands listed in Table 6-47 are generated automatically.

Table 6-47 Synchronous memory commands used by MPMC

Mnemonic

Operation

 

 

ACT

Opens an SDRAM row

 

 

REF

CAS before RAS style refresh

 

 

SREF

Self-refresh

 

 

PRE

Precharge, closes a bank

 

 

RD

Read from an open row, row left open

 

 

WR

Write to an open row, row left open

 

 

RDA

Read followed by precharge

 

 

WRA

Write followed by precharge

 

 

The commands in Table 6-48 are generated under software control by programming the SDRAM initialization (I) and deep sleep mode (DP) fields of the MPMCDynamicControl register.

Table 6-48 Synchronous memory commands programmed by software

Mnemonic

Operation

 

 

MRS

Mode register set, programs SDRAM mode register

 

 

NOP

No operation, used during the SDRAM initialization sequence

 

 

PALL

Precharge all, used during the SDRAM initialization sequence

 

 

DSM

Deep sleep mode, for low-power SDRAM

 

 

ARM DDI 0215A

Copyright © 2002 ARM Limited. All rights reserved.

6-55

Dynamic Memory Controller

6.5Generic SDRAM initialization example

On power-on reset, nPOR, software must initialize the MPMC and each of the dynamic memories connected to the controller. Check the dynamic memory data sheet for the start up procedure. A generic example initialization sequence is shown below:

1.Wait 100ms after the power is applied and the clocks have stabilized.

2.Set the SDRAM Initialization (I) value to NOP in the MPMCDynamicControl register. This automatically issues a NOP command to the SDRAM memories.

3.Wait 200ms.

4.Set the SDRAM Initialization (I) value to PALL in the MPMCDynamicControl register. This automatically issues a precharge all instruction (PRE-ALL) to the SDRAM memories. This precharges all banks and places the device into the all banks idle state.

5.Perform a number of refresh cycles, by writing 1 into the refresh register, MPMCDynamicRefresh. This provides a memory refresh every 16 AHB clock cycles.

6.Wait until eight SDRAM refresh cycles have occurred (128 AHB clock cycles).

7.Program the operational value into the refresh register, MPMCDynamicRefresh.

8.Program the operational value into the latency register, MPMCDynamicRasCas.

9.Program the operational values into the configuration register, MPMCDynamicConfig. The buffers must be disabled during initialization.

10.Set the SDRAM initialization value (I) to MODE in the MPMCDynamicControl register.

11.Program the SDRAM memories mode register. The mode register enables the following parameters (shown in Table 6-49 on page 6-57) to be programmed:

burst length

burst type

CAS latency

operating mode

write burst mode.

A read transaction from the SDRAM memory programs the mode register. The address of the transfer contains the value to be programmed. The mapping from AHB address bus, HADDR, to the SDRAM memories address lines depends on the address mapping value selected in the MPMCDynamicConfig register. The row address bits contain the value to be programmed. The bank select signals BA0 and BA1 must both be 0 to program the mode register.

6-56

Copyright © 2002 ARM Limited. All rights reserved.

ARM DDI 0215A

Dynamic Memory Controller

Table 6-49 Required MPMC SDRAM mode register settings

Field

Value

 

 

Burst length

4 for a 32-bit wide external databus, or 8

 

for a 16-bit wide external databus

 

 

Burst type

Sequential

 

 

CAS latency

Dependent on operating frequency

 

 

Operating mode

Standard operation

 

 

Write burst mode

Programmed burst length

 

 

12.Set the SDRAM initialization value (I) to NORMAL in the MPMCDynamicControl register.

13.Enable the buffers in MPMCDynamicConfig configuration register. The SDRAM is now ready for normal operation.

ARM DDI 0215A

Copyright © 2002 ARM Limited. All rights reserved.

6-57

Dynamic Memory Controller

6.6Micron MT48LC4M16A2 SDRAM initialization example

You can use the following procedure to initialize two Micron MT48LC4M16A2 SDRAM (64MB, 4MBx16) devices, speed grade -8E, configured to provide a 32-bit bus. HCLK and MPMCLK are 100MHz:

1.Wait 100ms after the power is applied and the clocks have stabilized.

2.Set the SDRAM Initialization (I) value to NOP in the MPMCDynamicControl register. This automatically issues a NOP to the SDRAM memories.

3.Set the SDRAM Initialization (I) value to PALL in the MPMCDynamicControl register. This automatically issues a precharge all instruction (PRE-ALL) to the SDRAM memories. This precharges all the banks and places the device into the all banks idle state.

4.Perform a number of refresh cycles, by writing 2 into the refresh register, MPMCDynamicRefresh. This provides a memory refresh every 32 AHB clock cycles.

5.Wait until two SDRAM refresh cycles have occurred (64 AHB clock cycles).

6.Program the operational value into the refresh register, MPMCDynamicRefresh. This device requires a memory refresh every 15.625µs, therefore with a 100MHz HCLK the refresh register must be programmed with (15.625µs x100MHz)/16 = 97.

7.Program the operational value into the latency register, MPMCDynamicRasCas. The -8E speed grade devices support CAS latency 2 at 100MHz operation. Therefore 0x0202 must be programmed into the register.

8.Program the operational values into the configuration register, MPMCDynamicConfig. The buffers must be disabled during initialization. For this memory device the fields must be set as shown in Table 6-50.

Table 6-50 Field settings for Micron MT48LC4M16A2 SDRAM

Field

Value

 

 

Memory Device (MD)

SDRAM (00)

 

 

Address Mapping (AM)

32-bit bus, 64MB, 4MB x16 devices, RBC mapping (10000101)

 

 

Buffer Enable (B

Disabled (0)

 

 

Write Protect (P)

Writes not protected (0)

 

 

Column Width (CW)

8 (010)

 

 

Number of Banks (NB)

Four banks (1)

 

 

Row Width (RW)

12 (01)

 

 

The value is 0x14804280.

6-58

Copyright © 2002 ARM Limited. All rights reserved.

ARM DDI 0215A

Dynamic Memory Controller

9.Set the SDRAM Initialization (I) value to MODE in the MPMCDynamicControl register.

10.Program the SDRAM memories mode register. The mode register enables the following parameters (shown in Table 6-51) to be programmed:

burst length

burst type

CAS latency

operating mode

write burst mode.

A read transaction from the SDRAM memory programs the mode register. The address of the transfer contains the value to be programmed. The mapping from AHB address bus, HADDR, to the SDRAM memories address lines depends on the address mapping value selected in the MPMCDynamicConfig register, in this case 32-bit, 64M, 4M x16, RBC (10000101). The row address bits contain the value to be programmed. The bank select signals BA0 and BA1 must both be 0 to program the mode register.

Table 6-51 Required Micron SDRAM mode register settings

Field

Value

Micron device

 

 

 

 

Burst length

4

(for 32-bit databus)

A[2:0]=010

 

 

 

Burst type

Sequential

A[3]=0

 

 

 

 

CAS latency

2

(for -8E device @ 100MHz)

A[6:4]=01

 

 

 

Operating mode

Standard operation

A[8:7]=0

 

 

 

Write burst mode

Programmed burst length

A[9]=0

 

 

 

 

Reserved (0)

0

 

A[11:10]=0

 

 

 

 

The value required to program the Micron SDRAM mode register is 0x22. The HADDR to SDRAM memory address mapping is 32-bit 64M SDRAM (4Mx16, RBC). The address mapping tables are shown in Address mapping on page 6-4. You can see the SDRAM memory row address bits are mapped to HADDR [23:12]. The SDRAM memory bank address bits are mapped to HADDR [11:10]. Therefore, the address to be accessed is 0x22000.

11.Set the SDRAM Initialization (I) value to NORMAL in the MPMCDynamicControl register.

12.Enable the buffers in MPMCDynamicConfig configuration register. The SDRAM is now ready for normal operation.

ARM DDI 0215A

Copyright © 2002 ARM Limited. All rights reserved.

6-59

Dynamic Memory Controller

6.7Low-power SDRAM initialization example

You can use the following procedure to initialize Infineon HYB/E 25L128160AC-A 128MB (8MB x16) devices configured to provide a 16-bit bus. HCLK and MPMCLK are 100MHz:

1.Wait 100ms after the power is applied and the clocks have stabilized.

2.Set the SDRAM Initialization (I) value to PALL in the MPMCDynamicControl register. This automatically issues a precharge all instruction (PRE-ALL) to the SDRAM memories. This precharges all the banks and places the device into the all banks idle state.

3.Perform a number of refresh cycles, by writing 2 into the refresh register, MPMCDynamicRefresh. This provides a memory refresh every 32 AHB clock cycles.

4.Wait until eight SDRAM refresh cycles have occurred (256 AHB clock cycles).

5.Program the operational value into the refresh register, MPMCDynamicRefresh. This device requires a memory refresh every 16µs. Therefore with a 100MHz HCLK the refresh register must be programmed with (16µs x 100MHz)/16 = 97.

6.Program the operational value into the latency register, MPMCDynamicRasCas. The -8 speed grade devices support CAS latency 2 at 100MHz operation. Therefore 0x0202 must be programmed into the register.

7.Program the operational values into the configuration register, MPMCDynamicConfig. The buffers must be disabled during initialization. For this memory device the fields must be set as shown in Table 6-52.

 

Table 6-52 Field settings for low-power SDRAM

 

 

Field

Value

 

 

Memory Device (MD)

Low-power SDRAM (01)

 

 

Address Mapping (AM)

16-bit bus, 128Mb, 8M x 16 devices, BRC mapping (00101001)

 

 

Buffer Enable (B

Disabled (0)

 

 

Write Protect (P)

Writes not protected (0)

 

 

Column Width (CW)

9 (011)

 

 

Number of Banks (NB)

Four banks (1)

 

 

Row Width (RW)

12 (01)

 

 

The value is 0x14C01488.

6-60

Copyright © 2002 ARM Limited. All rights reserved.

ARM DDI 0215A

Dynamic Memory Controller

8.Set the SDRAM initialization value (I) to MODE in the MPMCDynamicControl register.

9.Next the SDRAM memories mode register must be programmed. The mode register enables the following parameters (shown in Table 6-53) to be programmed:

burst length

burst type

CAS latency

operating mode.

A read transaction from the SDRAM memory programs the mode register. The address of the transfer contains the value to be programmed. The mapping from AHB address bus, HADDR, to the SDRAM memories address lines depends on the address mapping value selected in the MPMCDynamicConfig register, in this case 16-bit, 128Mb, 8Mx16, BRC. The row address bits contain the value to be programmed. The bank select signals BA0 and BA1 must both be 0 to program the mode register

Table 6-53 SDRAM mode register settings for low-power SDRAM

Option

Value

Micron device

 

 

 

 

Burst length

8

(for 32-bit databus)

A[2:0]=011

 

 

 

Burst type

Sequential

A[3]=0

 

 

 

 

CAS latency

2

(for -8E device @100MHz)

A[6:4]=010

 

 

 

Operating mode

Standard operation

A[11:7]=00000

 

 

 

 

Therefore, 0x23 must be programmed in the low-power SDRAM mode register. The HADDR to SDRAM memory address mapping is 16-bit 128Mb SDRAM (8Mx16, BRC). The address mapping tables are shown in Address mapping on page 6-4. You can see the SDRAM memory row address bits are mapped to HADDR [21:10]. The SDRAM memory bank address bits are mapped to HADDR [23:22]. The address to be accessed is therefore 0x08C00.

10.Next the low-power SDRAM memories extended mode register must be programmed. The mode register enables the following parameters to be programmed:

temperature compensated self-refresh

partial array self-refresh.

ARM DDI 0215A

Copyright © 2002 ARM Limited. All rights reserved.

6-61

Dynamic Memory Controller

The bank select signals BA1 and BA0 must be 1, 0 to select the extended mode register. A read transaction from the SDRAM memory programs the mode register. The address of the transfer contains the value to be programmed. The mapping from AHB address bus, HADDR, to the SDRAM memories address lines depends on the address mapping value selected in the MPMCDynamicConfig register, in this case 16-bit, 128Mb, 8Mx16, BRC. The row address bits contain the value to be programmed.

Table 6-54 Required low-power SDRAM extended mode register settings

Option

Value

Micron device

 

 

 

Partial array self-refresh

All banks

A[2:0]=000

 

 

 

Temperature compensated self-refresh

700C

A[4:3]=00

The value required to program the low-power SDRAM extended mode register is 0x00. The HADDR to SDRAM memory address mapping is 16-bit 128Mb SDRAM (8Mx16, BRC). The address mapping tables are shown in the Address mapping section. You can see the SDRAM memory row address bits are mapped to HADDR [21:10]. The SDRAM memory bank address bits are mapped to HADDR [23:22]. Therefore, the address to be accessed is 0x800000.

11.Set the SDRAM initialization value (I) to NORMAL in the MPMCDynamicControl register.

12.Enable the buffers in MPMCDynamicConfig configuration register. The SDRAM is now ready for normal operation.

6-62

Copyright © 2002 ARM Limited. All rights reserved.

ARM DDI 0215A