pci_attach_device() problems with Acromag card

I cannot seem to get the pci_attach_device() call to work with one
particular card I have, with class 06 (the gateway class, although
this is not a gateway, but a simple IP carrier card.) It works with
other cards, and I am beginning to think this is a library problem, or
my understanding of the library.

I wrote some code to do the pci_attach_device() call and map memory,
printing out diagnostic stuff. Below is the code, and the output for
each card. Note that for both the ATI card and the Acromag cards the
configuration registers have PCI address assigned as they should, But,
for the Acromag card only the info structure has 0’s for the
addresses.

Does this have something to do with the class being 06, maybe?

******************* The core of the code is:

/*

  • Look up Display Controller, Acromag APC8620 IP Carrier
    Board
    */

info.VendorId = 0x1002; /* Try ATI board /
info.DeviceId = 0x4742;
//info.VendorId = 0x10b5; /
Acromag /
//info.DeviceId = 0x1024; /
APC8620 */

/*

  • Do pci_attach_device() to find device, and create handle
    */

hdl = pci_attach_device(NULL, PCI_SEARCH_VENDEV | PCI_SHARE |
PCI_INIT_ALL, pidx, &info);

if (hdl == NULL) {
fprintf(stderr, “First pci_attach_device()
failed.\n”);
exit(1);
}
printf(“pci_attach_device() succeeded. Info:\n”);

/*

  • Print info
    */

pcishow(info);

printf(“Binary printout of info:\n”);
phex((char ) &info, sizeof(info));


/

  • Read and print config space
    */

if (pci_read_config(hdl, 0, 64, 1, buff) != PCI_SUCCESS) {
printf(“pci_read_config() failed.\n”);
pci_detach_device(hdl);
exit(1);
}
printf(“Big-Endian Config. space, as shown in manuals:\n”);

pciconfigshow((uint32_t *) buff, 16);


*****************Here is the output for vendor and device IDs for ATI
graphics card (first list), and Acromag APC8620 (second):

\

card yields:

Running acrotest with vendor and device ids for ATI graphics

card yields:

pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 1 Class code = 0x00030000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x1002) ATI Technologies
Device id = (0x4742)
Aperture 0: CPU Base 0x000d4000000 PCI Base 0x000d4000000 Length
16777216 bytes Type MEM
Aperture 1: CPU Base 0x0000000c000 PCI Base 0x0000000c001 Length
256 bytes Type IO
Aperture 2: CPU Base 0x000d6000000 PCI Base 0x000d6000000 Length
4096 bytes Type MEM
Binary printout of info:
42 47 02 10 00 00 00 00 01 00 0c 00 00 00 00 00 00 00 03 00
0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
00 00 00 00 01 c0 00 00 00 00 00 00 00 00 00 d6 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 d4 00 00 00 00 01 c0 00 00 00 00 00 00
00 00 00 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
47 42 10 02 02 90 00 87 03 00 00 5c 00 00 20 08 d4 00 00 00
00 00 c0 01 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 47 42 10 02 00 00 00 00 00 00 00 50 00 00 00 00
00 08 01 0b
Mapping first area at 0x00000000d4000000 of 16777216 bytes into
process space.
mmap_device_memory() success! Processor address = 0x00000000

Running acrotest with vendor and device ids for Acromag

card yields:



pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 2 Class code = 0x00068000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x10b5) PLX Technology
Device id = (0x1024) Unknown Device
Binary printout of info:
24 10 b5 10 00 00 00 00 02 38 01 00 00 00 00 00 00 80 06 00
ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
10 24 10 b5 02 80 00 03 06 80 00 01 00 00 00 08 d9 00 10 00
00 00 d0 01 d9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 10 24 10 b5 00 00 00 00 00 00 00 00 00 00 00 00
00 00 01 05
Mapping first area at 0x0000000000000000 of 0 bytes into process
space.
mmap_device_memory() success! Processor address = 0x00000000

\

===================
John H. Zouck
jzouck@charm.net

Some additional information:

The Acromag card (the problem card) is supposed to have 1024 bytes of
memory PCI space. The output shows none is mapped.

