Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3657
  • 博文数量: 1
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2015-01-18 11:17
文章分类
文章存档

2015年(1)

我的朋友
最近访客

分类: Windows平台

2015-02-09 14:56:27

c:\WM653WEHH\PLATFORM\AM33X\SRC\INC\addrtab_cfg.inc

c:\WM653WEHH\PLATFORM\AM33X\SRC\INC\image_cfg.h

c:\WM653WEHH\PLATFORM\AM33X\SRC\KERNEL\OAL\init.c

在这三个文件中做了更改。

 

 

首先要说的是这个函数:

DWORD OEMEnumExtensionDRAM(PMEMORY_SECTION pMemSections, DWORD cMemSections)

{

DWORD dwExtMem=0;

 

pMemSections[dwExtMem].dwFlags=0;

pMemSections[dwExtMem].dwStart=IMAGE_WINCE_DRAM_EXT_PA;

pMemSections[dwExtMem].dwLen=  IMAGE_WINCE_DRAM_EXT_SIZE;

 

++dwExtMem;

OALMSGS(1, (L"[OAL]OEMEnumExtensionDRAM!\r\n"));

return dwExtMem;

 

}

 

下划线的宏定义是在image_cfg.h中定义的,而这个位置是必须保持和在addrtab_cfg.inc文件中所做列举的内存映射一致,并且虚拟内存映射的范围必须在0x80000000~0xA0000000之间,否则也会导致失败。

 

查看MSDN可以发现:

-----------------------------------------------------PMEMORY_SECTION的定义如下----------------------------------------------------------------------

typedef struct _MEMORY_SECTION {
  DWORD dwFlags;
  DWORD dwStart;
  DWORD dwLen;
} MEMORY_SECTION, *PMEMORY_SECTION;

 

dwFlags

Reserved for future use.

Must be set to zero.

dwStart

Start address, statically mapped virtual address, of the memory section.//内存分段的起始地址,静态映射的虚拟地址

dwLen

Number of bytes in the memory section.

--------------------------------------------------------------------------END----------------------------------------------------------------------------------------

pMemSections[dwExtMem].dwStart=IMAGE_WINCE_DRAM_EXT_PA;这个是在给定额外扩展内存的虚拟地址的起始位置

pMemSections[dwExtMem].dwLen=  IMAGE_WINCE_DRAM_EXT_SIZE;这个是在给定额外扩展内存的虚拟地址的大小

 

注意,查看这个PMEMORY_SECTION结构体中地址使用的是虚拟地址,由后面的解释部分可以看出来。

而这个地址的起始位置和大小已在addrtab_cfg.inc文件中列举出来。

 

============================这个是addrtab_cfg.inc文件中地址的映射设置:===============================

 

           DCD       0x80000000, 0x80000000,  256    ; SDRAM

;         DCD       0x8a000000, 0x8a000000,         96        ; SDRAM for ramdisk,不需额外说明,续见image_cfg.h

       

        DCD     0x90000000, 0x48000000,  4      ; L4S

        DCD     0x90400000, 0x4A000000,  4      ; L4F

        DCD     0x90800000, 0x44C00000,  4      ; L4WKUP

        DCD     0x90C00000, 0x47C00000,  4      ; L4FW

        DCD     0x91000000, 0x40300000,  1      ; OCMC RAM

        DCD     0x91100000, 0x08000000,  16     ; NAND Flash SC0 

        DCD     0x92100000, 0x49000000,  1      ; TPCC 

        DCD     0x92200000, 0x49800000,  3      ; TPTC

        DCD     0x92500000, 0x46000000,  8      ; McASP 

        DCD     0x92D00000, 0x47400000,  4      ; USB/CPPI

        DCD     0x93100000, 0x47800000,  1      ; MMCHS2

      

        DCD     0x93200000, 0x53000000,  1      ; SHA

        DCD     0x93300000, 0x53400000,  1      ; AES0

        DCD     0x93400000, 0x54C00000,  4      ; ADC_TSC

        DCD     0x93800000, 0x56000000,  16      ; SGX530

        DCD     0x94800000, 0x40200000,  1      ; SRAM

        DCD     0x94900000, 0x4C000000,  1      ; EMIF0

        DCD     0x94A00000, 0x50000000,  1      ; GPMC

       

        DCD     0x94B00000, 0x90000000, 181        ; RAM 181M0x0B500000 SDRAM for RAMDISK on second bank        

        DCD     0x00000000, 0x00000000,  0      ; end of table

===========================================END======================================================

 

---------------------------------------------------这个是image_cfg.h文件中关于扩展内存的定义------------------------------------------------

//

//  Define: IMAGE_WINCE_DRAM_EXT

//

//  Following constants define the base address for additional DRAM on the EVM.

//

#define IMAGE_WINCE_DRAM_EXT_PA                0x94B00000 //0x96000000

#define IMAGE_WINCE_DRAM_EXT_SIZE         0x0b500000 //181Mbyte

 

//

//  Define: IMAGE_SHARE_ARGS_xxx

//

//  Following constants define location and maximal size of arguments shared

//  between loader and kernel. For actual structure see args.h file.

//

#define IMAGE_SHARE_ARGS_PA             0x80000000

#define IMAGE_SHARE_ARGS_CA             0x80000000

#define IMAGE_SHARE_ARGS_SIZE           0x00001000

 

---------------------------------------------------------------------------------END----------------------------------------------------------------------------

阅读(401) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~