flashrom.mk 3.1 KB

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