On Dec 30, 2017, at 6:04 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:

On Sat, Dec 30, 2017 at 05:44:10AM -0500, Jd Lyons wrote:
On Dec 30, 2017, at 4:21 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
On Fri, Dec 29, 2017 at 08:27:54PM -0500, Tarl Neustaedter wrote:
[re-send, copying the list. For whatever reason, it seems messages
aren't getting the reply-to: header.]

On 2017-Dec-29 03:58 , Jd Lyons wrote:
0 > " /pci/@e" open-dev to my-self  ok
0 > my-self . 5fc5ac34  ok
0 > my-parent . 5fc5abfc  ok
0 > my-space . 0  ok <<---Seems my-space isn't returning a correct value?
0 > 

That's the problem. It appears that simply open-dev and assigning
my-self isn't enough. my-space (and my-address and my-unit) aren't
getting set up, so all config-space accesses are going to do the wrong
thing (they'll go to device 0, which may or may not be the root).

In the Sun/Oracle version, select would properly set things up, it
appears no equivalent is available under openbios.

I think you'll have to further debug this by getting the FCode to be
pulled in at startup in place of the built-in vga fcode, rather than
trying to fiddle things this way.

Or set my-space to return 7000 and keep on fumbling :-)

How would I set my-space to 7000?

Is that specific to pci/@e?

I noticed in SLOF that my-space . returned 1800, however the card was pci/@3.

And that is correct :-)

It is @dev,fn or if fn is 0, it is written as @dev .  In the encoded
representation, it is  800*dev + 100*fn (dev is 5 bits, fn is 3 bits).

In openbios, it looks like my-space gets its data from >dn.probe-addr in
the device node...  And it is set via set-args...  And then I got lost,
not sure how that is supposed to be called.

Looks like we need to change the way openbios handles my-space.

SLOF deals with it in the nodes.fs

: (my-phandle)  ( -- phandle )
   my-self ?dup IF
      ihandle>phandle
   ELSE
      get-node dup 0= ABORT" no active node"
   THEN
;

: my-space ( -- phys.hi )
   (my-phandle) >space
;


I think we also need the >space word, the phandle word, and the ihandle word, I’ll have to track that  down too.

John, do you want to take a crack at fixing the >dn.probe-addr, or replacing it with something that returns a correct my-space .?






Segher