I did not show the code that does the printout (phex() and
pciconfigshow()), and will include if needed. phex() simly prints n bytes
in hex. pciconfigshow() prints the confiuration register contents
big-endian.

Here is the output of the pci -vv command for the Acromag card, which
shows no mappable PCI memory space, although Acromag says there is
supposed to be 1024 bytes (maybe there really isn’t…):


Class = Bridge (Unknown)
Vendor ID = 10b5h, PLX Technology
Device ID = 1024h, Unknown Unknown
PCI index = 0h
Class Codes = 068000h
Revision ID = 1h
Bus number = 2
Device number = 7
Function num = 0
Status Reg = 280h
Command Reg = 3h
I/O space access enabled
Memory space access enabled
Bus Master disabled
Special Cycle opertations ignored
Memory Write and Invalidate disabled
Palette Snooping disabled
Parity Checking disabled
Data/Address stepping disabled
SERR# driver disabled
Fast back-to-back transactions to different agents disabled
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 8h un-cacheable
Subsystem Vendor ID = 10b5h
Subsystem ID = 1024h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 5
Device Dependent Registers:
0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

John Zouck wrote:

I cannot seem to get the pci_attach_device() call to work with one
particular card I have, with class 06 (the gateway class, although
this is not a gateway, but a simple IP carrier card.) It works with
other cards, and I am beginning to think this is a library problem, or
my understanding of the library.

I wrote some code to do the pci_attach_device() call and map memory,
printing out diagnostic stuff. Below is the code, and the output for
each card. Note that for both the ATI card and the Acromag cards the
configuration registers have PCI address assigned as they should, But,
for the Acromag card only the info structure has 0’s for the
addresses.

Does this have something to do with the class being 06, maybe?
.
******************* The core of the code is:

/*

  • Look up Display Controller, Acromag APC8620 IP Carrier
    Board
    */

info.VendorId = 0x1002; /* Try ATI board /
info.DeviceId = 0x4742;
//info.VendorId = 0x10b5; /
Acromag /
//info.DeviceId = 0x1024; /
APC8620 */

/*

  • Do pci_attach_device() to find device, and create handle
    */

hdl = pci_attach_device(NULL, PCI_SEARCH_VENDEV | PCI_SHARE |
PCI_INIT_ALL, pidx, &info);

if (hdl == NULL) {
fprintf(stderr, “First pci_attach_device()
failed.\n”);
exit(1);
}
printf(“pci_attach_device() succeeded. Info:\n”);

/*

  • Print info
    */

pcishow(info);

printf(“Binary printout of info:\n”);
phex((char *) &info, sizeof(info));

/*

  • Read and print config space
    */

if (pci_read_config(hdl, 0, 64, 1, buff) != PCI_SUCCESS) {
printf(“pci_read_config() failed.\n”);
pci_detach_device(hdl);
exit(1);
}
printf(“Big-Endian Config. space, as shown in manuals:\n”);

pciconfigshow((uint32_t *) buff, 16);

*****************Here is the output for vendor and device IDs for ATI
graphics card (first list), and Acromag APC8620 (second):

card yields:

Running acrotest with vendor and device ids for ATI graphics

card yields:

pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 1 Class code = 0x00030000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x1002) ATI Technologies
Device id = (0x4742)
Aperture 0: CPU Base 0x000d4000000 PCI Base 0x000d4000000 Length
16777216 bytes Type MEM
Aperture 1: CPU Base 0x0000000c000 PCI Base 0x0000000c001 Length
256 bytes Type IO
Aperture 2: CPU Base 0x000d6000000 PCI Base 0x000d6000000 Length
4096 bytes Type MEM
Binary printout of info:
42 47 02 10 00 00 00 00 01 00 0c 00 00 00 00 00 00 00 03 00
0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
00 00 00 00 01 c0 00 00 00 00 00 00 00 00 00 d6 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 d4 00 00 00 00 01 c0 00 00 00 00 00 00
00 00 00 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
47 42 10 02 02 90 00 87 03 00 00 5c 00 00 20 08 d4 00 00 00
00 00 c0 01 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 47 42 10 02 00 00 00 00 00 00 00 50 00 00 00 00
00 08 01 0b
Mapping first area at 0x00000000d4000000 of 16777216 bytes into
process space.
mmap_device_memory() success! Processor address = 0x00000000

