For VGA ...

ron minnich rminnich at lanl.gov
Wed Jan 14 11:17:01 CET 2004


VGA is "special". 

This code: 
src/devices/device.c:static void allocate_vga_resource(void)

is great. 

This loop:
         while(bus) {
                bus->bridge_ctrl |= PCI_BRIDGE_CTL_VGA;
                bus = (bus == bus->dev->bus)? 0 : bus->dev->bus;
        } 

is close, but as noted it is somewhat pci-centric. It works darned well 
though: it sets up most bridges just fine. 

But VGA is just so darned "SPECIAL". 

I am thinking of adding a new device_operation just for good old vga. 

	void (*endable_vga)(dev, vga_dev)

The loop changes to this: 

        while(bus) {
		if (bus->dev->ops && bus->dev->ops->enable_vga)
			bus->dev->ops->enable_vga(bus->dev, vga);
		else
	                bus->bridge_ctrl |= PCI_BRIDGE_CTL_VGA;
                bus = (bus == bus->dev->bus)? 0 : bus->dev->bus;
        } 


I think this is all we need. Most of the devices would have this empty, 
but the amdk8 would have an entry so it could: 
- set the VGA_EN bit in the correct PCI I/O register
- set up an MMIO pair for the a0000-affff range

I realize this is a special case, but all of vga is a special case, and 
VGA is *very* *important* to the embedded space. Our goal is to have a VGA 
filo or etherboot prompt. 

comments? Absent serious objections I want to put this in today.

ron




More information about the coreboot mailing list