64MB SDRAM Configuration
- From: rainer <rainer@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 14 Aug 2007 02:08:01 -0700
Hello,
I'm working on Freescale iMX31ADS with CM-iMX31BGAR10 on WinCE 6.0.
My ebootloader (eboot.nb0) and also my image (nk.bin) work well when the
sdram is configured for 128MB.
But when I configure the SDRAM for 64MB, nothing happens.
To configure the SDRAM for 64MB I have made the following changes:
File image_cfg.inc and image_cfg.h :
before
IMAGE_BOOT_RAMDEV_RAM_SIZE EQU (128*1024*1024)
now
IMAGE_BOOT_RAMDEV_RAM_SIZE EQU (64*1024*1024)
I have also made some changes in startup.s.
My config.bib and my oemaddress table looks like this:
config.bib:
;**************************** MEMORY SECTION ***************************
MEMORY
IF BSP_MBX
#define MBX_START 8F000000
#define MBX_SIZE 01000000
ENDIF
IF IMGFLASH !
#define NK_START 88100000
#define NK_SIZE 03000000
#define RAM_START 8B100000
IF IMGPPC
; ------------------ RAM image (Windows Mobile PocketPC) ---------------
; Start Addr End Addr Mem Type Region Name Size
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; 0x88100000 0x8B0FFFFF SDRAM NK 48 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x8B100000 0x8E3FFFFF SDRAM RAM 51 MB
; 0x8E400000 0x8EFFFFFF SDRAM RAMFMD 12 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x8B100000 0x8F3FFFFF SDRAM RAM 67 MB
; 0x8F400000 0x8FFFFFFF SDRAM RAMFMD 12 MB
; ENDIF
;
; Note that the RAMFMD start address and size must also match what is
; defined in [HKEY_LOCAL_MACHINE\Drivers\BlockDevice\RAMFMD] registry
; key in platform.reg.
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 03300000
#define RAMFMD_START 8E400000
#define RAMFMD_SIZE 00C00000
ELSE
#define RAM_SIZE 04300000
#define RAMFMD_START 8F400000
#define RAMFMD_SIZE 00C00000
ENDIF
ELSE
IF IMGTPC
; ---------------- RAM image (Windows Mobile SmartPhone) ---------------
; Start Addr End Addr Mem Type Region Name Size
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; 0x88100000 0x8B0FFFFF SDRAM NK 48 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x8B100000 0x8E3FFFFF SDRAM RAM 51 MB
; 0x8E400000 0x8EFFFFFF SDRAM RAMFMD 12 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x8B100000 0x8F3FFFFF SDRAM RAM 67 MB
; 0x8F400000 0x8FFFFFFF SDRAM RAMFMD 12 MB
; ENDIF
;
; Note that the RAMFMD start address and size must also match what is
; defined in [HKEY_LOCAL_MACHINE\Drivers\BlockDevice\RAMFMD] registry
; key in platform.reg.
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 03300000
#define RAMFMD_START 8E400000
#define RAMFMD_SIZE 00C00000
ELSE
#define RAM_SIZE 04300000
#define RAMFMD_START 8F400000
#define RAMFMD_SIZE 00C00000
ENDIF
ELSE
; --------------------------- RAM image (Windows CE) -------------------
; Start Addr End Addr Mem Type Region Name Size
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; 0x88100000 0x8B0FFFFF SDRAM NK 48 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x8B100000 0x8EFFFFFF SDRAM RAM 63 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x8B100000 0x8FFFFFFF SDRAM RAM 79 MB
; ENDIF
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 03F00000
ELSE
#define RAM_SIZE 04F00000
ENDIF
ENDIF
ENDIF
ENDIF
IF IMGFLASH
IF IMGEBOOT
#define NK_START 80040000
#define NK_SIZE 01FC0000
#define RAM_START 88100000
IF IMGPPC
; --------- FLASH image with EBOOT (Windows Mobile PocketPC) -----------
; Start Addr End Addr Mem Type Region Name Size
; 0x80000000 0x8003FFFF FLASH resident EBOOT 256 KB
; 0x80040000 0x81FFFFFF FLASH NK 31.75 MB
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x88100000 0x8E3FFFFF SDRAM RAM 99 MB
; 0x8E400000 0x8EFFFFFF SDRAM RAMFMD 12 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x88100000 0x8F3FFFFF SDRAM RAM 115 MB
; 0x8F400000 0x8FFFFFFF SDRAM RAMFMD 12 MB
; ENDIF
;
; Note that the RAMFMD start address and size must also match what is
; defined in [HKEY_LOCAL_MACHINE\Drivers\BlockDevice\RAMFMD] registry
; key in platform.reg.
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 06300000
#define RAMFMD_START 8E400000
#define RAMFMD_SIZE 00C00000
ELSE
#define RAM_SIZE 07300000
#define RAMFMD_START 8F400000
#define RAMFMD_SIZE 00C00000
ENDIF
ELSE
IF IMGTPC
; -------- Flash image with EBOOT (Windows Mobile SmartPhone) ----------
; Start Addr End Addr Mem Type Region Name Size
; 0x80000000 0x8003FFFF FLASH resident EBOOT 256 KB
; 0x80040000 0x81FFFFFF FLASH NK 31.75 MB
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x88100000 0x8E3FFFFF SDRAM RAM 99 MB
; 0x8E400000 0x8EFFFFFF SDRAM RAMFMD 12 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x88100000 0x8F3FFFFF SDRAM RAM 115 MB
; 0x8F400000 0x8FFFFFFF SDRAM RAMFMD 12 MB
; ENDIF
;
; Note that the RAMFMD start address and size must also match what is
; defined in [HKEY_LOCAL_MACHINE\Drivers\BlockDevice\RAMFMD] registry
; key in platform.reg.
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 06300000
#define RAMFMD_START 8E400000
#define RAMFMD_SIZE 00C00000
ELSE
#define RAM_SIZE 07300000
#define RAMFMD_START 8F400000
#define RAMFMD_SIZE 00C00000
ENDIF
ELSE
; --------------- FLASH image with EBOOT (Windows CE) ------------------
; Start Addr End Addr Mem Type Region Name Size
; 0x80000000 0x8003FFFF FLASH resident EBOOT 256 KB
; 0x80040000 0x81FFFFFF FLASH NK 31.75 MB
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x88100000 0x8EFFFFFF SDRAM RAM 111 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x88100000 0x8FFFFFFF SDRAM RAM 127 MB
; ENDIF
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 06F00000
ELSE
#define RAM_SIZE 07F00000
ENDIF
ENDIF
ENDIF
ENDIF
IF IMGEBOOT !
#define NK_START 80000000
#define NK_SIZE 020C0000
#define RAM_START 88100000
IF IMGPPC
; ------ Flash image without EBOOT (Windows Mobile PocketPC) -----------
; Start Addr End Addr Mem Type Region Name Size
; 0x80000000 0x81FFFFFF FLASH NK 32 MB
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x88100000 0x8E3FFFFF SDRAM RAM 99 MB
; 0x8E400000 0x8EFFFFFF SDRAM RAMFMD 12 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x88100000 0x8F3FFFFF SDRAM RAM 115 MB
; 0x8F400000 0x8FFFFFFF SDRAM RAMFMD 12 MB
; ENDIF
;
; Note that the RAMFMD start address and size must also match what is
; defined in [HKEY_LOCAL_MACHINE\Drivers\BlockDevice\RAMFMD] registry
; key in platform.reg.
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 06300000
#define RAMFMD_START 8E400000
#define RAMFMD_SIZE 00C00000
ELSE
#define RAM_SIZE 07300000
#define RAMFMD_START 8F400000
#define RAMFMD_SIZE 00C00000
ENDIF
ELSE
IF IMGTPC
; ----- Flash image without EBOOT (Windows Mobile SmartPhone) ----------
; Start Addr End Addr Mem Type Region Name Size
; 0x80000000 0x81FFFFFF FLASH NK 32 MB
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x88100000 0x8E3FFFFF SDRAM RAM 99 MB
; 0x8E400000 0x8EFFFFFF SDRAM RAMFMD 12 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x88100000 0x8F3FFFFF SDRAM RAM 115 MB
; 0x8F400000 0x8FFFFFFF SDRAM RAMFMD 12 MB
; ENDIF
;
; Note that the RAMFMD start address and size must also match what is
; defined in [HKEY_LOCAL_MACHINE\Drivers\BlockDevice\RAMFMD] registry
; key in platform.reg.
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 06300000
#define RAMFMD_START 8E400000
#define RAMFMD_SIZE 00C00000
ELSE
#define RAM_SIZE 07300000
#define RAMFMD_START 8F400000
#define RAMFMD_SIZE 00C00000
ENDIF
ELSE
; ------------ FLASH image without EBOOT (Windows CE) ------------------
; Start Addr End Addr Mem Type Region Name Size
; 0x80000000 0x81FFFFFF FLASH NK 32 MB
; 0x88000000 0x880FFFFF SDRAM reserved 1 MB
; IF BSP_MBX
; Reserve top 16 MB for MBX (see the beginning of the MEMORY section).
; 0x88100000 0x8EFFFFFF SDRAM RAM 111 MB
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ELSE
; 0x88100000 0x8FFFFFFF SDRAM RAM 127 MB
; ENDIF
; ----------------------------------------------------------------------
; Name Address Size Type
IF BSP_MBX
#define RAM_SIZE 06F00000
ELSE
#define RAM_SIZE 07F00000
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
; ----------------- Reserved Region Mapping (1 MB) ---------------------
; Start Addr End Addr Mem Type Region Name Size
; 0x88000000 0x88000FFF SDRAM ARGS 4 KB
; 0x88001000 0x88008FFF SDRAM CSPDDK 32 KB
; 0x88009000 0x880FFFFF SDRAM RSVD 988 KB
; IF BSP_MBX
; Reserve top 16 MB for MBX.
; 0x8F000000 0x8FFFFFFF SDRAM MBX 16 MB
; ENDIF
; ----------------------------------------------------------------------
; Name Address Size Type
ARGS 88000000 00001000 RESERVED
CSPDDK 88001000 00008000 RESERVED
RSVD 88009000 000F7000 RESERVED
NK $(NK_START) $(NK_SIZE) RAMIMAGE
RAM $(RAM_START) $(RAM_SIZE) RAM
#if (defined IMGPPC || defined IMGTPC)
RAMFMD $(RAMFMD_START) $(RAMFMD_SIZE) RESERVED
#endif
IF BSP_MBX
MBX $(MBX_START) $(MBX_SIZE) RESERVED
ENDIF
;**************************** CONFIG SECTION ***************************
CONFIG
; ---------------------- All Image Types Settings ----------------------
; KERNELFIXUPS = ON (sections to which the kernel can write are
; relocated to the start of RAM)
; SRE = ON (Romimage.exe produces an .sre file)
; ----------------------------------------------------------------------
KERNELFIXUPS=ON
; --------------------------- RAM image --------------------------------
; AUTOSIZE = ON (allows NK and RAM space to resize automatically)
; ROMSIZE = 0x04000000 (64 MB)
; ROMSTART = 0x88000000 (SDRAM virtual address base)
; ROMWIDTH = 32 (32-bit wide memory, entire image in one file)
;
; Note: Since we run the bootloader with MMU on, we do not need to
; adjust virtual addresses back to physical. If we need
; to adjust to physical, the calculation would look something
; like this:
;
; ROMOFFSET = (SDRAM_PHYSICAL_START - ROMSTART) % 0x100000000
; = (0xC0000000 - 0x88000000) % 0x100000000 = 0x38000000
; ----------------------------------------------------------------------
IF IMGFLASH !
AUTOSIZE=ON
ROMSIZE=04000000
ROMSTART=88000000
ROMWIDTH=32
ENDIF
; ------------------- FLASH image with/without EBOOT -------------------
; ROMSIZE = 0x02000000 (32 MB)
; ROMSTART = 0x80000000 (SDRAM base + 2 MB offset for reserved region)
; ROMWIDTH = 32 (32-bit wide memory, entire image in one file)
; ROMOFFSET = (FLASH_PHYSICAL_START - ROMSTART) % 0x100000000
; = (0x80000000 - 0x80000000) % 0x100000000 = 0x00000000
; ----------------------------------------------------------------------
IF IMGFLASH
ROMSIZE=02000000
ROMSTART=80000000
ROMWIDTH=32
ROMOFFSET=00000000
ENDIF
; @CESYSGEN IF !NK_NKNOCOMP
COMPRESSION=ON
; @CESYSGEN ENDIF !NK_NKNOCOMP
; @CESYSGEN IF NK_NKNOCOMP
COMPRESSION=OFF
; @CESYSGEN ENDIF NK_NKNOCOMP
DLLADDR_AUTOSIZE=ON
; --------------------- Profiling kernel support -----------------------
; PROFILE = ON (includes profiler structure and symbols in image)
; PROFILE = OFF (does not include profiler structure and symbols)
; ----------------------------------------------------------------------
IF IMGPROFILER
PROFILE=ON
ELSE
PROFILE=OFF
ENDIF
;
; ROMFLAGS is a bitmask of options for the kernel
; ROMFLAGS 0x0001 Disallow Paging
; ROMFLAGS 0x0010 Trust Module only
;
IF IMGTRUSTROMONLY
ROMFLAGS=10
ELSE
ROMFLAGS=0
ENDIF
;
; Limit the RAM FS allocation to 32 kB for Windows Mobile 5.0 builds. This
; is a requirement as given in the SmartPhone and PocketPC Software
; Requirements Checklist (see the Windows Mobile online help and Reference
; item 106804).
;
#if (defined IMGPPC || defined IMGTPC)
FSRAMPERCENT=0x00000004
#endif
; This fix-up variable is a bitfield that can be used to initialize
; the OAL debug zones per oal_log.h. Uncomment the line and
; change the hexidecimal bits to enable the desired zones. The
; default value (0x0000000B) enables the OAL_LOG_ERROR,
; OAL_LOG_WARN, and OAL_LOG_INFO zones, and will be used by
; OEMInit if the line remains commented out.
;
; nk.exe:initialOALLogZones 00000000 0x0000000B FIXUPVAR
; This fix-up variable determines the amount of memory the BSP reserves
; for Watson dump capture (see also the OEMInit() function in the OAL).
; The current default behavior is to default to zero unless the image has
; SYSGEN_WATSON_DMPGEN defined, then the default size is 300KB (0x4B000).
;
; If WATSONBUFFERSIZE is defined, use its value. Otherwise use 300KB.
;
; @CESYSGEN IF CE_MODULES_OSAXST0
#if $(WATSONBUFFERSIZE)!=$()
nk.exe:dwOEMDrWatsonSize 00000000 $(WATSONBUFFERSIZE) FIXUPVAR
#else
nk.exe:dwOEMDrWatsonSize 00000000 0x4B000 FIXUPVAR
#endif
; @CESYSGEN ENDIF CE_MODULES_OSAXST0
; EOF config.bib
oemaddresstable
;------------------------------------------------------------------------------
;
; TABLE FORMAT
; cached address, physical address, size
;------------------------------------------------------------------------------
g_oalAddressTable
DCD 0x88000000, CSP_BASE_MEM_PA_CSD0, 128 ; RAM image mapping
DCD 0x80000000, CSP_BASE_MEM_PA_CS0, 64 ; FLASH image mapping
DCD 0x90000000, CSP_BASE_MEM_PA_CS4, 32 ; External WEIM CS4
DCD 0x97000000, CSP_BASE_REG_PA_AVIC, 1 ; AVIC regs
DCD 0x97200000, CSP_BASE_REG_PA_NANDFC, 1 ; NANDFC regs
DCD 0x97300000, CSP_BASE_REG_PA_WEIM, 1 ; WEIM regs
DCD 0x97400000, CSP_BASE_REG_PA_M3IF, 1 ; M3IF regs
DCD 0x97500000, CSP_BASE_REG_PA_ESDCTL, 1 ; ESDCTL regs
DCD 0x97600000, CSP_BASE_REG_PA_L2CC, 1 ; L2CC controller regs
DCD 0x98000000, CSP_BASE_MEM_PA_AIPSA, 64 ; AIPSA peripheral
regs
DCD 0x9C000000, CSP_BASE_MEM_PA_AIPSB, 64 ; AIPSB peripheral
regs
DCD 0x00000000, 0x00000000, 0 ; Terminate table
;------------------------------------------------------------------------------
END
And now I don't know what I must change next.
I hope somebody can help me.
Thanks
.
- Prev by Date: Re: Two SD Cards
- Next by Date: Re: Changing IP address at Boot time on CEPC
- Previous by thread: Is there anyone use Spansion Nor flash?
- Next by thread: Re: Way to make changes to a device driver with out rebuilding OS imag
- Index(es):
Relevant Pages
|