1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +02:00

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.

Corresponding to flashrom svn r1023.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
This commit is contained in:
Carl-Daniel Hailfinger 2010-05-31 15:27:27 +00:00
parent a0020df630
commit 71127727dc
13 changed files with 136 additions and 136 deletions

View File

@ -51,7 +51,7 @@ endif
ifeq ($(OS_ARCH), DOS) ifeq ($(OS_ARCH), DOS)
CPPFLAGS += -I../libgetopt -I../libpci/include CPPFLAGS += -I../libgetopt -I../libpci/include
# Bus Pirate and Serprog are not supported under DOS. # Bus Pirate and Serprog are not supported under DOS.
CONFIG_BUSPIRATESPI = no CONFIG_BUSPIRATE_SPI = no
CONFIG_SERPROG = no CONFIG_SERPROG = no
endif endif
@ -102,7 +102,7 @@ CONFIG_SATASII ?= yes
CONFIG_ATAHPT ?= no CONFIG_ATAHPT ?= no
# Always enable FT2232 SPI dongles for now. # Always enable FT2232 SPI dongles for now.
CONFIG_FT2232SPI ?= yes CONFIG_FT2232_SPI ?= yes
# Always enable dummy tracing for now. # Always enable dummy tracing for now.
CONFIG_DUMMY ?= yes CONFIG_DUMMY ?= yes
@ -114,7 +114,7 @@ CONFIG_DRKAISER ?= yes
CONFIG_NICREALTEK ?= yes CONFIG_NICREALTEK ?= yes
# Always enable Bus Pirate SPI for now. # Always enable Bus Pirate SPI for now.
CONFIG_BUSPIRATESPI ?= yes CONFIG_BUSPIRATE_SPI ?= yes
# Disable Dediprog SF100 until support is complete and tested. # Disable Dediprog SF100 until support is complete and tested.
CONFIG_DEDIPROG ?= no CONFIG_DEDIPROG ?= no
@ -123,7 +123,7 @@ CONFIG_DEDIPROG ?= no
CONFIG_PRINT_WIKI ?= no CONFIG_PRINT_WIKI ?= no
ifeq ($(CONFIG_INTERNAL), yes) 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 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. # FIXME: The PROGRAMMER_OBJS below should only be included on x86.
PROGRAMMER_OBJS += it87spi.o ichspi.o sb600spi.o wbsio_spi.o PROGRAMMER_OBJS += it87spi.o ichspi.o sb600spi.o wbsio_spi.o
@ -131,7 +131,7 @@ NEED_PCI := yes
endif endif
ifeq ($(CONFIG_SERPROG), yes) ifeq ($(CONFIG_SERPROG), yes)
FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_SERPROG=1'
PROGRAMMER_OBJS += serprog.o PROGRAMMER_OBJS += serprog.o
ifeq ($(OS_ARCH), SunOS) ifeq ($(OS_ARCH), SunOS)
LIBS += -lsocket LIBS += -lsocket
@ -139,66 +139,66 @@ endif
endif endif
ifeq ($(CONFIG_BITBANG_SPI), yes) ifeq ($(CONFIG_BITBANG_SPI), yes)
FEATURE_CFLAGS += -D'BITBANG_SPI_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1'
PROGRAMMER_OBJS += bitbang_spi.o PROGRAMMER_OBJS += bitbang_spi.o
endif endif
ifeq ($(CONFIG_NIC3COM), yes) ifeq ($(CONFIG_NIC3COM), yes)
FEATURE_CFLAGS += -D'NIC3COM_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1'
PROGRAMMER_OBJS += nic3com.o PROGRAMMER_OBJS += nic3com.o
NEED_PCI := yes NEED_PCI := yes
endif endif
ifeq ($(CONFIG_GFXNVIDIA), yes) ifeq ($(CONFIG_GFXNVIDIA), yes)
FEATURE_CFLAGS += -D'GFXNVIDIA_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1'
PROGRAMMER_OBJS += gfxnvidia.o PROGRAMMER_OBJS += gfxnvidia.o
NEED_PCI := yes NEED_PCI := yes
endif endif
ifeq ($(CONFIG_SATASII), yes) ifeq ($(CONFIG_SATASII), yes)
FEATURE_CFLAGS += -D'SATASII_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_SATASII=1'
PROGRAMMER_OBJS += satasii.o PROGRAMMER_OBJS += satasii.o
NEED_PCI := yes NEED_PCI := yes
endif endif
ifeq ($(CONFIG_ATAHPT), yes) ifeq ($(CONFIG_ATAHPT), yes)
FEATURE_CFLAGS += -D'ATAHPT_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1'
PROGRAMMER_OBJS += atahpt.o PROGRAMMER_OBJS += atahpt.o
NEED_PCI := yes NEED_PCI := yes
endif endif
ifeq ($(CONFIG_FT2232SPI), yes) ifeq ($(CONFIG_FT2232_SPI), yes)
FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb") FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb")
# This is a totally ugly hack. # 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)") FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)")
PROGRAMMER_OBJS += ft2232_spi.o PROGRAMMER_OBJS += ft2232_spi.o
endif endif
ifeq ($(CONFIG_DUMMY), yes) ifeq ($(CONFIG_DUMMY), yes)
FEATURE_CFLAGS += -D'DUMMY_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_DUMMY=1'
PROGRAMMER_OBJS += dummyflasher.o PROGRAMMER_OBJS += dummyflasher.o
endif endif
ifeq ($(CONFIG_DRKAISER), yes) ifeq ($(CONFIG_DRKAISER), yes)
FEATURE_CFLAGS += -D'DRKAISER_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1'
PROGRAMMER_OBJS += drkaiser.o PROGRAMMER_OBJS += drkaiser.o
NEED_PCI := yes NEED_PCI := yes
endif endif
ifeq ($(CONFIG_NICREALTEK), yes) ifeq ($(CONFIG_NICREALTEK), yes)
FEATURE_CFLAGS += -D'NICREALTEK_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1'
PROGRAMMER_OBJS += nicrealtek.o PROGRAMMER_OBJS += nicrealtek.o
NEED_PCI := yes NEED_PCI := yes
endif endif
ifeq ($(CONFIG_BUSPIRATESPI), yes) ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
FEATURE_CFLAGS += -D'BUSPIRATE_SPI_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1'
PROGRAMMER_OBJS += buspirate_spi.o PROGRAMMER_OBJS += buspirate_spi.o
endif endif
ifeq ($(CONFIG_DEDIPROG), yes) ifeq ($(CONFIG_DEDIPROG), yes)
FEATURE_CFLAGS += -D'DEDIPROG_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1'
FEATURE_LIBS += -lusb FEATURE_LIBS += -lusb
PROGRAMMER_OBJS += dediprog.o PROGRAMMER_OBJS += dediprog.o
endif endif
@ -207,7 +207,7 @@ endif
ifeq ($(CONFIG_SERPROG), yes) ifeq ($(CONFIG_SERPROG), yes)
LIB_OBJS += serial.o LIB_OBJS += serial.o
else else
ifeq ($(CONFIG_BUSPIRATESPI), yes) ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
LIB_OBJS += serial.o LIB_OBJS += serial.o
endif endif
endif endif
@ -233,7 +233,7 @@ endif
endif endif
ifeq ($(CONFIG_PRINT_WIKI), yes) ifeq ($(CONFIG_PRINT_WIKI), yes)
FEATURE_CFLAGS += -D'PRINT_WIKI_SUPPORT=1' FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1'
CLI_OBJS += print_wiki.o CLI_OBJS += print_wiki.o
endif endif
@ -308,7 +308,7 @@ endif
.features: features .features: features
ifeq ($(CONFIG_FT2232SPI), yes) ifeq ($(CONFIG_FT2232_SPI), yes)
features: compiler features: compiler
@echo "FEATURES := yes" > .features.tmp @echo "FEATURES := yes" > .features.tmp
@printf "Checking for FTDI support... " @printf "Checking for FTDI support... "

