Corey Osgood wrote:
The attached patch is a unified version of the current ports of the i82801 series currently in LinuxBIOS. Since most of the ports are nearly identical, I've taken for each file and chosen the cleanest or best version of the code, then checked over the datasheets to *some* of the series, including the aa, ba, ca, and db, to make sure that it would work. I've also made some changes here and there, mostly cleanup and clarification. The only things left to look at are the huge difference between this version's lpc init and the i82801er's, finding a better way to select which chip is present on the board, and gpl headers in all files. Anyways, comments, suggestions, even flames are welcome ;) Testing on other chips can be done at this point as well, this is tested and working on one model, the i82801aa.
Some ideas that could simplify the code: [..] +#elif I82801_MODEL == I82801ER +#define I82801_PCI 0x244e +#define I82801_LPC 0x24d0 +#define I82801_IDE 0x24db +#define I82801_SATA 0x24df [..]
You can also add several PCI driver structures in a driver, pointing to the same PCI ops.
+static struct pci_driver pci_driver __pci_driver = { + .ops = &pci_ops, + .vendor = PCI_VENDOR_ID_INTEL, + .device = I82801_PCI, +};
So you could add one of these for each supported component. Since each pci_driver struct is only 8 bytes, the driver could be made to completely autodetect which southbridge chip you are using without the need for any #defines.
The only non-pci_driver use of the _MODEL #define is in src/southbridge/intel/i82801xx/i82801xx_smbus.h which is for smbus_write_block() which does not seem to be used, yet.
So my suggestion is to put an unconditional #warning there so that code can be fixed if it should not work on a given ICH and is ever used.
Forgot to say: Good work! Really nice!
Stefan