[OpenBIOS] [PATCH] pci: fix BAR setup

Blue Swirl blauwirbel at gmail.com
Sat May 12 11:11:37 CEST 2012


On Thu, May 10, 2012 at 10:47 PM, Tarl Neustaedter <tarl-b2 at tarl.net> wrote:
> On 2012-May-10 17:48 , Jakub Jermar wrote:
>>
>> [...]
>>
>>
>> So it looks like either the child base should be 0, or reg_addr must be
>> 0x00900000, or parent_base must be 0x1ff00100000. From the way this
>> works e.g. on Sun E6500, the last option seems to be the correct one.
>
>
> Agreed. On current SPARC, the only non-zero Range on PCI is for 64-bit
> memory. For the memory ranges we see:
>
> 0200.0000 0000.0000 0000.0000 8000.8090 0000.0000 0000.0007 0000.0000
> 0300.0000 0000.0001 0000.0000 8000.8091 0000.0000 0000.0007 0000.0000
>
> My recollection is that memory space PCI RA (real address rather than
> physical address, because now we're behind a hypervisor) ranges from
> 8000.8090.0000.0000 through 8000.8097.FFFF.FFFF - which would match your
> guess that the parent_base needs to be hacked if 0800.0000 is going to be
> the BAR and is going to represent 1ff.0800.0000.
>
> So, why does OpenBios have 0100.0000 as a child base in the first place?

It's to avoid VGA legacy mapping at 0xa0000. If I change
hwdefs.pci.pci_mem_base in arch/sparc64/openbios.c to 0, OpenBIOS will
crash during VGA init. Previously this worked because the PCI devices
were mapped somewhat randomly and by chance, VGA legacy low mem area
was avoided.

I think the correct fix is to make QEMU VGA device disable the legacy
mapping unless explicitly enabled. Alternatively the child base
arithmetic could be fixed in OpenBIOS like proposed by Jakub.

>
>
>
> --
> OpenBIOS                 http://openbios.org/
> Mailinglist:  http://lists.openbios.org/mailman/listinfo
> Free your System - May the Forth be with you



More information about the OpenBIOS mailing list