So far, we have up to 4 different names for the same thing (ignoring capitalization): CONFIG_FT2232SPI (makefile config option) FT2232_SPI_SUPPORT (#define) ft2232spi (programmer name) ft2232_spi.c (programmer file)
Use CONFIG_* with underscores for makefile config options and #defines and kill the useless _SUPPORT idiom. Use lowercase names with underscores for programmer names and programmer files.
With this, you can run "grep -i ft2232_spi" and find everything related to the ft2232_spi driver. Same applies to all other programmers.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-config_foo_foo_support/flashrom.8 =================================================================== --- flashrom-config_foo_foo_support/flashrom.8 (Revision 1002) +++ flashrom-config_foo_foo_support/flashrom.8 (Arbeitskopie) @@ -162,11 +162,11 @@ .sp .BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)" .sp -.BR "* ft2232spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)" +.BR "* ft2232_spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)" .sp .BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)" .sp -.BR "* buspiratespi" " (for flash ROMs attached to a Bus Pirate)" +.BR "* buspirate_spi" " (for flash ROMs attached to a Bus Pirate)" .sp Some programmers have optional or mandatory parameters which are described in detail in the @@ -303,10 +303,10 @@ .B portnum is an I/O port number which must be a multiple of 8. .TP -.BR "ft2232spi " programmer +.BR "ft2232_spi " programmer An optional parameter species the controller type and interface/port it should support. For that you have to use the -.B "flashrom -p ft2232spi:model,port=interface" +.B "flashrom -p ft2232_spi:model,port=interface" syntax where .B model can be any of @@ -331,12 +331,12 @@ instead. More information about serprog is available in serprog-protocol.txt in the source distribution. .TP -.BR "buspiratespi " programmer +.BR "buspirate_spi " programmer A required dev parameter specifies the Bus Pirate device node and an optional spispeed parameter specifies the frequency of the SPI bus. The parameter delimiter is a comma. Syntax is .sp -.B "flashrom -p buspiratespi:dev=/dev/device,spispeed=frequency" +.B "flashrom -p buspirate_spi:dev=/dev/device,spispeed=frequency" .sp where .B frequency Index: flashrom-config_foo_foo_support/flash.h =================================================================== --- flashrom-config_foo_foo_support/flash.h (Revision 1002) +++ flashrom-config_foo_foo_support/flash.h (Arbeitskopie) @@ -37,44 +37,44 @@ typedef unsigned long chipaddr;
enum programmer { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 PROGRAMMER_INTERNAL, #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 PROGRAMMER_DUMMY, #endif -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 PROGRAMMER_NIC3COM, #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 PROGRAMMER_NICREALTEK, PROGRAMMER_NICREALTEK2, #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 PROGRAMMER_GFXNVIDIA, #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 PROGRAMMER_DRKAISER, #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 PROGRAMMER_SATASII, #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 PROGRAMMER_ATAHPT, #endif -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 PROGRAMMER_IT87SPI, #endif -#if FT2232_SPI_SUPPORT == 1 - PROGRAMMER_FT2232SPI, +#if CONFIG_FT2232_SPI == 1 + PROGRAMMER_FT2232_SPI, #endif -#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 PROGRAMMER_SERPROG, #endif -#if BUSPIRATE_SPI_SUPPORT == 1 - PROGRAMMER_BUSPIRATESPI, +#if CONFIG_BUSPIRATE_SPI == 1 + PROGRAMMER_BUSPIRATE_SPI, #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 PROGRAMMER_DEDIPROG, #endif PROGRAMMER_INVALID /* This must always be the last entry. */ @@ -254,7 +254,7 @@
extern struct flashchip flashchips[];
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 struct penable { uint16_t vendor_id; uint16_t device_id; @@ -334,7 +334,7 @@ /* print.c */ char *flashbuses_to_text(enum chipbustype bustype); void print_supported(void); -#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) || (ATAHPT_SUPPORT == 1) || (NICREALTEK_SUPPORT == 1) +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1 void print_supported_pcidevs(struct pcidev_status *devs); #endif void print_supported_wiki(void); @@ -386,7 +386,7 @@ #endif void get_io_perms(void); void release_io_perms(void); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 extern int is_laptop; extern int force_boardenable; extern int force_boardmismatch; @@ -422,7 +422,7 @@ void fallback_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
/* dummyflasher.c */ -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 int dummy_init(void); int dummy_shutdown(void); void *dummy_map(const char *descr, unsigned long phys_addr, size_t len); @@ -440,7 +440,7 @@ #endif
/* nic3com.c */ -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 int nic3com_init(void); int nic3com_shutdown(void); void nic3com_chip_writeb(uint8_t val, chipaddr addr); @@ -449,7 +449,7 @@ #endif
/* gfxnvidia.c */ -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 int gfxnvidia_init(void); int gfxnvidia_shutdown(void); void gfxnvidia_chip_writeb(uint8_t val, chipaddr addr); @@ -458,7 +458,7 @@ #endif
/* drkaiser.c */ -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 int drkaiser_init(void); int drkaiser_shutdown(void); void drkaiser_chip_writeb(uint8_t val, chipaddr addr); @@ -467,7 +467,7 @@ #endif
/* nicrealtek.c */ -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 int nicrealtek_init(void); int nicsmc1211_init(void); int nicrealtek_shutdown(void); @@ -479,7 +479,7 @@
/* satasii.c */ -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 int satasii_init(void); int satasii_shutdown(void); void satasii_chip_writeb(uint8_t val, chipaddr addr); @@ -488,7 +488,7 @@ #endif
/* atahpt.c */ -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 int atahpt_init(void); int atahpt_shutdown(void); void atahpt_chip_writeb(uint8_t val, chipaddr addr); @@ -602,7 +602,7 @@ /* spi.c */ enum spi_controller { SPI_CONTROLLER_NONE, -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 SPI_CONTROLLER_ICH7, SPI_CONTROLLER_ICH9, SPI_CONTROLLER_IT87XX, @@ -610,16 +610,16 @@ SPI_CONTROLLER_VIA, SPI_CONTROLLER_WBSIO, #endif -#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 SPI_CONTROLLER_FT2232, #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 SPI_CONTROLLER_DUMMY, #endif -#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 SPI_CONTROLLER_BUSPIRATE, #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 SPI_CONTROLLER_DEDIPROG, #endif SPI_CONTROLLER_INVALID /* This must always be the last entry. */ Index: flashrom-config_foo_foo_support/spi25.c =================================================================== --- flashrom-config_foo_foo_support/spi25.c (Revision 1002) +++ flashrom-config_foo_foo_support/spi25.c (Arbeitskopie) @@ -171,23 +171,23 @@ { /* only some SPI chipsets support 4 bytes commands */ switch (spi_controller) { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 case SPI_CONTROLLER_ICH7: case SPI_CONTROLLER_ICH9: case SPI_CONTROLLER_VIA: case SPI_CONTROLLER_SB600: case SPI_CONTROLLER_WBSIO: #endif -#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 case SPI_CONTROLLER_FT2232: #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 case SPI_CONTROLLER_DUMMY: #endif -#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 case SPI_CONTROLLER_BUSPIRATE: #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 case SPI_CONTROLLER_DEDIPROG: #endif return probe_spi_rdid_generic(flash, 4); @@ -949,7 +949,7 @@ int result;
switch (spi_controller) { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 case SPI_CONTROLLER_WBSIO: msg_cerr("%s: impossible with Winbond SPI masters," " degrading to byte program\n", __func__); Index: flashrom-config_foo_foo_support/buspirate_spi.c =================================================================== --- flashrom-config_foo_foo_support/buspirate_spi.c (Revision 1002) +++ flashrom-config_foo_foo_support/buspirate_spi.c (Arbeitskopie) @@ -116,7 +116,7 @@ } if (!dev) { msg_perr("No serial device given. Use flashrom -p " - "buspiratespi:dev=/dev/ttyUSB0\n"); + "buspirate_spi:dev=/dev/ttyUSB0\n"); return 1; } if (speed) { Index: flashrom-config_foo_foo_support/spi.c =================================================================== --- flashrom-config_foo_foo_support/spi.c (Revision 1002) +++ flashrom-config_foo_foo_support/spi.c (Arbeitskopie) @@ -41,7 +41,7 @@ .write_256 = NULL, },
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 { /* SPI_CONTROLLER_ICH7 */ .command = ich_spi_send_command, .multicommand = ich_spi_send_multicommand, @@ -85,7 +85,7 @@ }, #endif
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 { /* SPI_CONTROLLER_FT2232 */ .command = ft2232_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -94,7 +94,7 @@ }, #endif
-#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 { /* SPI_CONTROLLER_DUMMY */ .command = dummy_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -103,7 +103,7 @@ }, #endif
-#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 { /* SPI_CONTROLLER_BUSPIRATE */ .command = buspirate_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -112,7 +112,7 @@ }, #endif
-#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 { /* SPI_CONTROLLER_DEDIPROG */ .command = dediprog_spi_send_command, .multicommand = default_spi_send_multicommand, Index: flashrom-config_foo_foo_support/Makefile =================================================================== --- flashrom-config_foo_foo_support/Makefile (Revision 1002) +++ flashrom-config_foo_foo_support/Makefile (Arbeitskopie) @@ -51,7 +51,7 @@ ifeq ($(OS_ARCH), DOS) CPPFLAGS += -I../libgetopt -I../libpci/include # Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATESPI = no +CONFIG_BUSPIRATE_SPI = no CONFIG_SERPROG = no endif
@@ -102,7 +102,7 @@ CONFIG_ATAHPT ?= no
# Always enable FT2232 SPI dongles for now. -CONFIG_FT2232SPI ?= yes +CONFIG_FT2232_SPI ?= yes
# Always enable dummy tracing for now. CONFIG_DUMMY ?= yes @@ -114,7 +114,7 @@ CONFIG_NICREALTEK ?= yes
# Always enable Bus Pirate SPI for now. -CONFIG_BUSPIRATESPI ?= yes +CONFIG_BUSPIRATE_SPI ?= yes
# Disable Dediprog SF100 until support is complete and tested. CONFIG_DEDIPROG ?= no @@ -123,13 +123,13 @@ CONFIG_PRINT_WIKI ?= no
ifeq ($(CONFIG_INTERNAL), yes) -FEATURE_CFLAGS += -D'INTERNAL_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1' PROGRAMMER_OBJS += chipset_enable.o board_enable.o cbtable.o dmi.o it87spi.o ichspi.o sb600spi.o wbsio_spi.o internal.o NEED_PCI := yes endif
ifeq ($(CONFIG_SERPROG), yes) -FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_SERPROG=1' PROGRAMMER_OBJS += serprog.o ifeq ($(OS_ARCH), SunOS) LIBS += -lsocket @@ -137,66 +137,66 @@ endif
ifeq ($(CONFIG_BITBANG_SPI), yes) -FEATURE_CFLAGS += -D'BITBANG_SPI_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1' PROGRAMMER_OBJS += bitbang_spi.o endif
ifeq ($(CONFIG_NIC3COM), yes) -FEATURE_CFLAGS += -D'NIC3COM_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1' PROGRAMMER_OBJS += nic3com.o NEED_PCI := yes endif
ifeq ($(CONFIG_GFXNVIDIA), yes) -FEATURE_CFLAGS += -D'GFXNVIDIA_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1' PROGRAMMER_OBJS += gfxnvidia.o NEED_PCI := yes endif
ifeq ($(CONFIG_SATASII), yes) -FEATURE_CFLAGS += -D'SATASII_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_SATASII=1' PROGRAMMER_OBJS += satasii.o NEED_PCI := yes endif
ifeq ($(CONFIG_ATAHPT), yes) -FEATURE_CFLAGS += -D'ATAHPT_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1' PROGRAMMER_OBJS += atahpt.o NEED_PCI := yes endif
-ifeq ($(CONFIG_FT2232SPI), yes) +ifeq ($(CONFIG_FT2232_SPI), yes) FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb") # This is a totally ugly hack. -FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'") +FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_FT2232_SPI=1'") FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)") PROGRAMMER_OBJS += ft2232_spi.o endif
ifeq ($(CONFIG_DUMMY), yes) -FEATURE_CFLAGS += -D'DUMMY_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DUMMY=1' PROGRAMMER_OBJS += dummyflasher.o endif
ifeq ($(CONFIG_DRKAISER), yes) -FEATURE_CFLAGS += -D'DRKAISER_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1' PROGRAMMER_OBJS += drkaiser.o NEED_PCI := yes endif
ifeq ($(CONFIG_NICREALTEK), yes) -FEATURE_CFLAGS += -D'NICREALTEK_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1' PROGRAMMER_OBJS += nicrealtek.o NEED_PCI := yes endif
-ifeq ($(CONFIG_BUSPIRATESPI), yes) -FEATURE_CFLAGS += -D'BUSPIRATE_SPI_SUPPORT=1' +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1' PROGRAMMER_OBJS += buspirate_spi.o endif
ifeq ($(CONFIG_DEDIPROG), yes) -FEATURE_CFLAGS += -D'DEDIPROG_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1' FEATURE_LIBS += -lusb PROGRAMMER_OBJS += dediprog.o endif @@ -205,7 +205,7 @@ ifeq ($(CONFIG_SERPROG), yes) LIB_OBJS += serial.o else -ifeq ($(CONFIG_BUSPIRATESPI), yes) +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) LIB_OBJS += serial.o endif endif @@ -231,7 +231,7 @@ endif
ifeq ($(CONFIG_PRINT_WIKI), yes) -FEATURE_CFLAGS += -D'PRINT_WIKI_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1' CLI_OBJS += print_wiki.o endif
@@ -304,7 +304,7 @@
.features: features
-ifeq ($(CONFIG_FT2232SPI), yes) +ifeq ($(CONFIG_FT2232_SPI), yes) features: compiler @echo "FEATURES := yes" > .features.tmp @printf "Checking for FTDI support... " Index: flashrom-config_foo_foo_support/ft2232_spi.c =================================================================== --- flashrom-config_foo_foo_support/ft2232_spi.c (Revision 1002) +++ flashrom-config_foo_foo_support/ft2232_spi.c (Arbeitskopie) @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1
#include <stdio.h> #include <stdint.h> Index: flashrom-config_foo_foo_support/cli_classic.c =================================================================== --- flashrom-config_foo_foo_support/cli_classic.c (Revision 1002) +++ flashrom-config_foo_foo_support/cli_classic.c (Arbeitskopie) @@ -38,7 +38,7 @@ enum programmer p;
printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|" -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 "-z|" #endif "-E|-r <file>|-w <file>|-v <file>]\n" @@ -65,7 +65,7 @@ " -V | --verbose more verbose output\n" " -c | --chip <chipname> probe only for specified " "flash chip\n" -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 /* FIXME: --mainboard should be a programmer parameter */ " -m | --mainboard <[vendor:]part> override mainboard " "detection\n" @@ -78,7 +78,7 @@ " -i | --image <name> only flash image <name> " "from flash layout\n" " -L | --list-supported print supported devices\n" -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 " -z | --list-supported-wiki print supported devices " "in wiki syntax\n" #endif @@ -110,7 +110,7 @@ }
printf("\nYou can specify one of -h, -R, -L, " -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 "-z, " #endif "-E, -r, -w, -v or no operation.\n" @@ -136,7 +136,7 @@ int force = 0; int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; int dont_verify_it = 0, list_supported = 0; -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 int list_supported_wiki = 0; #endif int operation_specified = 0; @@ -236,7 +236,7 @@ erase_it = 1; break; case 'm': -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 tempstr = strdup(optarg); lb_vendor_dev_from_string(tempstr); #else @@ -267,7 +267,7 @@ list_supported = 1; break; case 'z': -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); @@ -343,7 +343,7 @@ exit(0); }
-#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 if (list_supported_wiki) { print_supported_wiki(); exit(0); @@ -355,7 +355,7 @@ cli_classic_abort_usage(argv[0]); }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) { fprintf(stderr, "Error: --mainboard requires the internal " "programmer. Aborting.\n"); Index: flashrom-config_foo_foo_support/flashrom.c =================================================================== --- flashrom-config_foo_foo_support/flashrom.c (Revision 1002) +++ flashrom-config_foo_foo_support/flashrom.c (Arbeitskopie) @@ -37,9 +37,9 @@ char *chip_to_probe = NULL; int verbose = 0;
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 enum programmer programmer = PROGRAMMER_INTERNAL; -#elif DUMMY_SUPPORT == 1 +#elif CONFIG_DUMMY == 1 enum programmer programmer = PROGRAMMER_DUMMY; #else /* If neither internal nor dummy are selected, we must pick a sensible default. @@ -47,39 +47,39 @@ * if more than one of them is selected. If only one is selected, it is clear * that the user wants that one to become the default. */ -#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+ATAHPT_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT+DEDIPROG_SUPPORT+NICREALTEK_SUPPORT > 1 -#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all external programmers except one. +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT+CONFIG_FT2232_SPI+CONFIG_SERPROG+CONFIG_BUSPIRATE_SPI+CONFIG_DEDIPROG > 1 +#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all programmers except one. #endif enum programmer programmer = -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 PROGRAMMER_NIC3COM #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 PROGRAMMER_NICREALTEK PROGRAMMER_NICREALTEK2 #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 PROGRAMMER_GFXNVIDIA #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 PROGRAMMER_DRKAISER #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 PROGRAMMER_SATASII #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 PROGRAMMER_ATAHPT #endif -#if FT2232_SPI_SUPPORT == 1 - PROGRAMMER_FT2232SPI +#if CONFIG_FT2232_SPI == 1 + PROGRAMMER_FT2232_SPI #endif -#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 PROGRAMMER_SERPROG #endif -#if BUSPIRATE_SPI_SUPPORT == 1 - PROGRAMMER_BUSPIRATESPI +#if CONFIG_BUSPIRATE_SPI == 1 + PROGRAMMER_BUSPIRATE_SPI #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 PROGRAMMER_DEDIPROG #endif ; @@ -106,7 +106,7 @@ };
const struct programmer_entry programmer_table[] = { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 { .name = "internal", .init = internal_init, @@ -125,7 +125,7 @@ }, #endif
-#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 { .name = "dummy", .init = dummy_init, @@ -144,7 +144,7 @@ }, #endif
-#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 { .name = "nic3com", .init = nic3com_init, @@ -163,7 +163,7 @@ }, #endif
-#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 { .name = "nicrealtek", .init = nicrealtek_init, @@ -199,7 +199,7 @@ #endif
-#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 { .name = "gfxnvidia", .init = gfxnvidia_init, @@ -218,7 +218,7 @@ }, #endif
-#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 { .name = "drkaiser", .init = drkaiser_init, @@ -237,7 +237,7 @@ }, #endif
-#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 { .name = "satasii", .init = satasii_init, @@ -256,7 +256,7 @@ }, #endif
-#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 { .name = "atahpt", .init = atahpt_init, @@ -275,7 +275,7 @@ }, #endif
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 { .name = "it87spi", .init = it87spi_init, @@ -294,9 +294,9 @@ }, #endif
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 { - .name = "ft2232spi", + .name = "ft2232_spi", .init = ft2232_spi_init, .shutdown = noop_shutdown, /* Missing shutdown */ .map_flash_region = fallback_map, @@ -313,7 +313,7 @@ }, #endif
-#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 { .name = "serprog", .init = serprog_init, @@ -332,9 +332,9 @@ }, #endif
-#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 { - .name = "buspiratespi", + .name = "buspirate_spi", .init = buspirate_spi_init, .shutdown = buspirate_spi_shutdown, .map_flash_region = fallback_map, @@ -351,7 +351,7 @@ }, #endif
-#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 { .name = "dediprog", .init = dediprog_init, @@ -1251,7 +1251,7 @@ msg_gerr("SPI programmer table miscompilation!\n"); ret = 1; } -#if BITBANG_SPI_SUPPORT == 1 +#if CONFIG_BITBANG_SPI == 1 if (bitbang_spi_master_count - 1 != BITBANG_SPI_INVALID) { msg_gerr("Bitbanging SPI master table miscompilation!\n"); ret = 1; @@ -1402,7 +1402,7 @@ }
numbytes = fread(buf, 1, size, image); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 show_id(buf, size, force); #endif fclose(image); Index: flashrom-config_foo_foo_support/internal.c =================================================================== --- flashrom-config_foo_foo_support/internal.c (Revision 1002) +++ flashrom-config_foo_foo_support/internal.c (Arbeitskopie) @@ -98,7 +98,7 @@ } #endif
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 struct superio superio = {}; int force_boardenable = 0; int force_boardmismatch = 0; Index: flashrom-config_foo_foo_support/layout.c =================================================================== --- flashrom-config_foo_foo_support/layout.c (Revision 1002) +++ flashrom-config_foo_foo_support/layout.c (Arbeitskopie) @@ -23,7 +23,7 @@ #include <ctype.h> #include "flash.h"
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 char *mainboard_vendor = NULL; char *mainboard_part = NULL; #endif @@ -40,7 +40,7 @@
romlayout_t rom_entries[MAX_ROMLAYOUT];
-#if INTERNAL_SUPPORT == 1 /* FIXME: Move the whole block to cbtable.c? */ +#if CONFIG_INTERNAL == 1 /* FIXME: Move the whole block to cbtable.c? */ static char *def_name = "DEFAULT";
int show_id(uint8_t *bios, int size, int force) Index: flashrom-config_foo_foo_support/print_wiki.c =================================================================== --- flashrom-config_foo_foo_support/print_wiki.c (Revision 1002) +++ flashrom-config_foo_foo_support/print_wiki.c (Arbeitskopie) @@ -25,7 +25,7 @@ #include "flash.h" #include "flashchips.h"
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 struct board_info_url { const char *vendor; const char *name; @@ -46,7 +46,7 @@ generated by pasting '''flashrom -z''' output.<br />\ '''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 const char *chipset_th = "{| border="0" style="font-size: smaller"\n\ |- bgcolor="#6699dd"\n! align="left" | Vendor\n\ ! align="left" | Southbridge\n! align="left" | PCI IDs\n\ @@ -89,7 +89,7 @@ ! align="left" | Device\n! align="left" | PCI IDs\n\ ! align="left" | Status\n\n";
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ In general, flashing laptops is more difficult because laptops\n\n\ * often use the flash chip for stuff besides the BIOS,\n\ @@ -582,25 +582,25 @@ time_t t = time(NULL);
printf(wiki_header, ctime(&t), flashrom_version); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 print_supported_chips_wiki(); print_supported_chipsets_wiki(); print_supported_boards_wiki(); #endif printf("%s", programmer_section); -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 print_supported_pcidevs_wiki(nics_3com); #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 print_supported_pcidevs_wiki(gfx_nvidia); #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 print_supported_pcidevs_wiki(drkaiser_pcidev); #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 print_supported_pcidevs_wiki(satas_sii); #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 print_supported_pcidevs_wiki(ata_hpt); #endif printf("\n|}\n"); Index: flashrom-config_foo_foo_support/print.c =================================================================== --- flashrom-config_foo_foo_support/print.c (Revision 1002) +++ flashrom-config_foo_foo_support/print.c (Arbeitskopie) @@ -144,7 +144,7 @@ } }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 void print_supported_chipsets(void) { int i, j, chipsetcount = 0; @@ -227,33 +227,33 @@ void print_supported(void) { print_supported_chips(); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 print_supported_chipsets(); print_supported_boards(); #endif -#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1 printf("\nSupported PCI devices flashrom can use " "as programmer:\n\n"); #endif -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 print_supported_pcidevs(nics_3com); #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 print_supported_pcidevs(gfx_nvidia); #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 print_supported_pcidevs(drkaiser_pcidev); #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 print_supported_pcidevs(satas_sii); #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 print_supported_pcidevs(ata_hpt); #endif }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 /* Please keep this list alphabetically ordered by vendor/board. */ const struct board_info boards_ok[] = { /* Verified working boards that don't need write-enables. */
Rediffed to apply against latest svn HEAD.
So far, we have up to 4 different names for the same thing (ignoring capitalization): CONFIG_FT2232SPI (makefile config option) FT2232_SPI_SUPPORT (#define) ft2232spi (programmer name) ft2232_spi.c (programmer file)
Use CONFIG_* with underscores for makefile config options and #defines and kill the useless _SUPPORT idiom. Use lowercase names with underscores for programmer names and programmer files.
With this, you can run "grep -i ft2232_spi" and find everything related to the ft2232_spi driver. Same applies to all other programmers.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-config_foo_foo_support/flashrom.8 =================================================================== --- flashrom-config_foo_foo_support/flashrom.8 (Revision 1013) +++ flashrom-config_foo_foo_support/flashrom.8 (Arbeitskopie) @@ -166,11 +166,11 @@ .sp .BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)" .sp -.BR "* ft2232spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)" +.BR "* ft2232_spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)" .sp .BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)" .sp -.BR "* buspiratespi" " (for flash ROMs attached to a Bus Pirate)" +.BR "* buspirate_spi" " (for flash ROMs attached to a Bus Pirate)" .sp Some programmers have optional or mandatory parameters which are described in detail in the @@ -307,10 +307,10 @@ .B portnum is an I/O port number which must be a multiple of 8. .TP -.BR "ft2232spi " programmer +.BR "ft2232_spi " programmer An optional parameter species the controller type and interface/port it should support. For that you have to use the -.B "flashrom -p ft2232spi:model,port=interface" +.B "flashrom -p ft2232_spi:model,port=interface" syntax where .B model can be any of @@ -335,12 +335,12 @@ instead. More information about serprog is available in serprog-protocol.txt in the source distribution. .TP -.BR "buspiratespi " programmer +.BR "buspirate_spi " programmer A required dev parameter specifies the Bus Pirate device node and an optional spispeed parameter specifies the frequency of the SPI bus. The parameter delimiter is a comma. Syntax is .sp -.B "flashrom -p buspiratespi:dev=/dev/device,spispeed=frequency" +.B "flashrom -p buspirate_spi:dev=/dev/device,spispeed=frequency" .sp where .B frequency Index: flashrom-config_foo_foo_support/flash.h =================================================================== --- flashrom-config_foo_foo_support/flash.h (Revision 1013) +++ flashrom-config_foo_foo_support/flash.h (Arbeitskopie) @@ -37,46 +37,46 @@ typedef unsigned long chipaddr;
enum programmer { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 PROGRAMMER_INTERNAL, #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 PROGRAMMER_DUMMY, #endif -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 PROGRAMMER_NIC3COM, #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 PROGRAMMER_NICREALTEK, PROGRAMMER_NICREALTEK2, #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 PROGRAMMER_GFXNVIDIA, #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 PROGRAMMER_DRKAISER, #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 PROGRAMMER_SATASII, #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 PROGRAMMER_ATAHPT, #endif -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) PROGRAMMER_IT87SPI, #endif #endif -#if FT2232_SPI_SUPPORT == 1 - PROGRAMMER_FT2232SPI, +#if CONFIG_FT2232_SPI == 1 + PROGRAMMER_FT2232_SPI, #endif -#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 PROGRAMMER_SERPROG, #endif -#if BUSPIRATE_SPI_SUPPORT == 1 - PROGRAMMER_BUSPIRATESPI, +#if CONFIG_BUSPIRATE_SPI == 1 + PROGRAMMER_BUSPIRATE_SPI, #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 PROGRAMMER_DEDIPROG, #endif PROGRAMMER_INVALID /* This must always be the last entry. */ @@ -256,7 +256,7 @@
extern struct flashchip flashchips[];
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 struct penable { uint16_t vendor_id; uint16_t device_id; @@ -336,7 +336,7 @@ /* print.c */ char *flashbuses_to_text(enum chipbustype bustype); void print_supported(void); -#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) || (ATAHPT_SUPPORT == 1) || (NICREALTEK_SUPPORT == 1) +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1 void print_supported_pcidevs(struct pcidev_status *devs); #endif void print_supported_wiki(void); @@ -388,7 +388,7 @@ #endif void get_io_perms(void); void release_io_perms(void); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 extern int is_laptop; extern int force_boardenable; extern int force_boardmismatch; @@ -430,7 +430,7 @@ void fallback_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
/* dummyflasher.c */ -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 int dummy_init(void); int dummy_shutdown(void); void *dummy_map(const char *descr, unsigned long phys_addr, size_t len); @@ -448,7 +448,7 @@ #endif
/* nic3com.c */ -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 int nic3com_init(void); int nic3com_shutdown(void); void nic3com_chip_writeb(uint8_t val, chipaddr addr); @@ -457,7 +457,7 @@ #endif
/* gfxnvidia.c */ -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 int gfxnvidia_init(void); int gfxnvidia_shutdown(void); void gfxnvidia_chip_writeb(uint8_t val, chipaddr addr); @@ -466,7 +466,7 @@ #endif
/* drkaiser.c */ -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 int drkaiser_init(void); int drkaiser_shutdown(void); void drkaiser_chip_writeb(uint8_t val, chipaddr addr); @@ -475,7 +475,7 @@ #endif
/* nicrealtek.c */ -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 int nicrealtek_init(void); int nicsmc1211_init(void); int nicrealtek_shutdown(void); @@ -487,7 +487,7 @@
/* satasii.c */ -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 int satasii_init(void); int satasii_shutdown(void); void satasii_chip_writeb(uint8_t val, chipaddr addr); @@ -496,7 +496,7 @@ #endif
/* atahpt.c */ -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 int atahpt_init(void); int atahpt_shutdown(void); void atahpt_chip_writeb(uint8_t val, chipaddr addr); @@ -610,7 +610,7 @@ /* spi.c */ enum spi_controller { SPI_CONTROLLER_NONE, -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) SPI_CONTROLLER_ICH7, SPI_CONTROLLER_ICH9, @@ -620,16 +620,16 @@ SPI_CONTROLLER_WBSIO, #endif #endif -#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 SPI_CONTROLLER_FT2232, #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 SPI_CONTROLLER_DUMMY, #endif -#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 SPI_CONTROLLER_BUSPIRATE, #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 SPI_CONTROLLER_DEDIPROG, #endif SPI_CONTROLLER_INVALID /* This must always be the last entry. */ Index: flashrom-config_foo_foo_support/spi25.c =================================================================== --- flashrom-config_foo_foo_support/spi25.c (Revision 1013) +++ flashrom-config_foo_foo_support/spi25.c (Arbeitskopie) @@ -171,7 +171,7 @@ { /* only some SPI chipsets support 4 bytes commands */ switch (spi_controller) { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) case SPI_CONTROLLER_ICH7: case SPI_CONTROLLER_ICH9: @@ -180,16 +180,16 @@ case SPI_CONTROLLER_WBSIO: #endif #endif -#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 case SPI_CONTROLLER_FT2232: #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 case SPI_CONTROLLER_DUMMY: #endif -#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 case SPI_CONTROLLER_BUSPIRATE: #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 case SPI_CONTROLLER_DEDIPROG: #endif return probe_spi_rdid_generic(flash, 4); @@ -997,7 +997,7 @@ int result;
switch (spi_controller) { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) case SPI_CONTROLLER_WBSIO: msg_cerr("%s: impossible with Winbond SPI masters," Index: flashrom-config_foo_foo_support/buspirate_spi.c =================================================================== --- flashrom-config_foo_foo_support/buspirate_spi.c (Revision 1013) +++ flashrom-config_foo_foo_support/buspirate_spi.c (Arbeitskopie) @@ -116,7 +116,7 @@ } if (!dev) { msg_perr("No serial device given. Use flashrom -p " - "buspiratespi:dev=/dev/ttyUSB0\n"); + "buspirate_spi:dev=/dev/ttyUSB0\n"); return 1; } if (speed) { Index: flashrom-config_foo_foo_support/spi.c =================================================================== --- flashrom-config_foo_foo_support/spi.c (Revision 1013) +++ flashrom-config_foo_foo_support/spi.c (Arbeitskopie) @@ -41,7 +41,7 @@ .write_256 = NULL, },
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) { /* SPI_CONTROLLER_ICH7 */ .command = ich_spi_send_command, @@ -87,7 +87,7 @@ #endif #endif
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 { /* SPI_CONTROLLER_FT2232 */ .command = ft2232_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -96,7 +96,7 @@ }, #endif
-#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 { /* SPI_CONTROLLER_DUMMY */ .command = dummy_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -105,7 +105,7 @@ }, #endif
-#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 { /* SPI_CONTROLLER_BUSPIRATE */ .command = buspirate_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -114,7 +114,7 @@ }, #endif
-#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 { /* SPI_CONTROLLER_DEDIPROG */ .command = dediprog_spi_send_command, .multicommand = default_spi_send_multicommand, Index: flashrom-config_foo_foo_support/Makefile =================================================================== --- flashrom-config_foo_foo_support/Makefile (Revision 1013) +++ flashrom-config_foo_foo_support/Makefile (Arbeitskopie) @@ -51,7 +51,7 @@ ifeq ($(OS_ARCH), DOS) CPPFLAGS += -I../libgetopt -I../libpci/include # Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATESPI = no +CONFIG_BUSPIRATE_SPI = no CONFIG_SERPROG = no endif
@@ -102,7 +102,7 @@ CONFIG_ATAHPT ?= no
# Always enable FT2232 SPI dongles for now. -CONFIG_FT2232SPI ?= yes +CONFIG_FT2232_SPI ?= yes
# Always enable dummy tracing for now. CONFIG_DUMMY ?= yes @@ -114,7 +114,7 @@ CONFIG_NICREALTEK ?= yes
# Always enable Bus Pirate SPI for now. -CONFIG_BUSPIRATESPI ?= yes +CONFIG_BUSPIRATE_SPI ?= yes
# Disable Dediprog SF100 until support is complete and tested. CONFIG_DEDIPROG ?= no @@ -123,7 +123,7 @@ CONFIG_PRINT_WIKI ?= no
ifeq ($(CONFIG_INTERNAL), yes) -FEATURE_CFLAGS += -D'INTERNAL_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1' PROGRAMMER_OBJS += chipset_enable.o board_enable.o cbtable.o dmi.o internal.o # FIXME: The PROGRAMMER_OBJS below should only be included on x86. PROGRAMMER_OBJS += it87spi.o ichspi.o sb600spi.o wbsio_spi.o @@ -131,7 +131,7 @@ endif
ifeq ($(CONFIG_SERPROG), yes) -FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_SERPROG=1' PROGRAMMER_OBJS += serprog.o ifeq ($(OS_ARCH), SunOS) LIBS += -lsocket @@ -139,66 +139,66 @@ endif
ifeq ($(CONFIG_BITBANG_SPI), yes) -FEATURE_CFLAGS += -D'BITBANG_SPI_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1' PROGRAMMER_OBJS += bitbang_spi.o endif
ifeq ($(CONFIG_NIC3COM), yes) -FEATURE_CFLAGS += -D'NIC3COM_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1' PROGRAMMER_OBJS += nic3com.o NEED_PCI := yes endif
ifeq ($(CONFIG_GFXNVIDIA), yes) -FEATURE_CFLAGS += -D'GFXNVIDIA_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1' PROGRAMMER_OBJS += gfxnvidia.o NEED_PCI := yes endif
ifeq ($(CONFIG_SATASII), yes) -FEATURE_CFLAGS += -D'SATASII_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_SATASII=1' PROGRAMMER_OBJS += satasii.o NEED_PCI := yes endif
ifeq ($(CONFIG_ATAHPT), yes) -FEATURE_CFLAGS += -D'ATAHPT_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1' PROGRAMMER_OBJS += atahpt.o NEED_PCI := yes endif
-ifeq ($(CONFIG_FT2232SPI), yes) +ifeq ($(CONFIG_FT2232_SPI), yes) FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb") # This is a totally ugly hack. -FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'") +FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_FT2232_SPI=1'") FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)") PROGRAMMER_OBJS += ft2232_spi.o endif
ifeq ($(CONFIG_DUMMY), yes) -FEATURE_CFLAGS += -D'DUMMY_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DUMMY=1' PROGRAMMER_OBJS += dummyflasher.o endif
ifeq ($(CONFIG_DRKAISER), yes) -FEATURE_CFLAGS += -D'DRKAISER_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1' PROGRAMMER_OBJS += drkaiser.o NEED_PCI := yes endif
ifeq ($(CONFIG_NICREALTEK), yes) -FEATURE_CFLAGS += -D'NICREALTEK_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1' PROGRAMMER_OBJS += nicrealtek.o NEED_PCI := yes endif
-ifeq ($(CONFIG_BUSPIRATESPI), yes) -FEATURE_CFLAGS += -D'BUSPIRATE_SPI_SUPPORT=1' +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1' PROGRAMMER_OBJS += buspirate_spi.o endif
ifeq ($(CONFIG_DEDIPROG), yes) -FEATURE_CFLAGS += -D'DEDIPROG_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1' FEATURE_LIBS += -lusb PROGRAMMER_OBJS += dediprog.o endif @@ -207,7 +207,7 @@ ifeq ($(CONFIG_SERPROG), yes) LIB_OBJS += serial.o else -ifeq ($(CONFIG_BUSPIRATESPI), yes) +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) LIB_OBJS += serial.o endif endif @@ -233,7 +233,7 @@ endif
ifeq ($(CONFIG_PRINT_WIKI), yes) -FEATURE_CFLAGS += -D'PRINT_WIKI_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1' CLI_OBJS += print_wiki.o endif
@@ -306,7 +306,7 @@
.features: features
-ifeq ($(CONFIG_FT2232SPI), yes) +ifeq ($(CONFIG_FT2232_SPI), yes) features: compiler @echo "FEATURES := yes" > .features.tmp @printf "Checking for FTDI support... " Index: flashrom-config_foo_foo_support/ft2232_spi.c =================================================================== --- flashrom-config_foo_foo_support/ft2232_spi.c (Revision 1013) +++ flashrom-config_foo_foo_support/ft2232_spi.c (Arbeitskopie) @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1
#include <stdio.h> #include <stdint.h> Index: flashrom-config_foo_foo_support/cli_classic.c =================================================================== --- flashrom-config_foo_foo_support/cli_classic.c (Revision 1013) +++ flashrom-config_foo_foo_support/cli_classic.c (Arbeitskopie) @@ -38,7 +38,7 @@ enum programmer p;
printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|" -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 "-z|" #endif "-E|-r <file>|-w <file>|-v <file>]\n" @@ -65,7 +65,7 @@ " -V | --verbose more verbose output\n" " -c | --chip <chipname> probe only for specified " "flash chip\n" -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 /* FIXME: --mainboard should be a programmer parameter */ " -m | --mainboard <[vendor:]part> override mainboard " "detection\n" @@ -78,7 +78,7 @@ " -i | --image <name> only flash image <name> " "from flash layout\n" " -L | --list-supported print supported devices\n" -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 " -z | --list-supported-wiki print supported devices " "in wiki syntax\n" #endif @@ -110,7 +110,7 @@ }
printf("\nYou can specify one of -h, -R, -L, " -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 "-z, " #endif "-E, -r, -w, -v or no operation.\n" @@ -136,7 +136,7 @@ int force = 0; int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; int dont_verify_it = 0, list_supported = 0; -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 int list_supported_wiki = 0; #endif int operation_specified = 0; @@ -236,7 +236,7 @@ erase_it = 1; break; case 'm': -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 tempstr = strdup(optarg); lb_vendor_dev_from_string(tempstr); #else @@ -267,7 +267,7 @@ list_supported = 1; break; case 'z': -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); @@ -343,7 +343,7 @@ exit(0); }
-#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 if (list_supported_wiki) { print_supported_wiki(); exit(0); @@ -355,7 +355,7 @@ cli_classic_abort_usage(argv[0]); }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) { fprintf(stderr, "Error: --mainboard requires the internal " "programmer. Aborting.\n"); Index: flashrom-config_foo_foo_support/flashrom.c =================================================================== --- flashrom-config_foo_foo_support/flashrom.c (Revision 1013) +++ flashrom-config_foo_foo_support/flashrom.c (Arbeitskopie) @@ -37,9 +37,9 @@ char *chip_to_probe = NULL; int verbose = 0;
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 enum programmer programmer = PROGRAMMER_INTERNAL; -#elif DUMMY_SUPPORT == 1 +#elif CONFIG_DUMMY == 1 enum programmer programmer = PROGRAMMER_DUMMY; #else /* If neither internal nor dummy are selected, we must pick a sensible default. @@ -47,39 +47,39 @@ * if more than one of them is selected. If only one is selected, it is clear * that the user wants that one to become the default. */ -#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+ATAHPT_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT+DEDIPROG_SUPPORT+NICREALTEK_SUPPORT > 1 -#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all external programmers except one. +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT+CONFIG_FT2232_SPI+CONFIG_SERPROG+CONFIG_BUSPIRATE_SPI+CONFIG_DEDIPROG > 1 +#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all programmers except one. #endif enum programmer programmer = -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 PROGRAMMER_NIC3COM #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 PROGRAMMER_NICREALTEK PROGRAMMER_NICREALTEK2 #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 PROGRAMMER_GFXNVIDIA #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 PROGRAMMER_DRKAISER #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 PROGRAMMER_SATASII #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 PROGRAMMER_ATAHPT #endif -#if FT2232_SPI_SUPPORT == 1 - PROGRAMMER_FT2232SPI +#if CONFIG_FT2232_SPI == 1 + PROGRAMMER_FT2232_SPI #endif -#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 PROGRAMMER_SERPROG #endif -#if BUSPIRATE_SPI_SUPPORT == 1 - PROGRAMMER_BUSPIRATESPI +#if CONFIG_BUSPIRATE_SPI == 1 + PROGRAMMER_BUSPIRATE_SPI #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 PROGRAMMER_DEDIPROG #endif ; @@ -106,7 +106,7 @@ };
const struct programmer_entry programmer_table[] = { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 { .name = "internal", .init = internal_init, @@ -125,7 +125,7 @@ }, #endif
-#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 { .name = "dummy", .init = dummy_init, @@ -144,7 +144,7 @@ }, #endif
-#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 { .name = "nic3com", .init = nic3com_init, @@ -163,7 +163,7 @@ }, #endif
-#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 { .name = "nicrealtek", .init = nicrealtek_init, @@ -199,7 +199,7 @@ #endif
-#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 { .name = "gfxnvidia", .init = gfxnvidia_init, @@ -218,7 +218,7 @@ }, #endif
-#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 { .name = "drkaiser", .init = drkaiser_init, @@ -237,7 +237,7 @@ }, #endif
-#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 { .name = "satasii", .init = satasii_init, @@ -256,7 +256,7 @@ }, #endif
-#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 { .name = "atahpt", .init = atahpt_init, @@ -275,7 +275,7 @@ }, #endif
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) { .name = "it87spi", @@ -296,9 +296,9 @@ #endif #endif
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 { - .name = "ft2232spi", + .name = "ft2232_spi", .init = ft2232_spi_init, .shutdown = noop_shutdown, /* Missing shutdown */ .map_flash_region = fallback_map, @@ -315,7 +315,7 @@ }, #endif
-#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 { .name = "serprog", .init = serprog_init, @@ -334,9 +334,9 @@ }, #endif
-#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 { - .name = "buspiratespi", + .name = "buspirate_spi", .init = buspirate_spi_init, .shutdown = buspirate_spi_shutdown, .map_flash_region = fallback_map, @@ -353,7 +353,7 @@ }, #endif
-#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 { .name = "dediprog", .init = dediprog_init, @@ -1258,7 +1258,7 @@ msg_gerr("SPI programmer table miscompilation!\n"); ret = 1; } -#if BITBANG_SPI_SUPPORT == 1 +#if CONFIG_BITBANG_SPI == 1 if (bitbang_spi_master_count - 1 != BITBANG_SPI_INVALID) { msg_gerr("Bitbanging SPI master table miscompilation!\n"); ret = 1; @@ -1409,7 +1409,7 @@ }
numbytes = fread(buf, 1, size, image); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 show_id(buf, size, force); #endif fclose(image); Index: flashrom-config_foo_foo_support/internal.c =================================================================== --- flashrom-config_foo_foo_support/internal.c (Revision 1013) +++ flashrom-config_foo_foo_support/internal.c (Arbeitskopie) @@ -98,7 +98,7 @@ } #endif
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 int force_boardenable = 0; int force_boardmismatch = 0;
Index: flashrom-config_foo_foo_support/layout.c =================================================================== --- flashrom-config_foo_foo_support/layout.c (Revision 1013) +++ flashrom-config_foo_foo_support/layout.c (Arbeitskopie) @@ -23,7 +23,7 @@ #include <ctype.h> #include "flash.h"
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 char *mainboard_vendor = NULL; char *mainboard_part = NULL; #endif @@ -40,7 +40,7 @@
romlayout_t rom_entries[MAX_ROMLAYOUT];
-#if INTERNAL_SUPPORT == 1 /* FIXME: Move the whole block to cbtable.c? */ +#if CONFIG_INTERNAL == 1 /* FIXME: Move the whole block to cbtable.c? */ static char *def_name = "DEFAULT";
int show_id(uint8_t *bios, int size, int force) Index: flashrom-config_foo_foo_support/print_wiki.c =================================================================== --- flashrom-config_foo_foo_support/print_wiki.c (Revision 1013) +++ flashrom-config_foo_foo_support/print_wiki.c (Arbeitskopie) @@ -25,7 +25,7 @@ #include "flash.h" #include "flashchips.h"
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 struct board_info_url { const char *vendor; const char *name; @@ -46,7 +46,7 @@ generated by pasting '''flashrom -z''' output.<br />\ '''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 const char *chipset_th = "{| border="0" style="font-size: smaller"\n\ |- bgcolor="#6699dd"\n! align="left" | Vendor\n\ ! align="left" | Southbridge\n! align="left" | PCI IDs\n\ @@ -89,7 +89,7 @@ ! align="left" | Device\n! align="left" | PCI IDs\n\ ! align="left" | Status\n\n";
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ In general, flashing laptops is more difficult because laptops\n\n\ * often use the flash chip for stuff besides the BIOS,\n\ @@ -599,29 +599,29 @@ time_t t = time(NULL);
printf(wiki_header, ctime(&t), flashrom_version); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 print_supported_chips_wiki(2); print_supported_chipsets_wiki(3); print_supported_boards_wiki(); #endif printf("%s", programmer_section); -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 print_supported_pcidevs_wiki(nics_3com); #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 print_supported_pcidevs_wiki(nics_realtek); print_supported_pcidevs_wiki(nics_realteksmc1211); #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 print_supported_pcidevs_wiki(gfx_nvidia); #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 print_supported_pcidevs_wiki(drkaiser_pcidev); #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 print_supported_pcidevs_wiki(satas_sii); #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 print_supported_pcidevs_wiki(ata_hpt); #endif printf("\n|}\n"); Index: flashrom-config_foo_foo_support/print.c =================================================================== --- flashrom-config_foo_foo_support/print.c (Revision 1013) +++ flashrom-config_foo_foo_support/print.c (Arbeitskopie) @@ -144,7 +144,7 @@ } }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 void print_supported_chipsets(void) { int i, j, chipsetcount = 0; @@ -227,37 +227,37 @@ void print_supported(void) { print_supported_chips(); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 print_supported_chipsets(); print_supported_boards(); #endif -#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1 printf("\nSupported PCI devices flashrom can use " "as programmer:\n\n"); #endif -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 print_supported_pcidevs(nics_3com); #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 print_supported_pcidevs(nics_realtek); print_supported_pcidevs(nics_realteksmc1211); #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 print_supported_pcidevs(gfx_nvidia); #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 print_supported_pcidevs(drkaiser_pcidev); #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 print_supported_pcidevs(satas_sii); #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 print_supported_pcidevs(ata_hpt); #endif }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 /* Please keep this list alphabetically ordered by vendor/board. */ const struct board_info boards_ok[] = { /* Verified working boards that don't need write-enables. */
Rediffed against current svn.
So far, we have up to 4 different names for the same thing (ignoring capitalization): CONFIG_FT2232SPI (makefile config option) FT2232_SPI_SUPPORT (#define) ft2232spi (programmer name) ft2232_spi.c (programmer file)
Use CONFIG_* with underscores for makefile config options and #defines and kill the useless _SUPPORT idiom. Use lowercase names with underscores for programmer names and programmer files.
With this, you can run "grep -i ft2232_spi" and find everything related to the ft2232_spi driver. Same applies to all other programmers.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-config_foo_foo_support/flashrom.8 =================================================================== --- flashrom-config_foo_foo_support/flashrom.8 (Revision 1022) +++ flashrom-config_foo_foo_support/flashrom.8 (Arbeitskopie) @@ -166,11 +166,11 @@ .sp .BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)" .sp -.BR "* ft2232spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)" +.BR "* ft2232_spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)" .sp .BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)" .sp -.BR "* buspiratespi" " (for flash ROMs attached to a Bus Pirate)" +.BR "* buspirate_spi" " (for flash ROMs attached to a Bus Pirate)" .sp Some programmers have optional or mandatory parameters which are described in detail in the @@ -307,10 +307,10 @@ .B portnum is an I/O port number which must be a multiple of 8. .TP -.BR "ft2232spi " programmer +.BR "ft2232_spi " programmer An optional parameter species the controller type and interface/port it should support. For that you have to use the -.B "flashrom -p ft2232spi:model,port=interface" +.B "flashrom -p ft2232_spi:model,port=interface" syntax where .B model can be any of @@ -335,12 +335,12 @@ instead. More information about serprog is available in serprog-protocol.txt in the source distribution. .TP -.BR "buspiratespi " programmer +.BR "buspirate_spi " programmer A required dev parameter specifies the Bus Pirate device node and an optional spispeed parameter specifies the frequency of the SPI bus. The parameter delimiter is a comma. Syntax is .sp -.B "flashrom -p buspiratespi:dev=/dev/device,spispeed=frequency" +.B "flashrom -p buspirate_spi:dev=/dev/device,spispeed=frequency" .sp where .B frequency Index: flashrom-config_foo_foo_support/flash.h =================================================================== --- flashrom-config_foo_foo_support/flash.h (Revision 1022) +++ flashrom-config_foo_foo_support/flash.h (Arbeitskopie) @@ -39,46 +39,46 @@ typedef unsigned long chipaddr;
enum programmer { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 PROGRAMMER_INTERNAL, #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 PROGRAMMER_DUMMY, #endif -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 PROGRAMMER_NIC3COM, #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 PROGRAMMER_NICREALTEK, PROGRAMMER_NICREALTEK2, #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 PROGRAMMER_GFXNVIDIA, #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 PROGRAMMER_DRKAISER, #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 PROGRAMMER_SATASII, #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 PROGRAMMER_ATAHPT, #endif -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) PROGRAMMER_IT87SPI, #endif #endif -#if FT2232_SPI_SUPPORT == 1 - PROGRAMMER_FT2232SPI, +#if CONFIG_FT2232_SPI == 1 + PROGRAMMER_FT2232_SPI, #endif -#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 PROGRAMMER_SERPROG, #endif -#if BUSPIRATE_SPI_SUPPORT == 1 - PROGRAMMER_BUSPIRATESPI, +#if CONFIG_BUSPIRATE_SPI == 1 + PROGRAMMER_BUSPIRATE_SPI, #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 PROGRAMMER_DEDIPROG, #endif PROGRAMMER_INVALID /* This must always be the last entry. */ @@ -258,7 +258,7 @@
extern struct flashchip flashchips[];
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 struct penable { uint16_t vendor_id; uint16_t device_id; @@ -338,7 +338,7 @@ /* print.c */ char *flashbuses_to_text(enum chipbustype bustype); void print_supported(void); -#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) || (ATAHPT_SUPPORT == 1) || (NICREALTEK_SUPPORT == 1) +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1 void print_supported_pcidevs(struct pcidev_status *devs); #endif void print_supported_wiki(void); @@ -390,7 +390,7 @@ #endif void get_io_perms(void); void release_io_perms(void); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 extern int is_laptop; extern int force_boardenable; extern int force_boardmismatch; @@ -432,7 +432,7 @@ void fallback_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
/* dummyflasher.c */ -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 int dummy_init(void); int dummy_shutdown(void); void *dummy_map(const char *descr, unsigned long phys_addr, size_t len); @@ -450,7 +450,7 @@ #endif
/* nic3com.c */ -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 int nic3com_init(void); int nic3com_shutdown(void); void nic3com_chip_writeb(uint8_t val, chipaddr addr); @@ -459,7 +459,7 @@ #endif
/* gfxnvidia.c */ -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 int gfxnvidia_init(void); int gfxnvidia_shutdown(void); void gfxnvidia_chip_writeb(uint8_t val, chipaddr addr); @@ -468,7 +468,7 @@ #endif
/* drkaiser.c */ -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 int drkaiser_init(void); int drkaiser_shutdown(void); void drkaiser_chip_writeb(uint8_t val, chipaddr addr); @@ -477,7 +477,7 @@ #endif
/* nicrealtek.c */ -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 int nicrealtek_init(void); int nicsmc1211_init(void); int nicrealtek_shutdown(void); @@ -489,7 +489,7 @@
/* satasii.c */ -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 int satasii_init(void); int satasii_shutdown(void); void satasii_chip_writeb(uint8_t val, chipaddr addr); @@ -498,7 +498,7 @@ #endif
/* atahpt.c */ -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 int atahpt_init(void); int atahpt_shutdown(void); void atahpt_chip_writeb(uint8_t val, chipaddr addr); @@ -611,7 +611,7 @@ /* spi.c */ enum spi_controller { SPI_CONTROLLER_NONE, -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) SPI_CONTROLLER_ICH7, SPI_CONTROLLER_ICH9, @@ -621,16 +621,16 @@ SPI_CONTROLLER_WBSIO, #endif #endif -#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 SPI_CONTROLLER_FT2232, #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 SPI_CONTROLLER_DUMMY, #endif -#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 SPI_CONTROLLER_BUSPIRATE, #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 SPI_CONTROLLER_DEDIPROG, #endif SPI_CONTROLLER_INVALID /* This must always be the last entry. */ Index: flashrom-config_foo_foo_support/spi25.c =================================================================== --- flashrom-config_foo_foo_support/spi25.c (Revision 1022) +++ flashrom-config_foo_foo_support/spi25.c (Arbeitskopie) @@ -171,7 +171,7 @@ { /* only some SPI chipsets support 4 bytes commands */ switch (spi_controller) { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) case SPI_CONTROLLER_ICH7: case SPI_CONTROLLER_ICH9: @@ -180,16 +180,16 @@ case SPI_CONTROLLER_WBSIO: #endif #endif -#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 case SPI_CONTROLLER_FT2232: #endif -#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 case SPI_CONTROLLER_DUMMY: #endif -#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 case SPI_CONTROLLER_BUSPIRATE: #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 case SPI_CONTROLLER_DEDIPROG: #endif return probe_spi_rdid_generic(flash, 4); @@ -1023,7 +1023,7 @@ int result;
switch (spi_controller) { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) case SPI_CONTROLLER_WBSIO: msg_cerr("%s: impossible with Winbond SPI masters," Index: flashrom-config_foo_foo_support/buspirate_spi.c =================================================================== --- flashrom-config_foo_foo_support/buspirate_spi.c (Revision 1022) +++ flashrom-config_foo_foo_support/buspirate_spi.c (Arbeitskopie) @@ -116,7 +116,7 @@ } if (!dev) { msg_perr("No serial device given. Use flashrom -p " - "buspiratespi:dev=/dev/ttyUSB0\n"); + "buspirate_spi:dev=/dev/ttyUSB0\n"); return 1; } if (speed) { Index: flashrom-config_foo_foo_support/spi.c =================================================================== --- flashrom-config_foo_foo_support/spi.c (Revision 1022) +++ flashrom-config_foo_foo_support/spi.c (Arbeitskopie) @@ -40,7 +40,7 @@ .write_256 = NULL, },
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) { /* SPI_CONTROLLER_ICH7 */ .command = ich_spi_send_command, @@ -86,7 +86,7 @@ #endif #endif
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 { /* SPI_CONTROLLER_FT2232 */ .command = ft2232_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -95,7 +95,7 @@ }, #endif
-#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 { /* SPI_CONTROLLER_DUMMY */ .command = dummy_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -104,7 +104,7 @@ }, #endif
-#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 { /* SPI_CONTROLLER_BUSPIRATE */ .command = buspirate_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -113,7 +113,7 @@ }, #endif
-#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 { /* SPI_CONTROLLER_DEDIPROG */ .command = dediprog_spi_send_command, .multicommand = default_spi_send_multicommand, @@ -214,7 +214,7 @@ uint32_t spi_get_valid_read_addr(void) { switch (spi_controller) { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) case SPI_CONTROLLER_ICH7: /* Return BBAR for ICH chipsets. */ Index: flashrom-config_foo_foo_support/Makefile =================================================================== --- flashrom-config_foo_foo_support/Makefile (Revision 1022) +++ flashrom-config_foo_foo_support/Makefile (Arbeitskopie) @@ -51,7 +51,7 @@ ifeq ($(OS_ARCH), DOS) CPPFLAGS += -I../libgetopt -I../libpci/include # Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATESPI = no +CONFIG_BUSPIRATE_SPI = no CONFIG_SERPROG = no endif
@@ -102,7 +102,7 @@ CONFIG_ATAHPT ?= no
# Always enable FT2232 SPI dongles for now. -CONFIG_FT2232SPI ?= yes +CONFIG_FT2232_SPI ?= yes
# Always enable dummy tracing for now. CONFIG_DUMMY ?= yes @@ -114,7 +114,7 @@ CONFIG_NICREALTEK ?= yes
# Always enable Bus Pirate SPI for now. -CONFIG_BUSPIRATESPI ?= yes +CONFIG_BUSPIRATE_SPI ?= yes
# Disable Dediprog SF100 until support is complete and tested. CONFIG_DEDIPROG ?= no @@ -123,7 +123,7 @@ CONFIG_PRINT_WIKI ?= no
ifeq ($(CONFIG_INTERNAL), yes) -FEATURE_CFLAGS += -D'INTERNAL_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1' PROGRAMMER_OBJS += chipset_enable.o board_enable.o cbtable.o dmi.o internal.o # FIXME: The PROGRAMMER_OBJS below should only be included on x86. PROGRAMMER_OBJS += it87spi.o ichspi.o sb600spi.o wbsio_spi.o @@ -131,7 +131,7 @@ endif
ifeq ($(CONFIG_SERPROG), yes) -FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_SERPROG=1' PROGRAMMER_OBJS += serprog.o ifeq ($(OS_ARCH), SunOS) LIBS += -lsocket @@ -139,66 +139,66 @@ endif
ifeq ($(CONFIG_BITBANG_SPI), yes) -FEATURE_CFLAGS += -D'BITBANG_SPI_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1' PROGRAMMER_OBJS += bitbang_spi.o endif
ifeq ($(CONFIG_NIC3COM), yes) -FEATURE_CFLAGS += -D'NIC3COM_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1' PROGRAMMER_OBJS += nic3com.o NEED_PCI := yes endif
ifeq ($(CONFIG_GFXNVIDIA), yes) -FEATURE_CFLAGS += -D'GFXNVIDIA_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1' PROGRAMMER_OBJS += gfxnvidia.o NEED_PCI := yes endif
ifeq ($(CONFIG_SATASII), yes) -FEATURE_CFLAGS += -D'SATASII_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_SATASII=1' PROGRAMMER_OBJS += satasii.o NEED_PCI := yes endif
ifeq ($(CONFIG_ATAHPT), yes) -FEATURE_CFLAGS += -D'ATAHPT_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1' PROGRAMMER_OBJS += atahpt.o NEED_PCI := yes endif
-ifeq ($(CONFIG_FT2232SPI), yes) +ifeq ($(CONFIG_FT2232_SPI), yes) FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb") # This is a totally ugly hack. -FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'") +FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_FT2232_SPI=1'") FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)") PROGRAMMER_OBJS += ft2232_spi.o endif
ifeq ($(CONFIG_DUMMY), yes) -FEATURE_CFLAGS += -D'DUMMY_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DUMMY=1' PROGRAMMER_OBJS += dummyflasher.o endif
ifeq ($(CONFIG_DRKAISER), yes) -FEATURE_CFLAGS += -D'DRKAISER_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1' PROGRAMMER_OBJS += drkaiser.o NEED_PCI := yes endif
ifeq ($(CONFIG_NICREALTEK), yes) -FEATURE_CFLAGS += -D'NICREALTEK_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1' PROGRAMMER_OBJS += nicrealtek.o NEED_PCI := yes endif
-ifeq ($(CONFIG_BUSPIRATESPI), yes) -FEATURE_CFLAGS += -D'BUSPIRATE_SPI_SUPPORT=1' +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1' PROGRAMMER_OBJS += buspirate_spi.o endif
ifeq ($(CONFIG_DEDIPROG), yes) -FEATURE_CFLAGS += -D'DEDIPROG_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1' FEATURE_LIBS += -lusb PROGRAMMER_OBJS += dediprog.o endif @@ -207,7 +207,7 @@ ifeq ($(CONFIG_SERPROG), yes) LIB_OBJS += serial.o else -ifeq ($(CONFIG_BUSPIRATESPI), yes) +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) LIB_OBJS += serial.o endif endif @@ -233,7 +233,7 @@ endif
ifeq ($(CONFIG_PRINT_WIKI), yes) -FEATURE_CFLAGS += -D'PRINT_WIKI_SUPPORT=1' +FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1' CLI_OBJS += print_wiki.o endif
@@ -308,7 +308,7 @@
.features: features
-ifeq ($(CONFIG_FT2232SPI), yes) +ifeq ($(CONFIG_FT2232_SPI), yes) features: compiler @echo "FEATURES := yes" > .features.tmp @printf "Checking for FTDI support... " Index: flashrom-config_foo_foo_support/ft2232_spi.c =================================================================== --- flashrom-config_foo_foo_support/ft2232_spi.c (Revision 1022) +++ flashrom-config_foo_foo_support/ft2232_spi.c (Arbeitskopie) @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1
#include <stdio.h> #include <stdint.h> Index: flashrom-config_foo_foo_support/cli_classic.c =================================================================== --- flashrom-config_foo_foo_support/cli_classic.c (Revision 1022) +++ flashrom-config_foo_foo_support/cli_classic.c (Arbeitskopie) @@ -39,7 +39,7 @@ enum programmer p;
printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|" -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 "-z|" #endif "-E|-r <file>|-w <file>|-v <file>]\n" @@ -66,7 +66,7 @@ " -V | --verbose more verbose output\n" " -c | --chip <chipname> probe only for specified " "flash chip\n" -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 /* FIXME: --mainboard should be a programmer parameter */ " -m | --mainboard <[vendor:]part> override mainboard " "detection\n" @@ -79,7 +79,7 @@ " -i | --image <name> only flash image <name> " "from flash layout\n" " -L | --list-supported print supported devices\n" -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 " -z | --list-supported-wiki print supported devices " "in wiki syntax\n" #endif @@ -111,7 +111,7 @@ }
printf("\nYou can specify one of -h, -R, -L, " -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 "-z, " #endif "-E, -r, -w, -v or no operation.\n" @@ -137,7 +137,7 @@ int force = 0; int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; int dont_verify_it = 0, list_supported = 0; -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 int list_supported_wiki = 0; #endif int operation_specified = 0; @@ -237,7 +237,7 @@ erase_it = 1; break; case 'm': -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 tempstr = strdup(optarg); lb_vendor_dev_from_string(tempstr); #else @@ -268,7 +268,7 @@ list_supported = 1; break; case 'z': -#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); @@ -344,7 +344,7 @@ exit(0); }
-#if PRINT_WIKI_SUPPORT == 1 +#if CONFIG_PRINT_WIKI == 1 if (list_supported_wiki) { print_supported_wiki(); exit(0); @@ -356,7 +356,7 @@ cli_classic_abort_usage(argv[0]); }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) { fprintf(stderr, "Error: --mainboard requires the internal " "programmer. Aborting.\n"); Index: flashrom-config_foo_foo_support/flashrom.c =================================================================== --- flashrom-config_foo_foo_support/flashrom.c (Revision 1022) +++ flashrom-config_foo_foo_support/flashrom.c (Arbeitskopie) @@ -38,9 +38,9 @@ char *chip_to_probe = NULL; int verbose = 0;
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 enum programmer programmer = PROGRAMMER_INTERNAL; -#elif DUMMY_SUPPORT == 1 +#elif CONFIG_DUMMY == 1 enum programmer programmer = PROGRAMMER_DUMMY; #else /* If neither internal nor dummy are selected, we must pick a sensible default. @@ -48,39 +48,39 @@ * if more than one of them is selected. If only one is selected, it is clear * that the user wants that one to become the default. */ -#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+ATAHPT_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT+DEDIPROG_SUPPORT+NICREALTEK_SUPPORT > 1 -#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all external programmers except one. +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT+CONFIG_FT2232_SPI+CONFIG_SERPROG+CONFIG_BUSPIRATE_SPI+CONFIG_DEDIPROG > 1 +#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all programmers except one. #endif enum programmer programmer = -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 PROGRAMMER_NIC3COM #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 PROGRAMMER_NICREALTEK PROGRAMMER_NICREALTEK2 #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 PROGRAMMER_GFXNVIDIA #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 PROGRAMMER_DRKAISER #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 PROGRAMMER_SATASII #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 PROGRAMMER_ATAHPT #endif -#if FT2232_SPI_SUPPORT == 1 - PROGRAMMER_FT2232SPI +#if CONFIG_FT2232_SPI == 1 + PROGRAMMER_FT2232_SPI #endif -#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 PROGRAMMER_SERPROG #endif -#if BUSPIRATE_SPI_SUPPORT == 1 - PROGRAMMER_BUSPIRATESPI +#if CONFIG_BUSPIRATE_SPI == 1 + PROGRAMMER_BUSPIRATE_SPI #endif -#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 PROGRAMMER_DEDIPROG #endif ; @@ -107,7 +107,7 @@ };
const struct programmer_entry programmer_table[] = { -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 { .name = "internal", .init = internal_init, @@ -126,7 +126,7 @@ }, #endif
-#if DUMMY_SUPPORT == 1 +#if CONFIG_DUMMY == 1 { .name = "dummy", .init = dummy_init, @@ -145,7 +145,7 @@ }, #endif
-#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 { .name = "nic3com", .init = nic3com_init, @@ -164,7 +164,7 @@ }, #endif
-#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 { .name = "nicrealtek", .init = nicrealtek_init, @@ -200,7 +200,7 @@ #endif
-#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 { .name = "gfxnvidia", .init = gfxnvidia_init, @@ -219,7 +219,7 @@ }, #endif
-#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 { .name = "drkaiser", .init = drkaiser_init, @@ -238,7 +238,7 @@ }, #endif
-#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 { .name = "satasii", .init = satasii_init, @@ -257,7 +257,7 @@ }, #endif
-#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 { .name = "atahpt", .init = atahpt_init, @@ -276,7 +276,7 @@ }, #endif
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 #if defined(__i386__) || defined(__x86_64__) { .name = "it87spi", @@ -297,9 +297,9 @@ #endif #endif
-#if FT2232_SPI_SUPPORT == 1 +#if CONFIG_FT2232_SPI == 1 { - .name = "ft2232spi", + .name = "ft2232_spi", .init = ft2232_spi_init, .shutdown = noop_shutdown, /* Missing shutdown */ .map_flash_region = fallback_map, @@ -316,7 +316,7 @@ }, #endif
-#if SERPROG_SUPPORT == 1 +#if CONFIG_SERPROG == 1 { .name = "serprog", .init = serprog_init, @@ -335,9 +335,9 @@ }, #endif
-#if BUSPIRATE_SPI_SUPPORT == 1 +#if CONFIG_BUSPIRATE_SPI == 1 { - .name = "buspiratespi", + .name = "buspirate_spi", .init = buspirate_spi_init, .shutdown = buspirate_spi_shutdown, .map_flash_region = fallback_map, @@ -354,7 +354,7 @@ }, #endif
-#if DEDIPROG_SUPPORT == 1 +#if CONFIG_DEDIPROG == 1 { .name = "dediprog", .init = dediprog_init, @@ -1259,7 +1259,7 @@ msg_gerr("SPI programmer table miscompilation!\n"); ret = 1; } -#if BITBANG_SPI_SUPPORT == 1 +#if CONFIG_BITBANG_SPI == 1 if (bitbang_spi_master_count - 1 != BITBANG_SPI_INVALID) { msg_gerr("Bitbanging SPI master table miscompilation!\n"); ret = 1; @@ -1410,7 +1410,7 @@ }
numbytes = fread(buf, 1, size, image); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 show_id(buf, size, force); #endif fclose(image); Index: flashrom-config_foo_foo_support/internal.c =================================================================== --- flashrom-config_foo_foo_support/internal.c (Revision 1022) +++ flashrom-config_foo_foo_support/internal.c (Arbeitskopie) @@ -98,7 +98,7 @@ } #endif
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 int force_boardenable = 0; int force_boardmismatch = 0;
Index: flashrom-config_foo_foo_support/layout.c =================================================================== --- flashrom-config_foo_foo_support/layout.c (Revision 1022) +++ flashrom-config_foo_foo_support/layout.c (Arbeitskopie) @@ -24,7 +24,7 @@ #include <ctype.h> #include "flash.h"
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 char *mainboard_vendor = NULL; char *mainboard_part = NULL; #endif @@ -41,7 +41,7 @@
romlayout_t rom_entries[MAX_ROMLAYOUT];
-#if INTERNAL_SUPPORT == 1 /* FIXME: Move the whole block to cbtable.c? */ +#if CONFIG_INTERNAL == 1 /* FIXME: Move the whole block to cbtable.c? */ static char *def_name = "DEFAULT";
int show_id(uint8_t *bios, int size, int force) Index: flashrom-config_foo_foo_support/print_wiki.c =================================================================== --- flashrom-config_foo_foo_support/print_wiki.c (Revision 1022) +++ flashrom-config_foo_foo_support/print_wiki.c (Arbeitskopie) @@ -25,7 +25,7 @@ #include "flash.h" #include "flashchips.h"
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 struct board_info_url { const char *vendor; const char *name; @@ -46,7 +46,7 @@ generated by pasting '''flashrom -z''' output.<br />\ '''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 const char *chipset_th = "{| border="0" style="font-size: smaller"\n\ |- bgcolor="#6699dd"\n! align="left" | Vendor\n\ ! align="left" | Southbridge\n! align="left" | PCI IDs\n\ @@ -89,7 +89,7 @@ ! align="left" | Device\n! align="left" | PCI IDs\n\ ! align="left" | Status\n\n";
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ In general, flashing laptops is more difficult because laptops\n\n\ * often use the flash chip for stuff besides the BIOS,\n\ @@ -599,29 +599,29 @@ time_t t = time(NULL);
printf(wiki_header, ctime(&t), flashrom_version); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 print_supported_chips_wiki(2); print_supported_chipsets_wiki(3); print_supported_boards_wiki(); #endif printf("%s", programmer_section); -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 print_supported_pcidevs_wiki(nics_3com); #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 print_supported_pcidevs_wiki(nics_realtek); print_supported_pcidevs_wiki(nics_realteksmc1211); #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 print_supported_pcidevs_wiki(gfx_nvidia); #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 print_supported_pcidevs_wiki(drkaiser_pcidev); #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 print_supported_pcidevs_wiki(satas_sii); #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 print_supported_pcidevs_wiki(ata_hpt); #endif printf("\n|}\n"); Index: flashrom-config_foo_foo_support/print.c =================================================================== --- flashrom-config_foo_foo_support/print.c (Revision 1022) +++ flashrom-config_foo_foo_support/print.c (Arbeitskopie) @@ -145,7 +145,7 @@ } }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 void print_supported_chipsets(void) { int i, j, chipsetcount = 0; @@ -228,37 +228,37 @@ void print_supported(void) { print_supported_chips(); -#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 print_supported_chipsets(); print_supported_boards(); #endif -#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) +#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1 printf("\nSupported PCI devices flashrom can use " "as programmer:\n\n"); #endif -#if NIC3COM_SUPPORT == 1 +#if CONFIG_NIC3COM == 1 print_supported_pcidevs(nics_3com); #endif -#if NICREALTEK_SUPPORT == 1 +#if CONFIG_NICREALTEK == 1 print_supported_pcidevs(nics_realtek); print_supported_pcidevs(nics_realteksmc1211); #endif -#if GFXNVIDIA_SUPPORT == 1 +#if CONFIG_GFXNVIDIA == 1 print_supported_pcidevs(gfx_nvidia); #endif -#if DRKAISER_SUPPORT == 1 +#if CONFIG_DRKAISER == 1 print_supported_pcidevs(drkaiser_pcidev); #endif -#if SATASII_SUPPORT == 1 +#if CONFIG_SATASII == 1 print_supported_pcidevs(satas_sii); #endif -#if ATAHPT_SUPPORT == 1 +#if CONFIG_ATAHPT == 1 print_supported_pcidevs(ata_hpt); #endif }
-#if INTERNAL_SUPPORT == 1 +#if CONFIG_INTERNAL == 1 /* Please keep this list alphabetically ordered by vendor/board. */ const struct board_info boards_ok[] = { /* Verified working boards that don't need write-enables. */
On Mon, May 31, 2010 at 03:26:34PM +0200, Carl-Daniel Hailfinger wrote:
Rediffed against current svn.
So far, we have up to 4 different names for the same thing (ignoring capitalization): CONFIG_FT2232SPI (makefile config option) FT2232_SPI_SUPPORT (#define) ft2232spi (programmer name) ft2232_spi.c (programmer file)
Use CONFIG_* with underscores for makefile config options and #defines and kill the useless _SUPPORT idiom. Use lowercase names with underscores for programmer names and programmer files.
With this, you can run "grep -i ft2232_spi" and find everything related to the ft2232_spi driver. Same applies to all other programmers.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Looks good and builds for me.
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Uwe.
On 31.05.2010 17:25, Uwe Hermann wrote:
On Mon, May 31, 2010 at 03:26:34PM +0200, Carl-Daniel Hailfinger wrote:
Use CONFIG_* with underscores for makefile config options and #defines and kill the useless _SUPPORT idiom. Use lowercase names with underscores for programmer names and programmer files.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Looks good and builds for me.
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Thanks, committed in r1023.
Regards, Carl-Daniel