[LinuxBIOS] [Patch] Fix CONFIG_CONSOLE_VGA handling in default pci_dev_init.

ron minnich rminnich at gmail.com
Thu Jan 3 02:31:27 CET 2008

On Jan 2, 2008 5:03 PM, Luc Verhaegen <libv at skynet.be> wrote:

> pci_dev_init is the default pci device initialisation routine.
> It is a dumb pci device initialisation routine, lacking all device
> specific knowledge.

Right. By design.

> It can only try to achieve anything when there is a pci rom present
> which can do the initialisation for us.
> When we choose to not run pci roms, we do not initialise anything, and
> we certainly shouldn't go claiming we did either.

OK. Where precisely are we making that claim? What is the path by
which we will claim to initialise something when we did not. Sorry, I
am looking at the code and not seeing it.

> When we choose to not run pci roms, why do we still run pci roms of
> devices if they just happen to be VGA devices?

Because that was what the user community asked for. The VGA ROM stuff
came first. Later, people wanted all option roms to be run. Then, it
turned out there is a need for some platforms to run VGA option ROMS
only. Finally, there can be a need for ALL option roms to be run but
NO VGA consoles to be set up. The logic in this function is twisted
because it grew by accretion. I make no claims that it is clean -- it
is not.

But I have not yet seen the case that it is wrong.

> So why bother setting vga_inited outside of PCI_ROM_RUN?

Because, once you reach that line, you've run the vga bios. I don't
understand the question.

> If you still do not believe logic, then please set CONFIG_CONSOLE_VGA
> without setting CONFIG_PCI_ROM_RUN and then build your rom. The build
> will fail due to missing symbols.

That's a prolem. Which symbols? Which mainboards? This is an error but
it has been a long enough time since I did this that I can easily
believe it will happen.

> What i am trying to do is implement native VGA bring-up for unichrome. I
> have had userspace code doing this on top of a clean linuxbios for more
> than 8 months. This is not just my X driver, i can also set up standard
> vga text mode, so it is not a pipe dream.

That's great to hear. Be aware that SiS also did native vga text mode
in 2000, by Ollie Lo. So, we know that it is possible to have this
work. We have done a fair amount of native and emulated VGA bringup
over the years.

> In that light it is perfectly valid to claim CONFIG_CONSOLE_VGA
> without setting CONFIG_PCI_ROM_RUN, because:
> * i have no need for a vga rom, as i provide the necessary code for a
>   full vga text mode bringup myself.
> * i have no need to run any other rom either.
> * i do want vga console logging.

Ah. Now I see what you are trying to do. I misunderstood from your
first message. No argument. We've been doing this for years. And if
you can't do it, then something is broken for sure. So I'm happy to
see it fixed.

At the same time, let's suppose for the sake of argument that you set
hardware bringup. How does that hurt your native device? There's no
option rom for it --> it won't be run. I'd like to understand this. We
have had cases where people had native bringup and installed a vga
card, and both were needed. In that case we would want roms to run.

> So when i initialise the unichrome, i set vga_inited myself, like any
> device driver should when it initialises a vga compatible device to a
> vga compatible state and expects the console code to make use of it as a
> vga compatible console.

OK. It's fine to set it there I suppose.

> Since I am trailblazing native vga bringup, it is perfectly
> understandable that some bumps are encountered along the way. What i do
> not understand is how something so perfectly logical is rejected without
> proper consideration, tossed aside as if it were a mindless cleanup.

It was considered. I think there is a bigger picture than you might
have realised. Torsten also pointed out a secondary issue.

I read your patch. I am still unsure of the case where there are vga
class devices but we don't want a vga console (hint: GPU computing).
It seems there is no way in your code to allow us to run the option
ROMs for a "vga" device and not enable a vga console.

This is a cooperative project and some patience from all sides is
important. So please bear with us as we try to make sure we understand
your needs and what you are doing. Very trivial changes can turn into
problems in ways we do not expect, and VGA and ROM issues have been a



More information about the coreboot mailing list