Hi,
thanks for your report. I'll focus on the compilation issues you found. Stefan Tauner already answered the erase related question.
Am 09.09.2011 22:10 schrieb Rohit Vijapure:
I am trying to mass update the BIOS on MB899 Intel ® CoreTM 2 Duo/CoreTM Duo/ Solo 945GM Mini-ITX Motherboard. I did compile the flashrom by following two modifications as I was getting errors for the global declaration .
*Compilation errors* programmer.h:567: warning: declaration of 'programmer' shadows a global declaration
gcc bug. It complains about the parameter name in a function declaration in programmer.h: void register_spi_programmer(const struct spi_programmer *programmer); Will add a workaround (rename programmer to pgm here).
board_enable.c: In function 'nvidia_mcp_gpio_set': board_enable.c:892: error: too few arguments to function 'pci_get_dev'
*2. board_enable.c* dev = pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, 1); /* dev = pci_get_dev(pacc, dev->bus, dev->dev, 1);*/
We explicitly check if we need to use the variant with or without the domain parameter. This check for PCI_LIB_VERSION >= 0x020200 should work fine.
[root@ME2000 /tmp]$ flashrom -w he76.052008 flashrom v0.9.4-r1395 on Linux 2.6.18.6-2g2g (i686), built with libpci 2.1.99-test8, GCC 4.0.2 20051125 (Red Hat 4.0.2-8), little endian
And here's the source of the compilation problem: Your distribution ships a beta version of libpci/pciutils which uses the interface of libpci 2.2 but without the matching version definition. We could hack around that with an additional check #if defined(PCI_CAP_ID_HT), but that matches only 2.1.99-test6 and above which would fix your case but leave 2.1.99-test3 to 2.1.99-test5 unfixed. It's the best possible solution, though.
Apparently Red Hat had forgotten the gcc 2.96 disaster and tried to repeat it with a beta libpci. Oh well.
Regards, Carl-Daniel