阅读:2589回复:0
Config.bib boot.bib loader.h 映射问题
各位高手:
小弟是windows ce初学者,最近在学习驱动程序开发,基于wce4.2+pxa255平台。驱动程序里的虚拟地址到物理地址的映射中,首先 pVMem = (PUCHAR)VirtualAlloc(0,PAGE_SIZE*4,MEM_RESERVE,PAGE_NOACCESS); 用于动态申请虚拟内存,请问为什么是PAGE_SIZE*4呢? 其次 VirtualCopy((LPVOID)pVMem,(LPVOID)GPIO_BASE_U_VIRTUAL,PAGE_SIZE,PAGE_READWRITE | PAGE_NOCACHE)) 中的第二个参数表示物理地址,它的取值根什么有关呢?跟电路图上的地址线和片选线连接吗?比如我手上的nandflash的驱动程序里,其取值就是0xbd200000。 在boot.bib,config.bib以及loader.h中,都有物理地址和虚拟地址的映射,它们之间有什么区别和联系?比如config.bib部分内容如下: MEMORY IF IMGFLASH ! NK 800B8000 02000000 RAMIMAGE ; SDRAM 32MB: [800B 8000 -> 820B 7FFF] RAM 820B8000 01C00000 RAM ; SDRAM 28MB: [820B 8000 -> 83CB 7FFF] EDBG 83F8D000 00020000 RESERVED ; x20000 for EBOOT - 3 Client memory pools of 24K (128K) ENDIF ; ***************************************************************************** ; Common RAM areas - Must match MemDefs.h and xsc1.inc: ; Currently Reserving [81C8 D000 - 81F8 CFFF] == 3 MB ; This area is reserved regardless of the build type (i.e. FLASH, !FLASH, EBOOT, !EBOOT) ; AUD_DMA 83CB8000 0000A000 RESERVED SLEEP_SAV 83CC2000 00001000 RESERVED DRV_GLB 83CC3000 00001000 RESERVED CACHE_FLG 83CC4000 0003C000 RESERVED ; DISPLAY 83D00000 00130000 RESERVED ; 1MB aligned BLOCK_BUF 83E30000 00080000 RESERVED UNUSED_BUF 83EB0000 000DD000 RESERVED ....... boot.bib文件部分内容如下: MEMORY ; Name Start Size Type ; ------- -------- -------- ---- EBOOT 80078000 00040000 RAMIMAGE ; 256 KB for code RAM 80068000 00008000 RAM STACK 80000000 00068000 RESERVED SECTBUFF 80077C00 00000400 RESERVED DRV_GLB 83CC3000 00001000 RESERVED BLOCK_BUF 83E30000 00080000 RESERVED ...... loader.h部分内容如下: // // Memory reigions defined in boot.bib... // #define EBOOT_RAM_IMAGE_BASE 0x8c038000 #define EBOOT_RAM_IMAGE_SIZE 0x00020000 #define EBOOT_STORE_OFFSET 0 #define EBOOT_STORE_ADDRESS (EBOOT_RAM_IMAGE_BASE + EBOOT_STORE_OFFSET) #define EBOOT_STORE_MAX_LENGTH EBOOT_RAM_IMAGE_SIZE // Flash Cache area defined in boot.bib #define FLASH_CACHE 0x8D000000UL #define FLASH_CACHE_SIZE /*0x02D00000UL*/0x01000000UL // BinFS work area defined in boot.bib #define BINFS_RAM_START (0x8c021000 | CACHED_TO_UNCACHED_OFFSET) // uncached #define BINFS_RAM_LENGTH 0x5000 // // Nk Memory reigions defined in config.bib... // // new old #define ROM_RAMIMAGE_START /*0x8C200000*/0x8C100000 #define ROM_RAMIMAGE_SIZE /*0x02D00000*/0x01000000 // Start addresses must match config.bib's RAMIMAGE #define RAM_START /*0x8F000000*/0x8d100000 #define RAM_SIZE 0x00F00000/*0x00F00000*/ #define DEFAULT_LAUNCHADDR ROM_RAMIMAGE_START // // SDRAM // #define SDRAM_BASE 0x8C000000 // defined in OEMAddressTable #define SDRAM_SIZE 0x04000000 /*0x02000000*/ // 32 MB ....... 上述三者之间是否矛盾呢?比如loader.h中的SDRAM_BASE就与config.bib中不符合。 BSP目录下的子文件夹INC下有文件xsc1bd.inc文件,其中部分定义如下: BOOT_FLASH_BASE_PHYSICAL EQU 0x00000000 BOOT_FLASH_BASE_C_VIRTUAL EQU 0x98300000 BOOT_FLASH_BASE_U_VIRTUAL EQU (BOOT_FLASH_BASE_C_VIRTUAL + lCACHED_TO_UNCACHED_OFFSET) ; ; Lubbock: Application FLASH (32 MB) ; APP_FLASH_BASE_PHYSICAL EQU 0x04000000 APP_FLASH_BASE_C_VIRTUAL EQU 0x9C300000 APP_FLASH_BASE_U_VIRTUAL EQU (APP_FLASH_BASE_C_VIRTUAL + lCACHED_TO_UNCACHED_OFFSET) ; ; Lubbock: Lubbock Registers (FPGA- aka BLR) ; FPGA_REGS_BASE_PHYSICAL EQU 0x08000000 FPGA_REGS_BASE_C_VIRTUAL EQU 0x9E300000 FPGA_REGS_BASE_U_VIRTUAL EQU (FPGA_REGS_BASE_C_VIRTUAL + lCACHED_TO_UNCACHED_OFFSET) ; ; Lubbock: SRAM (1 MB) ; SRAM_BASE_PHYSICAL EQU 0x0A000000 SRAM_BASE_C_VIRTUAL EQU 0x9E400000 SRAM_BASE_U_VIRTUAL EQU (SRAM_BASE_C_VIRTUAL + lCACHED_TO_UNCACHED_OFFSET) 请问这些地址的定义和什么有关呢?跟电路图上的地址线和片选线连接吗? |
|