我正在使用 VxWorks 653,我的目标是 wrSbc7457 Power PC。
我的 wrSbc7457 上有一张夹层卡,我正在尝试写入/读取该夹层卡上的内存。
对于那些熟悉 VxWorks 的人,我的usrAppInit()
ModuleOS 的功能中有以下内容:
printf ( "Entering ModuleOS, usrAppInit() ...\n" ) ;
printf ( "sysModel() returns %s\n", sysModel() ) ;
pciDeviceShow ( 0 ) ;
{
int pciBus, pciDevice, pciFunc ;
UINT32 BAR_0_contents, BAR_1_contents ;
printf
( "\npciFindDevice returns STATUS %d\n",
pciFindDevice ( my_VENDORID, my_PMC_DEVICEID, 0, &pciBus, &pciDevice, &pciFunc )
) ;
printf ( "\tand pciBus = %d, pciDevice = %d, pciFunc = %d\n", pciBus, pciDevice, pciFunc ) ;
printf ( "\npciConfigInLong returns STATUS %d\n",
pciConfigInLong ( pciBus, pciDevice, pciFunc, PCI_CFG_BASE_ADDRESS_0, & BAR_0_contents ) ) ;
printf ( "\tand Base Address Register 0 contains 0x%X\n", BAR_0_contents ) ;
printf ( "\npciConfigInLong returns STATUS %d\n",
pciConfigInLong ( pciBus, pciDevice, pciFunc, PCI_CFG_BASE_ADDRESS_1, & BAR_1_contents ) ) ;
printf ( "\tand Base Address Register 1 contains 0x%X\n", BAR_1_contents ) ;
加载操作系统启动映像时,我的目标输出以下内容:
Entering ModuleOS, usrAppInit() ...
sysModel() returns wrSbc7457 Power PC
Scanning function 0 of each PCI device on bus 0
Using configuration mechanism 0
bus device function vendorID deviceID class
00000000 00000000 00000000 0000---- 0000---- 000-----
00000000 00000001 00000000 0000---- 0000---- 00--0000
00000000 00000002 00000000 0000---- 0000---- 000-----
pciFindDevice returns STATUS 0 (OK)
and pciBus = 0, pciDevice = 1, pciFunc = 0
pciConfigInLong returns STATUS 0 (OK)
and Base Address Register 0 contains 0x50000000
pciConfigInLong returns STATUS 0 (OK)
and Base Address Register 1 contains 0x58000000
我的问题是:如何将夹层卡的内存映射到主机的地址空间,然后如何写入/读取夹层卡上的内存?