This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PCI Issue


Hello Friends,

I am working on PCI bus. My target board is i386 PC
motherboard; I want to write a PCI scan code for it,
which should gives me all the details about the card
inserted into the PCI slot. 

Information like:

1) Type of card (Serial, parallel, Ethernet etc.)
2) Found in which PCI bus
3) Found in which PCI slot number
4) Number of functions in the card
5) Number of ports in the card of same function
6) Base address of all the ports

I tried with pci1.c example. It gives me all the
details from 1 to 4, but I am unable to understand
where from I can get the information 5 and 6?

I have 2 Serial PCI cards: 1 has 2 serial ports and
another has 4 Serial ports.
When I scan PCI bus I get these information:

For 2 port serial PCI card:
=====================================================================
 device ID = 0x10800
 bus = 0x01, devfn = 0x08, dev = 0x01, fn = 0x00
 Note that board is active. Probed sizes and CPU
addresses invalid!
 num_bars  = 1, 0x01:
 Vendor    0x1409 [Enter Media][eTIMedia Technology Co
Ltd]
 Device    0x7168 [SUN1889][High-Speed RS-232 Standard
Serial-Interface.]
 Command   0x0081, Status 0x0280
 Class/Rev 0x07000201 [Simple Communications
Controller][Serial][16550 Compatible]
 Header 0x00
 SubVendor 0x1409, Sub ID 0x4037
 BAR[0]    0x0000c001 / probed size 0x00000000 / CPU
addr 0x0000c000
 BAR[1]    0x00000000 / probed size 0x00000000 / CPU
addr 0xaaaaaaaa
 BAR[2]    0x00000000 / probed size 0xaaaaaaaa / CPU
addr 0xaaaaaaaa
 BAR[3]    0x00000000 / probed size 0xaaaaaaaa / CPU
addr 0xaaaaaaaa
 BAR[4]    0x00000000 / probed size 0xaaaaaaaa / CPU
addr 0xaaaaaaaa
 BAR[5]    0x00000000 / probed size 0xaaaaaaaa / CPU
addr 0xaaaaaaaa
=====================================================================

For 4 port serial PCI card:
=====================================================================
 device ID = 0x11000
 bus = 0x01, devfn = 0x10, dev = 0x02, fn = 0x00
 Note that board is active. Probed sizes and CPU
addresses invalid!
 num_bars  = 2, 0x02:
 Vendor    0x1409 [Enter Media][eTIMedia Technology Co
Ltd]
 Device    0x7168 [SUN1889][High-Speed RS-232 Standard
Serial-Interface.]
 Command   0x0081, Status 0x0280
 Class/Rev 0x07000201 [Simple Communications
Controller][Serial][16550 Compatible]
 Header 0x00
 SubVendor 0x1409, Sub ID 0x4056
 BAR[0]    0x0000c401 / probed size 0x00000000 / CPU
addr 0x0000c400
 BAR[1]    0x0000c801 / probed size 0x00000000 / CPU
addr 0x0000c800
 BAR[2]    0x00000000 / probed size 0x00000000 / CPU
addr 0xaaaaaaaa
 BAR[3]    0x00000000 / probed size 0xaaaaaaaa / CPU
addr 0xaaaaaaaa
 BAR[4]    0x00000000 / probed size 0xaaaaaaaa / CPU
addr 0xaaaaaaaa
 BAR[5]    0x00000000 / probed size 0xaaaaaaaa / CPU
addr 0xaaaaaaaa
=====================================================================

>From the above information I am able to get
information from 1 to 4, but not able to get
information 5 and 6. I want to retrieve how many ports
are present in the PCI card and what are base
addresses of each port?

**Can anybody suggest me how can I get these
information?

I am able to access 1st port of 2 port serial PCI card
after considering:
BAR[0]    0x0000c001 / probed size 0x00000000 / CPU
addr 0x0000c000
CPU addr 0x0000c000 as a base address of 1st port. 

While this card has 2 port so where is next serial
port (2nd COM port) is mapped? What is the base
address of 2nd port?

When I look into 4 ports serial card scan info then I
am able to access port number 1st and 3rd by
considering :
BAR[0]    0x0000c401 / probed size 0x00000000 / CPU
addr 0x0000c400
BAR[1]    0x0000c801 / probed size 0x00000000 / CPU
addr 0x0000c800

CPU addr 0x0000c400 as a base address of 1st port. 
CPU addr 0x0000c800 as a base address of 3rd port. 
(Port numbers are labeled on the PCI card.)

So here also I am unable to get total number of ports
and base address of each port of the card. I get 1st
and 3rd port base address but where are the 2nd and
4th ports are mapped?

After observation I found that 1st port of each PCI
card is mapped after each 0x400 bytes (i.e. 1024
bytes) interval. While in case of 4 port serial PCI
card there is 0x800 (i.e. 2048) bytes are allocated.
In each 1024 bytes space there are 2 ports mapped. At
the starting of each 1024 block I got one port base
address and I am able to access those ports
successfully, but unable to detect base address of
reaming ports. 

I tried to get next (2nd) port on locations:
0x0000c408  =  0x0000c400 + 0x08; 
0x0000c410  =  0x0000c400 + 0x10;
0x0000c500  =  0x0000c400 + 0x100;
0x0000c600  =  0x0000c400 + 0x200;

It was just hit and trial way but I didn?t found any
port base on these location.

**Please if anybody can help me on this issue then it
will be a great help.

Thank You 
-Anupam




		
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]