You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.4 KiB

  1. # Flashrom variants
  2. define DefaultProgrammer
  3. MAKE_FLAGS += CONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_$(1)
  4. endef
  5. define DefineConfig
  6. ifeq ($(2),yes)
  7. MAKE_FLAGS += NEED_$(1)=$(2)
  8. endif
  9. endef
  10. define DefineProgrammer
  11. # Selecting invalid programmers will fail
  12. # Only disable unwanted programmers and keep the default ones
  13. ifeq ($(2),no)
  14. MAKE_FLAGS += CONFIG_$(1)=$(2)
  15. endif
  16. endef
  17. ifeq ($(BUILD_VARIANT),full)
  18. $(eval $(call DefaultProgrammer,LINUX_SPI))
  19. FLASHROM_BASIC := yes
  20. FLASHROM_FTDI := yes
  21. FLASHROM_PCI := yes
  22. FLASHROM_RAW := yes
  23. FLASHROM_SERIAL := yes
  24. FLASHROM_USB := yes
  25. endif
  26. ifeq ($(BUILD_VARIANT),pci)
  27. $(eval $(call DefaultProgrammer,INTERNAL))
  28. FLASHROM_BASIC := yes
  29. FLASHROM_FTDI := no
  30. FLASHROM_PCI := yes
  31. FLASHROM_RAW := yes
  32. FLASHROM_SERIAL := no
  33. FLASHROM_USB := no
  34. endif
  35. ifeq ($(BUILD_VARIANT),spi)
  36. $(eval $(call DefaultProgrammer,LINUX_SPI))
  37. FLASHROM_BASIC := yes
  38. FLASHROM_FTDI := no
  39. FLASHROM_PCI := no
  40. FLASHROM_RAW := no
  41. FLASHROM_SERIAL := no
  42. FLASHROM_USB := no
  43. endif
  44. ifeq ($(BUILD_VARIANT),usb)
  45. $(eval $(call DefaultProgrammer,SERPROG))
  46. FLASHROM_BASIC := yes
  47. FLASHROM_FTDI := yes
  48. FLASHROM_PCI := no
  49. FLASHROM_RAW := no
  50. FLASHROM_SERIAL := yes
  51. FLASHROM_USB := yes
  52. endif
  53. # Misc
  54. $(eval $(call DefineProgrammer,LINUX_SPI,$(FLASHROM_BASIC)))
  55. #$(eval $(call DefineProgrammer,MSTARDDC_SPI,$(FLASHROM_BASIC)))
  56. $(eval $(call DefineProgrammer,DUMMY,$(FLASHROM_BASIC)))
  57. # FTDI
  58. $(eval $(call DefineConfig,LIBFTDI,$(FLASHROM_FTDI)))
  59. $(eval $(call DefineProgrammer,FT2232_SPI,$(FLASHROM_FTDI)))
  60. $(eval $(call DefineProgrammer,USBBLASTER_SPI,$(FLASHROM_FTDI)))
  61. # RAW
  62. $(eval $(call DefineConfig,RAW_ACCESS,$(FLASHROM_RAW)))
  63. $(eval $(call DefineProgrammer,RAYER_SPI,$(FLASHROM_RAW)))
  64. # PCI
  65. $(eval $(call DefineConfig,LIBPCI,$(FLASHROM_PCI)))
  66. $(eval $(call DefineProgrammer,INTERNAL,$(FLASHROM_PCI)))
  67. $(eval $(call DefineProgrammer,NIC3COM,$(FLASHROM_PCI)))
  68. $(eval $(call DefineProgrammer,GFXNVIDIA,$(FLASHROM_PCI)))
  69. $(eval $(call DefineProgrammer,SATASII,$(FLASHROM_PCI)))
  70. $(eval $(call DefineProgrammer,ATAHPT,$(FLASHROM_PCI)))
  71. $(eval $(call DefineProgrammer,ATAPROMISE,$(FLASHROM_PCI)))
  72. $(eval $(call DefineProgrammer,ATAVIA,$(FLASHROM_PCI)))
  73. $(eval $(call DefineProgrammer,IT8212,$(FLASHROM_PCI)))
  74. $(eval $(call DefineProgrammer,DRKAISER,$(FLASHROM_PCI)))
  75. $(eval $(call DefineProgrammer,NICREALTEK,$(FLASHROM_PCI)))
  76. $(eval $(call DefineProgrammer,NICNATSEMI,$(FLASHROM_PCI)))
  77. $(eval $(call DefineProgrammer,NICINTEL,$(FLASHROM_PCI)))
  78. $(eval $(call DefineProgrammer,NICINTEL_SPI,$(FLASHROM_PCI)))
  79. $(eval $(call DefineProgrammer,NICINTEL_EEPROM,$(FLASHROM_PCI)))
  80. $(eval $(call DefineProgrammer,OGP_SPI,$(FLASHROM_PCI)))
  81. $(eval $(call DefineProgrammer,SATAMV,$(FLASHROM_PCI)))
  82. # Serial
  83. $(eval $(call DefineConfig,SERIAL,$(FLASHROM_SERIAL)))
  84. $(eval $(call DefineProgrammer,SERPROG,$(FLASHROM_SERIAL)))
  85. $(eval $(call DefineProgrammer,PONY_SPI,$(FLASHROM_SERIAL)))
  86. $(eval $(call DefineProgrammer,BUSPIRATE_SPI,$(FLASHROM_SERIAL)))
  87. # USB1
  88. $(eval $(call DefineConfig,LIBUSB1,$(FLASHROM_USB)))
  89. $(eval $(call DefineProgrammer,CH341A_SPI,$(FLASHROM_USB)))
  90. $(eval $(call DefineProgrammer,DEDIPROG,$(FLASHROM_USB)))
  91. $(eval $(call DefineProgrammer,DEVELOPERBOX_SPI,$(FLASHROM_USB)))
  92. $(eval $(call DefineProgrammer,DIGILENT_SPI,$(FLASHROM_USB)))
  93. $(eval $(call DefineProgrammer,PICKIT2_SPI,$(FLASHROM_USB)))
  94. $(eval $(call DefineProgrammer,STLINKV3_SPI,$(FLASHROM_USB)))