阅读:1219回复:0
Vxworks+IQ80310 PCI 问题
大家好!
我喜欢浏览驱动开发网,经常能中受益! 最近我在做一个移植项目,遇到了问题,忙了一个多礼拜了没有结果,特向您请教。 项目:SCSI设配卡(symbios53c895)的驱动。这个项目在x86+VxWorks下已经搞定了,现在想把它移植到ARM/Xscale Cyclone IQ80310 + VxWorks平台上,iq80310是一块intel出的基于ARM/Xcale的老评估板,插在一张Cyclone提供的背板上作target。SCSI设配卡是作为PCI设备插在iq80310目标板的Secondary PCI slot中。 Vxworks在iq80310上跑起来之后我用pciConfigInLong()读出来SCSI设配卡的I/O基地址寄存器的值是0xffffef01,直接用该基地址+offset访问PCI设备的寄存器时遇到data abort错,于是我按照target手册上的内存分配图给SCSI设配卡重新分配I/O基地址,把它定位到0x9001ef01,可是我在对SCSI设配卡的I/O寄存器进行操作的时候还是遇到data abort错。 我在设置完I/O基地址之后都通过写PCI的command配置寄存器使能内存空间操作和IO空间操作: pciConfigOutWord (pciBus, pciDevice, pciFunc, PCI_CFG_COMMAND,MEM_SPACE_ENABLE | IO_SPACE_ENABLE | BUS_MASTER_ENABLE); 另外我是全部用物理地址来访问I/O空间的,比如对16位寄存器的操作是: void Reg_Write16(ULONG Reg_addr,UINT16 value) { *(volatile UINT16 *)Reg_addr = value; } UINT16 Reg_Read16(ULONG Reg_addr) { return (*(volatile uint16 *)Reg_addr); } 两个函数的形参Reg_addr在赋值的时候都是用的物理地址,即等于I/O基地址+寄存器偏移量。 您知道错误出在哪里吗? 非常感谢! 祝 好运! ErorLiu@hotmail.com 下面附了一张target的内存分配图: Memory Maps of ARM/Xscale Cyclone IQ80310: Physical Address Range Description ----------------------- ---------------------------------- 0x00000000 - 0x00000fff flash Memory 0x00001000 - 0x00001fff 80312 Internal Registers 0x00002000 - 0x007fffff flash Memory 0x00800000 - 0x7fffffff PCI ATU Outbound Direct Window 0x80000000 - 0x83ffffff Primary PCI 32-bit Memory 0x84000000 - 0x87ffffff Primary PCI 64-bit Memory 0x88000000 - 0x8bffffff Secondary PCI 32-bit Memory //the mem space i need to concern 0x8c000000 - 0x8fffffff Secondary PCI 64-bit Memory 0x90000000 - 0x9000ffff Primary PCI IO Space 0x90010000 - 0x9001ffff Secondary PCI IO Space //the IO space i need to concern 0x90020000 - 0x9fffffff Unused 0xa0000000 - 0xbfffffff SDRAM 0xc0000000 - 0xefffffff Unused 0xf0000000 - 0xffffffff 80200 Internal Registers Virtual Address Range C B Description ----------------------- - - ---------------------------------- 0x00000000 - 0x00000fff Y Y SDRAM 0x00001000 - 0x00001fff N N 80312 Internal Registers 0x00002000 - 0x007fffff Y N flash Memory 0x00800000 - 0x7fffffff N N PCI ATU Outbound Direct Window 0x80000000 - 0x83ffffff N N Primary PCI 32-bit Memory 0x84000000 - 0x87ffffff N N Primary PCI 64-bit Memory 0x88000000 - 0x8bffffff N N Secondary PCI 32-bit Memory 0x8c000000 - 0x8fffffff N N Secondary PCI 64-bit Memory 0x90000000 - 0x9000ffff N N Primary PCI IO Space 0x90010000 - 0x9001ffff N N Secondary PCI IO Space 0xa0000000 - 0xbfffffff Y Y SDRAM 0xc0000000 - 0xcfffffff Y Y Cache Flush Region 0xd0000000 - 0xd0000fff Y N first 4k page of flash 0xf0000000 - 0xffffffff N N 80200 Internal Registers |
|