Eurotech A3pci7512 Owner's manual

Type
Owner's manual
C-PCI 3U PowerPC7447 CPU Board
Manual
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
2
Content
1. Outline ...................................................................................................................................................................................... 3
2. Installing the BSP ..................................................................................................................................................................... 4
2.1 Install the BSP for Tornado2.2.1 ...................................................................................................................................... 4
2.2 Install the BSP for Workbench2.5 .................................................................................................................................... 4
3. Preparation to start VxWorks on A3pci7512 ........................................................................................................................... 5
3.1 Make a VxWorks image file ............................................................................................................................................. 5
3.2 Preparation for boot file .................................................................................................................................................... 5
3.3 Connecting the console ..................................................................................................................................................... 6
3.4 Connecting the Network ................................................................................................................................................... 6
4. Boot of "VxWorks for A3pci7512" .......................................................................................................................................... 7
5. Using a file system ..................................................................................................................................................................10
5.1 File system related command ..........................................................................................................................................10
5.1.1 Mount ....................................................................................................................................................................... 10
5.1.2 Move of directry ....................................................................................................................................................... 10
5.1.3 Indication of current directory ................................................................................................................................. 10
5.1.4 Show the Contents of directory ................................................................................................................................ 10
5.1.5 Creation of directory ................................................................................................................................................ 10
5.1.6 Delete of directory .................................................................................................................................................... 11
5.1.7 Copy of file ............................................................................................................................................................... 11
5.1.8 Delete of file ............................................................................................................................................................. 11
5.2 Booting from miniSD card .............................................................................................................................................. 11
6. Programming information .......................................................................................................................................................12
6.1 Real time clock ................................................................................................................................................................ 12
6.1.1 Setups of a time-of-day ............................................................................................................................................ 12
6.1.2 Get of a time-of-day ................................................................................................................................................. 13
6.1.3 About system time ....................................................................................................................................................13
6.2 Direct Memory Access .....................................................................................................................................................14
6.2.1 adDmaInit() .............................................................................................................................................................. 14
6.2.2 adDmaStart() ............................................................................................................................................................ 14
6.2.3 adChainDmaStart() ................................................................................................................................................... 16
6.2.4 adDmaStop()............................................................................................................................................................. 18
7. About PCI bus ......................................................................................................................................................................... 19
7.1 For PCI configurations API ............................................................................................................................................. 19
7.2 PCI configurations APIs .................................................................................................................................................. 20
7.2.1 pciFindDevice() ........................................................................................................................................................ 20
7.2.2 pciFindClass() .......................................................................................................................................................... 21
7.2.3 pciDevConfig() ......................................................................................................................................................... 21
7.2.4 pciConfigInByte() ..................................................................................................................................................... 22
7.2.5 pciConfigInWord() ................................................................................................................................................... 22
7.2.6 pciConfigInLong() .................................................................................................................................................... 23
7.2.7 pciConfigOutByte() .................................................................................................................................................. 23
7.2.8 pciConfigOutWord() ................................................................................................................................................ 24
7.2.9 pciConfigOutLong() ................................................................................................................................................. 24
7.2.10 pciConfigModifyByte() .......................................................................................................................................... 25
7.2.11 pciConfigModifyWord() ........................................................................................................................................ 25
7.2.12 pciConfigModifyLong() ......................................................................................................................................... 26
7.2.13 pciIntConnect() ........................................................................................................................................................ 27
Appendix A. System dependent library ...................................................................................................................................... 28
Appendix B. The booting from ROM ......................................................................................................................................... 29
Appendix C. How to use ENUM interrupt ................................................................................................................................. 31
Appendix D. About VxWorks6.3 ................................................................................................................................................ 33
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
3
1. Outline
This book explains the BSP to execute VxWorks with CPU board equipped with PowerPC(G4) named A3pci7512 of
CompactPCI bus.
BSP is necessary to execute VxWorks with A3pci7512. It is VxWorks component, and the role of the interface with
hardware is played.
Necessary files, VxWorks system image, boot ROM , system dependence module, the device driver, and the configu-
ration customized to suit A3pci7512, etc. are included in this BSP.
It comes to be able to restructure VxWorks that suits A3pci7512 by preparing both of this BSP and WindRivers
Tornado and Workbench development environment. Tornado and Workbench is not included in this BSP. It is neces-
sary to buy Tornado for PowerPC or Workbench from WindRiver to use this BSP.
This BSP corresponds to versions of VxWorks listed below.
VxWorks5.5.1 (Tornado2.2.1)
VxWorks6.3 (Workbench2.5)
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
4
2. Installing the BSP
This section explanes how to install the BSP into host environment. It assumes that the Windows edition of Tornado
and Workbench would be used.
2.1 Install the BSP for Tornado2.2.1
Install the BSP for Tornado2.2.1 according to the following procedures. In the following explanations, the installed
directory in which Tornado for PowerPC was assumed as C:\Tornado and CD-ROM drive was assumed as E.
Install the BSP according to the following procedures.
(1) Make the subdirectory “A3pci7512” into the C:\Tornado\target\config directory.
For example,
C:\Tornado\target\config>mkdir A3pci7512
(2) All of the file below the E:\VxWorks5.5.1\A3pci7512 directory of attached CD-R to copy them onto the
C:\Tornado\target\config\A3pci7512 directory.
For example,
C:\Tornado\target\config>cd A3pci7512
C:\Tornado\target\config\A3pci7512>copy E:\VxWorks5.5.1\A3pci7512\*.*
The installation ends above.
2.2 Install the BSP for Workbench2.5
Install the BSP for Workbench2.5 according to the following procedures. In the following explanations, the installed
directory in which WindRiver Workbench2.5 was assumed as C:\WindRiver and CD-ROM drive was assumed as E.
Install the BSP according to the following procedures.
(1) Make the subdirectory “A3pci7512” into thec:\WindRiver\vxworks-6.3\target\config directory.
For example,
c:\WindRiver\vxworks-6.3\target\config>mkdir A3pci7512
(2) All of the file below the E:\VxWorks6.3\A3pci7512 directory of attached CD-R to copy them onto the
c:\WindRiver\vxworks-6.3\target\config\A3pci7512 directory.
For example,
c:\WindRiver\vxworks-6.3\target\config>cd A3pci7512
c:\WindRiver\vxworks-6.3\target\config\A3pci7512>copy E:\VxWorks6.3\A3pci7512\*.*
The installation ends above.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
5
3. Preparation to start VxWorks on A3pci7512
3.1 Make a VxWorks image file
This chapter explains the method of making VxWorks image file necessary to actually use VxWorks on A3pci7512.
It explains the making method of using Tornado1.0.1 interchangeable mode.
Select Options of the Tools menu to use Tornado1.0.1 interchangeable mode, open the Project tab, and select
Enable extened Builds Options.
There are two kinds of VxWorks images, Tornado and the standalone. Here said Tornado is VxWorks image that
uses the tool and the symbol table of the host computer.
vxWorks basic Tornado uses host shell and symbol table
vxWorks.st stand alone image has target shell and symbol table.
Here, use vxWorks that is basic Tornado.
Select Standard BSP Builds of the Build menu of Tornado to make the VxWorks image. A3pci7512 is clicked with
Select a BSP of the displayed window, and select vxWorks with Select an Image to Build and click the OK button.
Then, vxWorks is made for the BSP directory.
Refer to “5 VxWorks Image Projects” of “WindRiver Workbench Users Guide 2.5” how to make the VxWorks
6.3 kernel
3.2 Preparation for boot file
The command line interpreter named T4th is installed in boot ROM of A3pci7512.
In the T4th, the function to execute the FORTH word described in the file named autoexec.4th that exists in the
root directory of miniSD card automatically at power-on reset is provided. Boot VxWorks for A3pci7512 by using
this function.
Prepare it according to the procedure for showing the boot file as follows.
(1) Write bootrom.hex to the root directory of miniSD card, the bootrom.hex is collected in the attached CD-R.
(2) Make the file of the name of autoexec.4th described as follows for the root directory of miniSD card.
sdload bootrom.hex 0x1e00100 go
(3) Insert the miniSD card into the miniSD card socket of A3pci7512.
(4) Turn on bit 7 of DSW1 of A3pci7512 to execute the script of autoexec.4th automatically.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
6
3.3 Connecting the console
In boot ROM of this BSP, use the RS-232-C serial console as a console. Connect serial port SIO1 of the personal
computer and A3pci7512 that operates the terminal software such as the character terminal, dumb terminal, or the
hyper terminals with the cross cable of RS-232C.
The communication condition of the serial port is as follows.
baud rate : 38400bps
charactor length : 8bits
parity bit : none
stop bit : one stop bit
flow control : none
3.4 Connecting the Network
Connect ETHERNET1 of A3pci7512 to Ethernet HUB with which the personal computer that uses it as a host
computer with the Ethernet cable.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
7
4. Boot of "VxWorks for A3pci7512"
If “VxWorks for A3pci7512” is started, it will be displayed on a console as follows.
VxWorks System Boot
Copyright 1984-2002 Wind River Systems, Inc.
CPU: Advanet A3pci7512 : Tsi108 - MPC7447A
Version: VxWorks5.5.1
BSP version: 1.2/0
Creation date: May 31 2007, 19:09:51
If it is not displayed as mentioned above, please check settings of the terminal, and connecting of a cable assembly.
After being displayed as mentioned above, a count down of the auto booting is displayed as follows.
Press any key to stop auto-boot...
7
If a keystroke will not be performed by the time a count down is completed, a target is started according to the
description of the parameter set up now. When starting for the first time, press any key during a count down to change
boot parameters. If it carries out, the command prompt shown below is displayed.
[VxWorks Boot]:
To change boot parameters, please input c.
[VxWorks Boot]: c
The example of the booting parameters are shown below. Please input as “tsiG” for the boot device. Please change
other boot parameters according to the environment used.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
8
boot device : tsiG
unit number : 0
processor number : 0
host name : host
file name : vxworks
inet on ethernet (e) : 192.168.13.151
host inet (h) : 192.168.13.80
user (u) : a3pci7512
ftp password (pw) : 7512
flags (f) : 0x8
To boot VxWorks, please input @.
[VxWorks Boot] @
If it carries out, it is displayed as follows and VxWorks starts.
[VxWorks Boot]: @
Attached TCP/IP interface to tsiG0.
Warning: no netmask specified.
Attaching network interface lo0... done.
Loading... 1007856
Starting at 0x100000...
Target Name: vxTarget
Attached TCP/IP interface to tsiG unit 0
Attaching network interface lo0... done.
Loading symbol table from host:vxworks.sym ...done
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
9
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]] ]]]] ]]]]]]]]]] ]] ]]]] (R)
] ]]]]]]]]] ]]]]]] ]]]]]]]] ]] ]]]]
]] ]]]]]]] ]]]]]]]] ]]]]]] ] ]] ]]]]
]]] ]]]]] ] ]]] ] ]]]] ]]] ]]]]]]]]] ]]]] ]] ]]]] ]] ]]]]]
]]]] ]]] ]] ] ]]] ]] ]]]]] ]]]]]] ]] ]]]]]]] ]]]] ]] ]]]]
]]]]] ] ]]]] ]]]]] ]]]]]]]] ]]]] ]] ]]]] ]]]]]]] ]]]]
]]]]]] ]]]]] ]]]]]] ] ]]]]] ]]]] ]] ]]]] ]]]]]]]] ]]]]
]]]]]]] ]]]]] ] ]]]]]] ] ]]] ]]]] ]] ]]]] ]]]] ]]]] ]]]]
]]]]]]]] ]]]]] ]]] ]]]]]]] ] ]]]]]]] ]]]] ]]]] ]]]] ]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]] Development System
]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]] VxWorks version 5.5.1
]]]]]]]]]]]]]]]]]]]]]]]]]] KERNEL: WIND version 2.6
]]]]]]]]]]]]]]]]]]]]]]]]] Copyright Wind River Systems, Inc., 1984-2003
CPU: Advanet A3pci7512 : Tsi108 - MPC7447A. Processor #0.
Memory Size: 0x20000000. BSP version 1.2/0.
WDB Comm Type: WDB_COMM_END
WDB: Ready.
->
<< Remarks >>
The inputted boot parameters are saved to the NVRAM of the A3pci7512. Therefore, you don
t have to input
anything when power-on, if you use the same boot parameters that are used previous boot.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
10
5. Using a file system
In this chapter, the file system of this BSP is explained.
This BSP supports the MS-DOS file system for the miniSD card.
5.1 File system related command
In this chapter, the file system related commands are explained.
5.1.1 Mount
Format sdMount
Function Mount the miniSD card as "/ata0/".
5.1.2 Move of directry
Format cd "path"
Function Change the current directory to the directory specified by "path".
5.1.3 Indication of current directory
Format pwd
Function Print the current directory
5.1.4 Show the Contents of directory
Format ll "path"
Function Display the list of the directory specified by "path". When the "path" is omitted,
the description of a current directory is displayed.
5.1.5 Creation of directory
Format mkdir "name"
Function Make the directory specified by "name".
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
11
5.1.6 Delete of directory
Format rmdir "name"
Function Remove the directory specified by "name".
5.1.7 Copy of file
Format copy "name1","name2"
Function Copy the file "name1" to file"name2".
5.1.8 Delete of file
Format rm "name"
Function Remove the file specified by "name".
5.2 Booting from miniSD card
In this BSP, you can boot from a miniSD card by writing VxWorks image file “vxWorks” in the miniSD card. How
to boot from a miniSD card is explained below.
Change of boot parameter
After resetting A3pci7512 , change the boot device parameter as follows.
ata=0,0
Input the kernel filename as “file name” parameter. For enabling to use Ethernet after boot, please set “tsiG”
as “other” parameter. The example boot parameters are shown below.
boot device : ata=0,0
unit number : 0
processor number : 0
host name : host
file name : /ata0/vxworks
inet on ethernet (e) : 192.168.13.151
host inet (h) : 192.168.13.80
user (u) : a3pci7512
ftp password (pw) : 7512
flags (f) : 0x8
other : tsiG
If @ command is inputted after setting up boot parameter as mentioned above, it will boot from the kernel file
written in the miniSD card.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
12
6. Programming information
6.1 Real time clock
A3pci7512 has the real time clock to which the battery is backed up.This BSP file system allows the real-time
clock to be updated with the date and time when file updating (time stamp) takes place.
This section explains the APIs perform setups of RTC and acquisition.
6.1.1 Setups of a time-of-day
Format void RTCPutTime(struct tm *rtc)
Function The time-of-day data is set to the real-time clock on the A3pci7512.
Argument rtc Pointer to struct tm
Example
#include <vxWorks.h>
#include <time.h>
#include <timers.h>
#include <stdio.h>
.
.
.
struct tm rtc;
/* set as 14:19:00 on May31, 2007 */
rtc.tm_year = 107; /* The transit year from 1900 */
rtc.tm_mon = 4; /* The transit month from January 0-11 */
rtc.tm_mday = 30; /* The day of the month 1-31 */
rtc.tm_hour = 14; /* Lapsed time from twelve midnight 0-23 */
rtc.tm_min = 19; /* The transit minute form that time 0-59 */
rtc.tm_sec = 00; /* The transit second form that time 0-59 */
RTCPutTime(&rtc);
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
13
6.1.2 Get of a time-of-day
Format void RTCGetTime(struct tm *rtc)
Function The time-of-day data on the real-time clock on the A3pci7512 is acquired.
Argument rtc Pointer to struct tm
Example
#include <vxWorks.h>
#include <time.h>
#include <timers.h>
#include <stdio.h>
.
.
.
struct tm rtc;
time_t lt;
RTCGetTime(&rtc);
lt = mktime(&rtc);
printf("%s",ctime(&lt));
6.1.3 About system time
In this BSP, the present time is read from RTC when VxWorks booting, the system time of VxWorks would be
written.
For getting the system time of VxWorks from an application program, use time(), clock_gettime(), etc.
The example of use of clock_gettime() is shown below.
#include <vxworks.h>
#include <time.h>
#include <timers.h>
#include <stdio.h>
.
.
.
struct timespec tspec;
clock_gettime(CLOCK_REALTIME, &tspec); /* Acquisition of present time */
printf("%s",ctime(&tspec.tv_sec)); /* The display of present time */
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
14
6.2 Direct Memory Access
The host bridge, Tundra Tsi108 that is used in the A3pci7512, has four channels of DMA controller. This DMA
controller can be used for the transfer data between main memory and PCI devices.
The device driver for the DMA controllers is included in this BSP, and it is possible to perform DMA in an easy procedure.
6.2.1 adDmaInit()
Function Initialize DMA controller.
Format STATUS adDmaInit();
Argument N/A
Return value OK
Description Since this API is performed by the BSP, it is not necessary to call it from an application
program.
6.2.2 adDmaStart()
Function Start DMA transfer.
The routine of the member in the struct AD_DMA_PARAM is called at the end DMA.
Format STATUS adDmaStart(struct AD_DMA_PARAM *param);
Argument param Pointer to AD_DMA_PARAM structure
struct AD_DMA_PARAM
{
int ch_num;
unsigned int src_adrs;
unsigned int dst_adrs;
unsigned int byte_count;
VOIDFUNCPT routine;
int arg;
};
ch_num : DMA Channel number (0 to 3)
src_adrs : Source address
dst_adrs : Destination address
byte_count : The number of transfer (1 to 0x10000000)
routine : The routine called at the end of DMA would be registered.
Please set up NULL, if you have nothing to do when end of DMA.
arg : Argument passed to routine
Return value OK : DMA is started.
ERROR : DMA Channel is in use or a parameter error
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
15
Description The registered routine is called with an interrupt level.
The AD_DMA_PARAM structure is defined in adDma.h.
Example The example which carries out a 0x1000000(16MB) direct memory access transfer from
a main memory to a PCI space is shown below.
SEM_ID dmaSem;
void dma_isr(int arg)
{ /* Notify DMA completion */
semGive(dmaSem);
}
int dmaSample()
{
int pciBus,pciDevice,pciFunc;
struct AD_DMA_PARAM param;
UCHAR *src,*dst;
STATUS status;
int i,;
unsigned int adrs = 0x81000000;
dmaSem = semBCreate(SEM_Q_FIFO,SEM_EMPTY);
param.ch_num = 0;
param.byte_count = 0x1000000;
param.src_adrs= (UINT32) cacheDmaMalloc( param.byte_count );
/*
* A preparation of a DMA transfer data
* /
param.routine = dma_isr;
adDmaStart( &param );
status = semTake( dmaSem,1000 );
if( status != OK ) {
printf("Dma Timed out \n");
}
else {
printf("DMA OK. \n");
}
cacheDmaFree( param.src_adrs );
}
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
16
6.2.3 adChainDmaStart()
Function Start Chaining DMA transfer
The routine of the member in the struct AD_DMA_PARAM is called at the end DMA.
Format STATUS adChainDmaStart(struct AD_CHAIN_DMA_PARAM *param);
Argument param Pointer to AD_CHAIN_DMA_PARAM structure
struct AD_CHAIN_DMA_PARAM
{
int ch_num;
struct AD_CHAIN_DATA *pChain;
VOIDFUNCPTR routine;
int arg;
};
ch_num : DMA Channel number (0 to 3)
pChain : Pointer to a AD_CHAIN_DMA_PARAM structure
routine : The routine called at the end of DMA would be registered.
Please set up NULL, if you have nothing to do when end of DMA.
arg : Argument passed to routine
struct AD_CHAIN_DATA
{
unsigned int byte_count;
unsigned int src_adrs;
unsigned int dst_adrs;
struct AD_CHAIN_DATA *next_ptr;
};
byte_count : The number of transfer data (1 to 0xffffff)
src_adrs : Source address
dst_adrs : Destination address
next_ptr : The pointer to the following AD_CHAIN_DMA_PARAM structure
NULL would be specified as an end-of-chain.
Return value OK : DMA is started.
ERROR : A DMA Channel is in use or a parameter error
Remarks The registered routine is called with an interrupt level.
The AD_CHAIN_DMA_PARAM structure and AD_CHAIN_DATA structure is de
fined in adDma.h.
The number of transfer data which can be specified by one chain block is 1 to 0xffffff.
When you start a DMA transfer, please be sure to specify an end-of-chain
(next_ptr =NULL).
The number of blocks which can carry out a chain is up to 16.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
17
Example The example, which carries out the chaining of DMA transfer from main memory to the
PCI space by 3 blocks, and performs, it is shown below.
#include "adDma.h"
SEM_ID dmaSem;
void dma_isr(int arg)
{ /* Notify DMA completion */
semGive(dmaSem);
}
void dmaChain_sample()
{
STATUS status;
structAD_CHAIN_DMA_PARAM param;
struct AD_CHAIN_DATA cdata[3];
unsigned int pciAdrs0 = 0x81000000;
unsigned int pciAdrs1 = 0x88000000;
unsigned int pciAdrs2;= 0xa0000000;
dmaSem = semBCreate(SEM_Q_FIFO, SEM_EMPTY);
cdata[0].byte_count = 0x10000;
cdata[0].src_adrs = (unsigned int)cacheDmaMalloc(cdata[0].byte_count);
cdata[0].dst_adrs = pciAdrs0;
cdata[0].next_ptr = &cdata[1];
cdata[1].byte_count = 0x20000;
cdata[1].src_adrs =(unsigned int)cacheDmaMalloc(cdata[1].byte_count);
cdata[1].dst_adrs = pciAdrs1
cdata[1].next_ptr = &cdata[2];
cdata[2].byte_count = 0x8000;
cdata[2].src_adrs = (unsigned int)cacheDmaMalloc(cdata[2].byte_count);
cdata[2].dst_adrs = pciAdrs3;
cdata[2].next_ptr = NULL;
param.ch_num = 1;
param.pChain = cdata;
param.routine = dma_isr;
param.arg = 1;
/*
* A preparation of a DMA transfer data
* /
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
18
status = adChainDmaStart(&param); /* Start DMA */
status = semTake(dmaSem, 1000);
if( status != OK ) {
printf("Dma Timed out \n");
}
else {
printf("DMA OK. \n");
}
cacheDmaFree( cdata[0].src_adrs );
cacheDmaFree( cdata[1].src_adrs );
cacheDmaFree( cdata[2].src_adrs );
}
6.2.4 adDmaStop()
Function Stop DMA transfer
Format STATUS adDmaStop(int ch_num);
Argument ch_num DMA channel number (0 to 3)
Return value OK : DMA stopped.
ERROR : DMA has already stopped.
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
19
7. About PCI bus
In this BSP, the configuration of PCI device is automatically performed at the time of booting. Therefore, you don t
need to set up the PCI configuration of the device to be used. However, in order to use it by special setups, you can
also access to PCI configuration space directly.
7.1 For PCI configurations API
In this BSP, the supported functions for PCI configurations are listed below.
pciFindDevice() It searches for the specified device
pciFindClass() It searches for the specified class
pciDevConfig() The configuration of the specified device is performed
pciConfigInByte() Byte reading of PCI configuration space
pciConfigInWord() Word reading of PCI configuration space
pciConfigInLong() Long word reading of PCI configuration space
pciConfigOutByte() Byte Writing of PCI configuration space
pciConfigOutWord() Word Writing of PCI configuration space
pciConfigOutLong() Long Word Writing of PCI configuration space
pciConfigModifyByte() Reading by the byte of PCI configuration space,a modification, a writing
pciConfigModifyWord() Reading by the word of PCI configuration space,a modification, a writing
pciConfigModifyLong() Reading by the long word of PCI configuration space,a modification, a writing
When you use such APIs, please include the following header files.
pciConfigLib.h
<A3pci7512><A3pci7512>
<A3pci7512><A3pci7512>
<A3pci7512>
20
7.2 PCI configurations APIs
7.2.1 pciFindDevice()
Function It searches for the specified device. Look for the device to which specified device ID and
vender ID is corresponding.
When the congruous devices are found, a bus number, a device number, and a function
number are stored in pBusNo, pDeviceNo, and pFuncNo, respectively.
Format STATUS PCIFindDevice(int vendorId, int deviceId, int index,
int *pBusNo, int *pDeviceNo, int *pFuncNo)
Argument vendorId Vendor ID
deviceId Device ID
index It specifies the device of what position is found.
When 0 is specified, the intelligence on the device found first is acquired.
pBusNo The pointer to the variables in which a bus number is stored.
pDeviceNo The pointer to the variables in which a device number is stored.
pFuncNo The pointer to the variables in which a function number is stored.
Return value OK : The specified device was found.
ERROR : The specified device was not found.
Example
#define VENDORID_ADVANET 0x130f
#define DEVICEID_A3PCI1527 0x0050
int ret;
int busNo,deviceNo,funcNo;
ret = pciFindDevice(VENDORID_ADVANET,DEVICEID_A3PCI1527,
0,&busNo,&deviceNo,&funcNo );
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34

Eurotech A3pci7512 Owner's manual

Type
Owner's manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI