mcf5307cft90b Freescale Semiconductor, Inc, mcf5307cft90b Datasheet - Page 103

no-image

mcf5307cft90b

Manufacturer Part Number
mcf5307cft90b
Description
Mcf5307 Coldfire Integrated Microprocessor User
Manufacturer
Freescale Semiconductor, Inc
Datasheet
out of internal SRAM or cache during DMA access.
The ColdFire processor or an external emulator using the debug module can perform these
initialization functions.
4.5.1 SRAM Initialization Code
The code segment below initializes the SRAM. The code sets the base address of the SRAM
at 0x2000_0000 and then initializes the RAM to zeros.
RAMBASE
RAMVALID
move.l
movec.l
The following loop initializes the entire SRAM to zero:
lea.l
move.l
SRAM_INIT_LOOP:
clr.l
subq.l
bne.b
The following function copies the number of bytesToMove from the source (*src) to the
processor’s local RAM at an offset relative to the SRAM base address defined by
destinationOffset. The bytesToMove must be a multiple of 16. For best performance, source
and destination SRAM addresses should be line-aligned (0-modulo-16).
; copyToCpuRam (*src, destinationOffset, bytesToMove)
RAMBASE
RAMFLAGS
; stack arguments and locations
; +0
; +4
; +8
; +12
; +16
; +20
; +24
lea.l
movem.l
move.l
movec.l
move.l
lea.l
add.l
saved d2
saved d3
saved d4
returnPc
pointer to source operand
destinationOffset
bytesToMove
EQU
EQU
#RAMBASE+RAMVALID,D0
D0, RAMBAR
RAMBASE,A0
#1024,D0
(A0)+
#1,D0
SRAM_INIT_LOOP
EQU
EQU
-12(a7),a7
#0x1c,(a7)
RAMBASE+RAMFLAGS,a0
a0,rambar
16(a7),a0
RAMBASE,a1
20(a7),a1
Freescale Semiconductor, Inc.
For More Information On This Product,
0x20000000
0x00000035
0x20000000
0x00000035
Chapter 4. Local Memory
Go to: www.freescale.com
;set this variable to 0x20000000
;load RAMBASE + valid bit into D0
;load RAMBAR and enable SRAM
;load pointer to SRAM
;load loop counter into D0
;clear 4 bytes of SRAM
;decrement loop counter
;exit if done; else continue looping
;SRAM base address
;RAMBAR valid + mask bits
;allocate temporary space
;store D2/D3/D4 registers
;define RAMBAR contents
;load it
;load argument defining *src
;memory pointer to RAM base
;include destinationOffset
SRAM Initialization
4-5

Related parts for mcf5307cft90b