From c60de0e87faa631887821892547f0554eed2727f Mon Sep 17 00:00:00 2001 From: James Laird Date: Wed, 27 Mar 2013 13:00:23 +0000 Subject: Add Altera USB-Blaster SPI programmer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for the Altera USB-Blaster programming dongle in Active Serial (AS) mode. Tested on both original product and a clone dongle. Corresponding to flashrom svn r1658. Signed-off-by: James Laird Signed-off-by: Kyösti Mälkki Signed-off-by: Stefan Tauner Acked-by: Kyösti Mälkki Acked-by: Stefan Tauner --- Makefile | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b948996..07fefc0 100644 --- a/Makefile +++ b/Makefile @@ -128,6 +128,11 @@ UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes else override CONFIG_FT2232_SPI = no endif +ifeq ($(CONFIG_USBBLASTER_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes +else +override CONFIG_USBBLASTER_SPI = no +endif endif # FIXME: Should we check for Cygwin/MSVC as well? @@ -240,6 +245,11 @@ UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes else override CONFIG_FT2232_SPI = no endif +ifeq ($(CONFIG_USBBLASTER_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes +else +override CONFIG_USBBLASTER_SPI = no +endif endif ifneq ($(TARGET_OS), Linux) @@ -349,6 +359,9 @@ CONFIG_ATAHPT ?= no # Always enable FT2232 SPI dongles for now. CONFIG_FT2232_SPI ?= yes +# Always enable Altera USB-Blaster dongles for now. +CONFIG_USBBLASTER_SPI ?= yes + # Always enable dummy tracing for now. CONFIG_DUMMY ?= yes @@ -474,12 +487,23 @@ NEED_PCI := yes endif 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'CONFIG_FT2232_SPI=1'") +NEED_FTDI := yes +PROGRAMMER_OBJS += ft2232_spi.o +endif + +ifeq ($(CONFIG_USBBLASTER_SPI), yes) +# This is a totally ugly hack. +FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_USBBLASTER_SPI=1'") +NEED_FTDI := yes +PROGRAMMER_OBJS += usbblaster_spi.o +endif + +ifeq ($(NEED_FTDI), yes) +FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb") FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FT232H := yes" .features && printf "%s" "-D'HAVE_FT232H=1'") FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)") -PROGRAMMER_OBJS += ft2232_spi.o # We can't set NEED_USB here because that would transform libftdi auto-enabling # into a hard requirement for libusb, defeating the purpose of auto-enabling. endif @@ -799,7 +823,7 @@ export LINUX_SPI_TEST features: compiler @echo "FEATURES := yes" > .features.tmp -ifeq ($(CONFIG_FT2232_SPI), yes) +ifeq ($(NEED_FTDI), yes) @printf "Checking for FTDI support... " @echo "$$FTDI_TEST" > .featuretest.c @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 && \ -- cgit v1.1