我在PLATFORM\DEVICEEMULATOR\SRC\OAL\OALLIB\init.c中找到了一个此函数的实现代码
C/C++ codeBOOL
OEMGetExtensionDRAM(
LPDWORD lpMemStart,
LPDWORD lpMemLen
)
{
typedefvolatile unsignedlong MegOfExtendedRam_t[1024*1024/sizeof (unsignedlong)];
MegOfExtendedRam_t*MegsOfRam= (MegOfExtendedRam_t*)EXTENDED_RAM_BASE;
DWORD each_meg;const DWORD dwPageSize=4096;// PAGE_SIZE in ceddk isn't valid until later in boot
OALMSG(OAL_FUNC, (L"++OEMGetExtensionDRAM\r\n"));// Employ a simple memory test to see that all N meg's are there.// NB: Because an empty memory bus can "float" data for several// cycles and appear as valid memory, discharge the bus before// verifying the data.//// The probe is nondestructive, to allow the contents of extension// RAM to be preserved across soft resetstry {for (each_meg=0; each_meg< EXTENDED_RAM_MEGS;++each_meg)
{
unsignedlong temp0= MegsOfRam[each_meg][0];
unsignedlong temp1= MegsOfRam[each_meg][1];
SMDK6410\SRC\BOOTLOADER\EBOOT\startup.s文件中有一句不明白是干什么的,也涉及到大小。
Assembly code; Comment:; The following loop is to direct map RAM VA == PA. i.e.; VA == 0x50XXXXXX => PA == 0x50XXXXXX for S3C6410; Fill in 8 entries to have a direct mapping for DRAM
ldr r10, =PT_1ST_BASE; Restore address of 1st level page table ldr r0, =DRAM_BASE_PA_STARTadd r10, r10, #PTR_1ST_PTE; (r10) = ptr to 1st PTE for 0x50000000add r0, r0, #0x1E; 1MB cachable bufferable orr r0, r0, #0x400; set kernel r/w permissionmov r1, #0; mov r3, #64 ; 64MB DRAMmov r3, #128; 128MB DRAM
; mov r3, #256 ; 256MB DRAM