Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
Makefile: list dependencies for RAW_MEM_ACCESS, X86_PORT_IO, X86_MSR

List all programmers which depend on the respective hwaccess features.
This is the base for a precise feature selecting in the build system.

Change-Id: I588f698780b5acd65084346bcef781cbfd1203ea
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/60114
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
---
M Makefile
1 file changed, 48 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index c985ae0..9a6d7b0 100644
--- a/Makefile
+++ b/Makefile
@@ -107,6 +107,40 @@
CONFIG_PONY_SPI \
CONFIG_RAYER_SPI \

+DEPENDS_ON_RAW_MEM_ACCESS := \
+ CONFIG_ATAPROMISE \
+ CONFIG_DRKAISER \
+ CONFIG_GFXNVIDIA \
+ CONFIG_INTERNAL \
+ CONFIG_IT8212 \
+ CONFIG_NICINTEL \
+ CONFIG_NICINTEL_EEPROM \
+ CONFIG_NICINTEL_SPI \
+ CONFIG_OGP_SPI \
+ CONFIG_SATAMV \
+ CONFIG_SATASII \
+
+DEPENDS_ON_X86_MSR := \
+ CONFIG_INTERNAL \
+
+DEPENDS_ON_X86_PORT_IO := \
+ CONFIG_ATAHPT \
+ CONFIG_ATAPROMISE \
+ CONFIG_ATAVIA \
+ CONFIG_DRKAISER \
+ CONFIG_GFXNVIDIA \
+ CONFIG_INTERNAL \
+ CONFIG_NIC3COM \
+ CONFIG_NICINTEL \
+ CONFIG_NICINTEL_EEPROM \
+ CONFIG_NICINTEL_SPI \
+ CONFIG_NICNATSEMI \
+ CONFIG_NICREALTEK \
+ CONFIG_OGP_SPI \
+ CONFIG_RAYER_SPI \
+ CONFIG_SATAMV \
+ CONFIG_SATASII \
+
DEPENDS_ON_LIBPCI := \
CONFIG_ATAHPT \
CONFIG_ATAPROMISE \
@@ -255,7 +289,13 @@
# For now we disable all PCI-based programmers on Windows/MinGW (no libpci).
$(call mark_unsupported,$(DEPENDS_ON_LIBPCI))
# And programmers that need raw access.
-$(call mark_unsupported,CONFIG_RAYER_SPI)
+$(call mark_unsupported,$(DEPENDS_ON_RAW_MEM_ACCESS))
+
+else # No MinGW
+
+# NI USB-845x only supported on Windows at the moment
+$(call mark_unsupported,CONFIG_NI845X_SPI)
+
endif

ifeq ($(TARGET_OS), libpayload)
@@ -268,7 +308,9 @@
# libpayload does not provide the romsize field in struct pci_dev that the atapromise code requires.
$(call mark_unsupported,CONFIG_ATAPROMISE)
# Bus Pirate, Serprog and PonyProg are not supported with libpayload (missing serial support).
-$(call mark_unsupported,CONFIG_BUSPIRATE_SPI CONFIG_SERPROG CONFIG_PONY_SPI)
+$(call mark_unsupported,$(DEPENDS_ON_SERIAL))
+# Dediprog, Developerbox, USB-Blaster, PICkit2, CH341A and FT2232 are not supported with libpayload (missing libusb support).
+$(call mark_unsupported,$(DEPENDS_ON_LIBUSB1) $(DEPENDS_ON_LIBFTDI) $(DEPENDS_ON_LIBJAYLINK))
endif

ifeq ($(HAS_LINUX_MTD), no)
@@ -285,7 +327,7 @@

ifeq ($(TARGET_OS), Android)
# Android on x86 (currently) does not provide raw PCI port I/O operations.
-$(call mark_unsupported,CONFIG_RAYER_SPI)
+$(call mark_unsupported,$(DEPENDS_ON_X86_PORT_IO))
endif

# Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
@@ -319,18 +361,15 @@
# PCI port I/O support is unimplemented on PPC/MIPS/SPARC and unavailable on ARM.
# Right now this means the drivers below only work on x86.
ifneq ($(ARCH), x86)
-$(call mark_unsupported,CONFIG_NIC3COM CONFIG_NICREALTEK CONFIG_NICNATSEMI)
-$(call mark_unsupported,CONFIG_RAYER_SPI CONFIG_ATAHPT CONFIG_ATAPROMISE)
-$(call mark_unsupported,CONFIG_SATAMV)
+$(call mark_unsupported,$(DEPENDS_ON_X86_MSR))
+$(call mark_unsupported,$(DEPENDS_ON_X86_PORT_IO))
endif

# Additionally disable all drivers needing raw access (memory, PCI, port I/O)
# on architectures with unknown raw access properties.
# Right now those architectures are alpha hppa m68k sh s390
ifneq ($(ARCH), $(filter $(ARCH), x86 mips ppc arm sparc arc))
-$(call mark_unsupported,CONFIG_GFXNVIDIA CONFIG_SATASII CONFIG_ATAVIA)
-$(call mark_unsupported,CONFIG_DRKAISER CONFIG_NICINTEL CONFIG_NICINTEL_SPI)
-$(call mark_unsupported,CONFIG_NICINTEL_EEPROM CONFIG_OGP_SPI CONFIG_IT8212)
+$(call mark_unsupported,$(DEPENDS_ON_RAW_MEM_ACCESS))
endif

ifeq ($(TARGET_OS), $(filter $(TARGET_OS), Linux Darwin NetBSD OpenBSD))

To view, visit change 60114. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I588f698780b5acd65084346bcef781cbfd1203ea
Gerrit-Change-Number: 60114
Gerrit-PatchSet: 7
Gerrit-Owner: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged