public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] translating ACPI _HID & _UID to PCI bus number
@ 2001-05-02 19:33 Matt_Domsch
  2001-05-02 20:26 ` Nakajima, Jun
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matt_Domsch @ 2001-05-02 19:33 UTC (permalink / raw)
  To: linux-ia64

I'm working on a user-space application to add a Linux entry to the IA-64
EFI Boot Manager.  One component of this entry is the ACPI _HID and _UID
fields, which correspond to a PCI bus number (in Linux kernel terms).  I
know the PCI bus number, device, and function, for a given controller.  What
I don't have is the ACPI _HID and _UID fields that match the PCI bus number.
Any thoughts on how I can get them?

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number
  2001-05-02 19:33 [Linux-ia64] translating ACPI _HID & _UID to PCI bus number Matt_Domsch
@ 2001-05-02 20:26 ` Nakajima, Jun
  2001-05-02 21:02 ` Lee, Jung-Ik
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Nakajima, Jun @ 2001-05-02 20:26 UTC (permalink / raw)
  To: linux-ia64

Not all PCI devices appear in the ACPI namespace. If a PCI device shows up
in the ACPI namespace, it should have _ADR, which basically is its PCI bus,
device, and function number. Then you can tell the _HID and _UID associated
with that device. Hope this helps.

Jun

-----Original Message-----
From: Matt_Domsch@Dell.com [mailto:Matt_Domsch@Dell.com]
Sent: Wednesday, May 02, 2001 12:34 PM
To: acpi@phobos.fachschaften.tu-muenchen.de
Cc: linux-ia64@linuxia64.org
Subject: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number


I'm working on a user-space application to add a Linux entry to the IA-64
EFI Boot Manager.  One component of this entry is the ACPI _HID and _UID
fields, which correspond to a PCI bus number (in Linux kernel terms).  I
know the PCI bus number, device, and function, for a given controller.  What
I don't have is the ACPI _HID and _UID fields that match the PCI bus number.
Any thoughts on how I can get them?

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux



^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number
  2001-05-02 19:33 [Linux-ia64] translating ACPI _HID & _UID to PCI bus number Matt_Domsch
  2001-05-02 20:26 ` Nakajima, Jun
@ 2001-05-02 21:02 ` Lee, Jung-Ik
  2001-05-02 23:23 ` Nakajima, Jun
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Lee, Jung-Ik @ 2001-05-02 21:02 UTC (permalink / raw)
  To: linux-ia64

Even with ACPI namespace, {_HID, _UID} pair does not tell the path of a
device in a given topology, and can not produce a PCI bus number(vice
versa).
_ADR of PCI device does not provide bus number either. It's just dev +func.
 
So to get PCI bus number of a given PCI bus:
1. you can use _BBN of the device, but this works only on root pci bridges.
I personally want to see all PCI bridges have _BBN method for OSPM's
convenience, but ACPI spec does not require it for non-roots.
2. you can enumerate pci bus from root pci bridges, following PCI std df
enum scheme, and access pci config space of pci bridges to get BIOS set bus
numbers. (But note that bus numbers set by BIOS do not necessarily match to
what OSes assign. For reasons OSes can assign bus numbers different from
BIOS's. So, PCI numbers from pci config space at EFI boot manager time, it's
not always the same as OSes enumerates) Afaik, linux does not alter bus
numbers set by BIOS yet, but someday...)

Thus, there seems to be no perfect solutions here... to get pci bus number
from acpi name space alone.

J.I.


-----Original Message-----
From: Nakajima, Jun [mailto:jun.nakajima@intel.com]
Sent: Wednesday, May 02, 2001 1:26 PM
To: 'Matt_Domsch@Dell.com'; acpi@phobos.fachschaften.tu-muenchen.de
Cc: linux-ia64@linuxia64.org
Subject: RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number


Not all PCI devices appear in the ACPI namespace. If a PCI device shows up
in the ACPI namespace, it should have _ADR, which basically is its PCI bus,
device, and function number. Then you can tell the _HID and _UID associated
with that device. Hope this helps.

Jun

-----Original Message-----
From: Matt_Domsch@Dell.com [mailto:Matt_Domsch@Dell.com]
Sent: Wednesday, May 02, 2001 12:34 PM
To: acpi@phobos.fachschaften.tu-muenchen.de
Cc: linux-ia64@linuxia64.org
Subject: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number


I'm working on a user-space application to add a Linux entry to the IA-64
EFI Boot Manager.  One component of this entry is the ACPI _HID and _UID
fields, which correspond to a PCI bus number (in Linux kernel terms).  I
know the PCI bus number, device, and function, for a given controller.  What
I don't have is the ACPI _HID and _UID fields that match the PCI bus number.
Any thoughts on how I can get them?

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux


_______________________________________________
Linux-IA64 mailing list
Linux-IA64@linuxia64.org
http://lists.linuxia64.org/lists/listinfo/linux-ia64



