John,
 
The reg property looks strange!
 
Ok try at the ok prompt (you can simply copy-paste the following):
 
dev /pci/pci8086,7010
see open
\ (Re)define open.
: open ." Hooray! Device opened!" cr h# -1 ;
dev /
my-self .
" /pci/pci8086,7010" select-dev \ You will see the message from open.
my-self .             \ This should yield a non-zero value.
my-space pci-w@ .     \ This would be the Vendor ID.
my-space 2 + pci-w@ . \ This would be the Device ID.
 
-Asif

From: openbios-bounces@openbios.org [mailto:openbios-bounces@openbios.org] On Behalf Of Fusco, John (GE Healthcare)
Sent: Thursday, August 24, 2006 2:57 PM
To: The OpenBIOS Mailinglist
Subject: Re: [OpenBIOS] Basic Questions

I tried your commands on both real and virtual hardware. In both cases the results are similar. There are no properties listed for "assigned-addresses", but there is a "reg" property.
 
I will type the results, since I cannot capture the text:
 
0 > dev /pci/pci8086,7010 ok
0 > .properties
name             "pci8086,7010"
vendor-id        8086
device-id        7010
revision-id      0
interrupts       0
min-grant        0
max-latency      0
devsel-speed     0
cache-line-size  0
reg              -- 14 : 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
class            "ide"
 ok

 
By the way, the command "dev /pci/pci8086,7010@1,1" returns "no such device".
 
John

From: openbios-bounces@openbios.org [mailto:openbios-bounces@openbios.org] On Behalf Of Asif Haswarey
Sent: Thursday, August 24, 2006 1:47 PM
To: The OpenBIOS Mailinglist
Subject: Re: [OpenBIOS] Basic Questions

John,
 
Correction:
 
The property names are:
 
assigned-addresses
reg
 
-Asif

From: openbios-bounces@openbios.org [mailto:openbios-bounces@openbios.org] On Behalf Of Asif Haswarey
Sent: Thursday, August 24, 2006 11:11 AM
To: The OpenBIOS Mailinglist
Subject: Re: [OpenBIOS] Basic Questions

John,
 
Ok I'll try to make this as simple as possible for you.
You need 2 things to determine the bus, dev and func numbers:
 
1) OpenFirmware PCI Bus Binding: http://www.openbios.info/docs/bus.pci.pdf
Look at section: 2.1.3 thru 2.2.1; mainly 2.2.1.
 
2) Do the following at the ok prompt:
 
dev /pci/pci8086,7010@1,1
.properties
 
Post the contents of the screen on this mailing list (especially the assigned-reg and/or reg
properties and their values).

_____________

Äsif Haswaréy

QLogic Corporation

FCode Driver Development

Phone: 949.389.7607

  Fax: 949.389.6308

asif.haswarey@qlogic.com

 

 


From: openbios-bounces@openbios.org [mailto:openbios-bounces@openbios.org] On Behalf Of Fusco, John (GE Healthcare)
Sent: Thursday, August 24, 2006 10:57 AM
To: The OpenBIOS Mailinglist
Subject: Re: [OpenBIOS] Basic Questions

You're right. These words don't exist in openbios.
 
I wish this were a easier to use. Maybe it would catch on then. The "show-devs" word prints devices in a somewhat arbitrary heirarchy. For example:
 
    /pci/pci8086,7010@1,1
 
Okay, so I have a PCI device with vendor ID 8086 and device ID 7010. But if I want to read from that device, I need to know the bus, device and function number, which are not listed. So how do I find these unless I already know them up front?
 
This all seems pretty basic to me. It's as if the openbios were going out of its way to make this difficult. Unless someone can show me I'm wrong, I'm about to give up.
 
Thanks,
John


From: openbios-bounces@openbios.org [mailto:openbios-bounces@openbios.org] On Behalf Of Asif Haswarey
Sent: Thursday, August 24, 2006 12:32 PM
To: The OpenBIOS Mailinglist
Subject: Re: [OpenBIOS] Basic Questions

John,
 
Normally you have to first open the device node (whose pci config space you wish to read).
That will give you a non-zero value in my-self, ie. an instance handle of the opened node
will be created and assigned to my-self.
Example on a SPARC system:
 
