私はVxWorks653を使用しており、ターゲットはwrSbc7457PowerPCです。
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 ) ;
OSブートイメージがロードされると、ターゲットは次のように出力します。
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
私の質問は、メザニンカードのメモリをホストのアドレス空間にマッピングする方法と、そのメザニンカードのメモリを書き込む/読み取る方法です。