Enable support for USB programmers (FT2232, FT4232, etc), see rhbz #839179

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This commit is contained in:
Peter Lemenkov 2012-07-11 12:06:53 +04:00
parent 155f996a67
commit f918b18a61
11 changed files with 74 additions and 53 deletions

View File

@ -1,24 +1,24 @@
From 8c3f394bf5924ac8c916edeecdc3d8499f3fc534 Mon Sep 17 00:00:00 2001
From a417d56da1bf45e020d002625ab9464b66dda0a1 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Fri, 17 Sep 2010 18:58:28 +0400
Subject: [PATCH 1/9] Initial commit of autotools-related files
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
Makefile.am | 228 +++++++++++++++++++++++++++++++++++++
Makefile.am | 225 +++++++++++++++++++++++++++++++++++++
bootstrap.sh | 4 +
configure.ac | 352 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 584 insertions(+)
configure.ac | 353 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 582 insertions(+)
create mode 100644 Makefile.am
create mode 100755 bootstrap.sh
create mode 100644 configure.ac
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..ee6780c
index 0000000..a539f12
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,228 @@
@@ -0,0 +1,225 @@
+sbin_PROGRAMS = flashrom
+
+man_MANS = flashrom.8
@ -209,9 +209,6 @@ index 0000000..ee6780c
+
+lib_SOURCES = layout.c
+
+# Unknown purpose
+# sharplhf00l04.c
+
+flashrom_SOURCES = \
+ flash.h \
+ programmer.c \
@ -259,10 +256,10 @@ index 0000000..0213288
+automake --add-missing --copy --force-missing
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..3c09493
index 0000000..6bbeac0
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,352 @@
@@ -0,0 +1,353 @@
+AC_INIT([flashrom], [0.9.5.2-r1530], [flashrom@flashrom.org], [flashrom], [http://www.flashrom.org/])
+
+AC_PREREQ(2.59)
@ -540,8 +537,8 @@ index 0000000..3c09493
+fi
+
+if test "$ft2232_spi" = 'yes' ; then
+# AC_CHECK_LIB([ftdi],[main],,[AC_MSG_ERROR([ftdi library missing which is required for ft2232-spi])])
+ AC_CHECK_LIB([ftdi],[main],,[ft2232_spi="no"])
+ AC_CHECK_HEADERS([ftdi.h],[],[AC_MSG_ERROR([<ftdi.h> header not found])],[AC_INCLUDES_DEFAULT])
+ AC_CHECK_LIB([ftdi],[ftdi_init],,[AC_MSG_ERROR([ftdi library is missing])])
+fi
+
+# For Makefile.am
@ -595,6 +592,7 @@ index 0000000..3c09493
+ serprog: ...................... ${serprog}
+ Linux SPI: .................... ${linux_spi}
+ RayeR SPI: .................... ${rayer_spi}
+ PonyProg2000 SPI: ............. ${pony_spi}
+ Bitbang SPI: .................. ${bitbang_spi}
+ 3COM NIC: ..................... ${nic3com}
+ NVIDIA GFX: ................... ${gfxnvidia}
@ -616,5 +614,5 @@ index 0000000..3c09493
+------------------------------------------------------------------------
+])
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From 61369dd5e2ed8d9b3897ca7f82d23a7e4294aebd Mon Sep 17 00:00:00 2001
From cded4a9b60e8c7cd06d76f77a60626b600951b61 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sat, 12 Jun 2010 22:13:53 +0400
Subject: [PATCH 2/9] Use dmidecode path defined at configure stage
@ -22,5 +22,5 @@ index 2c2551d..6f62fc0 100644
static char *dmistrings[ARRAY_SIZE(dmidecode_names)];
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From 45cade613be579e425c15b524b1bd66e6571595a Mon Sep 17 00:00:00 2001
From a71a0e40017c72d863fb88832ff984d02d8e7714 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sat, 18 Sep 2010 09:05:43 +0400
Subject: [PATCH 3/9] Use macros from configure stage instead of HAVE_UTSNAME
@ -11,7 +11,7 @@ Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index ee6780c..5bdbeab 100644
index a539f12..5c4ee86 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,12 +5,6 @@ man_MANS = flashrom.8
@ -28,7 +28,7 @@ index ee6780c..5bdbeab 100644
DEFS += -DDMIDECODE_PATH=\"@DMIDECODE@\"
else
diff --git a/configure.ac b/configure.ac
index 3c09493..7946c99 100644
index 6bbeac0..be5503a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -307,10 +307,6 @@ AM_CONDITIONAL(HAVE_SERIAL, test "$serial" = "yes")
@ -43,7 +43,7 @@ index 3c09493..7946c99 100644
AC_OUTPUT
diff --git a/flashrom.c b/flashrom.c
index a54348d..4eeed24 100644
index 0fdcd5f..b0df817 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -31,7 +31,8 @@
@ -56,7 +56,7 @@ index a54348d..4eeed24 100644
#include <sys/utsname.h>
#endif
#include "flash.h"
@@ -1484,7 +1485,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
@@ -1485,7 +1486,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
void print_sysinfo(void)
{
@ -66,5 +66,5 @@ index a54348d..4eeed24 100644
uname(&osinfo);
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From 815c5d857b34cd9b2bf24ce73a967b1494b3dce0 Mon Sep 17 00:00:00 2001
From 7282844fb51db3806c66735f63ce51b2576775cf Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sat, 18 Sep 2010 09:40:01 +0400
Subject: [PATCH 4/9] Kill some x86-related ifdefs in code - this is now
@ -79,7 +79,7 @@ index 34bcc6a..690ba6a 100644
#endif /* __ICH_DESCRIPTORS_H__ */
-#endif /* defined(__i386__) || defined(__x86_64__) */
diff --git a/ichspi.c b/ichspi.c
index 403d763..6ecf50a 100644
index 29c507a..67dda58 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -23,8 +23,6 @@
@ -91,14 +91,14 @@ index 403d763..6ecf50a 100644
#include <string.h>
#include <stdlib.h>
#include "flash.h"
@@ -1888,5 +1886,3 @@ int via_init_spi(struct pci_dev *dev)
@@ -1892,5 +1890,3 @@ int via_init_spi(struct pci_dev *dev)
return 0;
}
-
-#endif
diff --git a/it85spi.c b/it85spi.c
index 01cb086..e911ddf 100644
index a5d5c2e..8bf9f5c 100644
--- a/it85spi.c
+++ b/it85spi.c
@@ -24,8 +24,6 @@
@ -110,14 +110,14 @@ index 01cb086..e911ddf 100644
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -368,5 +366,3 @@ static int it85xx_spi_send_command(struct flashctx *flash,
@@ -369,5 +367,3 @@ static int it85xx_spi_send_command(struct flashctx *flash,
return 0;
}
-
-#endif
diff --git a/it87spi.c b/it87spi.c
index fa37d52..d3ba900 100644
index c02f77b..92ecf5c 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -23,8 +23,6 @@
@ -129,7 +129,7 @@ index fa37d52..d3ba900 100644
#include <string.h>
#include <stdlib.h>
#include "flash.h"
@@ -404,5 +402,3 @@ static int it8716f_spi_chip_write_256(struct flashctx *flash, uint8_t *buf,
@@ -405,5 +403,3 @@ static int it8716f_spi_chip_write_256(struct flashctx *flash, uint8_t *buf,
return 0;
}
@ -258,7 +258,7 @@ index e39385b..45a62f7 100644
-#error PCI port I/O access is not supported on this architecture yet.
-#endif
diff --git a/sb600spi.c b/sb600spi.c
index c3d7710..458206a 100644
index e36ac96..a8d46f4 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -21,8 +21,6 @@
@ -270,14 +270,14 @@ index c3d7710..458206a 100644
#include "flash.h"
#include "programmer.h"
#include "spi.h"
@@ -321,5 +319,3 @@ int sb600_probe_spi(struct pci_dev *dev)
@@ -322,5 +320,3 @@ int sb600_probe_spi(struct pci_dev *dev)
register_spi_programmer(&spi_programmer_sb600);
return 0;
}
-
-#endif
diff --git a/wbsio_spi.c b/wbsio_spi.c
index 774890e..f6076aa 100644
index 38ac2d8..2247f0c 100644
--- a/wbsio_spi.c
+++ b/wbsio_spi.c
@@ -18,8 +18,6 @@
@ -289,12 +289,12 @@ index 774890e..f6076aa 100644
#include "flash.h"
#include "chipdrivers.h"
#include "programmer.h"
@@ -205,5 +203,3 @@ static int wbsio_spi_read(struct flashctx *flash, uint8_t *buf,
@@ -206,5 +204,3 @@ static int wbsio_spi_read(struct flashctx *flash, uint8_t *buf,
mmio_readn((void *)(flash->virtual_memory + start), buf, len);
return 0;
}
-
-#endif
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From ed994035450c5ad46cdf426f977f14ee4266c326 Mon Sep 17 00:00:00 2001
From 1b05252b5ee27b9cb94e35bb7181a0ef4a15f4df Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Tue, 21 Sep 2010 17:51:08 +0400
Subject: [PATCH 5/9] Simplify hwaccess.c
@ -185,5 +185,5 @@ index 1e276ec..be3af34 100644
#endif
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From 4be5f3a7a245506af5e82fa47911c96c24c34f60 Mon Sep 17 00:00:00 2001
From bcdcbb8e1755ddc2d5a911ff7379b48f020542c9 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sun, 26 Sep 2010 18:25:31 +0400
Subject: [PATCH 6/9] Use endiannes determined at the configure stage
@ -94,5 +94,5 @@ index be3af34..7d9b108 100644
#define be_to_cpu8 cpu_to_be8
#define be_to_cpu16 cpu_to_be16
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From f1ac24b82ddb8f24bc12cdeb6b2b78047e2dfb36 Mon Sep 17 00:00:00 2001
From 6fddd082c4c13864d45f77d696e4308223f7e3eb Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sun, 26 Sep 2010 21:05:50 +0400
Subject: [PATCH 7/9] Use HAVE_*_H macro for detecting includes
@ -152,5 +152,5 @@ index 7d9b108..96eee0e 100644
#include <arch/io.h>
#include <arch/msr.h>
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From 0b80eacf6058d7d459068b92d2df2b615e24c366 Mon Sep 17 00:00:00 2001
From e264ec74ba11b7e1b8dca5079a8b4df87b405d7c Mon Sep 17 00:00:00 2001
From: Mattias Mattsson <vitplister@gmail.com>
Date: Wed, 27 Jul 2011 21:02:50 +0400
Subject: [PATCH 8/9] ppc hack
@ -9,10 +9,10 @@ Subject: [PATCH 8/9] ppc hack
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/internal.c b/internal.c
index 479cbf7..2fb7c83 100644
index 5b24577..e5dde1f 100644
--- a/internal.c
+++ b/internal.c
@@ -334,6 +334,8 @@ int internal_init(void)
@@ -336,6 +336,8 @@ int internal_init(void)
"Aborting.\n");
return 1;
#endif
@ -35,5 +35,5 @@ index d680f97..014e019 100644
int processor_flash_enable(void)
{
--
1.7.10.1
1.7.10.4

View File

@ -1,4 +1,4 @@
From 8191d4bc8725efd6430eb5a5d942232de2a25496 Mon Sep 17 00:00:00 2001
From fd1fe86bcffcf1ac3571d2c98e4d5e91321a40cf Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Thu, 28 Jul 2011 12:56:17 +0400
Subject: [PATCH 9/9] Simplify processor.h
@ -58,5 +58,5 @@ index 014e019..bf69330 100644
-
-#endif
--
1.7.10.1
1.7.10.4

View File

@ -1,13 +1,13 @@
Summary: Simple program for reading/writing BIOS chips content
Name: flashrom
Version: 0.9.5.2
Release: 3.svn1530%{?dist}
Release: 4.svn1547%{?dist}
License: GPLv2
Group: Applications/System
URL: http://flashrom.org
#Source0: http://qa.coreboot.org/releases/%{name}-%{version}.tar.bz2
#Source1: http://qa.coreboot.org/releases/%{name}-%{version}.tar.bz2.asc
## svn -r 1530 export svn://coreboot.org/flashrom/trunk flashrom-0.9.5.2
## svn -r 1547 export svn://coreboot.org/flashrom/trunk flashrom-0.9.5.2
## tar -cjvf flashrom-0.9.5.2.tar.bz2 flashrom-0.9.5.2
Source0: %{name}-%{version}.tar.bz2
Patch1: flashrom-0001-Initial-commit-of-autotools-related-files.patch
@ -23,19 +23,23 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: pciutils-devel
BuildRequires: zlib-devel
BuildRequires: libftdi-devel
%ifnarch ppc ppc64 %{arm}
BuildRequires: dmidecode
Requires: dmidecode
%endif
Requires: udev
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# see rhbz #450273, #495226
ExclusiveArch: %{ix86} x86_64 ppc ppc64 %{arm}
%description
Utility which can be used to detect BIOS chips (DIP, PLCC), read their contents
and write new contents on the chips ("flash the chip").
%prep
%setup -q
%patch1 -p1
@ -60,19 +64,38 @@ make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
%if 0%{?el5}
install -D -p -m 0644 util/z60_flashrom.rules %{buildroot}/etc/udev/rules.d/z60_flashrom.rules
%else
install -D -p -m 0644 util/z60_flashrom.rules %{buildroot}/lib/udev/rules.d/z60_flashrom.rules
%endif
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc COPYING README
%{_sbindir}/%{name}
%{_mandir}/man8/%{name}.*
%if 0%{?el5}
/etc/udev/rules.d/z60_flashrom.rules
%else
/lib/udev/rules.d/z60_flashrom.rules
%endif
%changelog
* Wed Jul 11 2012 Peter Lemenkov <lemenkov@gmail.com> - 0.9.5.2-4.svn1547
- Enable support for USB programmers (FT2232, FT4232, etc), see rhbz #839179.
- Add board enable for MSI K9N SLI (MS-7250 VER:2.1)
- Add support for PMC Pm39LV512 flashchip
- Add support for Eon EN25QH32 flashchip
- Add Winbond W836xx SuperI/O detection
- Add ITE IT8707F/IT8710F SiperI/O detection
* Mon Jul 2 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 0.9.5.2-3.svn1530
- Enable building on ARM

View File

@ -1 +1 @@
fe2551921e220871c217565a48f80dab flashrom-0.9.5.2.tar.bz2
bebbdbb728ed830d38e0998c7556f37b flashrom-0.9.5.2.tar.bz2