On Mon, 13 Feb 2012 12:09:53 +0200
Shahar Or <mightyiampresence(a)gmail.com> wrote:
> Dear ones,
>
> I'm not subscribed to the list so please reply directly.
>
> I've tested read and write on Gigabyte GA-880GMA-USB3 (rev 3.1).
>
> Thanks so much for enabling me to flash my BIOS ROM from Linux!
>
> Here's the link to the mainboard's page in Gigabyte:
> http://www.gigabyte.com/products/product-page.aspx?pid=3817
Hello Shahar,
thanks for your report! I have marked the mainboard as tested and will
commit that later together with other small changes. It would be
appreciated if you could upload verbose logs of flashrom with such
reports (at least a verbose probing with flashrom -V).
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
The linux_spi driver is now enabled by default on Linux.
A man page entry and a line in --list-supported output have been added.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Index: flashrom-linux_spi_documentation/Makefile
===================================================================
--- flashrom-linux_spi_documentation/Makefile (Revision 1495)
+++ flashrom-linux_spi_documentation/Makefile (Arbeitskopie)
@@ -209,6 +209,14 @@
endif
endif
+ifneq ($(TARGET_OS), Linux)
+ifeq ($(CONFIG_LINUX_SPI), yes)
+UNSUPPORTED_FEATURES += CONFIG_LINUX_SPI=yes
+else
+override CONFIG_LINUX_SPI = no
+endif
+endif
+
# Determine the destination processor architecture.
# IMPORTANT: The following line must be placed before ARCH is ever used
# (of course), but should come after any lines setting CC because the line
@@ -324,16 +332,15 @@
# Always enable Bus Pirate SPI for now.
CONFIG_BUSPIRATE_SPI ?= yes
-# Disable Linux spidev interface support for now, until we check for a Linux
-# device (not host, as DOS binaries for example are built on a Linux host).
-CONFIG_LINUX_SPI ?= no
-
# Disable Dediprog SF100 until support is complete and tested.
CONFIG_DEDIPROG ?= no
# Always enable Marvell SATA controllers for now.
CONFIG_SATAMV ?= yes
+# Enable Linux spidev interface by default. We disable it on non-Linux targets.
+CONFIG_LINUX_SPI ?= yes
+
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
@@ -465,11 +472,6 @@
NEED_SERIAL := yes
endif
-ifeq ($(CONFIG_LINUX_SPI), yes)
-FEATURE_CFLAGS += -D'CONFIG_LINUX_SPI=1'
-PROGRAMMER_OBJS += linux_spi.o
-endif
-
ifeq ($(CONFIG_DEDIPROG), yes)
FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1'
FEATURE_LIBS += -lusb
@@ -482,6 +484,11 @@
NEED_PCI := yes
endif
+ifeq ($(CONFIG_LINUX_SPI), yes)
+FEATURE_CFLAGS += -D'CONFIG_LINUX_SPI=1'
+PROGRAMMER_OBJS += linux_spi.o
+endif
+
ifeq ($(NEED_SERIAL), yes)
LIB_OBJS += serial.o
endif
Index: flashrom-linux_spi_documentation/flashrom.8
===================================================================
--- flashrom-linux_spi_documentation/flashrom.8 (Revision 1495)
+++ flashrom-linux_spi_documentation/flashrom.8 (Arbeitskopie)
@@ -205,6 +205,8 @@
.sp
.BR "* ogp_spi" " (for SPI flash ROMs on Open Graphics Project graphics card)"
.sp
+.BR "* linux_spi" " (for SPI flash ROMs accessible via /dev/spidevX.Y on Linux)"
+.sp
Some programmers have optional or mandatory parameters which are described
in detail in the
.B PROGRAMMER SPECIFIC INFO
@@ -607,6 +609,17 @@
.sp
More information about the hardware is available at
.BR http://wiki.opengraphics.org .
+.TP
+.BR "linux_spi " programmer
+You have to specify the SPI controller to use with the
+.sp
+.B " flashrom \-p linux_spi:dev=/dev/spidevX.Y"
+.sp
+syntax where
+.B /dev/spidevX.Y
+is the Linux device node for your SPI controller.
+.sp
+Please note that the linux_spi driver only works on Linux.
.SH EXIT STATUS
flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
Index: flashrom-linux_spi_documentation/print.c
===================================================================
--- flashrom-linux_spi_documentation/print.c (Revision 1495)
+++ flashrom-linux_spi_documentation/print.c (Arbeitskopie)
@@ -527,6 +527,11 @@
programmer_table[PROGRAMMER_SATAMV].name);
print_supported_pcidevs(satas_mv);
#endif
+#if CONFIG_LINUX_SPI == 1
+ msg_ginfo("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_LINUX_SPI].name);
+ msg_ginfo("Device files /dev/spidev*.*\n");
+#endif
}
#if CONFIG_INTERNAL == 1
--
http://www.hailfinger.org/
Forced read functionality was disabled when programmer registration was
merged in r.
We now support registering more than one controller at once for each bus
type. This can happen e.g. if one SPI controller has an attached flash
chip and one controller doesn't. In such a case we rely on the probe
mechanism to find exactly one chip, and the probe mechanism will
remember which controller/bus the flash chip is attached to. A forced
read does not have the luxury of knowing which compatible controller to
use, so this case is handled by always picking the first one. That may
or may not be the correct one, but there is no way (yet) to specify
which controller a flash chip is attached to.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Index: flashrom-forced_read_reenable/cli_classic.c
===================================================================
--- flashrom-forced_read_reenable/cli_classic.c (Revision 1495)
+++ flashrom-forced_read_reenable/cli_classic.c (Arbeitskopie)
@@ -456,11 +456,27 @@
printf("Note: flashrom can never write if the flash "
"chip isn't found automatically.\n");
}
-#if 0 // FIXME: What happens for a forced chip read if multiple compatible programmers are registered?
if (force && read_it && chip_to_probe) {
+ struct registered_programmer *pgm;
+ int compatible_programmers = 0;
printf("Force read (-f -r -c) requested, pretending "
"the chip is there:\n");
- startchip = probe_flash(0, &flashes[0], 1);
+ /* This loop just counts compatible controllers. */
+ for (j = 0; j < registered_programmer_count; j++) {
+ pgm = ®istered_programmers[j];
+ if (pgm->buses_supported & flashes[0].bustype)
+ compatible_programmers++;
+ }
+ if (compatible_programmers > 1)
+ printf("More than one compatible controller "
+ "found for the requested flash chip, "
+ "using the first one.\n");
+ for (j = 0; j < registered_programmer_count; j++) {
+ pgm = ®istered_programmers[j];
+ startchip = probe_flash(pgm, 0, &flashes[0], 1);
+ if (startchip != -1)
+ break;
+ }
if (startchip == -1) {
printf("Probing for flash chip '%s' failed.\n",
chip_to_probe);
@@ -471,7 +487,6 @@
"contain garbage.\n");
return read_flash_to_file(&flashes[0], filename);
}
-#endif
ret = 1;
goto out_shutdown;
} else if (!chip_to_probe) {
--
http://www.hailfinger.org/
Author: hailfinger
Date: Thu Feb 16 22:00:27 2012
New Revision: 1498
URL: http://flashrom.org/trac/flashrom/changeset/1498
Log:
Document and enable the linux_spi driver
The linux_spi driver is now enabled by default on Linux.
A man page entry and a line in --list-supported output have been added.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Acked-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
Modified:
trunk/Makefile
trunk/flashrom.8
trunk/print.c
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile Thu Feb 16 21:55:27 2012 (r1497)
+++ trunk/Makefile Thu Feb 16 22:00:27 2012 (r1498)
@@ -209,6 +209,14 @@
endif
endif
+ifneq ($(TARGET_OS), Linux)
+ifeq ($(CONFIG_LINUX_SPI), yes)
+UNSUPPORTED_FEATURES += CONFIG_LINUX_SPI=yes
+else
+override CONFIG_LINUX_SPI = no
+endif
+endif
+
# Determine the destination processor architecture.
# IMPORTANT: The following line must be placed before ARCH is ever used
# (of course), but should come after any lines setting CC because the line
@@ -324,16 +332,15 @@
# Always enable Bus Pirate SPI for now.
CONFIG_BUSPIRATE_SPI ?= yes
-# Disable Linux spidev interface support for now, until we check for a Linux
-# device (not host, as DOS binaries for example are built on a Linux host).
-CONFIG_LINUX_SPI ?= no
-
# Disable Dediprog SF100 until support is complete and tested.
CONFIG_DEDIPROG ?= no
# Always enable Marvell SATA controllers for now.
CONFIG_SATAMV ?= yes
+# Enable Linux spidev interface by default. We disable it on non-Linux targets.
+CONFIG_LINUX_SPI ?= yes
+
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
@@ -465,11 +472,6 @@
NEED_SERIAL := yes
endif
-ifeq ($(CONFIG_LINUX_SPI), yes)
-FEATURE_CFLAGS += -D'CONFIG_LINUX_SPI=1'
-PROGRAMMER_OBJS += linux_spi.o
-endif
-
ifeq ($(CONFIG_DEDIPROG), yes)
FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1'
FEATURE_LIBS += -lusb
@@ -482,6 +484,11 @@
NEED_PCI := yes
endif
+ifeq ($(CONFIG_LINUX_SPI), yes)
+FEATURE_CFLAGS += -D'CONFIG_LINUX_SPI=1'
+PROGRAMMER_OBJS += linux_spi.o
+endif
+
ifeq ($(NEED_SERIAL), yes)
LIB_OBJS += serial.o
endif
Modified: trunk/flashrom.8
==============================================================================
--- trunk/flashrom.8 Thu Feb 16 21:55:27 2012 (r1497)
+++ trunk/flashrom.8 Thu Feb 16 22:00:27 2012 (r1498)
@@ -205,6 +205,8 @@
.sp
.BR "* ogp_spi" " (for SPI flash ROMs on Open Graphics Project graphics card)"
.sp
+.BR "* linux_spi" " (for SPI flash ROMs accessible via /dev/spidevX.Y on Linux)"
+.sp
Some programmers have optional or mandatory parameters which are described
in detail in the
.B PROGRAMMER SPECIFIC INFO
@@ -639,6 +641,17 @@
.sp
More information about the hardware is available at
.BR http://wiki.opengraphics.org .
+.SS
+.BR "linux_spi " programmer
+You have to specify the SPI controller to use with the
+.sp
+.B " flashrom \-p linux_spi:dev=/dev/spidevX.Y"
+.sp
+syntax where
+.B /dev/spidevX.Y
+is the Linux device node for your SPI controller.
+.sp
+Please note that the linux_spi driver only works on Linux.
.SH EXIT STATUS
flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
Modified: trunk/print.c
==============================================================================
--- trunk/print.c Thu Feb 16 21:55:27 2012 (r1497)
+++ trunk/print.c Thu Feb 16 22:00:27 2012 (r1498)
@@ -527,6 +527,11 @@
programmer_table[PROGRAMMER_SATAMV].name);
print_supported_pcidevs(satas_mv);
#endif
+#if CONFIG_LINUX_SPI == 1
+ msg_ginfo("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_LINUX_SPI].name);
+ msg_ginfo("Device files /dev/spidev*.*\n");
+#endif
}
#if CONFIG_INTERNAL == 1
Am 16.02.2012 21:44 schrieb Stefan Tauner:
> The sections describing the various options of the internal and dummy
> programmers have grown out of proportions. This patch adds some headlines
> to devide the unrelated topics a bit (with .TP commands). The previous indented
> paragraphs for the various programmers were transformed to subsections (.SS).
>
> Also, rephrase the documention related to laptops completely to make it
> less redundant and more informative.
> Document the laptop=this_is_not_a_laptop internal programmer parameter
>
> Change the contact info in the bugs section by removing the trac
> reference and adding IRC (and the pastebin) instead.
>
> Remove some superfluous white space.
>
> Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Regards,
Carl-Daniel
--
http://www.hailfinger.org/