Hi,
This patch adds initial flashrom support for matching mainboards based on pci-ids and pci subsystem/card ids.
I've been using subsystem/card ids as part of my unichrome driver for years (xf86-video-unichrome/src/via_id.c). It is a very easy and painless system for identifying boards.
It is relatively reliable, as it's always the same vendors that bugger them up (like VIA and ECS). Most vendors do play nice. But, in order to not mess up on devices like the EPIA-M, 2 sets of ids can be provided here. This gives pretty absolute reliability. Boards that don't need 2 matches can just null the second set.
This code works correctly on: * EPIA-M with original BIOS. Matched and enabled correctly: $ Found "VIA EPIA M/MII/...": Enabling flash write... OK. * EPIA-M with linuxbios: not matched - pci subsystem ids not set correctly (yet!) - but not a problem as linuxbios never disabled write in the first place. * Asus A7V400-MX now works correctly (the CrashFree BIOS). This involves poking the Winbond LPC superio: $ Found "Asus A7V8-MX SE": Enabling flash write... OK. (This different name is correct. The difference is the northbridge revision and a sticker over "A7V8-MX SE") * Mitac 8999 laptop. Here GPIO15 enables the panel backlight, while on EPIA-M it enables rom write. Hence this being highly incorrect here. Requires nothing board specific and can flash np. * Shuttle SK43G requires nothing board specific.
There is one more VT823x based device in this house that might get tested, and possibly implemented, this weekend.
The Island Aruma support is currently kept as is.
When no match has been made, or an error occured, then the name based matching is still attempted.
I'm not a big fan of doing board specific things on the name alone. A user also shouldn't be allowed to specify a board name as that would lead to very randomly poking bits with potentially not-so-fun consequences. Testing here should imho involve editing flash_enable.c directly.
Island aruma code can be converted with little effort, all it takes is the output of lspci -vn.
Commit message, signed-off, etc are done git-style.
Luc Verhaegen.