[OpenBIOS] b?branch

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Dec 31 19:09:20 CET 2017


On 31/12/17 12:59, Jd Lyons wrote:

>> On Dec 30, 2017, at 6:04 AM, Segher Boessenkool 
>> <segher at kernel.crashing.org <mailto:segher at 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 at kernel.crashing.org <mailto:segher at 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 .?

After a bit of poking, it appears that the issue is simply that set-args 
isn't being called for PCI devices.

The attached patch appears to fix the issue for me - can you confirm 
that it works for you?

0 > " /pci/QEMU,VGA" open-dev to my-self  ok
0 > my-space u. 800  ok


ATB,

Mark.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openbios-pci-set-args.patch
Type: text/x-patch
Size: 1182 bytes
Desc: not available
URL: <http://mail.coreboot.org/pipermail/openbios/attachments/20171231/0f560891/attachment-0001.patch>


More information about the OpenBIOS mailing list