Browse Source

flashrom: add config options

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
lilik-openwrt-22.03
Álvaro Fernández Rojas 10 years ago
parent
commit
3879265ffd
4 changed files with 355 additions and 2 deletions
  1. +279
    -0
      utils/flashrom/Config.in
  2. +11
    -2
      utils/flashrom/Makefile
  3. +54
    -0
      utils/flashrom/flashrom.mk
  4. +11
    -0
      utils/flashrom/patches/0001-fix_internal_bitbang.patch

+ 279
- 0
utils/flashrom/Config.in View File

@ -0,0 +1,279 @@
menu "Flashrom configuration"
depends on PACKAGE_flashrom
choice
prompt "Default Programmer"
default DEFPROG_INTERNAL if FLASHROM_PCI
default DEFPROG_LINUX_SPI
config DEFPROG_INTERNAL
depends on FRPROG_INTERNAL
bool "Internal"
config DEFPROG_LINUX_SPI
depends on FRPROG_LINUX_SPI
bool "Linux SPI"
config DEFPROG_SERPROG
depends on FRPROG_SERPROG
bool "Serial"
config DEFPROG_RAYER_SPI
depends on FRPROG_RAYER_SPI
bool "Rayer SPI"
config DEFPROG_PONY_SPI
depends on FRPROG_PONY_SPI
bool "Pony SPI"
config DEFPROG_NIC3COM
depends on FRPROG_NIC3COM
bool "NIC3Com"
config DEFPROG_GFXNVIDIA
depends on FRPROG_GFXNVIDIA
bool "GFX Nvidia"
config DEFPROG_SATASII
depends on FRPROG_SATASII
bool "SATASII"
# config DEFPROG_ATAHPT
# depends on FRPROG_ATAHPT
# bool "Highpoint (HPT) ATA/RAID"
config DEFPROG_ATAVIA
depends on FRPROG_ATAVIA
bool "ATAVIA"
config DEFPROG_FT2232_SPI
depends on FRPROG_FT2232_SPI
bool "FT2232 SPI"
config DEFPROG_USBBLASTER_SPI
depends on FRPROG_USBBLASTER_SPI
bool "USBBlaster SPI"
# config DEFPROG_MSTARDDC_SPI
# depends on FRPROG_MSTARDDC_SPI
# bool "MSTAR DDC SPI"
config DEFPROG_PICKIT2_SPI
depends on FRPROG_PICKIT2_SPI
bool "PICkit2 SPI"
config DEFPROG_DUMMY
depends on FRPROG_DUMMY
bool "Dummy"
config DEFPROG_DRKAISER
depends on FRPROG_DRKAISER
bool "Dr. Kaiser"
config DEFPROG_NICREALTEK
depends on FRPROG_NICREALTEK
bool "Realtek NICs"
# config DEFPROG_NICNATSEMI
# depends on FRPROG_NICNATSEMI
# bool "National Semiconductor NICs"
config DEFPROG_NICINTEL
depends on FRPROG_NICINTEL
bool "Intel NICs"
config DEFPROG_NICINTEL_SPI
depends on FRPROG_NICINTEL_SPI
bool "Intel NICs SPI"
config DEFPROG_NICINTEL_EEPROM
depends on FRPROG_NICINTEL_EEPROM
bool "Intel NICs EEPROM"
config DEFPROG_OGP_SPI
depends on FRPROG_OGP_SPI
bool "OGP SPI"
config DEFPROG_BUSPIRATE_SPI
depends on FRPROG_BUSPIRATE_SPI
bool "SPI BUS Pirate"
# config DEFPROG_DEDIPROG
# depends on FRPROG_DEDIPROG
# bool "Dediprog SF100"
config DEFPROG_SATAMV
depends on FRPROG_SATAMV
bool "Marvell SATA"
config DEFPROG_IT8212
depends on FRPROG_IT8212
bool "ITE IT8212F PATA"
endchoice
menu "Misc Programmers"
config FRPROG_LINUX_SPI
bool "Linux SPI"
default y
# config FRPROG_MSTARDDC_SPI
# bool "MSTAR DDC"
# default n
config FRPROG_DUMMY
bool "Dummy"
default y
endmenu
config FLASHROM_FTDI
bool "FTDI Support"
default y
menu "FTDI Programmers"
depends on FLASHROM_FTDI
config FRPROG_FT2232_SPI
depends on FLASHROM_FTDI
bool "FT2232 SPI"
default y
config FRPROG_USBBLASTER_SPI
depends on FLASHROM_FTDI
bool "USBBlaster SPI"
default y
endmenu
config FLASHROM_PCI
bool "PCI Support"
default y if (TARGET_x86||TARGET_x86_64)
menu "PCI Programmers"
depends on FLASHROM_PCI
config FRPROG_INTERNAL
depends on FLASHROM_PCI
bool "Internal"
default y
config FRPROG_RAYER_SPI
depends on FLASHROM_PCI
bool "Rayer SPI"
default y
config FRPROG_NIC3COM
depends on FLASHROM_PCI
bool "NIC3Com"
default y
config FRPROG_GFXNVIDIA
depends on FLASHROM_PCI
bool "GFX Nvidia"
default y
config FRPROG_SATASII
depends on FLASHROM_PCI
bool "SATASII"
default y
# config FRPROG_ATAHPT
# depends on FLASHROM_PCI
# bool "Highpoint (HPT) ATA/RAID"
# default n
config FRPROG_ATAVIA
depends on FLASHROM_PCI
bool "ATAVIA"
default y
config FRPROG_IT8212
depends on FLASHROM_PCI
bool "ITE IT8212F PATA"
default y
config FRPROG_DRKAISER
depends on FLASHROM_PCI
bool "Dr. Kaiser"
default y
config FRPROG_NICREALTEK
depends on FLASHROM_PCI
bool "Realtek NICs"
default y
# config FRPROG_NICNATSEMI
# depends on FLASHROM_PCI
# bool "National Semiconductor NICs"
# default n
config FRPROG_NICINTEL
depends on FLASHROM_PCI
bool "Intel NICs"
default y
config FRPROG_NICINTEL_SPI
depends on FLASHROM_PCI
bool "Intel NICs SPI"
default y
config FRPROG_NICINTEL_EEPROM
depends on FLASHROM_PCI
bool "Intel NICs EEPROM"
default y
config FRPROG_OGP_SPI
depends on FLASHROM_PCI
bool "OGP SPI"
default y
config FRPROG_SATAMV
depends on FLASHROM_PCI
bool "Marvell SATA"
default y
endmenu
config FLASHROM_SERIAL
bool "Serial Support"
default y
menu "Serial Programmers"
depends on FLASHROM_SERIAL
config FRPROG_SERPROG
depends on FLASHROM_SERIAL
bool "Serial"
default y
config FRPROG_PONY_SPI
depends on FLASHROM_SERIAL
bool "Pony SPI"
default y
config FRPROG_BUSPIRATE_SPI
depends on FLASHROM_SERIAL
bool "SPI BUS Pirate"
default y
endmenu
config FLASHROM_USB
bool "USB Support"
default y
menu "USB Programmers"
depends on FLASHROM_USB
config FRPROG_PICKIT2_SPI
depends on FLASHROM_USB
bool "PICkit2 SPI"
default y
# config FRPROG_DEDIPROG
# depends on FLASHROM_USB
# bool "Dediprog SF100"
# default n
endmenu
endmenu

