先说一下硬件情况
CPU: s3c2440
BANK6: 64M SDRAM
BANK7: 64M SDRAM
只使用64M内存能起来, 代码如下:
========================= config.bib ================================
NK 8C200000 01D00000 RAMIMAGE ;change by capbily
RAM 8E000000 02000000 RAM ; 64M mem
; RAM 8E000000 06000000 RAM ; 128M mem
AUD_DMA 8c002000 00002000 RESERVED
DRV_GLB 8c010000 00010000 RESERVED
DBGSER_DMA 8c022000 00002000 RESERVED
SER_DMA 8c024000 00002000 RESERVED
IR_DMA 8c026000 00002000 RESERVED
SD_DMA 8c028000 00008000 RESERVED
EDBG 8c030000 00020000 RESERVED ;change by capbily
CAMERA 8c050000 000A0000 RESERVED
DISPLAY 8c100000 00100000 RESERVED
CONFIG
COMPRESSION=ON
KERNELFIXUPS=ON
IF IMGPROFILER
PROFILE=ON
ENDIF
IF IMGPROFILER !
PROFILE=OFF
ENDIF
;; configur the percentage of RAM allocated for the file system ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF IMGTINYFSRAM !
FSRAMPERCENT=0x40404040
ENDIF
IF IMGTRUSTROMONLY
IF IMGNOTALLKMODE
ROMFLAGS=12
ENDIF
IF IMGNOTALLKMODE !
ROMFLAGS=10
ENDIF
ENDIF
IF IMGTRUSTROMONLY !
IF IMGNOTALLKMODE
ROMFLAGS=2
ENDIF
IF IMGNOTALLKMODE !
ROMFLAGS=0
ENDIF
ENDIF
ROMSTART=8C200000 ; change by capbily
ROMWIDTH=32
ROMSIZE=01D00000
复制代码
========================= map.a ================================
EXPORT OEMAddressTable[DATA]
OEMAddressTable
;;;-------------------------------------------------------------
;;; Virt Addr Phys Addr MB
;;;-------------------------------------------------------------
DCD 0x80000000, 0x02000000, 30 ; 30 MB SRAM(SRAM/ROM) BANK 0
DCD 0x82000000, 0x08000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 1
DCD 0x84000000, 0x10000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 2
DCD 0x86000000, 0x18000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 3
DCD 0x88000000, 0x20000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 4
DCD 0x8A000000, 0x28000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 5
DCD 0x8C000000, 0x30000000, 64 ; 64 MB DRAM BANK 0, 1
DCD 0x90800000, 0x48000000, 1 ; Memory control register
DCD 0x90900000, 0x49000000, 1 ; USB Host register
DCD 0x90A00000, 0x4A000000, 1 ; Interrupt Control register
DCD 0x90B00000, 0x4B000000, 1 ; DMA control register
DCD 0x90C00000, 0x4C000000, 1 ; Clock & Power register
DCD 0x90D00000, 0x4D000000, 1 ; LCD control register
DCD 0x90E00000, 0x4E000000, 1 ; NAND flash control register
DCD 0x90F00000, 0x4F000000, 1 ; Camera control register
DCD 0x91000000, 0x50000000, 1 ; UART control register
DCD 0x91100000, 0x51000000, 1 ; PWM timer register
DCD 0x91200000, 0x52000000, 1 ; USB device register
DCD 0x91300000, 0x53000000, 1 ; Watchdog Timer register
DCD 0x91400000, 0x54000000, 1 ; IIC control register
DCD 0x91500000, 0x55000000, 1 ; IIS control register
DCD 0x91600000, 0x56000000, 1 ; I/O Port register
DCD 0x91700000, 0x57000000, 1 ; RTC control register
DCD 0x91800000, 0x58000000, 1 ; A/D convert register
DCD 0x91900000, 0x59000000, 1 ; SPI register
DCD 0x91A00000, 0x5A000000, 1 ; SD Interface register
DCD 0x91B00000, 0x5B000000, 1 ; AC97 Interface register
DCD 0x00000000, 0x00000000, 0 ; End of Table (MB MUST BE ZERO!
复制代码
============================= OEMGetExtensionDRAM的实现 ====================
BOOL
OEMGetExtensionDRAM(
LPDWORD lpMemStart,
LPDWORD lpMemLen
)
{
return FALSE; // no extension DRAM
} 复制代码
参照这个http://blog.eeworld.net/gooogleman/archive/2009/03/19/4004153.aspx
修改如下:
========================= config.bib ===========================
未修改
========================= map.a ================================
EXPORT OEMAddressTable[DATA]
OEMAddressTable
;;;-------------------------------------------------------------
;;; Virt Addr Phys Addr MB
;;;-------------------------------------------------------------
DCD 0x80000000, 0x02000000, 30 ; 30 MB SRAM(SRAM/ROM) BANK 0
DCD 0x82000000, 0x08000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 1
DCD 0x84000000, 0x10000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 2
DCD 0x86000000, 0x18000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 3
DCD 0x88000000, 0x20000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 4
DCD 0x8A000000, 0x28000000, 32 ; 32 MB SROM(SRAM/ROM) BANK 5
DCD 0x8C000000, 0x30000000, 64 ; 64 MB DRAM BANK 0, 1
DCD 0x90800000, 0x48000000, 1 ; Memory control register
DCD 0x90900000, 0x49000000, 1 ; USB Host register
DCD 0x90A00000, 0x4A000000, 1 ; Interrupt Control register
DCD 0x90B00000, 0x4B000000, 1 ; DMA control register
DCD 0x90C00000, 0x4C000000, 1 ; Clock & Power register
DCD 0x90D00000, 0x4D000000, 1 ; LCD control register
DCD 0x90E00000, 0x4E000000, 1 ; NAND flash control register
DCD 0x90F00000, 0x4F000000, 1 ; Camera control register
DCD 0x91000000, 0x50000000, 1 ; UART control register
DCD 0x91100000, 0x51000000, 1 ; PWM timer register
DCD 0x91200000, 0x52000000, 1 ; USB device register
DCD 0x91300000, 0x53000000, 1 ; Watchdog Timer register
DCD 0x91400000, 0x54000000, 1 ; IIC control register
DCD 0x91500000, 0x55000000, 1 ; IIS control register
DCD 0x91600000, 0x56000000, 1 ; I/O Port register
DCD 0x91700000, 0x57000000, 1 ; RTC control register
DCD 0x91800000, 0x58000000, 1 ; A/D convert register
DCD 0x91900000, 0x59000000, 1 ; SPI register
DCD 0x91A00000, 0x5A000000, 1 ; SD Interface register
DCD 0x91B00000, 0x5B000000, 1 ; AC97 Interface register
[color=#FF0000];================ 增加下面这句 ====================[/color]
DCD 0x92000000, 0x38000000, 64 ; 32 MB SROM(SRAM/ROM) BANK
[color=#FF0000];==================================================[/color]
DCD 0x00000000, 0x00000000, 0 ; End of Table (MB MUST BE ZERO!
复制代码
============================= OEMGetExtensionDRAM的实现 ====================
BOOL
OEMGetExtensionDRAM(
LPDWORD lpMemStart,
LPDWORD lpMemLen
)
{ *lpMemStart = 0x92000000;
*lpMemLen = 0x04000000;
return TRUE;
//return FALSE; //[color=#FF0000];只要在此处return FALSE, 就能够起来[/color]
} 复制代码