" /pci@1f,4000/network@2" begin-select-dev
my-space " config-w@" $call-parent .
 
That should print out the contents of the register at offset 0 in config space of the network@2 node.
But most of the words in the example may not exist in the OpenBios implementation.
I have been wanting to try out OpenBIOS, but I have'nt been able to get to it yet.

_____________

Äsif Haswaréy

QLogic Corporation

FCode Driver Development

Phone: 949.389.7607

  Fax: 949.389.6308

asif.haswarey@qlogic.com

 



From: openbios-bounces@openbios.org [mailto:openbios-bounces@openbios.org] On Behalf Of Fusco, John (GE Healthcare)
Sent: Thursday, August 24, 2006 8:13 AM
To: Asif Haswarey
Cc: openbios@openbios.org
Subject: Re: [OpenBIOS] Basic Questions

I have a console with an "ok" prompt that I boot with grub. It's an Intel Westville II motherboard - dual Xeon with 7500 chipset.
 
Here is where I am stuck. The PCI commands that come with openbios do not comply with the standard, so they are largely undocumented. Looking at the source, I can muddle through although I'm new at Forth. Mabye you can help me with the syntax.
 
Here is the output from lspci on Linux for Westville:
    $ lspci -n
    00:00.0 0600: 8086:254c (rev 01)
So bus 0 device 0, function 0 has a PCI device. If I read config word zero, I expect something like 8086 or 254c, but what I get is always FFFF. Here is the syntax I am using:
 
0 0 pci-c@ . ff
0 0 pci-w@ . ffff
0 0 pci-l@ . -1
 
What am I doing wrong?
 
Thanks,
John
 
 


From: Asif Haswarey [mailto:asif.haswarey@qlogic.com]
Sent: Wednesday, August 23, 2006 5:24 PM
To: Fusco, John (GE Healthcare)
Cc: openbios@openbios.org
Subject: RE: [OpenBIOS] Basic Questions

John,
 
I do not have an environment that you are persuing, ie. Qemu.
So you will need to clarify a little more.
Do you have a running OpenBIOS system such that you get to the
OpenFirmware console specifically at the "ok" prompt?
 
-Asif


From: Fusco, John (GE Healthcare) [mailto:John.Fusco@med.ge.com]
Sent: Wednesday, August 23, 2006 11:02 AM
To: Asif Haswarey
Cc: openbios@openbios.org
Subject: RE: [OpenBIOS] Basic Questions

Yes, that's essentially what I want. The runiso target in the makefile uses qemu. So that part was easy.
 
Trying to decipher all the rest of it is where I'm stuck.
 
John


From: Asif Haswarey [mailto:asif.haswarey@qlogic.com]
Sent: Wednesday, August 23, 2006 12:31 PM
To: Fusco, John (GE Healthcare)
Subject: RE: [OpenBIOS] Basic Questions

John,
 
Exercising the PCI config space is probably what you are looking to do.
Have you actually been able to install OpenBIOS in your Qemu environment/platform?

_____________

Äsif Haswaréy

QLogic Corporation

FCode Driver Development

Phone: 949.389.7607

  Fax: 949.389.6308

asif.haswarey@qlogic.com

 



From: openbios-bounces@openbios.org [mailto:openbios-bounces@openbios.org] On Behalf Of Fusco, John (GE Healthcare)
Sent: Wednesday, August 23, 2006 10:12 AM
To: openbios@openbios.org
Subject: [OpenBIOS] Basic Questions

I am investigating the possiblity of using Openbios as a tool to verify our custom PCI designs.
 
Specifically what I am interested in is the ability to modify the PCI base address registers and excercise the address decoders on the cards. What I'm after is some basic PCI compliance testing that is hard to do with a full blown OS.
 
My problem is that I'm having a tough time with the learning curve of openbios. I'm having trouble figuring out how to do some basic things, like query the BARs of a PCI device. I'm using Qemu as a sandbox to play with openbios, but I can't even figure out how print the value of configuration register zero of a particular device!
 
Can anyone steer me in the right direction? Am I wasting my time, or does it sound like Openbios is going to do what I want.
 
Thanks,
John