+ 11
- 2
utils/flashrom/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=flashrom
PKG_VERSION:=0.9.8
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.flashrom.org/releases
@ -22,13 +22,22 @@ PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include flashrom.mk
define Package/flashrom
SECTION:=utils
CATEGORY:=Utilities
TITLE:=FlashROM Utility
URL:=http://www.flashrom.org/
DEPENDS:=+zlib +pciutils +(TARGET_x86||TARGET_x86_64):dmidecode +libftdi
DEPENDS:=\
+(TARGET_x86||TARGET_x86_64):dmidecode \
+FLASHROM_FTDI:libftdi \
+FLASHROM_PCI:pciutils \
+FLASHROM_USB:libusb-compat
endef
define Package/flashrom/config
source "$(SOURCE)/Config.in"
endef
define Package/flashrom/description


+ 54
- 0
utils/flashrom/flashrom.mk View File

@ -0,0 +1,54 @@
# Flashrom configuration
define DefineConfig
ifeq ($(CONFIG_FLASHROM_$(1)),)
MAKE_FLAGS += NEED_$(1)=0
endif
endef
define DefineProgrammer
ifeq ($(CONFIG_FRPROG_$(1)),)
MAKE_FLAGS += CONFIG_$(1)=0
endif
ifneq ($(CONFIG_DEFPROG_$(1)),)
MAKE_FLAGS += CONFIG_DEFAULT_PROGRAMMER=CONFIG_$(1)
endif
endef
# Misc
$(eval $(call DefineProgrammer,LINUX_SPI))
#$(eval $(call DefineProgrammer,MSTARDDC_SPI))
$(eval $(call DefineProgrammer,DUMMY))
# FTDI
$(eval $(call DefineConfig,FTDI))
$(eval $(call DefineProgrammer,FT2232_SPI))
$(eval $(call DefineProgrammer,USBBLASTER_SPI))
# PCI
$(eval $(call DefineConfig,PCI))
$(eval $(call DefineProgrammer,INTERNAL))
$(eval $(call DefineProgrammer,RAYER_SPI))
$(eval $(call DefineProgrammer,NIC3COM))
$(eval $(call DefineProgrammer,GFXNVIDIA))
$(eval $(call DefineProgrammer,SATASII))
#$(eval $(call DefineProgrammer,ATAHPT))
$(eval $(call DefineProgrammer,ATAVIA))
$(eval $(call DefineProgrammer,IT8212))
$(eval $(call DefineProgrammer,DRKAISER))
$(eval $(call DefineProgrammer,NICREALTEK))
#$(eval $(call DefineProgrammer,NICNATSEMI))
$(eval $(call DefineProgrammer,NICINTEL))
$(eval $(call DefineProgrammer,NICINTEL_SPI))
$(eval $(call DefineProgrammer,NICINTEL_EEPROM))
$(eval $(call DefineProgrammer,OGP_SPI))
$(eval $(call DefineProgrammer,SATAMV))
# Serial
$(eval $(call DefineConfig,SERIAL))
$(eval $(call DefineProgrammer,SERPROG))
$(eval $(call DefineProgrammer,PONY_SPI))
$(eval $(call DefineProgrammer,BUSPIRATE_SPI))
# USB
$(eval $(call DefineConfig,USB))
$(eval $(call DefineProgrammer,PICKIT2_SPI))
#$(eval $(call DefineProgrammer,DEDIPROG))

+ 11
- 0
utils/flashrom/patches/0001-fix_internal_bitbang.patch View File

@ -0,0 +1,11 @@
--- a/programmer.h
+++ b/programmer.h
@@ -557,7 +557,7 @@ enum spi_controller {
#if CONFIG_DEDIPROG == 1
SPI_CONTROLLER_DEDIPROG,
#endif
-#if CONFIG_OGP_SPI == 1 || CONFIG_NICINTEL_SPI == 1 || CONFIG_RAYER_SPI == 1 || CONFIG_PONY_SPI == 1 || (CONFIG_INTERNAL == 1 && (defined(__i386__) || defined(__x86_64__)))
+#if CONFIG_OGP_SPI == 1 || CONFIG_NICINTEL_SPI == 1 || CONFIG_RAYER_SPI == 1 || CONFIG_PONY_SPI == 1 || CONFIG_INTERNAL == 1
SPI_CONTROLLER_BITBANG,
#endif
#if CONFIG_LINUX_SPI == 1

Loading…
Cancel
Save