mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
Allow to compile out serprog completely
If CONFIG_SERPROG is not set, no stubs and no data of serprog will remain. Side benefit: This kills a few dozen lines of code. r678, r679 and r680 made this possible. Once "Only list available programers in usage()" is committed, even the usage message will be adjusted automatically. Corresponding to flashrom svn r681. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
This commit is contained in:
parent
37fc469ca2
commit
6be741114d
20
Makefile
20
Makefile
@ -49,7 +49,7 @@ OBJS = chipset_enable.o board_enable.o udelay.o jedec.o stm50flw0x0x.o \
|
|||||||
sst49lfxxxc.o sst_fwhub.o layout.o cbtable.o flashchips.o physmap.o \
|
sst49lfxxxc.o sst_fwhub.o layout.o cbtable.o flashchips.o physmap.o \
|
||||||
flashrom.o w39v080fa.o sharplhf00l04.o w29ee011.o spi.o it87spi.o \
|
flashrom.o w39v080fa.o sharplhf00l04.o w29ee011.o spi.o it87spi.o \
|
||||||
ichspi.o w39v040c.o sb600spi.o wbsio_spi.o m29f002.o internal.o \
|
ichspi.o w39v040c.o sb600spi.o wbsio_spi.o m29f002.o internal.o \
|
||||||
dummyflasher.o pcidev.o nic3com.o satasii.o ft2232_spi.o serprog.o \
|
dummyflasher.o pcidev.o nic3com.o satasii.o ft2232_spi.o \
|
||||||
print.o
|
print.o
|
||||||
|
|
||||||
all: pciutils features dep $(PROGRAM)
|
all: pciutils features dep $(PROGRAM)
|
||||||
@ -64,15 +64,21 @@ VERSION := 0.9.0-r$(SVNVERSION)
|
|||||||
|
|
||||||
SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
|
SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
|
||||||
|
|
||||||
|
# Always enable serprog for now. Needs to be disabled on Windows.
|
||||||
|
CONFIG_SERPROG = yes
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_SERPROG), yes)
|
||||||
|
FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1'
|
||||||
|
OBJS += serprog.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'")
|
||||||
|
|
||||||
|
FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-lftdi")
|
||||||
|
|
||||||
$(PROGRAM): $(OBJS)
|
$(PROGRAM): $(OBJS)
|
||||||
$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) $(FEATURE_LIBS)
|
$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) $(FEATURE_LIBS)
|
||||||
|
|
||||||
FEATURE_CFLAGS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'")
|
|
||||||
# Always enable serprog for now. Needs to be disabled on Windows.
|
|
||||||
FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1'
|
|
||||||
|
|
||||||
FEATURE_LIBS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-lftdi")
|
|
||||||
|
|
||||||
# TAROPTIONS reduces information leakage from the packager's system.
|
# TAROPTIONS reduces information leakage from the packager's system.
|
||||||
# If other tar programs support command line arguments for setting uid/gid of
|
# If other tar programs support command line arguments for setting uid/gid of
|
||||||
# stored files, they can be handled here as well.
|
# stored files, they can be handled here as well.
|
||||||
|
2
flash.h
2
flash.h
@ -87,7 +87,9 @@ enum programmer {
|
|||||||
PROGRAMMER_SATASII,
|
PROGRAMMER_SATASII,
|
||||||
PROGRAMMER_IT87SPI,
|
PROGRAMMER_IT87SPI,
|
||||||
PROGRAMMER_FT2232SPI,
|
PROGRAMMER_FT2232SPI,
|
||||||
|
#if SERPROG_SUPPORT == 1
|
||||||
PROGRAMMER_SERPROG,
|
PROGRAMMER_SERPROG,
|
||||||
|
#endif
|
||||||
PROGRAMMER_INVALID /* This must always be the last entry. */
|
PROGRAMMER_INVALID /* This must always be the last entry. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -139,6 +139,7 @@ const struct programmer_entry programmer_table[] = {
|
|||||||
.delay = internal_delay,
|
.delay = internal_delay,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
#if SERPROG_SUPPORT == 1
|
||||||
{
|
{
|
||||||
.name = "serprog",
|
.name = "serprog",
|
||||||
.init = serprog_init,
|
.init = serprog_init,
|
||||||
@ -155,6 +156,7 @@ const struct programmer_entry programmer_table[] = {
|
|||||||
.chip_writen = fallback_chip_writen,
|
.chip_writen = fallback_chip_writen,
|
||||||
.delay = serprog_delay,
|
.delay = serprog_delay,
|
||||||
},
|
},
|
||||||
|
#endif
|
||||||
|
|
||||||
{}, /* This entry corresponds to PROGRAMMER_INVALID. */
|
{}, /* This entry corresponds to PROGRAMMER_INVALID. */
|
||||||
};
|
};
|
||||||
|
42
serprog.c
42
serprog.c
@ -23,9 +23,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "flash.h"
|
#include "flash.h"
|
||||||
|
|
||||||
#if SERPROG_SUPPORT == 1
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -774,42 +771,3 @@ void serprog_delay(int delay)
|
|||||||
sp_opbuf_usage += 5;
|
sp_opbuf_usage += 5;
|
||||||
sp_prev_was_write = 0;
|
sp_prev_was_write = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int serprog_init(void)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Serial programmer support was not compiled in\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int serprog_shutdown(void)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Serial programmer support was not compiled in\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void serprog_chip_writeb(uint8_t val, chipaddr addr)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Serial programmer support was not compiled in\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t serprog_chip_readb(const chipaddr addr)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Serial programmer support was not compiled in\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void serprog_chip_readn(uint8_t *buf, const chipaddr addr, size_t len)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Serial programmer support was not compiled in\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void serprog_delay(int delay)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "Serial programmer support was not compiled in\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user