Running acrotest with vendor and device ids for Acromag

card yields:

pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 2 Class code = 0x00068000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x10b5) PLX Technology
Device id = (0x1024) Unknown Device
Binary printout of info:
24 10 b5 10 00 00 00 00 02 38 01 00 00 00 00 00 00 80 06 00
ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
10 24 10 b5 02 80 00 03 06 80 00 01 00 00 00 08 d9 00 10 00
00 00 d0 01 d9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 10 24 10 b5 00 00 00 00 00 00 00 00 00 00 00 00
00 00 01 05
Mapping first area at 0x0000000000000000 of 0 bytes into process
space.
mmap_device_memory() success! Processor address = 0x00000000

John H. Zouck
jzouck@charm.net

John H. Zouck
jzouck@charm.net

Previously, John Zouck wrote in qdn.public.qnxrtp.os:

I cannot seem to get the pci_attach_device() call to work with one
particular card I have, with class 06 (the gateway class, although
this is not a gateway, but a simple IP carrier card.) It works with
other cards, and I am beginning to think this is a library problem, or
my understanding of the library.

I wrote some code to do the pci_attach_device() call and map memory,
printing out diagnostic stuff. Below is the code, and the output for
each card. Note that for both the ATI card and the Acromag cards the
configuration registers have PCI address assigned as they should, But,
for the Acromag card only the info structure has 0’s for the
addresses.

Does this have something to do with the class being 06, maybe?
.

The pci server assumes that bridges have been setup by the bios and does
not change any values. The reason for this being that there are so many
different bridges out there, that it is extremely difficult to support
every known type of bridge.


******************* The core of the code is:

/*

  • Look up Display Controller, Acromag APC8620 IP Carrier
    Board
    */

info.VendorId = 0x1002; /* Try ATI board /
info.DeviceId = 0x4742;
//info.VendorId = 0x10b5; /
Acromag /
//info.DeviceId = 0x1024; /
APC8620 */

/*

  • Do pci_attach_device() to find device, and create handle
    */

hdl = pci_attach_device(NULL, PCI_SEARCH_VENDEV | PCI_SHARE |
PCI_INIT_ALL, pidx, &info);

if (hdl == NULL) {
fprintf(stderr, “First pci_attach_device()
failed.\n”);
exit(1);
}
printf(“pci_attach_device() succeeded. Info:\n”);

/*

  • Print info
    */

pcishow(info);

printf(“Binary printout of info:\n”);
phex((char ) &info, sizeof(info));


/

  • Read and print config space
    */

if (pci_read_config(hdl, 0, 64, 1, buff) != PCI_SUCCESS) {
printf(“pci_read_config() failed.\n”);
pci_detach_device(hdl);
exit(1);
}
printf(“Big-Endian Config. space, as shown in manuals:\n”);

pciconfigshow((uint32_t *) buff, 16);


*****************Here is the output for vendor and device IDs for ATI
graphics card (first list), and Acromag APC8620 (second):

\

card yields:

Running acrotest with vendor and device ids for ATI graphics

card yields:

pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 1 Class code = 0x00030000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x1002) ATI Technologies
Device id = (0x4742)
Aperture 0: CPU Base 0x000d4000000 PCI Base 0x000d4000000 Length
16777216 bytes Type MEM
Aperture 1: CPU Base 0x0000000c000 PCI Base 0x0000000c001 Length
256 bytes Type IO
Aperture 2: CPU Base 0x000d6000000 PCI Base 0x000d6000000 Length
4096 bytes Type MEM
Binary printout of info:
42 47 02 10 00 00 00 00 01 00 0c 00 00 00 00 00 00 00 03 00
0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
00 00 00 00 01 c0 00 00 00 00 00 00 00 00 00 d6 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 d4 00 00 00 00 01 c0 00 00 00 00 00 00
00 00 00 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
47 42 10 02 02 90 00 87 03 00 00 5c 00 00 20 08 d4 00 00 00
00 00 c0 01 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 47 42 10 02 00 00 00 00 00 00 00 50 00 00 00 00
00 08 01 0b
Mapping first area at 0x00000000d4000000 of 16777216 bytes into
process space.
mmap_device_memory() success! Processor address = 0x00000000