View File

@ -116,7 +116,7 @@ int buspirate_spi_init(void)
} }
if (!dev) { if (!dev) {
msg_perr("No serial device given. Use flashrom -p " msg_perr("No serial device given. Use flashrom -p "
"buspiratespi:dev=/dev/ttyUSB0\n"); "buspirate_spi:dev=/dev/ttyUSB0\n");
return 1; return 1;
} }
if (speed) { if (speed) {

View File

@ -39,7 +39,7 @@ void cli_classic_usage(const char *name)
enum programmer p; enum programmer p;
printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|" printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|"
#if PRINT_WIKI_SUPPORT == 1 #if CONFIG_PRINT_WIKI == 1
"-z|" "-z|"
#endif #endif
"-E|-r <file>|-w <file>|-v <file>]\n" "-E|-r <file>|-w <file>|-v <file>]\n"
@ -66,7 +66,7 @@ void cli_classic_usage(const char *name)
" -V | --verbose more verbose output\n" " -V | --verbose more verbose output\n"
" -c | --chip <chipname> probe only for specified " " -c | --chip <chipname> probe only for specified "
"flash chip\n" "flash chip\n"
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
/* FIXME: --mainboard should be a programmer parameter */ /* FIXME: --mainboard should be a programmer parameter */
" -m | --mainboard <[vendor:]part> override mainboard " " -m | --mainboard <[vendor:]part> override mainboard "
"detection\n" "detection\n"
@ -79,7 +79,7 @@ void cli_classic_usage(const char *name)
" -i | --image <name> only flash image <name> " " -i | --image <name> only flash image <name> "
"from flash layout\n" "from flash layout\n"
" -L | --list-supported print supported devices\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 " " -z | --list-supported-wiki print supported devices "
"in wiki syntax\n" "in wiki syntax\n"
#endif #endif
@ -111,7 +111,7 @@ void cli_classic_usage(const char *name)
} }
printf("\nYou can specify one of -h, -R, -L, " printf("\nYou can specify one of -h, -R, -L, "
#if PRINT_WIKI_SUPPORT == 1 #if CONFIG_PRINT_WIKI == 1
"-z, " "-z, "
#endif #endif
"-E, -r, -w, -v or no operation.\n" "-E, -r, -w, -v or no operation.\n"
@ -137,7 +137,7 @@ int cli_classic(int argc, char *argv[])
int force = 0; int force = 0;
int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
int dont_verify_it = 0, list_supported = 0; int dont_verify_it = 0, list_supported = 0;
#if PRINT_WIKI_SUPPORT == 1 #if CONFIG_PRINT_WIKI == 1
int list_supported_wiki = 0; int list_supported_wiki = 0;
#endif #endif
int operation_specified = 0; int operation_specified = 0;
@ -237,7 +237,7 @@ int cli_classic(int argc, char *argv[])
erase_it = 1; erase_it = 1;
break; break;
case 'm': case 'm':
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
tempstr = strdup(optarg); tempstr = strdup(optarg);
lb_vendor_dev_from_string(tempstr); lb_vendor_dev_from_string(tempstr);
#else #else
@ -268,7 +268,7 @@ int cli_classic(int argc, char *argv[])
list_supported = 1; list_supported = 1;
break; break;
case 'z': case 'z':
#if PRINT_WIKI_SUPPORT == 1 #if CONFIG_PRINT_WIKI == 1
if (++operation_specified > 1) { if (++operation_specified > 1) {
fprintf(stderr, "More than one operation " fprintf(stderr, "More than one operation "
"specified. Aborting.\n"); "specified. Aborting.\n");
@ -344,7 +344,7 @@ int cli_classic(int argc, char *argv[])
exit(0); exit(0);
} }
#if PRINT_WIKI_SUPPORT == 1 #if CONFIG_PRINT_WIKI == 1
if (list_supported_wiki) { if (list_supported_wiki) {
print_supported_wiki(); print_supported_wiki();
exit(0); exit(0);
@ -356,7 +356,7 @@ int cli_classic(int argc, char *argv[])
cli_classic_abort_usage(argv[0]); cli_classic_abort_usage(argv[0]);
} }
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) { if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) {
fprintf(stderr, "Error: --mainboard requires the internal " fprintf(stderr, "Error: --mainboard requires the internal "
"programmer. Aborting.\n"); "programmer. Aborting.\n");

60
flash.h
View File

@ -39,46 +39,46 @@
typedef unsigned long chipaddr; typedef unsigned long chipaddr;
enum programmer { enum programmer {
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
PROGRAMMER_INTERNAL, PROGRAMMER_INTERNAL,
#endif #endif
#if DUMMY_SUPPORT == 1 #if CONFIG_DUMMY == 1
PROGRAMMER_DUMMY, PROGRAMMER_DUMMY,
#endif #endif
#if NIC3COM_SUPPORT == 1 #if CONFIG_NIC3COM == 1
PROGRAMMER_NIC3COM, PROGRAMMER_NIC3COM,
#endif #endif
#if NICREALTEK_SUPPORT == 1 #if CONFIG_NICREALTEK == 1
PROGRAMMER_NICREALTEK, PROGRAMMER_NICREALTEK,
PROGRAMMER_NICREALTEK2, PROGRAMMER_NICREALTEK2,
#endif #endif
#if GFXNVIDIA_SUPPORT == 1 #if CONFIG_GFXNVIDIA == 1
PROGRAMMER_GFXNVIDIA, PROGRAMMER_GFXNVIDIA,
#endif #endif
#if DRKAISER_SUPPORT == 1 #if CONFIG_DRKAISER == 1
PROGRAMMER_DRKAISER, PROGRAMMER_DRKAISER,
#endif #endif
#if SATASII_SUPPORT == 1 #if CONFIG_SATASII == 1
PROGRAMMER_SATASII, PROGRAMMER_SATASII,
#endif #endif
#if ATAHPT_SUPPORT == 1 #if CONFIG_ATAHPT == 1
PROGRAMMER_ATAHPT, PROGRAMMER_ATAHPT,
#endif #endif
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
PROGRAMMER_IT87SPI, PROGRAMMER_IT87SPI,
#endif #endif
#endif #endif
#if FT2232_SPI_SUPPORT == 1 #if CONFIG_FT2232_SPI == 1
PROGRAMMER_FT2232SPI, PROGRAMMER_FT2232_SPI,
#endif #endif
#if SERPROG_SUPPORT == 1 #if CONFIG_SERPROG == 1
PROGRAMMER_SERPROG, PROGRAMMER_SERPROG,
#endif #endif
#if BUSPIRATE_SPI_SUPPORT == 1 #if CONFIG_BUSPIRATE_SPI == 1
PROGRAMMER_BUSPIRATESPI, PROGRAMMER_BUSPIRATE_SPI,
#endif #endif
#if DEDIPROG_SUPPORT == 1 #if CONFIG_DEDIPROG == 1
PROGRAMMER_DEDIPROG, PROGRAMMER_DEDIPROG,
#endif #endif
PROGRAMMER_INVALID /* This must always be the last entry. */ PROGRAMMER_INVALID /* This must always be the last entry. */
@ -258,7 +258,7 @@ struct flashchip {
extern struct flashchip flashchips[]; extern struct flashchip flashchips[];
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
struct penable { struct penable {
uint16_t vendor_id; uint16_t vendor_id;
uint16_t device_id; uint16_t device_id;
@ -338,7 +338,7 @@ uint32_t pcidev_init(uint16_t vendor_id, uint32_t bar, struct pcidev_status *dev
/* print.c */ /* print.c */
char *flashbuses_to_text(enum chipbustype bustype); char *flashbuses_to_text(enum chipbustype bustype);
void print_supported(void); 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); void print_supported_pcidevs(struct pcidev_status *devs);
#endif #endif
void print_supported_wiki(void); void print_supported_wiki(void);
@ -390,7 +390,7 @@ struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
#endif #endif
void get_io_perms(void); void get_io_perms(void);
void release_io_perms(void); void release_io_perms(void);
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
extern int is_laptop; extern int is_laptop;
extern int force_boardenable; extern int force_boardenable;
extern int force_boardmismatch; extern int force_boardmismatch;
@ -432,7 +432,7 @@ uint32_t fallback_chip_readl(const chipaddr addr);
void fallback_chip_readn(uint8_t *buf, const chipaddr addr, size_t len); void fallback_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
/* dummyflasher.c */ /* dummyflasher.c */
#if DUMMY_SUPPORT == 1 #if CONFIG_DUMMY == 1
int dummy_init(void); int dummy_init(void);
int dummy_shutdown(void); int dummy_shutdown(void);
void *dummy_map(const char *descr, unsigned long phys_addr, size_t len); void *dummy_map(const char *descr, unsigned long phys_addr, size_t len);
@ -450,7 +450,7 @@ int dummy_spi_send_command(unsigned int writecnt, unsigned int readcnt,
#endif #endif
/* nic3com.c */ /* nic3com.c */
#if NIC3COM_SUPPORT == 1 #if CONFIG_NIC3COM == 1
int nic3com_init(void); int nic3com_init(void);
int nic3com_shutdown(void); int nic3com_shutdown(void);
void nic3com_chip_writeb(uint8_t val, chipaddr addr); void nic3com_chip_writeb(uint8_t val, chipaddr addr);
@ -459,7 +459,7 @@ extern struct pcidev_status nics_3com[];
#endif #endif
/* gfxnvidia.c */ /* gfxnvidia.c */
#if GFXNVIDIA_SUPPORT == 1 #if CONFIG_GFXNVIDIA == 1
int gfxnvidia_init(void); int gfxnvidia_init(void);
int gfxnvidia_shutdown(void); int gfxnvidia_shutdown(void);
void gfxnvidia_chip_writeb(uint8_t val, chipaddr addr); void gfxnvidia_chip_writeb(uint8_t val, chipaddr addr);
@ -468,7 +468,7 @@ extern struct pcidev_status gfx_nvidia[];
#endif #endif
/* drkaiser.c */ /* drkaiser.c */
#if DRKAISER_SUPPORT == 1 #if CONFIG_DRKAISER == 1
int drkaiser_init(void); int drkaiser_init(void);
int drkaiser_shutdown(void); int drkaiser_shutdown(void);
void drkaiser_chip_writeb(uint8_t val, chipaddr addr); void drkaiser_chip_writeb(uint8_t val, chipaddr addr);
@ -477,7 +477,7 @@ extern struct pcidev_status drkaiser_pcidev[];
#endif #endif
/* nicrealtek.c */ /* nicrealtek.c */
#if NICREALTEK_SUPPORT == 1 #if CONFIG_NICREALTEK == 1
int nicrealtek_init(void); int nicrealtek_init(void);
int nicsmc1211_init(void); int nicsmc1211_init(void);
int nicrealtek_shutdown(void); int nicrealtek_shutdown(void);
@ -489,7 +489,7 @@ extern struct pcidev_status nics_realteksmc1211[];
/* satasii.c */ /* satasii.c */
#if SATASII_SUPPORT == 1 #if CONFIG_SATASII == 1
int satasii_init(void); int satasii_init(void);
int satasii_shutdown(void); int satasii_shutdown(void);
void satasii_chip_writeb(uint8_t val, chipaddr addr); void satasii_chip_writeb(uint8_t val, chipaddr addr);
@ -498,7 +498,7 @@ extern struct pcidev_status satas_sii[];
#endif #endif
/* atahpt.c */ /* atahpt.c */
#if ATAHPT_SUPPORT == 1 #if CONFIG_ATAHPT == 1
int atahpt_init(void); int atahpt_init(void);
int atahpt_shutdown(void); int atahpt_shutdown(void);
void atahpt_chip_writeb(uint8_t val, chipaddr addr); void atahpt_chip_writeb(uint8_t val, chipaddr addr);
@ -611,7 +611,7 @@ int handle_romentries(uint8_t *buffer, struct flashchip *flash);
/* spi.c */ /* spi.c */
enum spi_controller { enum spi_controller {
SPI_CONTROLLER_NONE, SPI_CONTROLLER_NONE,
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
SPI_CONTROLLER_ICH7, SPI_CONTROLLER_ICH7,
SPI_CONTROLLER_ICH9, SPI_CONTROLLER_ICH9,
@ -621,16 +621,16 @@ enum spi_controller {
SPI_CONTROLLER_WBSIO, SPI_CONTROLLER_WBSIO,
#endif #endif
#endif #endif
#if FT2232_SPI_SUPPORT == 1 #if CONFIG_FT2232_SPI == 1
SPI_CONTROLLER_FT2232, SPI_CONTROLLER_FT2232,
#endif #endif
#if DUMMY_SUPPORT == 1 #if CONFIG_DUMMY == 1
SPI_CONTROLLER_DUMMY, SPI_CONTROLLER_DUMMY,
#endif #endif
#if BUSPIRATE_SPI_SUPPORT == 1 #if CONFIG_BUSPIRATE_SPI == 1
SPI_CONTROLLER_BUSPIRATE, SPI_CONTROLLER_BUSPIRATE,
#endif #endif
#if DEDIPROG_SUPPORT == 1 #if CONFIG_DEDIPROG == 1
SPI_CONTROLLER_DEDIPROG, SPI_CONTROLLER_DEDIPROG,
#endif #endif
SPI_CONTROLLER_INVALID /* This must always be the last entry. */ SPI_CONTROLLER_INVALID /* This must always be the last entry. */

View File

@ -166,11 +166,11 @@ Specify the programmer device. Currently supported are:
.sp .sp
.BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)" .BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)"
.sp .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 .sp
.BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)" .BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)"
.sp .sp
.BR "* buspiratespi" " (for flash ROMs attached to a Bus Pirate)" .BR "* buspirate_spi" " (for flash ROMs attached to a Bus Pirate)"
.sp .sp
Some programmers have optional or mandatory parameters which are described Some programmers have optional or mandatory parameters which are described
in detail in the in detail in the
@ -307,10 +307,10 @@ syntax where
.B portnum .B portnum
is an I/O port number which must be a multiple of 8. is an I/O port number which must be a multiple of 8.
.TP .TP
.BR "ft2232spi " programmer .BR "ft2232_spi " programmer
An optional parameter species the controller An optional parameter species the controller
type and interface/port it should support. For that you have to use the 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 syntax where
.B model .B model
can be any of can be any of
@ -335,12 +335,12 @@ syntax and for IP, you have to use
instead. More information about serprog is available in serprog-protocol.txt in instead. More information about serprog is available in serprog-protocol.txt in
the source distribution. the source distribution.
.TP .TP
.BR "buspiratespi " programmer .BR "buspirate_spi " programmer
A required dev parameter specifies the Bus Pirate device node and an optional A required dev parameter specifies the Bus Pirate device node and an optional
spispeed parameter specifies the frequency of the SPI bus. The parameter spispeed parameter specifies the frequency of the SPI bus. The parameter
delimiter is a comma. Syntax is delimiter is a comma. Syntax is
.sp .sp
.B "flashrom -p buspiratespi:dev=/dev/device,spispeed=frequency" .B "flashrom -p buspirate_spi:dev=/dev/device,spispeed=frequency"
.sp .sp
where where
.B frequency .B frequency

View File

@ -38,9 +38,9 @@ const char *flashrom_version = FLASHROM_VERSION;
char *chip_to_probe = NULL; char *chip_to_probe = NULL;
int verbose = 0; int verbose = 0;
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
enum programmer programmer = PROGRAMMER_INTERNAL; enum programmer programmer = PROGRAMMER_INTERNAL;
#elif DUMMY_SUPPORT == 1 #elif CONFIG_DUMMY == 1
enum programmer programmer = PROGRAMMER_DUMMY; enum programmer programmer = PROGRAMMER_DUMMY;
#else #else
/* If neither internal nor dummy are selected, we must pick a sensible default. /* If neither internal nor dummy are selected, we must pick a sensible default.
@ -48,39 +48,39 @@ enum programmer programmer = PROGRAMMER_DUMMY;
* if more than one of them is selected. If only one is selected, it is clear * 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. * 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 #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 external programmers except one. #error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all programmers except one.
#endif #endif
enum programmer programmer = enum programmer programmer =
#if NIC3COM_SUPPORT == 1 #if CONFIG_NIC3COM == 1
PROGRAMMER_NIC3COM PROGRAMMER_NIC3COM
#endif #endif
#if NICREALTEK_SUPPORT == 1 #if CONFIG_NICREALTEK == 1
PROGRAMMER_NICREALTEK PROGRAMMER_NICREALTEK
PROGRAMMER_NICREALTEK2 PROGRAMMER_NICREALTEK2
#endif #endif
#if GFXNVIDIA_SUPPORT == 1 #if CONFIG_GFXNVIDIA == 1
PROGRAMMER_GFXNVIDIA PROGRAMMER_GFXNVIDIA
#endif #endif
#if DRKAISER_SUPPORT == 1 #if CONFIG_DRKAISER == 1
PROGRAMMER_DRKAISER PROGRAMMER_DRKAISER
#endif #endif
#if SATASII_SUPPORT == 1 #if CONFIG_SATASII == 1
PROGRAMMER_SATASII PROGRAMMER_SATASII
#endif #endif
#if ATAHPT_SUPPORT == 1 #if CONFIG_ATAHPT == 1
PROGRAMMER_ATAHPT PROGRAMMER_ATAHPT
#endif #endif
#if FT2232_SPI_SUPPORT == 1 #if CONFIG_FT2232_SPI == 1
PROGRAMMER_FT2232SPI PROGRAMMER_FT2232_SPI
#endif #endif
#if SERPROG_SUPPORT == 1 #if CONFIG_SERPROG == 1
PROGRAMMER_SERPROG PROGRAMMER_SERPROG
#endif #endif
#if BUSPIRATE_SPI_SUPPORT == 1 #if CONFIG_BUSPIRATE_SPI == 1
PROGRAMMER_BUSPIRATESPI PROGRAMMER_BUSPIRATE_SPI
#endif #endif
#if DEDIPROG_SUPPORT == 1 #if CONFIG_DEDIPROG == 1
PROGRAMMER_DEDIPROG PROGRAMMER_DEDIPROG
#endif #endif
; ;
@ -107,7 +107,7 @@ struct decode_sizes max_rom_decode = {
}; };
const struct programmer_entry programmer_table[] = { const struct programmer_entry programmer_table[] = {
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
{ {
.name = "internal", .name = "internal",
.init = internal_init, .init = internal_init,
@ -126,7 +126,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if DUMMY_SUPPORT == 1 #if CONFIG_DUMMY == 1
{ {
.name = "dummy", .name = "dummy",
.init = dummy_init, .init = dummy_init,
@ -145,7 +145,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if NIC3COM_SUPPORT == 1 #if CONFIG_NIC3COM == 1
{ {
.name = "nic3com", .name = "nic3com",
.init = nic3com_init, .init = nic3com_init,
@ -164,7 +164,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if NICREALTEK_SUPPORT == 1 #if CONFIG_NICREALTEK == 1
{ {
.name = "nicrealtek", .name = "nicrealtek",
.init = nicrealtek_init, .init = nicrealtek_init,
@ -200,7 +200,7 @@ const struct programmer_entry programmer_table[] = {
#endif #endif
#if GFXNVIDIA_SUPPORT == 1 #if CONFIG_GFXNVIDIA == 1
{ {
.name = "gfxnvidia", .name = "gfxnvidia",
.init = gfxnvidia_init, .init = gfxnvidia_init,
@ -219,7 +219,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if DRKAISER_SUPPORT == 1 #if CONFIG_DRKAISER == 1
{ {
.name = "drkaiser", .name = "drkaiser",
.init = drkaiser_init, .init = drkaiser_init,
@ -238,7 +238,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if SATASII_SUPPORT == 1 #if CONFIG_SATASII == 1
{ {
.name = "satasii", .name = "satasii",
.init = satasii_init, .init = satasii_init,
@ -257,7 +257,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if ATAHPT_SUPPORT == 1 #if CONFIG_ATAHPT == 1
{ {
.name = "atahpt", .name = "atahpt",
.init = atahpt_init, .init = atahpt_init,
@ -276,7 +276,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
{ {
.name = "it87spi", .name = "it87spi",
@ -297,9 +297,9 @@ const struct programmer_entry programmer_table[] = {
#endif #endif
#endif #endif
#if FT2232_SPI_SUPPORT == 1 #if CONFIG_FT2232_SPI == 1
{ {
.name = "ft2232spi", .name = "ft2232_spi",
.init = ft2232_spi_init, .init = ft2232_spi_init,
.shutdown = noop_shutdown, /* Missing shutdown */ .shutdown = noop_shutdown, /* Missing shutdown */
.map_flash_region = fallback_map, .map_flash_region = fallback_map,
@ -316,7 +316,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if SERPROG_SUPPORT == 1 #if CONFIG_SERPROG == 1
{ {
.name = "serprog", .name = "serprog",
.init = serprog_init, .init = serprog_init,
@ -335,9 +335,9 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if BUSPIRATE_SPI_SUPPORT == 1 #if CONFIG_BUSPIRATE_SPI == 1
{ {
.name = "buspiratespi", .name = "buspirate_spi",
.init = buspirate_spi_init, .init = buspirate_spi_init,
.shutdown = buspirate_spi_shutdown, .shutdown = buspirate_spi_shutdown,
.map_flash_region = fallback_map, .map_flash_region = fallback_map,
@ -354,7 +354,7 @@ const struct programmer_entry programmer_table[] = {
}, },
#endif #endif
#if DEDIPROG_SUPPORT == 1 #if CONFIG_DEDIPROG == 1
{ {
.name = "dediprog", .name = "dediprog",
.init = dediprog_init, .init = dediprog_init,
@ -1259,7 +1259,7 @@ int selfcheck(void)
msg_gerr("SPI programmer table miscompilation!\n"); msg_gerr("SPI programmer table miscompilation!\n");
ret = 1; ret = 1;
} }
#if BITBANG_SPI_SUPPORT == 1 #if CONFIG_BITBANG_SPI == 1
if (bitbang_spi_master_count - 1 != BITBANG_SPI_INVALID) { if (bitbang_spi_master_count - 1 != BITBANG_SPI_INVALID) {
msg_gerr("Bitbanging SPI master table miscompilation!\n"); msg_gerr("Bitbanging SPI master table miscompilation!\n");
ret = 1; ret = 1;
@ -1410,7 +1410,7 @@ int doit(struct flashchip *flash, int force, char *filename, int read_it, int wr
} }
numbytes = fread(buf, 1, size, image); numbytes = fread(buf, 1, size, image);
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
show_id(buf, size, force); show_id(buf, size, force);
#endif #endif
fclose(image); fclose(image);

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * 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 <stdio.h>
#include <stdint.h> #include <stdint.h>

View File

@ -98,7 +98,7 @@ struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
} }
#endif #endif
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
int force_boardenable = 0; int force_boardenable = 0;
int force_boardmismatch = 0; int force_boardmismatch = 0;

View File

@ -24,7 +24,7 @@
#include <ctype.h> #include <ctype.h>
#include "flash.h" #include "flash.h"
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
char *mainboard_vendor = NULL; char *mainboard_vendor = NULL;
char *mainboard_part = NULL; char *mainboard_part = NULL;
#endif #endif
@ -41,7 +41,7 @@ typedef struct {
romlayout_t rom_entries[MAX_ROMLAYOUT]; 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"; static char *def_name = "DEFAULT";
int show_id(uint8_t *bios, int size, int force) int show_id(uint8_t *bios, int size, int force)

20
print.c
View File

@ -145,7 +145,7 @@ void print_supported_chips(void)
} }
} }
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
void print_supported_chipsets(void) void print_supported_chipsets(void)
{ {
int i, j, chipsetcount = 0; int i, j, chipsetcount = 0;
@ -228,37 +228,37 @@ void print_supported_boards(void)
void print_supported(void) void print_supported(void)
{ {
print_supported_chips(); print_supported_chips();
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
print_supported_chipsets(); print_supported_chipsets();
print_supported_boards(); print_supported_boards();
#endif #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 " printf("\nSupported PCI devices flashrom can use "
"as programmer:\n\n"); "as programmer:\n\n");
#endif #endif
#if NIC3COM_SUPPORT == 1 #if CONFIG_NIC3COM == 1
print_supported_pcidevs(nics_3com); print_supported_pcidevs(nics_3com);
#endif #endif
#if NICREALTEK_SUPPORT == 1 #if CONFIG_NICREALTEK == 1
print_supported_pcidevs(nics_realtek); print_supported_pcidevs(nics_realtek);
print_supported_pcidevs(nics_realteksmc1211); print_supported_pcidevs(nics_realteksmc1211);
#endif #endif
#if GFXNVIDIA_SUPPORT == 1 #if CONFIG_GFXNVIDIA == 1
print_supported_pcidevs(gfx_nvidia); print_supported_pcidevs(gfx_nvidia);
#endif #endif
#if DRKAISER_SUPPORT == 1 #if CONFIG_DRKAISER == 1
print_supported_pcidevs(drkaiser_pcidev); print_supported_pcidevs(drkaiser_pcidev);
#endif #endif
#if SATASII_SUPPORT == 1 #if CONFIG_SATASII == 1
print_supported_pcidevs(satas_sii); print_supported_pcidevs(satas_sii);
#endif #endif
#if ATAHPT_SUPPORT == 1 #if CONFIG_ATAHPT == 1
print_supported_pcidevs(ata_hpt); print_supported_pcidevs(ata_hpt);
#endif #endif
} }
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
/* Please keep this list alphabetically ordered by vendor/board. */ /* Please keep this list alphabetically ordered by vendor/board. */
const struct board_info boards_ok[] = { const struct board_info boards_ok[] = {
/* Verified working boards that don't need write-enables. */ /* Verified working boards that don't need write-enables. */

View File

@ -25,7 +25,7 @@
#include "flash.h" #include "flash.h"
#include "flashchips.h" #include "flashchips.h"
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
struct board_info_url { struct board_info_url {
const char *vendor; const char *vendor;
const char *name; const char *name;
@ -46,7 +46,7 @@ Please do '''not''' edit these tables in the wiki directly, they are \
generated by pasting '''flashrom -z''' output.<br />\ generated by pasting '''flashrom -z''' output.<br />\
'''Last update:''' %s(generated by flashrom %s)\n</small></div>\n"; '''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\ const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\
|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ |- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\ ! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
@ -89,7 +89,7 @@ smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\ ! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\
! align=\"left\" | Status\n\n"; ! align=\"left\" | Status\n\n";
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\
In general, flashing laptops is more difficult because laptops\n\n\ In general, flashing laptops is more difficult because laptops\n\n\
* often use the flash chip for stuff besides the BIOS,\n\ * often use the flash chip for stuff besides the BIOS,\n\
@ -599,29 +599,29 @@ void print_supported_wiki(void)
time_t t = time(NULL); time_t t = time(NULL);
printf(wiki_header, ctime(&t), flashrom_version); printf(wiki_header, ctime(&t), flashrom_version);
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
print_supported_chips_wiki(2); print_supported_chips_wiki(2);
print_supported_chipsets_wiki(3); print_supported_chipsets_wiki(3);
print_supported_boards_wiki(); print_supported_boards_wiki();
#endif #endif
printf("%s", programmer_section); printf("%s", programmer_section);
#if NIC3COM_SUPPORT == 1 #if CONFIG_NIC3COM == 1
print_supported_pcidevs_wiki(nics_3com); print_supported_pcidevs_wiki(nics_3com);
#endif #endif
#if NICREALTEK_SUPPORT == 1 #if CONFIG_NICREALTEK == 1
print_supported_pcidevs_wiki(nics_realtek); print_supported_pcidevs_wiki(nics_realtek);
print_supported_pcidevs_wiki(nics_realteksmc1211); print_supported_pcidevs_wiki(nics_realteksmc1211);
#endif #endif
#if GFXNVIDIA_SUPPORT == 1 #if CONFIG_GFXNVIDIA == 1
print_supported_pcidevs_wiki(gfx_nvidia); print_supported_pcidevs_wiki(gfx_nvidia);
#endif #endif
#if DRKAISER_SUPPORT == 1 #if CONFIG_DRKAISER == 1
print_supported_pcidevs_wiki(drkaiser_pcidev); print_supported_pcidevs_wiki(drkaiser_pcidev);
#endif #endif
#if SATASII_SUPPORT == 1 #if CONFIG_SATASII == 1
print_supported_pcidevs_wiki(satas_sii); print_supported_pcidevs_wiki(satas_sii);
#endif #endif
#if ATAHPT_SUPPORT == 1 #if CONFIG_ATAHPT == 1
print_supported_pcidevs_wiki(ata_hpt); print_supported_pcidevs_wiki(ata_hpt);
#endif #endif
printf("\n|}\n"); printf("\n|}\n");

12
spi.c
View File

@ -40,7 +40,7 @@ const struct spi_programmer spi_programmer[] = {
.write_256 = NULL, .write_256 = NULL,
}, },
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
{ /* SPI_CONTROLLER_ICH7 */ { /* SPI_CONTROLLER_ICH7 */
.command = ich_spi_send_command, .command = ich_spi_send_command,
@ -86,7 +86,7 @@ const struct spi_programmer spi_programmer[] = {
#endif #endif
#endif #endif
#if FT2232_SPI_SUPPORT == 1 #if CONFIG_FT2232_SPI == 1
{ /* SPI_CONTROLLER_FT2232 */ { /* SPI_CONTROLLER_FT2232 */
.command = ft2232_spi_send_command, .command = ft2232_spi_send_command,
.multicommand = default_spi_send_multicommand, .multicommand = default_spi_send_multicommand,
@ -95,7 +95,7 @@ const struct spi_programmer spi_programmer[] = {
}, },
#endif #endif
#if DUMMY_SUPPORT == 1 #if CONFIG_DUMMY == 1
{ /* SPI_CONTROLLER_DUMMY */ { /* SPI_CONTROLLER_DUMMY */
.command = dummy_spi_send_command, .command = dummy_spi_send_command,
.multicommand = default_spi_send_multicommand, .multicommand = default_spi_send_multicommand,
@ -104,7 +104,7 @@ const struct spi_programmer spi_programmer[] = {
}, },
#endif #endif
#if BUSPIRATE_SPI_SUPPORT == 1 #if CONFIG_BUSPIRATE_SPI == 1
{ /* SPI_CONTROLLER_BUSPIRATE */ { /* SPI_CONTROLLER_BUSPIRATE */
.command = buspirate_spi_send_command, .command = buspirate_spi_send_command,
.multicommand = default_spi_send_multicommand, .multicommand = default_spi_send_multicommand,
@ -113,7 +113,7 @@ const struct spi_programmer spi_programmer[] = {
}, },
#endif #endif
#if DEDIPROG_SUPPORT == 1 #if CONFIG_DEDIPROG == 1
{ /* SPI_CONTROLLER_DEDIPROG */ { /* SPI_CONTROLLER_DEDIPROG */
.command = dediprog_spi_send_command, .command = dediprog_spi_send_command,
.multicommand = default_spi_send_multicommand, .multicommand = default_spi_send_multicommand,
@ -214,7 +214,7 @@ int spi_chip_write_256(struct flashchip *flash, uint8_t *buf)
uint32_t spi_get_valid_read_addr(void) uint32_t spi_get_valid_read_addr(void)
{ {
switch (spi_controller) { switch (spi_controller) {
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
case SPI_CONTROLLER_ICH7: case SPI_CONTROLLER_ICH7:
/* Return BBAR for ICH chipsets. */ /* Return BBAR for ICH chipsets. */

12
spi25.c
View File

@ -171,7 +171,7 @@ int probe_spi_rdid4(struct flashchip *flash)
{ {
/* only some SPI chipsets support 4 bytes commands */ /* only some SPI chipsets support 4 bytes commands */
switch (spi_controller) { switch (spi_controller) {
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
case SPI_CONTROLLER_ICH7: case SPI_CONTROLLER_ICH7:
case SPI_CONTROLLER_ICH9: case SPI_CONTROLLER_ICH9:
@ -180,16 +180,16 @@ int probe_spi_rdid4(struct flashchip *flash)
case SPI_CONTROLLER_WBSIO: case SPI_CONTROLLER_WBSIO:
#endif #endif
#endif #endif
#if FT2232_SPI_SUPPORT == 1 #if CONFIG_FT2232_SPI == 1
case SPI_CONTROLLER_FT2232: case SPI_CONTROLLER_FT2232:
#endif #endif
#if DUMMY_SUPPORT == 1 #if CONFIG_DUMMY == 1
case SPI_CONTROLLER_DUMMY: case SPI_CONTROLLER_DUMMY:
#endif #endif
#if BUSPIRATE_SPI_SUPPORT == 1 #if CONFIG_BUSPIRATE_SPI == 1
case SPI_CONTROLLER_BUSPIRATE: case SPI_CONTROLLER_BUSPIRATE:
#endif #endif
#if DEDIPROG_SUPPORT == 1 #if CONFIG_DEDIPROG == 1
case SPI_CONTROLLER_DEDIPROG: case SPI_CONTROLLER_DEDIPROG:
#endif #endif
return probe_spi_rdid_generic(flash, 4); return probe_spi_rdid_generic(flash, 4);
@ -1023,7 +1023,7 @@ int spi_aai_write(struct flashchip *flash, uint8_t *buf)
int result; int result;
switch (spi_controller) { switch (spi_controller) {
#if INTERNAL_SUPPORT == 1 #if CONFIG_INTERNAL == 1
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
case SPI_CONTROLLER_WBSIO: case SPI_CONTROLLER_WBSIO:
msg_cerr("%s: impossible with Winbond SPI masters," msg_cerr("%s: impossible with Winbond SPI masters,"