From eab84056431739da5aa199f303ca9e510ad3bac3 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Fri, 21 Oct 2011 17:38:55 +0400 Subject: [PATCH] Updated to latest svn ver. 1455 (post-release snapshot for 0.9.4) Signed-off-by: Peter Lemenkov --- ...al-commit-of-autotools-related-files.patch | 82 ++++++++--- ...code-path-defined-at-configure-stage.patch | 10 +- ...Use-flashrom-s-version-from-config.h.patch | 79 ----------- ...rom-config.h-instead-of-HAVE_UTSNAME.patch | 70 ++++++++++ ...lated-ifdefs-in-code-this-is-now-con.patch | 93 +++++++++---- ...CI-from-config.h-instead-of-NEED_PCI.patch | 105 -------------- ...=> flashrom-0005-Simplify-hwaccess.c.patch | 6 +- ...rom-config.h-instead-of-HAVE_UTSNAME.patch | 35 ----- ...es-determined-at-the-configure-stage.patch | 14 +- ...AVE_-_H-macro-for-detecting-includes.patch | 41 +++--- ...rch-checking-ifdef-block-into-header.patch | 30 ++-- ...hack.patch => flashrom-0009-ppc-hack.patch | 10 +- ...> flashrom-0010-Simplify-processor.h.patch | 39 +++--- ...m-0012-Support-for-LH28F008BJT-BTLZ1.patch | 128 ------------------ flashrom.spec | 32 ++--- sources | 2 +- 16 files changed, 285 insertions(+), 491 deletions(-) delete mode 100644 flashrom-0003-Use-flashrom-s-version-from-config.h.patch create mode 100644 flashrom-0003-Use-macros-from-config.h-instead-of-HAVE_UTSNAME.patch rename flashrom-0006-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch => flashrom-0004-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch (70%) delete mode 100644 flashrom-0004-Use-HAVE_LIBPCI-from-config.h-instead-of-NEED_PCI.patch rename flashrom-0007-Simplify-hwaccess.c.patch => flashrom-0005-Simplify-hwaccess.c.patch (97%) delete mode 100644 flashrom-0005-Use-macros-from-config.h-instead-of-HAVE_UTSNAME.patch rename flashrom-0008-Use-endiannes-determined-at-the-configure-stage.patch => flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch (90%) rename flashrom-0009-Use-HAVE_-_H-macro-for-detecting-includes.patch => flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch (80%) rename flashrom-0010-Move-arch-checking-ifdef-block-into-header.patch => flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch (65%) rename flashrom-0011-ppc-hack.patch => flashrom-0009-ppc-hack.patch (83%) rename flashrom-0013-Simplify-processor.h.patch => flashrom-0010-Simplify-processor.h.patch (67%) delete mode 100644 flashrom-0012-Support-for-LH28F008BJT-BTLZ1.patch diff --git a/flashrom-0001-Initial-commit-of-autotools-related-files.patch b/flashrom-0001-Initial-commit-of-autotools-related-files.patch index 9d9dd00..b7836e5 100644 --- a/flashrom-0001-Initial-commit-of-autotools-related-files.patch +++ b/flashrom-0001-Initial-commit-of-autotools-related-files.patch @@ -1,26 +1,37 @@ -From 29c6d0872db6f9189a2cdc076f38eff1bb646ade Mon Sep 17 00:00:00 2001 +From 660b803c1f6ba64ffe4e09fd5244d5c1fc3bdde6 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Fri, 17 Sep 2010 18:58:28 +0400 -Subject: [PATCH 01/13] Initial commit of autotools-related files +Subject: [PATCH 01/10] Initial commit of autotools-related files Signed-off-by: Peter Lemenkov --- - Makefile.am | 193 +++++++++++++++++++++++++++++++++++++++++++++ - configure.ac | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 439 insertions(+), 0 deletions(-) + Makefile.am | 210 +++++++++++++++++++++++++++++++++++++++++++++++ + bootstrap.sh | 5 + + configure.ac | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 473 insertions(+), 0 deletions(-) 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..9ae35e5 +index 0000000..06e76da --- /dev/null +++ b/Makefile.am -@@ -0,0 +1,193 @@ +@@ -0,0 +1,210 @@ +sbin_PROGRAMS = flashrom + +man_MANS = flashrom.8 + ++# FIXME use "config.h" in the future ++DEFS += -DFLASHROM_VERSION=\"@VERSION@\" ++ ++if HAVE_SYS_UTSNAME ++if HAVE_UNAME ++DEFS += -DHAVE_UTSNAME=1 ++endif ++endif ++ +if HAVE_DMIDECODE +DEFS += -DDMIDECODE_PATH=\"@DMIDECODE@\" +else @@ -38,6 +49,7 @@ index 0000000..9ae35e5 + processor_enable.c +if HAVE_X86_ONLY_INTERNAL +internal_x86_only_SOURCES = \ ++ ich_descriptors.c \ + ichspi.c \ + it85spi.c \ + it87spi.c \ @@ -53,6 +65,11 @@ index 0000000..9ae35e5 +DEFS += -DCONFIG_SERPROG=1 +endif + ++if HAVE_LINUX_SPI ++linux_spi_SOURCES = linux_spi.c ++DEFS += -DCONFIG_LINUX_SPI=1 ++endif ++ +if HAVE_RAYER_SPI +rayer_spi_SOURCES = rayer_spi.c +DEFS += -DCONFIG_RAYER_SPI=1 @@ -151,6 +168,7 @@ index 0000000..9ae35e5 +pci_SOURCES = pcidev.c \ + physmap.c \ + hwaccess.c ++DEFS += -DNEED_PCI=1 +endif + +chip_SOURCES = 82802ab.c \ @@ -187,6 +205,7 @@ index 0000000..9ae35e5 + $(internal_SOURCES) \ + $(internal_x86_only_SOURCES) \ + $(serprog_SOURCES) \ ++ $(linux_spi_SOURCES) \ + $(rayer_spi_SOURCES) \ + $(bitbang_spi_SOURCES) \ + $(nic3com_SOURCES) \ @@ -210,13 +229,24 @@ index 0000000..9ae35e5 + $(chip_SOURCES) \ + $(cli_SOURCES) \ + $(lib_SOURCES) +diff --git a/bootstrap.sh b/bootstrap.sh +new file mode 100755 +index 0000000..050fe4f +--- /dev/null ++++ b/bootstrap.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++aclocal --force ++/usr/bin/autoconf --force ++/usr/bin/autoheader --force ++automake --add-missing --copy --force-missing diff --git a/configure.ac b/configure.ac new file mode 100644 -index 0000000..87b7520 +index 0000000..c5e89fe --- /dev/null +++ b/configure.ac -@@ -0,0 +1,246 @@ -+AC_INIT([flashrom], [0.9.4-r1412], [flashrom@flashrom.org], [flashrom], [http://www.flashrom.org/]) +@@ -0,0 +1,258 @@ ++AC_INIT([flashrom], [0.9.4-r1455], [flashrom@flashrom.org], [flashrom], [http://www.flashrom.org/]) + +AC_PREREQ(2.59) + @@ -236,6 +266,10 @@ index 0000000..87b7520 + AC_HELP_STRING([--with-serprog],[serprog support.]), + [serprog="$withval"],[serprog="yes"]) + ++AC_ARG_WITH([linux_spi], ++ AC_HELP_STRING([--with-linux-spi],[Linux SPI subsystem support.]), ++ [linux_spi="$withval"],[linux_spi="no"]) ++ +AC_ARG_WITH([rayer_spi], + AC_HELP_STRING([--with-rayer-spi],[RayeR SPIPGM hardware support.]), + [rayer_spi="$withval"],[rayer_spi="yes"]) @@ -314,37 +348,40 @@ index 0000000..87b7520 + +# Check for CPU-specific features +case $target_cpu in -+ i386|i486|i586|i686|x86_64) ++ i386|i486|i586|i686|i786|x86_64) + if test "$internal" = 'yes'; then + enable_x86_only_internal="yes" + fi + ;; -+ *) ++ mips*|power*) + if test "$nic3com" = 'yes'; then -+ echo "NIC 3Com is not supported for this target (" $target_cpu "). No PCI port I/O access on this architecture yet" ++ AC_MSG_WARN([NIC 3Com is not supported for this target ($target_cpu). No PCI port I/O access on this architecture yet.]) + nic3com="no" + fi + if test "$nicnatsemi" = 'yes'; then -+ echo "NIC NatSemi is not supported for this target (" $target_cpu "). No PCI port I/O access on this architecture yet" ++ AC_MSG_WARN([NIC NatSemi is not supported for this target ($target_cpu). No PCI port I/O access on this architecture yet.]) + nicnatsemi="no" + fi + if test "$nicrealtek" = 'yes'; then -+ echo "NIC Realtek is not supported for this target (" $target_cpu "). No PCI port I/O access on this architecture yet" ++ AC_MSG_WARN([NIC Realtek is not supported for this target ($target_cpu). No PCI port I/O access on this architecture yet.]) + nicrealtek="no" + fi + if test "$rayer_spi" = 'yes'; then -+ echo "RayeR SPIPGM is not supported for this target (" $target_cpu "). No PCI port I/O access on this architecture yet" ++ AC_MSG_WARN([RayeR SPIPGM is not supported for this target ($target_cpu). No PCI port I/O access on this architecture yet.]) + rayer_spi="no" + fi + if test "$satamv" = 'yes'; then -+ echo "Marvell SATA is not supported for this target (" $target_cpu "). No PCI port I/O access on this architecture yet" ++ AC_MSG_WARN([Marvell SATA is not supported for this target ($target_cpu). No PCI port I/O access on this architecture yet]) + satamv="no" + fi + if test "$atahpt" = 'yes'; then -+ echo "Highpoint (HPT) ATA/RAID controller support is not supported for this target (" $target_cpu "). No PCI port I/O access on this architecture yet" ++ AC_MSG_WARN([Highpoint (HPT) ATA/RAID controller support is not supported for this target ($target_cpu). No PCI port I/O access on this architecture yet.]) + atahpt="no" + fi + ;; ++ *) ++ AC_MSG_ERROR([No support for this target ($target_cpu) yet]) ++ ;; +esac + +# Enable OS-specific compilation flags @@ -395,7 +432,7 @@ index 0000000..87b7520 +AC_TYPE_OFF_T +AC_TYPE_SIZE_T +AC_CHECK_SIZEOF(int) -+dnl mingw (for instance) lacks ssize_t ++dnl mingw (for instance) lacks ssize_t +AC_CHECK_TYPE(ssize_t, int) +AC_CHECK_TYPE(uint8_t, unsigned char) +AC_CHECK_TYPE(uint16_t, unsigned short) @@ -439,6 +476,7 @@ index 0000000..87b7520 +AM_CONDITIONAL(HAVE_DMIDECODE, test "$DMIDECODE" != "") +AM_CONDITIONAL(HAVE_X86_ONLY_INTERNAL, test "$enable_x86_only_internal" = "yes") +AM_CONDITIONAL(HAVE_SERPROG, test "$serprog" = "yes") ++AM_CONDITIONAL(HAVE_LINUX_SPI, test "$linux_spi" = "yes") +AM_CONDITIONAL(HAVE_RAYER_SPI, test "$rayer_spi" = "yes") +AM_CONDITIONAL(HAVE_BITBANG_SPI, test "$bitbang_spi" = "yes") +AM_CONDITIONAL(HAVE_NIC3COM, test "$nic3com" = "yes") @@ -460,8 +498,12 @@ index 0000000..87b7520 +AM_CONDITIONAL(HAVE_PCI, test "$pci" = "yes") +AM_CONDITIONAL(HAVE_PRINT_WIKI, test "$print_wiki" = "yes") + ++# FIXME remove in the future ++AM_CONDITIONAL(HAVE_SYS_UTSNAME, test "$ac_cv_header_sys_utsname_h" = "yes") ++AM_CONDITIONAL(HAVE_UNAME, test "$ac_cv_func_uname" = "yes") ++ +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch b/flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch index ef4d491..c8334ac 100644 --- a/flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch +++ b/flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch @@ -1,7 +1,7 @@ -From e389cb3a26fac0ff6f343fcad17a592c0b81c6aa Mon Sep 17 00:00:00 2001 +From d2e30fbae81b893a011d930bda82dbb08b1a369f Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sat, 12 Jun 2010 22:13:53 +0400 -Subject: [PATCH 02/13] Use dmidecode path defined at configure stage +Subject: [PATCH 02/10] Use dmidecode path defined at configure stage Signed-off-by: Peter Lemenkov --- @@ -9,10 +9,10 @@ Signed-off-by: Peter Lemenkov 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dmi.c b/dmi.c -index 4f36245..d03e2b8 100644 +index 5f64b94..537c2d5 100644 --- a/dmi.c +++ b/dmi.c -@@ -84,7 +84,7 @@ static const struct { +@@ -85,7 +85,7 @@ static const struct { }; #define DMI_COMMAND_LEN_MAX 260 @@ -22,5 +22,5 @@ index 4f36245..d03e2b8 100644 static char *dmistrings[ARRAY_SIZE(dmidecode_names)]; -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0003-Use-flashrom-s-version-from-config.h.patch b/flashrom-0003-Use-flashrom-s-version-from-config.h.patch deleted file mode 100644 index a31edb7..0000000 --- a/flashrom-0003-Use-flashrom-s-version-from-config.h.patch +++ /dev/null @@ -1,79 +0,0 @@ -From acae0d448b6f947d5592d588ef6ecb8d51c599fa Mon Sep 17 00:00:00 2001 -From: Peter Lemenkov -Date: Fri, 17 Sep 2010 22:32:07 +0400 -Subject: [PATCH 03/13] Use flashrom's version from config.h - -Signed-off-by: Peter Lemenkov ---- - flash.h | 1 - - flashrom.c | 6 ++++-- - print_wiki.c | 3 ++- - 3 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/flash.h b/flash.h -index 4b1cca2..d164883 100644 ---- a/flash.h -+++ b/flash.h -@@ -199,7 +199,6 @@ enum write_granularity { - }; - extern enum chipbustype buses_supported; - extern int verbose; --extern const char flashrom_version[]; - extern char *chip_to_probe; - void map_flash_registers(struct flashchip *flash); - int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len); -diff --git a/flashrom.c b/flashrom.c -index 07cfdd9..578e256 100644 ---- a/flashrom.c -+++ b/flashrom.c -@@ -31,6 +31,9 @@ - #include - #include - #include -+ -+#include "config.h" -+ - #if HAVE_UTSNAME == 1 - #include - #endif -@@ -38,7 +41,6 @@ - #include "flashchips.h" - #include "programmer.h" - --const char flashrom_version[] = FLASHROM_VERSION; - char *chip_to_probe = NULL; - int verbose = 0; - -@@ -1684,7 +1686,7 @@ void print_sysinfo(void) - - void print_version(void) - { -- msg_ginfo("flashrom v%s", flashrom_version); -+ msg_ginfo("flashrom v%s", PACKAGE_VERSION); - print_sysinfo(); - } - -diff --git a/print_wiki.c b/print_wiki.c -index b70da86..8240e6c 100644 ---- a/print_wiki.c -+++ b/print_wiki.c -@@ -26,6 +26,7 @@ - #include "flash.h" - #include "flashchips.h" - #include "programmer.h" -+#include "config.h" - - static const char wiki_header[] = "= Supported devices =\n\n\ -
+Date: Sat, 18 Sep 2010 09:05:43 +0400 +Subject: [PATCH 03/10] Use macros from config.h instead of HAVE_UTSNAME + +Signed-off-by: Peter Lemenkov +--- + Makefile.am | 6 ------ + configure.ac | 4 ---- + flashrom.c | 6 ++++-- + 3 files changed, 4 insertions(+), 12 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 06e76da..9eb6522 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -5,12 +5,6 @@ man_MANS = flashrom.8 + # FIXME use "config.h" in the future + DEFS += -DFLASHROM_VERSION=\"@VERSION@\" + +-if HAVE_SYS_UTSNAME +-if HAVE_UNAME +-DEFS += -DHAVE_UTSNAME=1 +-endif +-endif +- + if HAVE_DMIDECODE + DEFS += -DDMIDECODE_PATH=\"@DMIDECODE@\" + else +diff --git a/configure.ac b/configure.ac +index c5e89fe..c73e276 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -250,9 +250,5 @@ AM_CONDITIONAL(HAVE_SERIAL, test "$serial" = "yes") + AM_CONDITIONAL(HAVE_PCI, test "$pci" = "yes") + AM_CONDITIONAL(HAVE_PRINT_WIKI, test "$print_wiki" = "yes") + +-# FIXME remove in the future +-AM_CONDITIONAL(HAVE_SYS_UTSNAME, test "$ac_cv_header_sys_utsname_h" = "yes") +-AM_CONDITIONAL(HAVE_UNAME, test "$ac_cv_func_uname" = "yes") +- + AC_CONFIG_FILES([Makefile]) + AC_OUTPUT +diff --git a/flashrom.c b/flashrom.c +index c565a43..6360d97 100644 +--- a/flashrom.c ++++ b/flashrom.c +@@ -31,7 +31,9 @@ + #include + #include + #include +-#if HAVE_UTSNAME == 1 ++#include "config.h" ++ ++#if HAVE_SYS_UTSNAME_H == 1 + #include + #endif + #include "flash.h" +@@ -1607,7 +1609,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren) + + void print_sysinfo(void) + { +-#if HAVE_UTSNAME == 1 ++#if HAVE_UNAME == 1 + struct utsname osinfo; + uname(&osinfo); + +-- +1.7.6.4 + diff --git a/flashrom-0006-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch b/flashrom-0004-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch similarity index 70% rename from flashrom-0006-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch rename to flashrom-0004-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch index dab393d..a2d1544 100644 --- a/flashrom-0006-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch +++ b/flashrom-0004-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch @@ -1,24 +1,26 @@ -From d143299bcd2d0dcb4c9753f3ff0b795dc04ed465 Mon Sep 17 00:00:00 2001 +From abec9376de399fd6e41d1b26343fc2b4eec85c05 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sat, 18 Sep 2010 09:40:01 +0400 -Subject: [PATCH 06/13] Kill some x86-related ifdefs in code - this is now +Subject: [PATCH 04/10] Kill some x86-related ifdefs in code - this is now controlled via autotools Signed-off-by: Peter Lemenkov --- - atahpt.c | 6 ------ - ichspi.c | 4 ---- - it85spi.c | 4 ---- - it87spi.c | 4 ---- - mcp6x_spi.c | 4 ---- - nic3com.c | 6 ------ - nicnatsemi.c | 6 ------ - nicrealtek.c | 6 ------ - rayer_spi.c | 5 ----- - satamv.c | 5 ----- - sb600spi.c | 4 ---- - wbsio_spi.c | 4 ---- - 12 files changed, 0 insertions(+), 58 deletions(-) + atahpt.c | 6 ------ + ich_descriptors.c | 3 --- + ich_descriptors.h | 2 -- + ichspi.c | 4 ---- + it85spi.c | 4 ---- + it87spi.c | 4 ---- + mcp6x_spi.c | 4 ---- + nic3com.c | 6 ------ + nicnatsemi.c | 6 ------ + nicrealtek.c | 6 ------ + rayer_spi.c | 5 ----- + satamv.c | 5 ----- + sb600spi.c | 4 ---- + wbsio_spi.c | 4 ---- + 14 files changed, 0 insertions(+), 63 deletions(-) diff --git a/atahpt.c b/atahpt.c index 3451342..eadb158 100644 @@ -41,8 +43,43 @@ index 3451342..eadb158 100644 -#else -#error PCI port I/O access is not supported on this architecture yet. -#endif +diff --git a/ich_descriptors.c b/ich_descriptors.c +index 125077c..8ca643d 100644 +--- a/ich_descriptors.c ++++ b/ich_descriptors.c +@@ -19,8 +19,6 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#if defined(__i386__) || defined(__x86_64__) +- + #include "ich_descriptors.h" + #include "flash.h" /* for msg_* */ + #include "programmer.h" +@@ -313,4 +311,3 @@ int read_ich_descriptors_via_fdo(void *spibar, struct ich_descriptors *desc) + msg_pdbg2(" done.\n"); + return ICH_RET_OK; + } +-#endif /* defined(__i386__) || defined(__x86_64__) */ +diff --git a/ich_descriptors.h b/ich_descriptors.h +index 4e2ad0a..a3cfea8 100644 +--- a/ich_descriptors.h ++++ b/ich_descriptors.h +@@ -19,7 +19,6 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#if defined(__i386__) || defined(__x86_64__) + #ifndef __ICH_DESCRIPTORS_H__ + #define __ICH_DESCRIPTORS_H__ 1 + +@@ -258,4 +257,3 @@ int read_ich_descriptors_via_fdo(void *spibar, struct ich_descriptors *desc); + int getFCBA_component_density(const struct ich_descriptors *desc, uint8_t idx); + + #endif /* __ICH_DESCRIPTORS_H__ */ +-#endif /* defined(__i386__) || defined(__x86_64__) */ diff --git a/ichspi.c b/ichspi.c -index 34f0891..27170c6 100644 +index afa420b..cc4ce0d 100644 --- a/ichspi.c +++ b/ichspi.c @@ -23,8 +23,6 @@ @@ -52,16 +89,16 @@ index 34f0891..27170c6 100644 -#if defined(__i386__) || defined(__x86_64__) - #include + #include #include "flash.h" - #include "chipdrivers.h" -@@ -1397,5 +1395,3 @@ int via_init_spi(struct pci_dev *dev) +@@ -1561,5 +1559,3 @@ int via_init_spi(struct pci_dev *dev) return 0; } - -#endif diff --git a/it85spi.c b/it85spi.c -index 76e4861..c9cbb72 100644 +index 75a565c..f9815b2 100644 --- a/it85spi.c +++ b/it85spi.c @@ -24,8 +24,6 @@ @@ -80,7 +117,7 @@ index 76e4861..c9cbb72 100644 - -#endif diff --git a/it87spi.c b/it87spi.c -index c24ba9b..24dd746 100644 +index 5fe74ce..fcd881e 100644 --- a/it87spi.c +++ b/it87spi.c @@ -23,8 +23,6 @@ @@ -92,7 +129,7 @@ index c24ba9b..24dd746 100644 #include #include #include "flash.h" -@@ -400,5 +398,3 @@ static int it8716f_spi_chip_write_256(struct flashchip *flash, uint8_t *buf, +@@ -399,5 +397,3 @@ static int it8716f_spi_chip_write_256(struct flashchip *flash, uint8_t *buf, return 0; } @@ -181,7 +218,7 @@ index bed0710..39bbc8a 100644 -#error PCI port I/O access is not supported on this architecture yet. -#endif diff --git a/rayer_spi.c b/rayer_spi.c -index 0807487..f722f95 100644 +index 417fde9..46babb4 100644 --- a/rayer_spi.c +++ b/rayer_spi.c @@ -28,7 +28,6 @@ @@ -191,8 +228,8 @@ index 0807487..f722f95 100644 -#if defined(__i386__) || defined(__x86_64__) #include - #include "flash.h" -@@ -136,7 +135,3 @@ int rayer_spi_init(void) + #include +@@ -177,7 +176,3 @@ int rayer_spi_init(void) return 0; } @@ -221,7 +258,7 @@ index 5c15fc8..618f946 100644 -#error PCI port I/O access is not supported on this architecture yet. -#endif diff --git a/sb600spi.c b/sb600spi.c -index 37aac3b..e176f00 100644 +index 9d82b47..4a5e954 100644 --- a/sb600spi.c +++ b/sb600spi.c @@ -21,8 +21,6 @@ @@ -231,9 +268,9 @@ index 37aac3b..e176f00 100644 -#if defined(__i386__) || defined(__x86_64__) - #include "flash.h" - #include "chipdrivers.h" #include "programmer.h" -@@ -317,5 +315,3 @@ int sb600_probe_spi(struct pci_dev *dev) + #include "spi.h" +@@ -319,5 +317,3 @@ int sb600_probe_spi(struct pci_dev *dev) register_spi_programmer(&spi_programmer_sb600); return 0; } @@ -259,5 +296,5 @@ index 851c87f..e166d8e 100644 - -#endif -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0004-Use-HAVE_LIBPCI-from-config.h-instead-of-NEED_PCI.patch b/flashrom-0004-Use-HAVE_LIBPCI-from-config.h-instead-of-NEED_PCI.patch deleted file mode 100644 index 40d62ed..0000000 --- a/flashrom-0004-Use-HAVE_LIBPCI-from-config.h-instead-of-NEED_PCI.patch +++ /dev/null @@ -1,105 +0,0 @@ -From ef2850b293646d085ecddc615de17ced7c036c0c Mon Sep 17 00:00:00 2001 -From: Peter Lemenkov -Date: Fri, 17 Sep 2010 22:33:12 +0400 -Subject: [PATCH 04/13] Use HAVE_LIBPCI from config.h instead of NEED_PCI - -Signed-off-by: Peter Lemenkov ---- - flashrom.c | 2 +- - hwaccess.h | 6 ++++-- - internal.c | 3 ++- - programmer.h | 6 ++++-- - 4 files changed, 11 insertions(+), 6 deletions(-) - -diff --git a/flashrom.c b/flashrom.c -index 578e256..0ff1fad 100644 ---- a/flashrom.c -+++ b/flashrom.c -@@ -1652,7 +1652,7 @@ void print_sysinfo(void) - msg_ginfo(" on unknown machine"); - #endif - msg_ginfo(", built with"); --#if NEED_PCI == 1 -+#if HAVE_LIBPCI == 1 - #ifdef PCILIB_VERSION - msg_ginfo(" libpci %s,", PCILIB_VERSION); - #else -diff --git a/hwaccess.h b/hwaccess.h -index eea3652..5ca8975 100644 ---- a/hwaccess.h -+++ b/hwaccess.h -@@ -24,13 +24,15 @@ - #ifndef __HWACCESS_H__ - #define __HWACCESS_H__ 1 - -+#include "config.h" -+ - #if defined (__i386__) || defined (__x86_64__) - #if defined(__GLIBC__) - #include - #endif - #endif - --#if NEED_PCI == 1 -+#if HAVE_LIBPCI == 1 - /* - * libpci headers use the variable name "index" which triggers shadowing - * warnings on systems which have the index() function in a default #include -@@ -160,7 +162,7 @@ cpu_to_be(64) - #define le_to_cpu32 cpu_to_le32 - #define le_to_cpu64 cpu_to_le64 - --#if NEED_PCI == 1 -+#if HAVE_LIBPCI == 1 - #if defined (__i386__) || defined (__x86_64__) - - #define __FLASHROM_HAVE_OUTB__ 1 -diff --git a/internal.c b/internal.c -index 846cf1e..6cd791c 100644 ---- a/internal.c -+++ b/internal.c -@@ -22,8 +22,9 @@ - #include - #include "flash.h" - #include "programmer.h" -+#include "config.h" - --#if NEED_PCI == 1 -+#if HAVE_LIBPCI == 1 - struct pci_dev *pci_dev_find_filter(struct pci_filter filter) - { - struct pci_dev *temp; -diff --git a/programmer.h b/programmer.h -index 6a28dbe..a6c04d5 100644 ---- a/programmer.h -+++ b/programmer.h -@@ -24,6 +24,8 @@ - #ifndef __PROGRAMMER_H__ - #define __PROGRAMMER_H__ 1 - -+#include "config.h" -+ - enum programmer { - #if CONFIG_INTERNAL == 1 - PROGRAMMER_INTERNAL, -@@ -211,7 +213,7 @@ void myusec_delay(int usecs); - void myusec_calibrate_delay(void); - void internal_delay(int usecs); - --#if NEED_PCI == 1 -+#if HAVE_LIBPCI == 1 - /* pcidev.c */ - extern uint32_t io_base_addr; - extern struct pci_access *pacc; -@@ -287,7 +289,7 @@ extern int superio_count; - #define SUPERIO_VENDOR_NONE 0x0 - #define SUPERIO_VENDOR_ITE 0x1 - #endif --#if NEED_PCI == 1 -+#if HAVE_LIBPCI == 1 - struct pci_dev *pci_dev_find_filter(struct pci_filter filter); - struct pci_dev *pci_dev_find_vendorclass(uint16_t vendor, uint16_t devclass); - struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device); --- -1.7.6 - diff --git a/flashrom-0007-Simplify-hwaccess.c.patch b/flashrom-0005-Simplify-hwaccess.c.patch similarity index 97% rename from flashrom-0007-Simplify-hwaccess.c.patch rename to flashrom-0005-Simplify-hwaccess.c.patch index d44182d..77f565b 100644 --- a/flashrom-0007-Simplify-hwaccess.c.patch +++ b/flashrom-0005-Simplify-hwaccess.c.patch @@ -1,7 +1,7 @@ -From 63f49c09bafe87945d71d72e6b1c9aabea65c5d7 Mon Sep 17 00:00:00 2001 +From e2730aed4ce04a0e06e7a7113a9c3e5334b3130a Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Tue, 21 Sep 2010 17:51:08 +0400 -Subject: [PATCH 07/13] Simplify hwaccess.c +Subject: [PATCH 05/10] Simplify hwaccess.c This file is saturated with superfluous ifdefs arranged into several nested levels. This in turn adds additional complexity @@ -142,5 +142,5 @@ index 8c89925..f10d957 100644 void mmio_writeb(uint8_t val, void *addr) { -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0005-Use-macros-from-config.h-instead-of-HAVE_UTSNAME.patch b/flashrom-0005-Use-macros-from-config.h-instead-of-HAVE_UTSNAME.patch deleted file mode 100644 index fd842f0..0000000 --- a/flashrom-0005-Use-macros-from-config.h-instead-of-HAVE_UTSNAME.patch +++ /dev/null @@ -1,35 +0,0 @@ -From a15e045ef7c703186ae728a271eba4a35a059cee Mon Sep 17 00:00:00 2001 -From: Peter Lemenkov -Date: Sat, 18 Sep 2010 09:05:43 +0400 -Subject: [PATCH 05/13] Use macros from config.h instead of HAVE_UTSNAME - -Signed-off-by: Peter Lemenkov ---- - flashrom.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/flashrom.c b/flashrom.c -index 0ff1fad..15246cd 100644 ---- a/flashrom.c -+++ b/flashrom.c -@@ -34,7 +34,7 @@ - - #include "config.h" - --#if HAVE_UTSNAME == 1 -+#if HAVE_SYS_UTSNAME_H == 1 - #include - #endif - #include "flash.h" -@@ -1642,7 +1642,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren) - - void print_sysinfo(void) - { --#if HAVE_UTSNAME == 1 -+#if HAVE_UNAME == 1 - struct utsname osinfo; - uname(&osinfo); - --- -1.7.6 - diff --git a/flashrom-0008-Use-endiannes-determined-at-the-configure-stage.patch b/flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch similarity index 90% rename from flashrom-0008-Use-endiannes-determined-at-the-configure-stage.patch rename to flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch index 4c1393b..2b25b50 100644 --- a/flashrom-0008-Use-endiannes-determined-at-the-configure-stage.patch +++ b/flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch @@ -1,7 +1,7 @@ -From 99b4c8249dffba7072f770436615d633b6920c52 Mon Sep 17 00:00:00 2001 +From c56eb72b4bd5656b081afa1ab5bc82fb85157526 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 26 Sep 2010 18:25:31 +0400 -Subject: [PATCH 08/13] Use endiannes determined at the configure stage +Subject: [PATCH 06/10] Use endiannes determined at the configure stage Signed-off-by: Peter Lemenkov --- @@ -9,10 +9,10 @@ Signed-off-by: Peter Lemenkov 1 files changed, 2 insertions(+), 51 deletions(-) diff --git a/hwaccess.h b/hwaccess.h -index 5ca8975..61f1251 100644 +index eea3652..5188a98 100644 --- a/hwaccess.h +++ b/hwaccess.h -@@ -43,51 +43,6 @@ +@@ -41,51 +41,6 @@ #undef index #endif @@ -64,7 +64,7 @@ index 5ca8975..61f1251 100644 #define ___constant_swab8(x) ((uint8_t) ( \ (((uint8_t)(x) & (uint8_t)0xffU)))) -@@ -129,7 +84,7 @@ cpu_to_le(64) +@@ -127,7 +82,7 @@ cpu_to_le(64) #define cpu_to_be32 #define cpu_to_be64 @@ -73,7 +73,7 @@ index 5ca8975..61f1251 100644 #define cpu_to_be(bits) \ static inline uint##bits##_t cpu_to_be##bits(uint##bits##_t val) \ -@@ -147,11 +102,7 @@ cpu_to_be(64) +@@ -145,11 +100,7 @@ cpu_to_be(64) #define cpu_to_le32 #define cpu_to_le64 @@ -87,5 +87,5 @@ index 5ca8975..61f1251 100644 #define be_to_cpu8 cpu_to_be8 #define be_to_cpu16 cpu_to_be16 -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0009-Use-HAVE_-_H-macro-for-detecting-includes.patch b/flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch similarity index 80% rename from flashrom-0009-Use-HAVE_-_H-macro-for-detecting-includes.patch rename to flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch index 2388df7..db6c179 100644 --- a/flashrom-0009-Use-HAVE_-_H-macro-for-detecting-includes.patch +++ b/flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch @@ -1,35 +1,34 @@ -From fb8494eb62635a5520aa1da7bad4555882026af9 Mon Sep 17 00:00:00 2001 +From 88ea1d878356897c04ea06008e82a8e10daf6a03 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 26 Sep 2010 21:05:50 +0400 -Subject: [PATCH 09/13] Use HAVE_*_H macro for detecting includes +Subject: [PATCH 07/10] Use HAVE_*_H macro for detecting includes Signed-off-by: Peter Lemenkov --- - hwaccess.h | 72 ++++++++++++++++++++++++++++++++++++++++++----------------- - 1 files changed, 51 insertions(+), 21 deletions(-) + hwaccess.h | 72 +++++++++++++++++++++++++++++++++++++++++++---------------- + 1 files changed, 52 insertions(+), 20 deletions(-) diff --git a/hwaccess.h b/hwaccess.h -index 61f1251..b3024b3 100644 +index 5188a98..85c556d 100644 --- a/hwaccess.h +++ b/hwaccess.h -@@ -26,13 +26,11 @@ - - #include "config.h" +@@ -24,11 +24,11 @@ + #ifndef __HWACCESS_H__ + #define __HWACCESS_H__ 1 -#if defined (__i386__) || defined (__x86_64__) -#if defined(__GLIBC__) ++#include "config.h" ++ +#if defined (HAVE_SYS_IO_H) #include -#endif -#endif +#endif /* defined (HAVE_SYS_IO_H) */ --#if HAVE_LIBPCI == 1 -+#if defined (HAVE_LIBPCI) + #if NEED_PCI == 1 /* - * libpci headers use the variable name "index" which triggers shadowing - * warnings on systems which have the index() function in a default #include -@@ -41,7 +39,47 @@ +@@ -39,7 +39,47 @@ #define index shadow_workaround_index #include #undef index @@ -78,10 +77,10 @@ index 61f1251..b3024b3 100644 #define ___constant_swab8(x) ((uint8_t) ( \ (((uint8_t)(x) & (uint8_t)0xffU)))) -@@ -114,18 +152,13 @@ cpu_to_be(64) +@@ -112,18 +152,13 @@ cpu_to_be(64) #define le_to_cpu64 cpu_to_le64 - #if HAVE_LIBPCI == 1 + #if NEED_PCI == 1 + +/* PCI port I/O is not yet implemented on PowerPC. */ +/* PCI port I/O is not yet implemented on MIPS. */ @@ -100,7 +99,7 @@ index 61f1251..b3024b3 100644 #if (defined(__MACH__) && defined(__APPLE__)) #define __DARWIN__ #endif -@@ -135,7 +168,6 @@ cpu_to_be(64) +@@ -133,7 +168,6 @@ cpu_to_be(64) */ #if defined(__FreeBSD__) || defined(__DragonFly__) @@ -108,7 +107,7 @@ index 61f1251..b3024b3 100644 #define off64_t off_t #define lseek64 lseek #define OUTB(x, y) do { u_int outb_tmp = (y); outb(outb_tmp, (x)); } while (0) -@@ -163,8 +195,6 @@ cpu_to_be(64) +@@ -161,8 +195,6 @@ cpu_to_be(64) #ifdef __DJGPP__ @@ -117,7 +116,7 @@ index 61f1251..b3024b3 100644 #define OUTB(x,y) outportb(y, x) #define OUTW(x,y) outportw(y, x) #define OUTL(x,y) outportl(y, x) -@@ -191,8 +221,6 @@ cpu_to_be(64) +@@ -189,8 +221,6 @@ cpu_to_be(64) #define off64_t off_t #define lseek64 lseek #if defined(__i386__) || defined(__x86_64__) @@ -126,7 +125,7 @@ index 61f1251..b3024b3 100644 #if defined(__NetBSD__) #if defined(__i386__) #define iopl i386_iopl -@@ -249,7 +277,8 @@ static inline uint32_t inl(uint16_t port) +@@ -247,7 +277,8 @@ static inline uint32_t inl(uint16_t port) typedef struct { uint32_t hi, lo; } msr_t; msr_t rdmsr(int addr); int wrmsr(int addr, msr_t msr); @@ -136,7 +135,7 @@ index 61f1251..b3024b3 100644 #if defined(__FreeBSD__) || defined(__DragonFly__) /* FreeBSD already has conflicting definitions for wrmsr/rdmsr. */ #undef rdmsr -@@ -259,7 +288,8 @@ int wrmsr(int addr, msr_t msr); +@@ -257,7 +288,8 @@ int wrmsr(int addr, msr_t msr); typedef struct { uint32_t hi, lo; } msr_t; msr_t freebsd_rdmsr(int addr); int freebsd_wrmsr(int addr, msr_t msr); @@ -147,5 +146,5 @@ index 61f1251..b3024b3 100644 #include #include -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0010-Move-arch-checking-ifdef-block-into-header.patch b/flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch similarity index 65% rename from flashrom-0010-Move-arch-checking-ifdef-block-into-header.patch rename to flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch index 3387a68..c200c61 100644 --- a/flashrom-0010-Move-arch-checking-ifdef-block-into-header.patch +++ b/flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch @@ -1,13 +1,13 @@ -From 7364a346bc8e0026df4d470809035cd4d3dc916a Mon Sep 17 00:00:00 2001 +From 706a7a08d331f6dde0cbc539aa8dd449a21104ba Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 17 Oct 2010 12:53:18 +0400 -Subject: [PATCH 10/13] Move arch-checking #ifdef block into header +Subject: [PATCH 08/10] Move arch-checking #ifdef block into header Signed-off-by: Peter Lemenkov --- hwaccess.c | 7 ------- - hwaccess.h | 21 ++++++++------------- - 2 files changed, 8 insertions(+), 20 deletions(-) + hwaccess.h | 14 +------------- + 2 files changed, 1 insertions(+), 20 deletions(-) diff --git a/hwaccess.c b/hwaccess.c index f10d957..98dbfaa 100644 @@ -28,24 +28,10 @@ index f10d957..98dbfaa 100644 #if defined(__FreeBSD__) || defined(__DragonFly__) int io_fd; diff --git a/hwaccess.h b/hwaccess.h -index b3024b3..214c38b 100644 +index 85c556d..c1678e1 100644 --- a/hwaccess.h +++ b/hwaccess.h -@@ -26,6 +26,13 @@ - - #include "config.h" - -+#if !( defined(__i386__) || \ -+ defined(__x86_64__) || defined(__amd64) || \ -+ defined (__mips) || defined (__mips__) || defined (_mips) || defined (mips) || \ -+ defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__)) -+#error Unknown architecture -+#endif -+ - #if defined (HAVE_SYS_IO_H) - #include - #endif /* defined (HAVE_SYS_IO_H) */ -@@ -183,7 +190,7 @@ cpu_to_be(64) +@@ -183,7 +183,7 @@ cpu_to_be(64) #define off64_t off_t #define lseek64 lseek #endif @@ -54,7 +40,7 @@ index b3024b3..214c38b 100644 /* Note different order for outb */ #define OUTB(x,y) outb(y, x) #define OUTW(x,y) outw(y, x) -@@ -301,18 +308,6 @@ int libpayload_wrmsr(int addr, msr_t msr); +@@ -301,18 +301,6 @@ int libpayload_wrmsr(int addr, msr_t msr); #define wrmsr libpayload_wrmsr #endif @@ -74,5 +60,5 @@ index b3024b3..214c38b 100644 #endif -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0011-ppc-hack.patch b/flashrom-0009-ppc-hack.patch similarity index 83% rename from flashrom-0011-ppc-hack.patch rename to flashrom-0009-ppc-hack.patch index 24c8b71..0c3103e 100644 --- a/flashrom-0011-ppc-hack.patch +++ b/flashrom-0009-ppc-hack.patch @@ -1,7 +1,7 @@ -From 64d86555c0c1061572d8cb66a8ec5e73423ad7e6 Mon Sep 17 00:00:00 2001 +From 1a514e6abd046c2e9310c07488090d03bfd9d86c Mon Sep 17 00:00:00 2001 From: Mattias Mattsson Date: Wed, 27 Jul 2011 21:02:50 +0400 -Subject: [PATCH 11/13] ppc hack +Subject: [PATCH 09/10] ppc hack --- internal.c | 2 ++ @@ -9,10 +9,10 @@ Subject: [PATCH 11/13] ppc hack 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/internal.c b/internal.c -index 6cd791c..c7e527f 100644 +index fc9d9e4..393bdcd 100644 --- a/internal.c +++ b/internal.c -@@ -293,6 +293,8 @@ int internal_init(void) +@@ -295,6 +295,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.6 +1.7.6.4 diff --git a/flashrom-0013-Simplify-processor.h.patch b/flashrom-0010-Simplify-processor.h.patch similarity index 67% rename from flashrom-0013-Simplify-processor.h.patch rename to flashrom-0010-Simplify-processor.h.patch index 235867f..38749fa 100644 --- a/flashrom-0013-Simplify-processor.h.patch +++ b/flashrom-0010-Simplify-processor.h.patch @@ -1,15 +1,15 @@ -From 4dd2659b1379d008709e63ae9f28bb09382221d2 Mon Sep 17 00:00:00 2001 +From 8366b13dfc43d432e9735bef59aa276aa7e8dd98 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Thu, 28 Jul 2011 12:56:17 +0400 -Subject: [PATCH 13/13] Simplify processor.h +Subject: [PATCH 10/10] Simplify processor.h Signed-off-by: Peter Lemenkov --- - processor_enable.c | 24 ++++++++---------------- - 1 files changed, 8 insertions(+), 16 deletions(-) + processor_enable.c | 26 +++++++++----------------- + 1 files changed, 9 insertions(+), 17 deletions(-) diff --git a/processor_enable.c b/processor_enable.c -index 014e019..d2e98b0 100644 +index 014e019..bf69330 100644 --- a/processor_enable.c +++ b/processor_enable.c @@ -24,19 +24,6 @@ @@ -32,24 +32,31 @@ index 014e019..d2e98b0 100644 #if defined (__MIPSEL__) && defined (__linux) #include #include -@@ -89,9 +76,14 @@ int processor_flash_enable(void) +@@ -83,15 +70,20 @@ static int is_loongson(void) + + int processor_flash_enable(void) + { ++ int ret = 1; + /* FIXME: detect loongson on FreeBSD and OpenBSD as well. */ + #if defined (__MIPSEL__) && defined (__linux) + if (is_loongson()) { flashbase = 0x1fc00000; - return 0; +- return 0; ++ ret = 0; } --#endif +#elif defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__) + /* On x86, flash access is not processor specific except on + * AMD Elan SC520, AMD Geode and maybe other SoC-style CPUs. + * FIXME: Move enable_flash_cs5536 and get_flashbase_sc520 here. + */ -+ return 0; -+#else - /* Not implemented yet. Oh well. */ - return 1; --} -- ++ ret = 0; #endif -+} + /* Not implemented yet. Oh well. */ +- return 1; ++ return ret; + } +- +-#endif -- -1.7.6 +1.7.6.4 diff --git a/flashrom-0012-Support-for-LH28F008BJT-BTLZ1.patch b/flashrom-0012-Support-for-LH28F008BJT-BTLZ1.patch deleted file mode 100644 index f8a9b70..0000000 --- a/flashrom-0012-Support-for-LH28F008BJT-BTLZ1.patch +++ /dev/null @@ -1,128 +0,0 @@ -From dfd43b86397cf877450b3e75608fc897e71b0b06 Mon Sep 17 00:00:00 2001 -From: Mattias Mattsson -Date: Wed, 27 Jul 2011 21:03:48 +0400 -Subject: [PATCH 12/13] Support for LH28F008BJT-BTLZ1 - ---- - 82802ab.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - chipdrivers.h | 1 + - flashchips.c | 30 ++++++++++++++++++++++++++++++ - 3 files changed, 84 insertions(+), 0 deletions(-) - -diff --git a/82802ab.c b/82802ab.c -index cd59c07..abffff9 100644 ---- a/82802ab.c -+++ b/82802ab.c -@@ -208,3 +208,56 @@ int unlock_28f004s5(struct flashchip *flash) - - return 0; - } -+ -+int unlock_lh28f008bjt(struct flashchip *flash) -+{ -+ chipaddr bios = flash->virtual_memory; -+ uint8_t mcfg, bcfg, need_unlock = 0, can_unlock = 0; -+ int i; -+ -+ /* Wait if chip is busy */ -+ wait_82802ab(flash); -+ -+ /* Read identifier codes */ -+ chip_writeb(0x90, bios); -+ -+ /* Read master lock-bit */ -+ mcfg = chip_readb(bios + 0x3); -+ msg_cdbg("master lock is "); -+ if (mcfg) { -+ msg_cdbg("locked!\n"); -+ } else { -+ msg_cdbg("unlocked!\n"); -+ can_unlock = 1; -+ } -+ -+ /* Read block lock-bits, 8 * 8 KiB + 15 * 64 KiB */ -+ for (i = 0; i < flash->total_size * 1024; i+= (i >= (64 * 1024) ? 64 * 1024 : 8 * 1024)) { -+ bcfg = chip_readb(bios + i + 2); // read block lock config -+ msg_cdbg("block lock at %06x is %slocked!\n", i, bcfg ? "" : "un"); -+ if (bcfg) { -+ need_unlock = 1; -+ } -+ } -+ -+ /* Reset chip */ -+ chip_writeb(0xFF, bios); -+ -+ /* Unlock: clear block lock-bits, if needed */ -+ if (can_unlock && need_unlock) { -+ msg_cdbg("Unlock: "); -+ chip_writeb(0x60, bios); -+ chip_writeb(0xD0, bios); -+ chip_writeb(0xFF, bios); -+ wait_82802ab(flash); -+ msg_cdbg("Done!\n"); -+ } -+ -+ /* Error: master locked or a block is locked */ -+ if (!can_unlock && need_unlock) { -+ msg_cerr("At least one block is locked and lockdown is active!\n"); -+ return -1; -+ } -+ -+ return 0; -+} -diff --git a/chipdrivers.h b/chipdrivers.h -index 92ddbea..4c29b65 100644 ---- a/chipdrivers.h -+++ b/chipdrivers.h -@@ -83,6 +83,7 @@ int write_82802ab(struct flashchip *flash, uint8_t *buf, int start, int len); - void print_status_82802ab(uint8_t status); - int unlock_82802ab(struct flashchip *flash); - int unlock_28f004s5(struct flashchip *flash); -+int unlock_lh28f008bjt(struct flashchip *flash); - - /* jedec.c */ - uint8_t oddparity(uint8_t val); -diff --git a/flashchips.c b/flashchips.c -index 1a5622f..109b9b7 100644 ---- a/flashchips.c -+++ b/flashchips.c -@@ -5379,6 +5379,36 @@ const struct flashchip flashchips[] = { - - { - .vendor = "Sharp", -+ .name = "LH28F008BJT-BTLZ1", -+ .bustype = BUS_PARALLEL, -+ .manufacture_id = SHARP_ID, -+ .model_id = SHARP_LH28F008BJxxPB, -+ .total_size = 1024, -+ .page_size = 64 * 1024, -+ .tested = TEST_OK_PREW, -+ .probe = probe_82802ab, -+ .probe_timing = TIMING_ZERO, -+ .block_erasers = -+ { -+ { -+ .eraseblocks = { -+ {8 * 1024, 8}, -+ {64 * 1024, 15} -+ }, -+ .block_erase = erase_block_82802ab, -+ }, { -+ .eraseblocks = { {1024 * 1024, 1} }, -+ .block_erase = erase_sector_49lfxxxc, -+ } -+ }, -+ .unlock = unlock_lh28f008bjt, -+ .write = write_82802ab, -+ .read = read_memmapped, -+ .voltage = {2700, 3600}, -+ }, -+ -+ { -+ .vendor = "Sharp", - .name = "LHF00L04", - .bustype = BUS_FWH, /* A/A Mux */ - .manufacture_id = SHARP_ID, --- -1.7.6 - diff --git a/flashrom.spec b/flashrom.spec index 95d940a..69fba53 100644 --- a/flashrom.spec +++ b/flashrom.spec @@ -1,28 +1,25 @@ Summary: Simple program for reading/writing BIOS chips content Name: flashrom Version: 0.9.4 -Release: 1.svn1412%{?dist} +Release: 2.svn1455%{?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 1412 export svn://coreboot.org/flashrom/trunk flashrom-0.9.4 +## svn -r 1455 export svn://coreboot.org/flashrom/trunk flashrom-0.9.4 ## tar -cjvf flashrom-0.9.4.tar.bz2 flashrom-0.9.4 Source0: %{name}-%{version}.tar.bz2 Patch1: flashrom-0001-Initial-commit-of-autotools-related-files.patch Patch2: flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch -Patch3: flashrom-0003-Use-flashrom-s-version-from-config.h.patch -Patch4: flashrom-0004-Use-HAVE_LIBPCI-from-config.h-instead-of-NEED_PCI.patch -Patch5: flashrom-0005-Use-macros-from-config.h-instead-of-HAVE_UTSNAME.patch -Patch6: flashrom-0006-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch -Patch7: flashrom-0007-Simplify-hwaccess.c.patch -Patch8: flashrom-0008-Use-endiannes-determined-at-the-configure-stage.patch -Patch9: flashrom-0009-Use-HAVE_-_H-macro-for-detecting-includes.patch -Patch10: flashrom-0010-Move-arch-checking-ifdef-block-into-header.patch -Patch11: flashrom-0011-ppc-hack.patch -Patch12: flashrom-0012-Support-for-LH28F008BJT-BTLZ1.patch -Patch13: flashrom-0013-Simplify-processor.h.patch +Patch3: flashrom-0003-Use-macros-from-config.h-instead-of-HAVE_UTSNAME.patch +Patch4: flashrom-0004-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patch +Patch5: flashrom-0005-Simplify-hwaccess.c.patch +Patch6: flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch +Patch7: flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch +Patch8: flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch +Patch9: flashrom-0009-ppc-hack.patch +Patch10: flashrom-0010-Simplify-processor.h.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: pciutils-devel @@ -52,9 +49,7 @@ and write new contents on the chips ("flash the chip"). %patch8 -p1 %patch9 -p1 %patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 + %build autoreconf -ivf @@ -76,6 +71,11 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/%{name}.* %changelog +* Fri Oct 21 2011 Peter Lemenkov - 0.9.4-2.svn1455 +- Updated to latest svn ver. 1455 (post-release snapshot for 0.9.4) +- Added lots of new boards and several chipsets and flashchips +- Lots of other cleanups and enhancements + * Fri Aug 12 2011 Peter Lemenkov - 0.9.4-1.svn1412 - Updated to latest svn ver. 1412 (post-release snapshot for 0.9.4) - Experimental support for Apple PowerPC Macs reflashing diff --git a/sources b/sources index b9c9bbf..66942ea 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fb58fca9ff8b93de876bc4c3cfd77007 flashrom-0.9.4.tar.bz2 +ca3a057426ce8c0850997021e32d289e flashrom-0.9.4.tar.bz2