Freebios2 recovery progress...

Li-Ta Lo ollie at lanl.gov
Thu Oct 21 12:23:00 CEST 2004


On Thu, 2004-10-21 at 11:23, YhLu wrote:
> Driver add 
> < static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned
> device)
> < {
> <       pci_write_config32(dev, 0x2c, 
> <               ((device & 0xffff) << 16) | (vendor & 0xffff));
> < }
> < 
> < static struct pci_operations lops_pci = {
> <       .set_subsystem = lpci_set_subsystem,
> < };
> 
> 


OOPS, we are doing it with "uses MAINBOARD_SUBSYSTEM_ID" and if I am 
right every on board device share the same ID. For devices who want
its own ID it has to implement the .set_subsystem method. This is
really ugly. IMHO, we should treat the subsystem ids as attributes
of PCI device and it should be defined in the mainboard config file.
It should look like this

device pci 0.0 on
	vendor 0x1234
	device 0x5678
end

or

device pci 0.0 on
	register "subsystem_vendor_id" = "0x1234"
	register "subsystem_device_id" = "0x5678"
end

and the PCI enumeration code will call the generic
pci_set_subsystem() function to set subsystem ID for every
PCI device. For those device with subsystem ID unspecified,
it is default to zero any.

Ollie





More information about the coreboot mailing list