From f4ee62f185bcbbd87085b1c004b578f81166495d Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sat, 31 Mar 2012 21:16:30 +0400 Subject: [PATCH] svn rev. 1517 Signed-off-by: Peter Lemenkov --- .gitignore | 1 + ...al-commit-of-autotools-related-files.patch | 127 ++++++++++++++---- ...code-path-defined-at-configure-stage.patch | 12 +- ...configure-stage-instead-of-HAVE_UTSN.patch | 18 +-- ...lated-ifdefs-in-code-this-is-now-con.patch | 22 +-- flashrom-0005-Simplify-hwaccess.c.patch | 83 +++++++++--- ...es-determined-at-the-configure-stage.patch | 25 ++-- ...AVE_-_H-macro-for-detecting-includes.patch | 42 +++--- ...rch-checking-ifdef-block-into-header.patch | 64 --------- ...hack.patch => flashrom-0008-ppc-hack.patch | 10 +- ...> flashrom-0009-Simplify-processor.h.patch | 8 +- flashrom.spec | 23 ++-- sources | 2 +- 13 files changed, 257 insertions(+), 180 deletions(-) delete mode 100644 flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch rename flashrom-0009-ppc-hack.patch => flashrom-0008-ppc-hack.patch (82%) rename flashrom-0010-Simplify-processor.h.patch => flashrom-0009-Simplify-processor.h.patch (90%) diff --git a/.gitignore b/.gitignore index f1447e6..50461c2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ flashrom-0.9.2.tar.bz2 /flashrom-0.9.3.tar.xz /flashrom-0.9.3.tar.bz2 /flashrom-0.9.4.tar.bz2 +/flashrom-0.9.5.2.tar.bz2 diff --git a/flashrom-0001-Initial-commit-of-autotools-related-files.patch b/flashrom-0001-Initial-commit-of-autotools-related-files.patch index b2f6122..f37f0e1 100644 --- a/flashrom-0001-Initial-commit-of-autotools-related-files.patch +++ b/flashrom-0001-Initial-commit-of-autotools-related-files.patch @@ -1,24 +1,24 @@ -From 0b786729ee0094d33ea88beac62b89ba8b66aa54 Mon Sep 17 00:00:00 2001 +From f1082ad2316f9257eaf3a6a1672593fa0cf66c79 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Fri, 17 Sep 2010 18:58:28 +0400 -Subject: [PATCH 01/10] Initial commit of autotools-related files +Subject: [PATCH 1/9] Initial commit of autotools-related files Signed-off-by: Peter Lemenkov --- - Makefile.am | 210 +++++++++++++++++++++++++++++++++++++++++++++++ - bootstrap.sh | 5 + - configure.ac | 257 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 472 insertions(+), 0 deletions(-) + Makefile.am | 211 +++++++++++++++++++++++++++++++++++++ + bootstrap.sh | 4 + + configure.ac | 332 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 547 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..cd203b8 +index 0000000..24fe251 --- /dev/null +++ b/Makefile.am -@@ -0,0 +1,210 @@ +@@ -0,0 +1,211 @@ +sbin_PROGRAMS = flashrom + +man_MANS = flashrom.8 @@ -179,6 +179,7 @@ index 0000000..cd203b8 + m29f400bt.c \ + opaque.c \ + pm49fl00x.c \ ++ sfdp.c \ + spi.c \ + spi25.c \ + sst_fwhub.c \ @@ -231,29 +232,28 @@ index 0000000..cd203b8 + $(lib_SOURCES) diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 -index 0000000..050fe4f +index 0000000..0213288 --- /dev/null +++ b/bootstrap.sh -@@ -0,0 +1,5 @@ +@@ -0,0 +1,4 @@ +#!/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..c795ce8 +index 0000000..5870714 --- /dev/null +++ b/configure.ac -@@ -0,0 +1,257 @@ -+AC_INIT([flashrom], [0.9.4-r1487], [flashrom@flashrom.org], [flashrom], [http://www.flashrom.org/]) +@@ -0,0 +1,332 @@ ++AC_INIT([flashrom], [0.9.5.2-r1517], [flashrom@flashrom.org], [flashrom], [http://www.flashrom.org/]) + +AC_PREREQ(2.59) + +AC_CANONICAL_TARGET + +AC_CONFIG_SRCDIR([flashrom.c]) -+AM_INIT_AUTOMAKE([foreign]) ++AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip tar-ustar foreign]) + +# Internal (mainboard) flashing +AC_ARG_WITH([internal], @@ -265,10 +265,6 @@ index 0000000..c795ce8 + 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"]) @@ -346,13 +342,15 @@ index 0000000..c795ce8 + ) + +# Check for CPU-specific features -+case $target_cpu in ++case "$target_cpu" in + i386|i486|i586|i686|i786|x86_64) + if test "$internal" = 'yes'; then + enable_x86_only_internal="yes" + fi ++ AC_CHECK_HEADERS([sys/io.h]) + ;; -+ mips*|power*) ++ mips*|power*|arm*) ++ enable_x86_only_internal="n/a" + if test "$nic3com" = 'yes'; then + 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" @@ -379,12 +377,50 @@ index 0000000..c795ce8 + fi + ;; + *) -+ AC_MSG_ERROR([No support for this target ($target_cpu) yet]) ++ AC_MSG_ERROR([No support for this CPU ($target_cpu) yet]) + ;; +esac + +# Enable OS-specific compilation flags -+# TODO ++case "$target_os" in ++ linux*) ++ AC_CHECK_HEADERS([sys/ioctl.h]) ++ AC_ARG_WITH( ++ [linux_spi], ++ AC_HELP_STRING([--with-linux-spi],[Linux SPI subsystem support.]), ++ [linux_spi="$withval"], ++ [linux_spi="yes"] ++ ) ++ if test "$linux_spi" = "yes" ; then ++ AC_CHECK_HEADERS([linux/types.h], [], [AC_MSG_ERROR([ not found])], []) ++ AC_CHECK_HEADERS([linux/spi/spidev.h], [], [AC_MSG_ERROR([ not found])], []) ++ fi ++ ;; ++ darwin*) ++ AC_CHECK_HEADERS([DirectIO/darwinio.h DirectHW/DirectHW.h]) ++ ;; ++ freebsd*) ++ AC_CHECK_HEADERS([machine/cpufunc.h]) ++ ;; ++ openbsd*) ++ AC_CHECK_HEADERS([machine/sysarch.h sys/types.h]) ++ ;; ++ netbsd*) ++ AC_CHECK_HEADERS([machine/sysarch.h sys/types.h]) ++ ;; ++ *solaris*) ++ AC_CHECK_HEADERS([asm/sunddi.h strings.h sys/psw.h sys/sysi86.h]) ++ ;; ++ mingw*) ++ # TODO ++ ;; ++ *djgpp*) ++ AC_CHECK_HEADERS([pc.h]) ++ ;; ++ *) ++ AC_MSG_ERROR([No support for this OS ($target_os) yet]) ++ ;; ++esac + +# Check whether we need seial support +if test "$serprog" = 'yes' -o \ @@ -424,7 +460,7 @@ index 0000000..c795ce8 +AC_PATH_PROG([DMIDECODE], dmidecode, [], [$PATH$PATH_SEPARATOR/usr/sbin]) + +# Checks for header files. -+AC_CHECK_HEADERS([DirectIO/darwinio.h arpa/inet.h asm/sunddi.h fcntl.h inttypes.h limits.h machine/cpufunc.h machine/sysarch.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/io.h sys/ioctl.h sys/psw.h sys/socket.h sys/sysi86.h sys/time.h sys/utsname.h termios.h unistd.h]) ++AC_CHECK_HEADERS([limits.h stddef.h stdint.h stdlib.h string.h sys/time.h sys/utsname.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE @@ -448,7 +484,7 @@ index 0000000..c795ce8 +AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_FUNC_REALLOC -+AC_CHECK_FUNCS([gethostbyaddr gethostbyname getpagesize gettimeofday memmove memset munmap socket strcasecmp strchr strcspn strdup strerror strncasecmp strspn strstr strtol strtoul uname]) ++AC_CHECK_FUNCS([getpagesize gettimeofday memmove memset munmap strcasecmp strchr strcspn strdup strerror strncasecmp strspn strstr strtol strtoul uname]) + +# Checks for pcilib +if test "$pci" = 'yes' ; then @@ -458,6 +494,8 @@ index 0000000..c795ce8 +# check for socket (required for SunOS) +if test "$serprog" = 'yes' ; then + AC_CHECK_LIB([socket], [socket]) ++ AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h sys/socket.h termios.h unistd.h]) ++ AC_CHECK_FUNCS([gethostbyaddr gethostbyname socket]) +fi + +# Check for libusb @@ -503,6 +541,43 @@ index 0000000..c795ce8 + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT ++ ++AC_MSG_RESULT([ ++------------------------------------------------------------------------ ++ $PACKAGE $VERSION configuration. ++ ++ Compiler support: ++ ++ Target CPU: ................... ${target_cpu} ++ Target OS: .................... ${target_os} ++ ++ Suppored programmers: ++ ++ Internal: ..................... ${internal} ++ x86-only features: .......... ${enable_x86_only_internal} ++ serprog: ...................... ${serprog} ++ Linux SPI: .................... ${linux_spi} ++ RayeR SPI: .................... ${rayer_spi} ++ Bitbang SPI: .................. ${bitbang_spi} ++ 3COM NIC: ..................... ${nic3com} ++ NVIDIA GFX: ................... ${gfxnvidia} ++ Open Graphics Project GFX: .... ${gfxogp} ++ Silicon Image SATA: ........... ${satasii} ++ Highpoint ATA: ................ ${atahpt} ++ FT232 SPI: .................... ${ft2232_spi} ++ Dummy: ........................ ${dummy} ++ Dr. Kaiser: ................... ${drkaiser} ++ Realtek NIC: .................. ${nicrealtek} ++ National Semiconductor NIC: ... ${nicnatsemi} ++ Intel NIC: .................... ${nicintel} ++ Intel NIC SPI: ................ ${nicintel_spi} ++ Bus Pirate SPI: ............... ${buspirate_spi} ++ Dediprog SF100: ............... ${dediprog} ++ Marvell SATA: ................. ${satamv} ++ Serial: ....................... ${serial} ++ ++------------------------------------------------------------------------ ++]) -- -1.7.7.5 +1.7.9.3 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 bf0cfb1..14e5527 100644 --- a/flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch +++ b/flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch @@ -1,18 +1,18 @@ -From 9f98c4a7ab4712091d963fbb8eda53f6ca2c442f Mon Sep 17 00:00:00 2001 +From ff41aca7925147681ec29e9a1e5a302eef0addcc Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sat, 12 Jun 2010 22:13:53 +0400 -Subject: [PATCH 02/10] Use dmidecode path defined at configure stage +Subject: [PATCH 2/9] Use dmidecode path defined at configure stage Signed-off-by: Peter Lemenkov --- dmi.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmi.c b/dmi.c -index 5f64b94..537c2d5 100644 +index 2c2551d..6f62fc0 100644 --- a/dmi.c +++ b/dmi.c -@@ -85,7 +85,7 @@ static const struct { +@@ -86,7 +86,7 @@ static const struct { }; #define DMI_COMMAND_LEN_MAX 260 @@ -22,5 +22,5 @@ index 5f64b94..537c2d5 100644 static char *dmistrings[ARRAY_SIZE(dmidecode_names)]; -- -1.7.7.5 +1.7.9.3 diff --git a/flashrom-0003-Use-macros-from-configure-stage-instead-of-HAVE_UTSN.patch b/flashrom-0003-Use-macros-from-configure-stage-instead-of-HAVE_UTSN.patch index c98256f..10d6aed 100644 --- a/flashrom-0003-Use-macros-from-configure-stage-instead-of-HAVE_UTSN.patch +++ b/flashrom-0003-Use-macros-from-configure-stage-instead-of-HAVE_UTSN.patch @@ -1,8 +1,7 @@ -From 519e44ea557387ec0eb1ca77ea3f42de8a89b267 Mon Sep 17 00:00:00 2001 +From 2afeaf03a24e253c4bcfed49155bc7ef264fe1b4 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sat, 18 Sep 2010 09:05:43 +0400 -Subject: [PATCH 03/10] Use macros from configure stage instead of - HAVE_UTSNAME +Subject: [PATCH 3/9] Use macros from configure stage instead of HAVE_UTSNAME Signed-off-by: Peter Lemenkov --- @@ -12,7 +11,7 @@ Signed-off-by: Peter Lemenkov 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Makefile.am b/Makefile.am -index cd203b8..27c6b36 100644 +index 24fe251..c56efd1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,12 +5,6 @@ man_MANS = flashrom.8 @@ -29,10 +28,10 @@ index cd203b8..27c6b36 100644 DEFS += -DDMIDECODE_PATH=\"@DMIDECODE@\" else diff --git a/configure.ac b/configure.ac -index c795ce8..194838f 100644 +index 5870714..e669b2c 100644 --- a/configure.ac +++ b/configure.ac -@@ -249,9 +249,5 @@ AM_CONDITIONAL(HAVE_SERIAL, test "$serial" = "yes") +@@ -287,10 +287,6 @@ AM_CONDITIONAL(HAVE_SERIAL, test "$serial" = "yes") AM_CONDITIONAL(HAVE_PCI, test "$pci" = "yes") AM_CONDITIONAL(HAVE_PRINT_WIKI, test "$print_wiki" = "yes") @@ -42,8 +41,9 @@ index c795ce8..194838f 100644 - AC_CONFIG_FILES([Makefile]) AC_OUTPUT + diff --git a/flashrom.c b/flashrom.c -index ee68344..5208f28 100644 +index cad043b..10f43f4 100644 --- a/flashrom.c +++ b/flashrom.c @@ -31,7 +31,8 @@ @@ -56,7 +56,7 @@ index ee68344..5208f28 100644 #include #endif #include "flash.h" -@@ -1449,7 +1450,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren) +@@ -1474,7 +1475,7 @@ void list_programmers_linebreak(int startcol, int cols, int paren) void print_sysinfo(void) { @@ -66,5 +66,5 @@ index ee68344..5208f28 100644 uname(&osinfo); -- -1.7.7.5 +1.7.9.3 diff --git a/flashrom-0004-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 index fb9127c..422cbb1 100644 --- a/flashrom-0004-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,7 +1,7 @@ -From 5381ae7e3423475d5ade49bd11b5844e68f4fdc7 Mon Sep 17 00:00:00 2001 +From c1942ed484853d4c97e6bc8e66a7e03f47180c34 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sat, 18 Sep 2010 09:40:01 +0400 -Subject: [PATCH 04/10] Kill some x86-related ifdefs in code - this is now +Subject: [PATCH 4/9] Kill some x86-related ifdefs in code - this is now controlled via autotools Signed-off-by: Peter Lemenkov @@ -20,7 +20,7 @@ Signed-off-by: Peter Lemenkov satamv.c | 5 ----- sb600spi.c | 4 ---- wbsio_spi.c | 4 ---- - 14 files changed, 0 insertions(+), 63 deletions(-) + 14 files changed, 63 deletions(-) diff --git a/atahpt.c b/atahpt.c index 4234f6d..27b106d 100644 @@ -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 163ecf1..f81d88c 100644 +index 403d763..6ecf50a 100644 --- a/ichspi.c +++ b/ichspi.c @@ -23,8 +23,6 @@ @@ -91,7 +91,7 @@ index 163ecf1..f81d88c 100644 #include #include #include "flash.h" -@@ -1839,5 +1837,3 @@ int via_init_spi(struct pci_dev *dev) +@@ -1888,5 +1886,3 @@ int via_init_spi(struct pci_dev *dev) return 0; } @@ -117,7 +117,7 @@ index 01cb086..e911ddf 100644 - -#endif diff --git a/it87spi.c b/it87spi.c -index f089d78..fbd8db2 100644 +index fa37d52..d3ba900 100644 --- a/it87spi.c +++ b/it87spi.c @@ -23,8 +23,6 @@ @@ -277,7 +277,7 @@ index c3d7710..458206a 100644 - -#endif diff --git a/wbsio_spi.c b/wbsio_spi.c -index 740a48c..7c4ff57 100644 +index 774890e..f6076aa 100644 --- a/wbsio_spi.c +++ b/wbsio_spi.c @@ -18,8 +18,6 @@ @@ -289,12 +289,12 @@ index 740a48c..7c4ff57 100644 #include "flash.h" #include "chipdrivers.h" #include "programmer.h" -@@ -204,5 +202,3 @@ static int wbsio_spi_read(struct flashctx *flash, uint8_t *buf, - { - return read_memmapped(flash, buf, start, len); +@@ -205,5 +203,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.7.5 +1.7.9.3 diff --git a/flashrom-0005-Simplify-hwaccess.c.patch b/flashrom-0005-Simplify-hwaccess.c.patch index ee74b25..6f7cdd2 100644 --- a/flashrom-0005-Simplify-hwaccess.c.patch +++ b/flashrom-0005-Simplify-hwaccess.c.patch @@ -1,7 +1,7 @@ -From a96a6cc8d45f274614826f30e26b92ed33f5e1f3 Mon Sep 17 00:00:00 2001 +From 8530143c1daf10e4e2564be7eef680c2cd8d82ee Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Tue, 21 Sep 2010 17:51:08 +0400 -Subject: [PATCH 05/10] Simplify hwaccess.c +Subject: [PATCH 5/9] Simplify hwaccess.c This file is saturated with superfluous ifdefs arranged into several nested levels. This in turn adds additional complexity @@ -12,26 +12,19 @@ definitions. Also I added define(__amd64) to the list of x86-arches. Signed-off-by: Peter Lemenkov --- - hwaccess.c | 85 +++++++++++++++++++++-------------------------------------- - 1 files changed, 30 insertions(+), 55 deletions(-) + hwaccess.c | 92 +++++++++++++++--------------------------------------------- + hwaccess.h | 18 +----------- + 2 files changed, 24 insertions(+), 86 deletions(-) diff --git a/hwaccess.c b/hwaccess.c -index 8c89925..f10d957 100644 +index 571edd7..62065de 100644 --- a/hwaccess.c +++ b/hwaccess.c -@@ -31,30 +31,47 @@ - #endif +@@ -32,29 +32,39 @@ #include "flash.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(__i386__) || defined(__x86_64__) -+#if defined(__FreeBSD__) || defined(__DragonFly__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +int io_fd; +#endif +#endif @@ -43,7 +36,7 @@ index 8c89925..f10d957 100644 { -} - --#if defined(__FreeBSD__) || defined(__DragonFly__) +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -int io_fd; +/* sync primitive is needed only on PowerPC because + * x86 uses uncached accesses which have a strongly ordered memory model @@ -69,14 +62,14 @@ index 8c89925..f10d957 100644 -#if defined (__sun) && (defined(__i386) || defined(__amd64)) +#if defined (__sun) if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0) { - #elif defined(__FreeBSD__) || defined (__DragonFly__) + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined (__DragonFly__) if ((io_fd = open("/dev/io", O_RDWR)) < 0) { -#else +#else if (iopl(3) != 0) { #endif msg_perr("ERROR: Could not get I/O privileges (%s).\n" -@@ -67,60 +84,18 @@ void get_io_perms(void) +@@ -67,74 +77,18 @@ void get_io_perms(void) exit(1); } #endif @@ -87,7 +80,7 @@ index 8c89925..f10d957 100644 { +/* PCI port I/O is not yet implemented on PowerPC or MIPS. */ +#if defined(__i386__) || defined(__x86_64__) || defined(__amd64) - #if defined(__FreeBSD__) || defined(__DragonFly__) + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) close(io_fd); #endif -} @@ -132,6 +125,20 @@ index 8c89925..f10d957 100644 -{ -} - +-#elif defined (__arm__) +- +-static inline void sync_primitive(void) +-{ +-} +- +-void get_io_perms(void) +-{ +-} +- +-void release_io_perms(void) +-{ +-} +- -#else - -#error Unknown architecture @@ -141,6 +148,42 @@ index 8c89925..f10d957 100644 void mmio_writeb(uint8_t val, void *addr) { +diff --git a/hwaccess.h b/hwaccess.h +index 1e276ec..be3af34 100644 +--- a/hwaccess.h ++++ b/hwaccess.h +@@ -209,7 +209,7 @@ cpu_to_be(64) + #define off64_t off_t + #define lseek64 lseek + #endif +-#if defined (__sun) && (defined(__i386) || defined(__amd64)) ++#if defined (__sun) + /* Note different order for outb */ + #define OUTB(x,y) outb(y, x) + #define OUTW(x,y) outw(y, x) +@@ -329,22 +329,6 @@ int libpayload_wrmsr(int addr, msr_t msr); + #define wrmsr libpayload_wrmsr + #endif + +-#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__) +- +-/* PCI port I/O is not yet implemented on PowerPC. */ +- +-#elif defined (__mips) || defined (__mips__) || defined (_mips) || defined (mips) +- +-/* PCI port I/O is not yet implemented on MIPS. */ +- +-#elif defined(__arm__) +- +-/* Non memory mapped I/O is not supported on ARM. */ +- +-#else +- +-#error Unknown architecture, please check if it supports PCI port IO. +- + #endif + #endif + -- -1.7.7.5 +1.7.9.3 diff --git a/flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch b/flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch index 5edc4fa..83b5d64 100644 --- a/flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch +++ b/flashrom-0006-Use-endiannes-determined-at-the-configure-stage.patch @@ -1,18 +1,18 @@ -From d15ca8999d1fa60cae0017adf6ff533726cb10b2 Mon Sep 17 00:00:00 2001 +From 29e2b7378e475195c59b400a04ca28036bf97d10 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 26 Sep 2010 18:25:31 +0400 -Subject: [PATCH 06/10] Use endiannes determined at the configure stage +Subject: [PATCH 6/9] Use endiannes determined at the configure stage Signed-off-by: Peter Lemenkov --- - hwaccess.h | 53 ++--------------------------------------------------- - 1 files changed, 2 insertions(+), 51 deletions(-) + hwaccess.h | 60 ++---------------------------------------------------------- + 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/hwaccess.h b/hwaccess.h -index eea3652..5188a98 100644 +index be3af34..7d9b108 100644 --- a/hwaccess.h +++ b/hwaccess.h -@@ -41,51 +41,6 @@ +@@ -41,58 +41,6 @@ #undef index #endif @@ -43,6 +43,13 @@ index eea3652..5188a98 100644 -#error Little-endian PowerPC #defines are unknown -#endif - +-#elif defined (__arm__) +-#if defined (__ARMEL__) +-#define __FLASHROM_LITTLE_ENDIAN__ 1 +-#else +-#error Big-endian ARM #defines are unknown +-#endif +- -#endif - -#if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__) @@ -64,7 +71,7 @@ index eea3652..5188a98 100644 #define ___constant_swab8(x) ((uint8_t) ( \ (((uint8_t)(x) & (uint8_t)0xffU)))) -@@ -127,7 +82,7 @@ cpu_to_le(64) +@@ -134,7 +82,7 @@ cpu_to_le(64) #define cpu_to_be32 #define cpu_to_be64 @@ -73,7 +80,7 @@ index eea3652..5188a98 100644 #define cpu_to_be(bits) \ static inline uint##bits##_t cpu_to_be##bits(uint##bits##_t val) \ -@@ -145,11 +100,7 @@ cpu_to_be(64) +@@ -152,11 +100,7 @@ cpu_to_be(64) #define cpu_to_le32 #define cpu_to_le64 @@ -87,5 +94,5 @@ index eea3652..5188a98 100644 #define be_to_cpu8 cpu_to_be8 #define be_to_cpu16 cpu_to_be16 -- -1.7.7.5 +1.7.9.3 diff --git a/flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch b/flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch index efacfc8..c2bf253 100644 --- a/flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch +++ b/flashrom-0007-Use-HAVE_-_H-macro-for-detecting-includes.patch @@ -1,15 +1,15 @@ -From c133e2af9a4b2d558303976fd02e85e186b2b9f4 Mon Sep 17 00:00:00 2001 +From 570a0f7e8ec62b5cf4fc65f2d8c30be1167db5e3 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 26 Sep 2010 21:05:50 +0400 -Subject: [PATCH 07/10] Use HAVE_*_H macro for detecting includes +Subject: [PATCH 7/9] Use HAVE_*_H macro for detecting includes Signed-off-by: Peter Lemenkov --- - hwaccess.h | 70 ++++++++++++++++++++++++++++++++++++++++++----------------- - 1 files changed, 50 insertions(+), 20 deletions(-) + hwaccess.h | 77 ++++++++++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 54 insertions(+), 23 deletions(-) diff --git a/hwaccess.h b/hwaccess.h -index 5188a98..4560c17 100644 +index 7d9b108..96eee0e 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -24,11 +24,9 @@ @@ -26,11 +26,10 @@ index 5188a98..4560c17 100644 #if NEED_PCI == 1 /* -@@ -39,7 +37,47 @@ +@@ -39,7 +37,53 @@ #define index shadow_workaround_index #include #undef index --#endif + +#if defined (HAVE_STRINGS_H) +#include @@ -49,7 +48,13 @@ index 5188a98..4560c17 100644 +#endif /* defined (HAVE_MACHINE_SYSARCH_H) */ + +#if defined (HAVE_MACHINE_CPUFUNC_H) ++#if defined(__FreeBSD__) || defined(__DragonFly__) ++ /* Note that Debian/kFreeBSD (FreeBSD kernel with glibc) has conflicting ++ * out[bwl] definitions in machine/cpufunc.h and sys/io.h at least in some ++ * versions. Use machine/cpufunc.h only for plain FreeBSD/DragonFlyBSD. ++ */ +#include + #endif +#endif /* defined (HAVE_MACHINE_CPUFUNC_H) */ + +/* for iopl and outb under Solaris */ @@ -75,7 +80,7 @@ index 5188a98..4560c17 100644 #define ___constant_swab8(x) ((uint8_t) ( \ (((uint8_t)(x) & (uint8_t)0xffU)))) -@@ -112,18 +150,13 @@ cpu_to_be(64) +@@ -112,18 +156,13 @@ cpu_to_be(64) #define le_to_cpu64 cpu_to_le64 #if NEED_PCI == 1 @@ -97,15 +102,19 @@ index 5188a98..4560c17 100644 #if (defined(__MACH__) && defined(__APPLE__)) #define __DARWIN__ #endif -@@ -133,7 +166,6 @@ cpu_to_be(64) +@@ -133,11 +172,6 @@ cpu_to_be(64) */ #if defined(__FreeBSD__) || defined(__DragonFly__) +- /* Note that Debian/kFreeBSD (FreeBSD kernel with glibc) has conflicting +- * out[bwl] definitions in machine/cpufunc.h and sys/io.h at least in some +- * versions. Use machine/cpufunc.h only for plain FreeBSD/DragonFlyBSD. +- */ - #include #define off64_t off_t #define lseek64 lseek #define OUTB(x, y) do { u_int outb_tmp = (y); outb(outb_tmp, (x)); } while (0) -@@ -161,8 +193,6 @@ cpu_to_be(64) +@@ -165,8 +199,6 @@ cpu_to_be(64) #ifdef __DJGPP__ @@ -114,7 +123,7 @@ index 5188a98..4560c17 100644 #define OUTB(x,y) outportb(y, x) #define OUTW(x,y) outportw(y, x) #define OUTL(x,y) outportl(y, x) -@@ -189,8 +219,6 @@ cpu_to_be(64) +@@ -193,8 +225,6 @@ cpu_to_be(64) #define off64_t off_t #define lseek64 lseek #if defined(__i386__) || defined(__x86_64__) @@ -123,17 +132,16 @@ index 5188a98..4560c17 100644 #if defined(__NetBSD__) #if defined(__i386__) #define iopl i386_iopl -@@ -247,7 +275,8 @@ static inline uint32_t inl(uint16_t port) +@@ -251,7 +281,7 @@ 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); -#endif -+#endif /* !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__DragonFly__) */ -+ - #if defined(__FreeBSD__) || defined(__DragonFly__) ++#endif /* !defined(__DARWIN__) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__) */ + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) /* FreeBSD already has conflicting definitions for wrmsr/rdmsr. */ #undef rdmsr -@@ -257,7 +286,8 @@ int wrmsr(int addr, msr_t msr); +@@ -261,7 +291,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); @@ -144,5 +152,5 @@ index 5188a98..4560c17 100644 #include #include -- -1.7.7.5 +1.7.9.3 diff --git a/flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch b/flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch deleted file mode 100644 index 12b6f30..0000000 --- a/flashrom-0008-Move-arch-checking-ifdef-block-into-header.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 285d0fbc9bc7c413651f563760ec81492a445874 Mon Sep 17 00:00:00 2001 -From: Peter Lemenkov -Date: Sun, 17 Oct 2010 12:53:18 +0400 -Subject: [PATCH 08/10] Move arch-checking #ifdef block into header - -Signed-off-by: Peter Lemenkov ---- - hwaccess.c | 7 ------- - hwaccess.h | 14 +------------- - 2 files changed, 1 insertions(+), 20 deletions(-) - -diff --git a/hwaccess.c b/hwaccess.c -index f10d957..98dbfaa 100644 ---- a/hwaccess.c -+++ b/hwaccess.c -@@ -31,13 +31,6 @@ - #endif - #include "flash.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(__i386__) || defined(__x86_64__) - #if defined(__FreeBSD__) || defined(__DragonFly__) - int io_fd; -diff --git a/hwaccess.h b/hwaccess.h -index 4560c17..5a6631f 100644 ---- a/hwaccess.h -+++ b/hwaccess.h -@@ -181,7 +181,7 @@ cpu_to_be(64) - #define off64_t off_t - #define lseek64 lseek - #endif --#if defined (__sun) && (defined(__i386) || defined(__amd64)) -+#if defined (__sun) - /* Note different order for outb */ - #define OUTB(x,y) outb(y, x) - #define OUTW(x,y) outw(y, x) -@@ -299,18 +299,6 @@ int libpayload_wrmsr(int addr, msr_t msr); - #define wrmsr libpayload_wrmsr - #endif - --#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__) -- --/* PCI port I/O is not yet implemented on PowerPC. */ -- --#elif defined (__mips) || defined (__mips__) || defined (_mips) || defined (mips) -- --/* PCI port I/O is not yet implemented on MIPS. */ -- --#else -- --#error Unknown architecture, please check if it supports PCI port IO. -- - #endif - #endif - --- -1.7.7.5 - diff --git a/flashrom-0009-ppc-hack.patch b/flashrom-0008-ppc-hack.patch similarity index 82% rename from flashrom-0009-ppc-hack.patch rename to flashrom-0008-ppc-hack.patch index 7f97620..bd44014 100644 --- a/flashrom-0009-ppc-hack.patch +++ b/flashrom-0008-ppc-hack.patch @@ -1,15 +1,15 @@ -From afa660c6abea4f1c5b0df5bd35b95dadc681108b Mon Sep 17 00:00:00 2001 +From f5b9fc324c31c765e3fa7fb5a0f3d61130c65ef3 Mon Sep 17 00:00:00 2001 From: Mattias Mattsson Date: Wed, 27 Jul 2011 21:02:50 +0400 -Subject: [PATCH 09/10] ppc hack +Subject: [PATCH 8/9] ppc hack --- internal.c | 2 ++ processor_enable.c | 2 +- - 2 files changed, 3 insertions(+), 1 deletions(-) + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal.c b/internal.c -index 5716e64..1233cae 100644 +index 479cbf7..2fb7c83 100644 --- a/internal.c +++ b/internal.c @@ -334,6 +334,8 @@ int internal_init(void) @@ -35,5 +35,5 @@ index d680f97..014e019 100644 int processor_flash_enable(void) { -- -1.7.7.5 +1.7.9.3 diff --git a/flashrom-0010-Simplify-processor.h.patch b/flashrom-0009-Simplify-processor.h.patch similarity index 90% rename from flashrom-0010-Simplify-processor.h.patch rename to flashrom-0009-Simplify-processor.h.patch index 30fde70..110ff4d 100644 --- a/flashrom-0010-Simplify-processor.h.patch +++ b/flashrom-0009-Simplify-processor.h.patch @@ -1,12 +1,12 @@ -From eb00fe31da8571f16ae87f981a30fed1c89dc15a Mon Sep 17 00:00:00 2001 +From 489274cbff3c17b88a7de990425a0c365609d2ff Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Thu, 28 Jul 2011 12:56:17 +0400 -Subject: [PATCH 10/10] Simplify processor.h +Subject: [PATCH 9/9] Simplify processor.h Signed-off-by: Peter Lemenkov --- processor_enable.c | 26 +++++++++----------------- - 1 files changed, 9 insertions(+), 17 deletions(-) + 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/processor_enable.c b/processor_enable.c index 014e019..bf69330 100644 @@ -58,5 +58,5 @@ index 014e019..bf69330 100644 - -#endif -- -1.7.7.5 +1.7.9.3 diff --git a/flashrom.spec b/flashrom.spec index 84f4a50..6883b60 100644 --- a/flashrom.spec +++ b/flashrom.spec @@ -1,14 +1,14 @@ Summary: Simple program for reading/writing BIOS chips content Name: flashrom -Version: 0.9.4 -Release: 4.svn1487%{?dist} +Version: 0.9.5.2 +Release: 1.svn1517%{?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 1487 export svn://coreboot.org/flashrom/trunk flashrom-0.9.4 -## tar -cjvf flashrom-0.9.4.tar.bz2 flashrom-0.9.4 +## svn -r 1517 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 Patch2: flashrom-0002-Use-dmidecode-path-defined-at-configure-stage.patch @@ -17,9 +17,8 @@ Patch4: flashrom-0004-Kill-some-x86-related-ifdefs-in-code-this-is-now-con.patc 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 +Patch8: flashrom-0008-ppc-hack.patch +Patch9: flashrom-0009-Simplify-processor.h.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: pciutils-devel @@ -48,7 +47,6 @@ and write new contents on the chips ("flash the chip"). %patch7 -p1 %patch8 -p1 %patch9 -p1 -%patch10 -p1 %build @@ -71,6 +69,15 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/%{name}.* %changelog +* Sat Mar 31 2012 Peter Lemenkov - 0.9.5.2-1.svn1517 +- Updated to latest svn ver. 1517 (post-release snapshot for 0.9.5.2) +- Add (untested) board enable for ASUS TUSL2-C +- Add board enable for ASUS OPLX-M. +- Add support for SFDP (JESD216) +- Support compilation for the ARM architecture (not enabled in the spec-file) +- Board enable for TriGem Anaheim-3 +- Add support for RDC R6030 chipset + * Thu Feb 02 2012 Peter Lemenkov - 0.9.4-4.svn1487 - Updated to latest svn ver. 1487 (post-release snapshot for 0.9.4) - Add board enable for the MSC Q7 Tunnel Creek board diff --git a/sources b/sources index 77cf72b..39b1de0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e56266c885c895bd10298867fc18194b flashrom-0.9.4.tar.bz2 +543860dfd4f17c211a304ed4026b1591 flashrom-0.9.5.2.tar.bz2