Running acrotest with vendor and device ids for Acromag

card yields:



pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 2 Class code = 0x00068000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x10b5) PLX Technology
Device id = (0x1024) Unknown Device
Binary printout of info:
24 10 b5 10 00 00 00 00 02 38 01 00 00 00 00 00 00 80 06 00
ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
10 24 10 b5 02 80 00 03 06 80 00 01 00 00 00 08 d9 00 10 00
00 00 d0 01 d9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 10 24 10 b5 00 00 00 00 00 00 00 00 00 00 00 00
00 00 01 05
Mapping first area at 0x0000000000000000 of 0 bytes into process
space.
mmap_device_memory() success! Processor address = 0x00000000

\

===================
John H. Zouck
jzouck@charm.net

\

Hugh Brown (613) 591-0931 ext. 209 (voice)
QNX Software Systems Ltd. (613) 591-3579 (fax)
175 Terence Matthews Cres. email: hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8

Hugh,

Thanks for the fast reply. Just to be sure before I call the card vendor
(Acromag), the pci server keys on class = 6 (only) and does no further card
setup. To use this card I need to get the card manufacturer to change the
class he uses from 6 to something else. My guess for the class would be
something like 0x11, which the PCI architecture (version 2.2) calls “Data
acquisition and digital signal processing”, or 0xff, which is everything
not fitting a defined class.

Would the pci server set up things on the card if I used either 0x11 or
0xff?

Thanks again for the help.

Hugh Brown wrote:

Previously, John Zouck wrote in qdn.public.qnxrtp.os:
I cannot seem to get the pci_attach_device() call to work with one
particular card I have, with class 06 (the gateway class, although
this is not a gateway, but a simple IP carrier card.) It works with
other cards, and I am beginning to think this is a library problem, or
my understanding of the library.

I wrote some code to do the pci_attach_device() call and map memory,
printing out diagnostic stuff. Below is the code, and the output for
each card. Note that for both the ATI card and the Acromag cards the
configuration registers have PCI address assigned as they should, But,
for the Acromag card only the info structure has 0’s for the
addresses.

Does this have something to do with the class being 06, maybe?
.

The pci server assumes that bridges have been setup by the bios and does
not change any values. The reason for this being that there are so many
different bridges out there, that it is extremely difficult to support
every known type of bridge.

******************* The core of the code is:

/*

  • Look up Display Controller, Acromag APC8620 IP Carrier
    Board
    */

info.VendorId = 0x1002; /* Try ATI board /
info.DeviceId = 0x4742;
//info.VendorId = 0x10b5; /
Acromag /
//info.DeviceId = 0x1024; /
APC8620 */

/*

  • Do pci_attach_device() to find device, and create handle
    */

hdl = pci_attach_device(NULL, PCI_SEARCH_VENDEV | PCI_SHARE |
PCI_INIT_ALL, pidx, &info);

if (hdl == NULL) {
fprintf(stderr, “First pci_attach_device()
failed.\n”);
exit(1);
}
printf(“pci_attach_device() succeeded. Info:\n”);

/*

  • Print info
    */

pcishow(info);

printf(“Binary printout of info:\n”);
phex((char ) &info, sizeof(info));


/

  • Read and print config space
    */

if (pci_read_config(hdl, 0, 64, 1, buff) != PCI_SUCCESS) {
printf(“pci_read_config() failed.\n”);
pci_detach_device(hdl);
exit(1);
}
printf(“Big-Endian Config. space, as shown in manuals:\n”);

pciconfigshow((uint32_t *) buff, 16);


*****************Here is the output for vendor and device IDs for ATI
graphics card (first list), and Acromag APC8620 (second):

