[SeaBIOS] [PATCH] Seabios: allow mapping of multiple PCI option ROMs to one

Dave Frodin dave.frodin at se-eng.com
Fri May 24 16:06:54 CEST 2013


The new patch that I've attached no longer alters the pci device struct.
I also no longer repeatedly read the file in from CBFS, but keep the
pointer to it around for the next time the function is called.

As far as the use case is concerned. We (or a client) will often have several of
the same mainboard (e.g. persimmon), but the graphics ID will vary depending on
which version of the cpu is installed. Previously, we would have to figure out
what the PCI ID of the graphics devices was, adjust the ID in coreboot's config,
build/flash the new rom image. This seabios change along with a change to
coreboot to set the ID and stuff the correct vendev mapping file into CBFS
will allow a single coreboot/seabios image to be used on any particular
mainboard independent of what cpu was installed. This change won't be useful
to someone who is using a single board who's graphics ID would never change.
For that case they wouldn't need to do anything. If the vendev mapping file
doesn't get added they would see no difference.

Thanks again,

----- Original Message -----
> From: "Kevin O'Connor" <kevin at koconnor.net>
> To: "Dave Frodin" <dave.frodin at se-eng.com>
> Cc: "seabios" <seabios at seabios.org>
> Sent: Thursday, May 23, 2013 9:01:00 PM
> Subject: Re: [SeaBIOS] [PATCH] Seabios: allow mapping of multiple PCI option ROMs to one
> On Thu, May 23, 2013 at 05:25:42PM -0500, Dave Frodin wrote:
> > Kevin,
> > I've attached a patch that I hope is more along the lines
> > of where you wanted me to go with this change. In my testing
> > of the patch I'm currently just stuffing the vendev-map.bin file
> > into my coreboot image.
> Thanks.
> [...]
> > +    for (i=0; i < filesize/(sizeof (u32)); i+=2) {
> > +        if ( filedata[i] == ((pci->vendor << 16) | pci->device)) {
> > +            dprintf(1, "Mapping PCI device 0x%8x to 0x%8x\n",
> > +                ((pci->vendor << 16) | pci->device), filedata[i+1]);
> > +            pci->vendor = filedata[i+1] >> 16;
> > +            pci->device = filedata[i+1] & 0xFFFF;
> > +            return;
> I don't understand why struct pci_device is being modified.  Maybe you
> could further explain the use case.  After modifying struct
> pci_device, where does the video rom actually come from?
> -Kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Seabios-allow-mapping-of-multiple-PCI-option-ROMs-to.patch
Type: text/x-patch
Size: 3129 bytes
Desc: not available
URL: <http://www.seabios.org/pipermail/seabios/attachments/20130524/302b079b/attachment.patch>

More information about the SeaBIOS mailing list