summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJustin Chevrier <jchevrier@gmail.com>2015-02-08 21:58:10 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2015-02-08 21:58:10 +0000
commit66e554bc88a29ec6bc55c86320799c31b5b0e6c1 (patch)
tree597dd6c02ecd223e56d3088682e1c5314409af1f /Makefile
parent5673450316b0624f3b0a763babdcaf9f13fde12c (diff)
downloadast2050-flashrom-66e554bc88a29ec6bc55c86320799c31b5b0e6c1.zip
ast2050-flashrom-66e554bc88a29ec6bc55c86320799c31b5b0e6c1.tar.gz
Add support for the Microchip PICkit2 as an SPI programmer
This patch was inspired by the code in AVRDude (open source Atmel AVR programmer) to support the PICkit2 written by Doug Brown [1]. The Dediprog code in flashrom was used as the template for this code with some reference to the ft2232 code as well. [1] - https://github.com/steve-m/avrdude/blob/master/pickit2.c Corresponding to flashrom svn r1881. Signed-off-by: Justin Chevrier <jchevrier@gmail.com> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 21 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 93759c3..aaeca43 100644
--- a/Makefile
+++ b/Makefile
@@ -138,7 +138,7 @@ UNSUPPORTED_FEATURES += CONFIG_PONY_SPI=yes
else
override CONFIG_PONY_SPI = no
endif
-# Dediprog, USB-Blaster and FT2232 are not supported under DOS (missing USB support).
+# Dediprog, USB-Blaster, PICkit2 and FT2232 are not supported under DOS (missing USB support).
ifeq ($(CONFIG_DEDIPROG), yes)
UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes
else
@@ -154,6 +154,11 @@ UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes
else
override CONFIG_USBBLASTER_SPI = no
endif
+ifeq ($(CONFIG_PICKIT2_SPI), yes)
+UNSUPPORTED_FEATURES += CONFIG_PICKIT2_SPI=yes
+else
+override CONFIG_PICKIT2_SPI = no
+endif
endif
# FIXME: Should we check for Cygwin/MSVC as well?
@@ -277,7 +282,7 @@ UNSUPPORTED_FEATURES += CONFIG_PONY_SPI=yes
else
override CONFIG_PONY_SPI = no
endif
-# Dediprog, USB-Blaster and FT2232 are not supported with libpayload (missing libusb support)
+# Dediprog, USB-Blaster, PICkit2 and FT2232 are not supported with libpayload (missing libusb support)
ifeq ($(CONFIG_DEDIPROG), yes)
UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes
else
@@ -293,6 +298,11 @@ UNSUPPORTED_FEATURES += CONFIG_USBBLASTER_SPI=yes
else
override CONFIG_USBBLASTER_SPI = no
endif
+ifeq ($(CONFIG_PICKIT2_SPI), yes)
+UNSUPPORTED_FEATURES += CONFIG_PICKIT2_SPI=yes
+else
+override CONFIG_PICKIT2_SPI = no
+endif
endif
ifneq ($(TARGET_OS), Linux)
@@ -429,6 +439,9 @@ CONFIG_USBBLASTER_SPI ?= yes
# MSTAR DDC support needs more tests/reviews/cleanups.
CONFIG_MSTARDDC_SPI ?= no
+# Always enable PICkit2 SPI dongles for now.
+CONFIG_PICKIT2_SPI ?= yes
+
# Always enable dummy tracing for now.
CONFIG_DUMMY ?= yes
@@ -614,6 +627,12 @@ NEED_FTDI := yes
PROGRAMMER_OBJS += usbblaster_spi.o
endif
+ifeq ($(CONFIG_PICKIT2_SPI), yes)
+FEATURE_CFLAGS += -D'CONFIG_PICKIT2_SPI=1'
+PROGRAMMER_OBJS += pickit2_spi.o
+NEED_USB := yes
+endif
+
ifeq ($(NEED_FTDI), yes)
FTDILIBS := $(shell ([ -n "$(PKG_CONFIG_LIBDIR)" ] && export PKG_CONFIG_LIBDIR="$(PKG_CONFIG_LIBDIR)" ); pkg-config --libs libftdi || printf "%s" "-lftdi -lusb")
FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FT232H := yes" .features && printf "%s" "-D'HAVE_FT232H=1'")
OpenPOWER on IntegriCloud