Hi Rich,
I have added all the code in ".cfg" into my ".c" file before initialising hardware. But still it is not working.
Here is my ".cfg" file:
-------------------------------------------------------------------------------------
ResetHalt
Delay 200
Stop
; Set VBR to the beginning of what will be SDRAM
; VBR is an absolute CPU register
; SDRAM is at 0x00000000+0x0400000
writecontrolreg 0x0801 0x00000000
; Set RAMBAR = 0x20000001
; RAMBAR is an absolute CPU register
; This is the location of the internal 64k of SRAM on the chip
writecontrolreg 0x0C05 0x20000001
; Set PAR_SDRAM to allow SDRAM signals to be enabled
writemem.b 0x40100046 0x3F
; Set PAR_AD to allow 32-bit SDRAM if the exteranl boot device is 16-bits
writemem.b 0x40100040 0xE1
; Turn off WCR
writemem.w 0x40140000 0x0000
; 1MB ASRAM on CS1 at 0x30000000
writemem.w 0x4000008C 0x3000 ; CSAR1
writemem.l 0x40000090 0x000F0001 ; CSMR1
writemem.w 0x40000096 0x3D20 ; CSCR1
; 2MB FLASH on CS0 at 0xFFE00000
writemem.w 0x40000080 0xFFE0 ; CSAR0
writemem.l 0x40000084 0x001F0001 ; CSMR0
writemem.w 0x4000008A 0x1980 ; CSCR0
delay 100
; 16 MB SDRAM
; Like the 5307 and 5407 Cadre 3 boards, this board uses DCR,DACR, DMR to access SDRAM
writemem.w 0x40000040 0x0446 ;
writemem.l 0x40000048 0x00001300 ;
writemem.l 0x4000004C 0x00FC0001 ;
writemem.l 0x40000048 0x00001308 ;
writemem.l 0x00000000 0x00000000 ;
; Wait a bit
delay 100
; Initialize SDRAM with a write
writemem.l 0x40000048 0x00009300;
writemem.l 0x40000048 0x00009340;
writemem.l 0x00000400 0x00000000;
; Wait a bit more
delay 600
writemem.w 0x40140000 0x0000 ; disable the watchdog timer in WCR
-----------------------------------------------------------------------------------------
I have added the following lines before initialising hardware:
----------------------------------------------------------------------------------------
asm
{
move.l #(__IPSBAR + 1),d0
move.l d0,0x40000000
}
(*(uint8 *)0x40100046) = 0x3F;
(*(uint8 *)0x40100040) = 0xE1;
MCF_WTM_WCR = 0;
(*(uint16 *)0x4000008C) = 0x3000;
(*(uint32 *)0x40000090) = 0x000F0001;
(*(uint16 *)0x40000096) = 0x3D20;
(*(uint16 *)0x40000080) = 0xFFE0;
(*(uint32 *)0x40000084) = 0x001F0001;
(*(uint16 *)0x4000008A) = 0x1980;
(*(uint16 *)0x40000040) = 0x0446;
(*(uint32 *)0x40000048) = 0x00009340;
(*(uint32 *)0x00000000) = 0x00000000;
(*(uint32 *)0x00000400) = 0x00000000;
(*(uint32 *)0x4000004C) = 0x00FC0001;
Processor works wrongly when I reset it.
Thanks for your support.
Hari
Message Edited by habha on 2009-04-07 08:23 PM
Message Edited by habha on 2009-04-07 08:24 PM