\

card yields:

Running acrotest with vendor and device ids for ATI graphics

card yields:

pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 1 Class code = 0x00030000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x1002) ATI Technologies
Device id = (0x4742)
Aperture 0: CPU Base 0x000d4000000 PCI Base 0x000d4000000 Length
16777216 bytes Type MEM
Aperture 1: CPU Base 0x0000000c000 PCI Base 0x0000000c001 Length
256 bytes Type IO
Aperture 2: CPU Base 0x000d6000000 PCI Base 0x000d6000000 Length
4096 bytes Type MEM
Binary printout of info:
42 47 02 10 00 00 00 00 01 00 0c 00 00 00 00 00 00 00 03 00
0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
00 00 00 00 01 c0 00 00 00 00 00 00 00 00 00 d6 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 d4 00 00 00 00 01 c0 00 00 00 00 00 00
00 00 00 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
47 42 10 02 02 90 00 87 03 00 00 5c 00 00 20 08 d4 00 00 00
00 00 c0 01 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 47 42 10 02 00 00 00 00 00 00 00 50 00 00 00 00
00 08 01 0b
Mapping first area at 0x00000000d4000000 of 16777216 bytes into
process space.
mmap_device_memory() success! Processor address = 0x00000000

Running acrotest with vendor and device ids for Acromag

card yields:



pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 2 Class code = 0x00068000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x10b5) PLX Technology
Device id = (0x1024) Unknown Device
Binary printout of info:
24 10 b5 10 00 00 00 00 02 38 01 00 00 00 00 00 00 80 06 00
ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
10 24 10 b5 02 80 00 03 06 80 00 01 00 00 00 08 d9 00 10 00
00 00 d0 01 d9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 10 24 10 b5 00 00 00 00 00 00 00 00 00 00 00 00
00 00 01 05
Mapping first area at 0x0000000000000000 of 0 bytes into process
space.
mmap_device_memory() success! Processor address = 0x00000000

\

===================
John H. Zouck
jzouck@charm.net




\

Hugh Brown (613) 591-0931 ext. 209 (voice)
QNX Software Systems Ltd. (613) 591-3579 (fax)
175 Terence Matthews Cres. email: > hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8

John H. Zouck
The Johns Hopkins University
Applied Physics Laboratory

Hugh,

Reading your reply again, you said the server does not change anything, but
looking at the config registers they are set up with a PCI address.
Shouldn’t the pci_attach_device() function still fill out the info
structure with addresses and lengths?

Hugh Brown wrote:

Previously, John Zouck wrote in qdn.public.qnxrtp.os:
I cannot seem to get the pci_attach_device() call to work with one
particular card I have, with class 06 (the gateway class, although
this is not a gateway, but a simple IP carrier card.) It works with
other cards, and I am beginning to think this is a library problem, or
my understanding of the library.

I wrote some code to do the pci_attach_device() call and map memory,
printing out diagnostic stuff. Below is the code, and the output for
each card. Note that for both the ATI card and the Acromag cards the
configuration registers have PCI address assigned as they should, But,
for the Acromag card only the info structure has 0’s for the
addresses.

Does this have something to do with the class being 06, maybe?
.

The pci server assumes that bridges have been setup by the bios and does
not change any values. The reason for this being that there are so many
different bridges out there, that it is extremely difficult to support
every known type of bridge.

******************* The core of the code is:

/*

  • Look up Display Controller, Acromag APC8620 IP Carrier
    Board
    */

info.VendorId = 0x1002; /* Try ATI board /
info.DeviceId = 0x4742;
//info.VendorId = 0x10b5; /
Acromag /
//info.DeviceId = 0x1024; /
APC8620 */

/*

  • Do pci_attach_device() to find device, and create handle
    */

hdl = pci_attach_device(NULL, PCI_SEARCH_VENDEV | PCI_SHARE |
PCI_INIT_ALL, pidx, &info);

if (hdl == NULL) {
fprintf(stderr, “First pci_attach_device()
failed.\n”);
exit(1);
}
printf(“pci_attach_device() succeeded. Info:\n”);