^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number
  2001-05-02 19:33 [Linux-ia64] translating ACPI _HID & _UID to PCI bus number Matt_Domsch
  2001-05-02 20:26 ` Nakajima, Jun
  2001-05-02 21:02 ` Lee, Jung-Ik
@ 2001-05-02 23:23 ` Nakajima, Jun
  2001-05-02 23:43 ` Mike Smith
  2001-05-03  3:50 ` Matt_Domsch
  4 siblings, 0 replies; 6+ messages in thread
From: Nakajima, Jun @ 2001-05-02 23:23 UTC (permalink / raw)
  To: linux-ia64

In general a PCI device does not need to have _HID or _UID, because _ADR is
used for that purpose. If a PCI device happens to be on a root PCI bus, it
has _HID and _UID as well. So the bus number is avaialble from _BBN on the
bus, assuming that the OS does not change the PCI bus number.

So as long as you are interested in _HID and _UID of a PCI device, you
should be able to assume _BBN, thus, PCI bus number.

Jun 

-----Original Message-----
From: Lee, Jung-Ik 
Sent: Wednesday, May 02, 2001 2:02 PM
To: Nakajima, Jun; 'Matt_Domsch@Dell.com';
acpi@phobos.fachschaften.tu-muenchen.de
Cc: linux-ia64@linuxia64.org
Subject: RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number


Even with ACPI namespace, {_HID, _UID} pair does not tell the path of a
device in a given topology, and can not produce a PCI bus number(vice
versa).
_ADR of PCI device does not provide bus number either. It's just dev +func.
 
So to get PCI bus number of a given PCI bus:
1. you can use _BBN of the device, but this works only on root pci bridges.
I personally want to see all PCI bridges have _BBN method for OSPM's
convenience, but ACPI spec does not require it for non-roots.
2. you can enumerate pci bus from root pci bridges, following PCI std df
enum scheme, and access pci config space of pci bridges to get BIOS set bus
numbers. (But note that bus numbers set by BIOS do not necessarily match to
what OSes assign. For reasons OSes can assign bus numbers different from
BIOS's. So, PCI numbers from pci config space at EFI boot manager time, it's
not always the same as OSes enumerates) Afaik, linux does not alter bus
numbers set by BIOS yet, but someday...)

Thus, there seems to be no perfect solutions here... to get pci bus number
from acpi name space alone.

J.I.


-----Original Message-----
From: Nakajima, Jun [mailto:jun.nakajima@intel.com]
Sent: Wednesday, May 02, 2001 1:26 PM
To: 'Matt_Domsch@Dell.com'; acpi@phobos.fachschaften.tu-muenchen.de
Cc: linux-ia64@linuxia64.org
Subject: RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number


Not all PCI devices appear in the ACPI namespace. If a PCI device shows up
in the ACPI namespace, it should have _ADR, which basically is its PCI bus,
device, and function number. Then you can tell the _HID and _UID associated
with that device. Hope this helps.

Jun

-----Original Message-----
From: Matt_Domsch@Dell.com [mailto:Matt_Domsch@Dell.com]
Sent: Wednesday, May 02, 2001 12:34 PM
To: acpi@phobos.fachschaften.tu-muenchen.de
Cc: linux-ia64@linuxia64.org
Subject: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number


I'm working on a user-space application to add a Linux entry to the IA-64
EFI Boot Manager.  One component of this entry is the ACPI _HID and _UID
fields, which correspond to a PCI bus number (in Linux kernel terms).  I
know the PCI bus number, device, and function, for a given controller.  What
I don't have is the ACPI _HID and _UID fields that match the PCI bus number.
Any thoughts on how I can get them?

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux


_______________________________________________
Linux-IA64 mailing list
Linux-IA64@linuxia64.org
http://lists.linuxia64.org/lists/listinfo/linux-ia64



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number
  2001-05-02 19:33 [Linux-ia64] translating ACPI _HID & _UID to PCI bus number Matt_Domsch
                   ` (2 preceding siblings ...)
  2001-05-02 23:23 ` Nakajima, Jun
@ 2001-05-02 23:43 ` Mike Smith
  2001-05-03  3:50 ` Matt_Domsch
  4 siblings, 0 replies; 6+ messages in thread
From: Mike Smith @ 2001-05-02 23:43 UTC (permalink / raw)
  To: linux-ia64

It's not actually clear from the conversation so far what exactly Matt is 
after.  I get the impression, however, that what he wants to do is 
synthesise an _HID/_UID pair, which is not quite what's being discussed 
here.

If that's the case, typically _HID is the 32-bit vendor/device ID of the 
controller, and _UID is the instance count for the given _HID, eg. the 
first controller has a _UID of 0, the second has a _UID of 1, etc.

> In general a PCI device does not need to have _HID or _UID, because _ADR is
> used for that purpose. If a PCI device happens to be on a root PCI bus, it
> has _HID and _UID as well. So the bus number is avaialble from _BBN on the
> bus, assuming that the OS does not change the PCI bus number.

This isn't entirely correct either.

> -----Original Message-----
> From: Lee, Jung-Ik 
> Sent: Wednesday, May 02, 2001 2:02 PM
> To: Nakajima, Jun; 'Matt_Domsch@Dell.com';
> acpi@phobos.fachschaften.tu-muenchen.de
> Cc: linux-ia64@linuxia64.org
> Subject: RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number
> 
> 
> Even with ACPI namespace, {_HID, _UID} pair does not tell the path of a
> device in a given topology, and can not produce a PCI bus number(vice
> versa).
> _ADR of PCI device does not provide bus number either. It's just dev +func.
>
> So to get PCI bus number of a given PCI bus:
> 1. you can use _BBN of the device, but this works only on root pci bridges.
> I personally want to see all PCI bridges have _BBN method for OSPM's
> convenience, but ACPI spec does not require it for non-roots.

This is because ACPI assumes that you have a functional bus architecture. 
The created bus instance should know its bus number, either from _BBN or 
from querying the bridge's secondary bus number register, so as a device 
you just query your parent for its bus number.

Because Matt's tool is running in userspace, however, this may not be so 
easy to achieve.

> Thus, there seems to be no perfect solutions here... to get pci bus number
> from acpi name space alone.

That's basically correct; you can't do this.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E




^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Linux-ia64] translating ACPI _HID & _UID to PCI bus number
  2001-05-02 19:33 [Linux-ia64] translating ACPI _HID & _UID to PCI bus number Matt_Domsch
                   ` (3 preceding siblings ...)
  2001-05-02 23:43 ` Mike Smith
@ 2001-05-03  3:50 ` Matt_Domsch
  4 siblings, 0 replies; 6+ messages in thread
