- Use a new variable NO_PCI to centralize the disabling of programmers.
- Reorder the disabling code alphabetically.
- Clean up the section that presets all programmer config variables.
Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
---
Makefile | 193 ++++++++++++++++++++++----------------------------------------
1 file changed, 69 insertions(+), 124 deletions(-)
diff --git a/Makefile b/Makefile
index a8d0ad8..0550213 100644
--- a/Makefile
+++ b/Makefile
@@ -73,6 +73,10 @@ ifneq ($(HOST_OS), SunOS)
STRIP_ARGS = -s
endif
+# In circumstances we know beforehand that PCI support is unavailable, we set this to yes and
+# use it to disable default programmers needing it.
+NO_PCI = no
+
# Determine the destination OS.
# IMPORTANT: The following line must be placed before TARGET_OS is ever used
# (of course), but should come after any lines setting CC because the line
@@ -150,66 +154,8 @@ UNSUPPORTED_FEATURES += CONFIG_INTERNAL=yes
else
override CONFIG_INTERNAL = no
endif
-ifeq ($(CONFIG_RAYER_SPI), yes)
-UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes
-else
-override CONFIG_RAYER_SPI = no
-endif
-ifeq ($(CONFIG_NIC3COM), yes)
-UNSUPPORTED_FEATURES += CONFIG_NIC3COM=yes
-else
-override CONFIG_NIC3COM = no
-endif
-ifeq ($(CONFIG_GFXNVIDIA), yes)
-UNSUPPORTED_FEATURES += CONFIG_GFXNVIDIA=yes
-else
-override CONFIG_GFXNVIDIA = no
-endif
-ifeq ($(CONFIG_SATASII), yes)
-UNSUPPORTED_FEATURES += CONFIG_SATASII=yes
-else
-override CONFIG_SATASII = no
-endif
-ifeq ($(CONFIG_ATAHPT), yes)
-UNSUPPORTED_FEATURES += CONFIG_ATAHPT=yes
-else
-override CONFIG_ATAHPT = no
-endif
-ifeq ($(CONFIG_DRKAISER), yes)
-UNSUPPORTED_FEATURES += CONFIG_DRKAISER=yes
-else
-override CONFIG_DRKAISER = no
-endif
-ifeq ($(CONFIG_NICREALTEK), yes)
-UNSUPPORTED_FEATURES += CONFIG_NICREALTEK=yes
-else
-override CONFIG_NICREALTEK = no
-endif
-ifeq ($(CONFIG_NICNATSEMI), yes)
-UNSUPPORTED_FEATURES += CONFIG_NICNATSEMI=yes
-else
-override CONFIG_NICNATSEMI = no
-endif
-ifeq ($(CONFIG_NICINTEL), yes)
-UNSUPPORTED_FEATURES += CONFIG_NICINTEL=yes
-else
-override CONFIG_NICINTEL = no
-endif
-ifeq ($(CONFIG_NICINTEL_SPI), yes)
-UNSUPPORTED_FEATURES += CONFIG_NICINTEL_SPI=yes
-else
-override CONFIG_NICINTEL_SPI = no
-endif
-ifeq ($(CONFIG_OGP_SPI), yes)
-UNSUPPORTED_FEATURES += CONFIG_OGP_SPI=yes
-else
-override CONFIG_OGP_SPI = no
-endif
-ifeq ($(CONFIG_SATAMV), yes)
-UNSUPPORTED_FEATURES += CONFIG_SATAMV=yes
-else
-override CONFIG_SATAMV = no
-endif
+# All others are disabled together below.
+NO_PCI = yes
endif
ifeq ($(TARGET_OS), libpayload)
@@ -257,38 +203,73 @@ endif
override ARCH := $(strip $(shell LC_ALL=C $(CC) $(CPPFLAGS) -E arch.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
# PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM.
-# Right now this means the drivers below only work on x86.
+# Right now this means those drivers only work on x86, disable them elsewhere if not selected explicitly.
ifneq ($(ARCH), x86)
+NO_PCI = yes
+endif
+
+# Disable all programmers which require PCI access because it is apparently not available on the target.
+ifeq ($(NO_PCI), yes)
+ifeq ($(CONFIG_ATAHPT), yes)
+UNSUPPORTED_FEATURES += CONFIG_ATAHPT=yes
+else
+override CONFIG_ATAHPT = no
+endif
+ifeq ($(CONFIG_DRKAISER), yes)
+UNSUPPORTED_FEATURES += CONFIG_DRKAISER=yes
+else
+override CONFIG_DRKAISER = no
+endif
+ifeq ($(CONFIG_GFXNVIDIA), yes)
+UNSUPPORTED_FEATURES += CONFIG_GFXNVIDIA=yes
+else
+override CONFIG_GFXNVIDIA = no
+endif
ifeq ($(CONFIG_NIC3COM), yes)
UNSUPPORTED_FEATURES += CONFIG_NIC3COM=yes
else
override CONFIG_NIC3COM = no
endif
-ifeq ($(CONFIG_NICREALTEK), yes)
-UNSUPPORTED_FEATURES += CONFIG_NICREALTEK=yes
+ifeq ($(CONFIG_NICINTEL), yes)
+UNSUPPORTED_FEATURES += CONFIG_NICINTEL=yes
else
-override CONFIG_NICREALTEK = no
+override CONFIG_NICINTEL = no
+endif
+ifeq ($(CONFIG_NICINTEL_SPI), yes)
+UNSUPPORTED_FEATURES += CONFIG_NICINTEL_SPI=yes
+else
+override CONFIG_NICINTEL_SPI = no
endif
ifeq ($(CONFIG_NICNATSEMI), yes)
UNSUPPORTED_FEATURES += CONFIG_NICNATSEMI=yes
else
override CONFIG_NICNATSEMI = no
endif
+ifeq ($(CONFIG_NICREALTEK), yes)
+UNSUPPORTED_FEATURES += CONFIG_NICREALTEK=yes
+else
+override CONFIG_NICREALTEK = no
+endif
+ifeq ($(CONFIG_OGP_SPI), yes)
+UNSUPPORTED_FEATURES += CONFIG_OGP_SPI=yes
+else
+override CONFIG_OGP_SPI = no
+endif
ifeq ($(CONFIG_RAYER_SPI), yes)
UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes
else
override CONFIG_RAYER_SPI = no
endif
-ifeq ($(CONFIG_ATAHPT), yes)
-UNSUPPORTED_FEATURES += CONFIG_ATAHPT=yes
-else
-override CONFIG_ATAHPT = no
-endif
ifeq ($(CONFIG_SATAMV), yes)
UNSUPPORTED_FEATURES += CONFIG_SATAMV=yes
else
override CONFIG_SATAMV = no
endif
+ifeq ($(CONFIG_SATASII), yes)
+UNSUPPORTED_FEATURES += CONFIG_SATASII=yes
+else
+override CONFIG_SATASII = no
+endif
endif
###############################################################################
@@ -321,67 +302,31 @@ RELEASENAME ?= $(VERSION)
SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
-# Always enable internal/onboard support for now.
+# Enable programmer modules by default (and disable them later if needed), sorted alphabetically.
+CONFIG_BUSPIRATE_SPI ?= yes
+CONFIG_DRKAISER ?= yes
+CONFIG_DUMMY ?= yes
+CONFIG_FT2232_SPI ?= yes
+CONFIG_GFXNVIDIA ?= yes
CONFIG_INTERNAL ?= yes
-
-# Always enable serprog for now. Needs to be disabled on Windows.
-CONFIG_SERPROG ?= yes
-
-# RayeR SPIPGM hardware support
-CONFIG_RAYER_SPI ?= yes
-
-# PonyProg2000 SPI hardware support
-CONFIG_PONY_SPI ?= yes
-
-# Always enable 3Com NICs for now.
+CONFIG_LINUX_SPI ?= yes
CONFIG_NIC3COM ?= yes
-
-# Enable NVIDIA graphics cards. Note: write and erase do not work properly.
-CONFIG_GFXNVIDIA ?= yes
-
-# Always enable SiI SATA controllers for now.
-CONFIG_SATASII ?= yes
-
-# Highpoint (HPT) ATA/RAID controller support.
-# IMPORTANT: This code is not yet working!
-CONFIG_ATAHPT ?= no
-
-# Always enable FT2232 SPI dongles for now.
-CONFIG_FT2232_SPI ?= yes
-
-# Always enable dummy tracing for now.
-CONFIG_DUMMY ?= yes
-
-# Always enable Dr. Kaiser for now.
-CONFIG_DRKAISER ?= yes
-
-# Always enable Realtek NICs for now.
-CONFIG_NICREALTEK ?= yes
-
-# Disable National Semiconductor NICs until support is complete and tested.
-CONFIG_NICNATSEMI ?= no
-
-# Always enable Intel NICs for now.
-CONFIG_NICINTEL ?= yes
-
-# Always enable SPI on Intel NICs for now.
CONFIG_NICINTEL_SPI ?= yes
-
-# Always enable SPI on OGP cards for now.
+CONFIG_NICINTEL ?= yes
+CONFIG_NICREALTEK ?= yes
CONFIG_OGP_SPI ?= yes
+CONFIG_PONY_SPI ?= yes
+CONFIG_RAYER_SPI ?= yes
+CONFIG_SATAMV ?= yes
+CONFIG_SATASII ?= yes
+CONFIG_SERPROG ?= yes
-# Always enable Bus Pirate SPI for now.
-CONFIG_BUSPIRATE_SPI ?= yes
-
+# Highpoint (HPT) ATA/RAID controller support is not yet working!
+CONFIG_ATAHPT ?= no
# Disable Dediprog SF100 until support is complete and tested.
CONFIG_DEDIPROG ?= no
-
-# Always enable Marvell SATA controllers for now.
-CONFIG_SATAMV ?= yes
-
-# Enable Linux spidev interface by default. We disable it on non-Linux targets.
-CONFIG_LINUX_SPI ?= yes
-
+# Disable National Semiconductor NICs until support is complete and tested.
+CONFIG_NICNATSEMI ?= no
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
@@ -749,7 +694,7 @@ ifeq ($(PROGRAMMER_OBJS),)
@false
endif
ifneq ($(UNSUPPORTED_FEATURES), )
- @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)"
+ @echo "The following features are unavailable on the target machine: $(UNSUPPORTED_FEATURES)"
@false
endif
--
Kind regards, Stefan Tauner