/*

  • Print info
    */

pcishow(info);

printf(“Binary printout of info:\n”);
phex((char ) &info, sizeof(info));


/

  • Read and print config space
    */

if (pci_read_config(hdl, 0, 64, 1, buff) != PCI_SUCCESS) {
printf(“pci_read_config() failed.\n”);
pci_detach_device(hdl);
exit(1);
}
printf(“Big-Endian Config. space, as shown in manuals:\n”);

pciconfigshow((uint32_t *) buff, 16);


*****************Here is the output for vendor and device IDs for ATI
graphics card (first list), and Acromag APC8620 (second):

\

card yields:

Running acrotest with vendor and device ids for ATI graphics

card yields:

pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 1 Class code = 0x00030000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x1002) ATI Technologies
Device id = (0x4742)
Aperture 0: CPU Base 0x000d4000000 PCI Base 0x000d4000000 Length
16777216 bytes Type MEM
Aperture 1: CPU Base 0x0000000c000 PCI Base 0x0000000c001 Length
256 bytes Type IO
Aperture 2: CPU Base 0x000d6000000 PCI Base 0x000d6000000 Length
4096 bytes Type MEM
Binary printout of info:
42 47 02 10 00 00 00 00 01 00 0c 00 00 00 00 00 00 00 03 00
0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
00 00 00 00 01 c0 00 00 00 00 00 00 00 00 00 d6 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 d4 00 00 00 00 01 c0 00 00 00 00 00 00
00 00 00 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
47 42 10 02 02 90 00 87 03 00 00 5c 00 00 20 08 d4 00 00 00
00 00 c0 01 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 47 42 10 02 00 00 00 00 00 00 00 50 00 00 00 00
00 08 01 0b
Mapping first area at 0x00000000d4000000 of 16777216 bytes into
process space.
mmap_device_memory() success! Processor address = 0x00000000

Running acrotest with vendor and device ids for Acromag

card yields:



pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 2 Class code = 0x00068000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x10b5) PLX Technology
Device id = (0x1024) Unknown Device
Binary printout of info:
24 10 b5 10 00 00 00 00 02 38 01 00 00 00 00 00 00 80 06 00
ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
10 24 10 b5 02 80 00 03 06 80 00 01 00 00 00 08 d9 00 10 00
00 00 d0 01 d9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 10 24 10 b5 00 00 00 00 00 00 00 00 00 00 00 00
00 00 01 05
Mapping first area at 0x0000000000000000 of 0 bytes into process
space.
mmap_device_memory() success! Processor address = 0x00000000

\

===================
John H. Zouck
jzouck@charm.net




\

Hugh Brown (613) 591-0931 ext. 209 (voice)
QNX Software Systems Ltd. (613) 591-3579 (fax)
175 Terence Matthews Cres. email: > hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8

John H. Zouck
The Johns Hopkins University
Applied Physics Laboratory

Previously, John H. Zouck wrote in qdn.public.qnxrtp.os:

Hugh,

Reading your reply again, you said the server does not change anything, but
looking at the config registers they are set up with a PCI address.
Shouldn’t the pci_attach_device() function still fill out the info
structure with addresses and lengths?

The pci server is currently only checking the device type, where it should
be checking the header type as well.

Hugh Brown wrote:

Previously, John Zouck wrote in qdn.public.qnxrtp.os:
I cannot seem to get the pci_attach_device() call to work with one
particular card I have, with class 06 (the gateway class, although
this is not a gateway, but a simple IP carrier card.) It works with
other cards, and I am beginning to think this is a library problem, or
my understanding of the library.

I wrote some code to do the pci_attach_device() call and map memory,
printing out diagnostic stuff. Below is the code, and the output for
each card. Note that for both the ATI card and the Acromag cards the
configuration registers have PCI address assigned as they should, But,
for the Acromag card only the info structure has 0’s for the
addresses.

Does this have something to do with the class being 06, maybe?
.

The pci server assumes that bridges have been setup by the bios and does
not change any values. The reason for this being that there are so many
different bridges out there, that it is extremely difficult to support
every known type of bridge.