From: Matt_Domsch @ 2001-05-03  3:50 UTC (permalink / raw)
  To: linux-ia64

> It's not actually clear from the conversation so far what 
> exactly Matt is 
> after.  I get the impression, however, that what he wants to do is 
> synthesise an _HID/_UID pair, which is not quite what's being 
> discussed 
> here.

I'm creating a DEVICE_PATH that looks like ACPI()/PCI()/SCSI()/HardDrive().
I have the PCI bus, device, and function number (via ioctl in kernel 2.4.4)
of the IDE/SCSI/FC/I2O controller, the SCSI ID and LUN, and all the Hard
Drive information.  I'm looking for the ACPI _HID and _UID which match the
controller.

I can cheat somewhat.  I do have the EFI blkX variables, which contain
something like (unparsed):

/proc/efi/vars/blk0-47c7b225-c42a-11d2-8e57-00a0c969723b
Type: 2 Subtype: 1      Length: c
ACPI Device Path: ACPI Device Path
        _HID: a0341d0
        _GID: 1

Type: 1 Subtype: 1      Length: 6
Hardware Device Path: PCI
        Function 0x0, Device 0x2

Type: 3 Subtype: 2      Length: 8
Messaging Device Path: SCSI
        Target ID: 0
        Logical Unit Number: 0

I could look for a device that matches on PCI device,function and SCSI
ID/LUN, and then copy the ACPI Device Path portion, but that still leaves
open the possibility of a PCI device on a separate bus that happens to match
all these fields.

> If that's the case, typically _HID is the 32-bit 
> vendor/device ID of the 
> controller, and _UID is the instance count for the given 
> _HID, eg. the 
> first controller has a _UID of 0, the second has a _UID of 1, etc.

From this example, taken from actual hardware, the _HID is not anything like
the PCI vendor/device ID.  In this case this is a QLogic 12160 PCI SCSI
controller, 0x1077/0x1216.

> > So to get PCI bus number of a given PCI bus:
> > 1. you can use _BBN of the device, but this works only on 
> root pci bridges.

This isn't a bridge, so no luck.

> Because Matt's tool is running in userspace, however, this 
> may not be so 
> easy to achieve.
> 
> > Thus, there seems to be no perfect solutions here... to get 
> > pci bus number from acpi name space alone.
> 
> That's basically correct; you can't do this.

I appreciate the help.  If there isn't a way to do this *today*, what steps
might we take to make this information available in the future?

Thanks,
Matt

-- 
Matt Domsch
Sr. Software Engineer
Dell Linux Systems Group
Linux OS Development
www.dell.com/linux


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-05-03  3:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-02 19:33 [Linux-ia64] translating ACPI _HID & _UID to PCI bus number Matt_Domsch
2001-05-02 20:26 ` Nakajima, Jun
2001-05-02 21:02 ` Lee, Jung-Ik
2001-05-02 23:23 ` Nakajima, Jun
2001-05-02 23:43 ` Mike Smith
2001-05-03  3:50 ` Matt_Domsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox