阅读:1939回复:0
急救:9052两个memory基址如何区分
我参照PDC1000开发板SYS程序
if (ResourceRaw->u.Memory.Length == 0x80) { //PCI Bar 0 pdx->PhysicalMemBase = ResourceRaw->u.Memory.Start; pdx->MemCount = ResourceRaw->u.Memory.Length; pdx->MemBase = (ULONG *)MmMapIoSpace(pdx->PhysicalMemBase, pdx->MemCount,MmNonCached); DebugPrint("The MEM Base 0 is %x; Count is %x.",pdx->MemBase,pdx->MemCount); if (pdx->MemBase == NULL) { // PCI BAR 0 is required for register access DebugPrint("PDC1000: ERROR - BAR 0 mapping is required\n"); return STATUS_INSUFFICIENT_RESOURCES; } GotBaseMem = TRUE; } //PCI Bar 0 else { //PCI Bar 2, 8155 Mem map pdx->PdcPhysicalMemBase = ResourceRaw->u.Memory.Start; pdx->PdcMemCount = ResourceRaw->u.Memory.Length; pdx->PdcMemBase = (ULONG *)MmMapIoSpace(pdx->PdcPhysicalMemBase, pdx->PdcMemCount,MmNonCached); DebugPrint("The MEM Base SJA1000 is %x;Count is %x.",pdx->PdcMemBase,pdx->PdcMemCount); if (pdx->PdcMemBase == NULL) { DebugPrint("ERROR - Unable to map SJA1000.\n"); return STATUS_INSUFFICIENT_RESOURCES; } GotPdcMem = TRUE; } //PCI Bar 2, 8155 Mem map 开发板是用8位数据线 而我们公司开发的板用16位数据线,3个地址线 |
|