Question on pci-configuration space - Linux

This is a discussion on Question on pci-configuration space - Linux ; Hi all, Iam working on pci application programming in linux I have Few questions If i have two pci Devices of same type and same vendor how can i Differentiate two devices? suppose the devices are memory based devices 0-1000address ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Question on pci-configuration space

  1. Question on pci-configuration space

    Hi all,
    Iam working on pci application programming in linux I have Few
    questions

    If i have two pci Devices of same type and same vendor
    how can i Differentiate two devices?
    suppose the devices are memory based devices 0-1000address deals 1st
    memory based device and 1000-2000 deals with 2nd device and same
    address lines going to the devices How can i differentiate these two
    devices with the configuration space? what are the things that differs
    in pci configuration space?

  2. Re: Question on pci-configuration space

    srblinux@gmail.com wrote:
    > Hi all,
    > Iam working on pci application programming in linux I have Few
    > questions
    >
    > If i have two pci Devices of same type and same vendor
    > how can i Differentiate two devices?
    > suppose the devices are memory based devices 0-1000address deals 1st
    > memory based device and 1000-2000 deals with 2nd device and same
    > address lines going to the devices How can i differentiate these two
    > devices with the configuration space? what are the things that differs
    > in pci configuration space?


    Sounds like you need to pick up a book on PCI. I find the Mindshare
    books on PCI System Architecture very readable and thorough.

    Configuration space uses the address bus to encode specific devices and
    functions. Each address in config space belongs to a specific card and
    function. Address 1000 does not give you all the info - it's address
    1000 of bus X, card Y, function Z. There is no ambiguity in
    configuration space.

    The device ID (16-bits) is used to differentiate between different cards
    by the same vendor.

    In Linux use lspci to see for yourself. If you have an Intel
    motherboard, almost all the chips will have vendor ID 0x8086 (Intel).

    Sometimes cards may use an off-the-shelf PCI interface that has it's own
    device and vendor ID. In this case it's possible for two different cards
    to have the same device and vendor ID. In this case, the "subsystem"
    device and vendor ids should have unique information for each card. I
    have never seen one of these yet myself, but that's what the subsystem
    IDs are for.

    John

  3. Re: Question on pci-configuration space

    "srblinux@gmail.com" wrote:
    >
    >If i have two pci Devices of same type and same vendor
    >how can i Differentiate two devices?
    > suppose the devices are memory based devices 0-1000address deals 1st
    >memory based device and 1000-2000 deals with 2nd device and same
    >address lines going to the devices How can i differentiate these two
    >devices with the configuration space? what are the things that differs
    >in pci configuration space?


    There's no way to tell them apart. The BIOS will assign different
    addresses to them, the operating system will create two different devices
    for them and will make sure each gets one of the addresses, but there's no
    way to know which is which. Their configuration spaces will be identical,
    other than the assigned addresses.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.

+ Reply to Thread