******************* The core of the code is:

/*

  • Look up Display Controller, Acromag APC8620 IP Carrier
    Board
    */

info.VendorId = 0x1002; /* Try ATI board /
info.DeviceId = 0x4742;
//info.VendorId = 0x10b5; /
Acromag /
//info.DeviceId = 0x1024; /
APC8620 */

/*

  • Do pci_attach_device() to find device, and create handle
    */

hdl = pci_attach_device(NULL, PCI_SEARCH_VENDEV | PCI_SHARE |
PCI_INIT_ALL, pidx, &info);

if (hdl == NULL) {
fprintf(stderr, “First pci_attach_device()
failed.\n”);
exit(1);
}
printf(“pci_attach_device() succeeded. Info:\n”);

/*

  • Print info
    */

pcishow(info);

printf(“Binary printout of info:\n”);
phex((char ) &info, sizeof(info));


/

  • Read and print config space
    */

if (pci_read_config(hdl, 0, 64, 1, buff) != PCI_SUCCESS) {
printf(“pci_read_config() failed.\n”);
pci_detach_device(hdl);
exit(1);
}
printf(“Big-Endian Config. space, as shown in manuals:\n”);

pciconfigshow((uint32_t *) buff, 16);


*****************Here is the output for vendor and device IDs for ATI
graphics card (first list), and Acromag APC8620 (second):

\

card yields:

Running acrotest with vendor and device ids for ATI graphics

card yields:

pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 1 Class code = 0x00030000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x1002) ATI Technologies
Device id = (0x4742)
Aperture 0: CPU Base 0x000d4000000 PCI Base 0x000d4000000 Length
16777216 bytes Type MEM
Aperture 1: CPU Base 0x0000000c000 PCI Base 0x0000000c001 Length
256 bytes Type IO
Aperture 2: CPU Base 0x000d6000000 PCI Base 0x000d6000000 Length
4096 bytes Type MEM
Binary printout of info:
42 47 02 10 00 00 00 00 01 00 0c 00 00 00 00 00 00 00 03 00
0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
00 00 00 00 01 c0 00 00 00 00 00 00 00 00 00 d6 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 d4 00 00 00 00 01 c0 00 00 00 00 00 00
00 00 00 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
47 42 10 02 02 90 00 87 03 00 00 5c 00 00 20 08 d4 00 00 00
00 00 c0 01 d6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 47 42 10 02 00 00 00 00 00 00 00 50 00 00 00 00
00 08 01 0b
Mapping first area at 0x00000000d4000000 of 16777216 bytes into
process space.
mmap_device_memory() success! Processor address = 0x00000000

Running acrotest with vendor and device ids for Acromag

card yields:



pci_attach() successful.
pci_attach_device() succeeded. Info:
Bus = 2 Class code = 0x00068000
CpuIoTranslation = 0x00000000000
CpuMemTranslation = 0x00000000000
CpuBmstrTranslation = 0x00000000000
Vendor id = (0x10b5) PLX Technology
Device id = (0x1024) Unknown Device
Binary printout of info:
24 10 b5 10 00 00 00 00 02 38 01 00 00 00 00 00 00 80 06 00
ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
Big-Endian Config. space, as shown in manuals:
10 24 10 b5 02 80 00 03 06 80 00 01 00 00 00 08 d9 00 10 00
00 00 d0 01 d9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 10 24 10 b5 00 00 00 00 00 00 00 00 00 00 00 00
00 00 01 05
Mapping first area at 0x0000000000000000 of 0 bytes into process
space.
mmap_device_memory() success! Processor address = 0x00000000

\

===================
John H. Zouck
jzouck@charm.net




\

============================
John H. Zouck
The Johns Hopkins University
Applied Physics Laboratory


\

Hugh Brown (613) 591-0931 ext. 209 (voice)
QNX Software Systems Ltd. (613) 591-3579 (fax)
175 Terence Matthews Cres. email: hsbrown@qnx.com
Kanata, Ontario, Canada.
K2M 1W8