flyingbearboy
驱动牛犊
驱动牛犊
  • 注册日期2007-01-12
  • 最后登录2016-06-07
  • 粉丝0
  • 关注0
  • 积分15分
  • 威望99点
  • 贡献值0点
  • 好评度30点
  • 原创分0分
  • 专家分0分
阅读:1885回复:0

急救:9052两个memory基址如何区分

楼主#
更多 发布于:2007-12-10 21:31
我参照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个地址线
游客

返回顶部