On 30.05.2010 19:42, Michael Karcher wrote:
> Also modifies nvidia_mcp_gpio_set to cope with multiple MCP55 chips on
> the same board, like on the Tyan S2915-E.
>
> Signed-off-by: Michael Karcher <flashrom(a)mkarcher.dialup.fu-berlin.de>
>
This was committed in r1025.
Regards,
Carl-Daniel
--
http://www.hailfinger.org/
The ECS P6IWP-Fe can be added to the list of out of the box boards.
Confirmed with two Intel 82802AB
But it killed a PMC Pm49FL004 as well as another 512KB FWH chip (I think
it was a SST).
-Anders
NetBSD needs libpciutils (which is called libpci on pretty much every
other platform and lives in the pciutils package) and apparently the
libpciutils on NetBSD needs the NetBSD-native libpci (no equivalent on
other platforms).
Thanks to Jonathan A. Kollasch for reporting.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Index: flashrom-netbsd/Makefile
===================================================================
--- flashrom-netbsd/Makefile (Revision 1028)
+++ flashrom-netbsd/Makefile (Arbeitskopie)
@@ -220,8 +220,10 @@
FEATURE_CFLAGS += -D'NEED_PCI=1'
PROGRAMMER_OBJS += pcidev.o physmap.o hwaccess.o
ifeq ($(OS_ARCH), NetBSD)
-LIBS += -lpciutils # The libpci we want.
-LIBS += -l$(shell uname -p) # For (i386|x86_64)_iopl(2).
+# The libpci we want is called libpciutils on NetBSD and needs NetBSD libpci.
+LIBS += -lpciutils -lpci
+# For (i386|x86_64)_iopl(2).
+LIBS += -l$(shell uname -p)
else
ifeq ($(OS_ARCH), DOS)
# FIXME There needs to be a better way to do this
--
http://www.hailfinger.org/
Author: hailfinger
Date: Sat Jun 5 01:24:57 2010
New Revision: 1033
URL: http://flashrom.org/trac/coreboot/changeset/1033
Log:
NetBSD needs libpciutils (which is called libpci on pretty much every
other platform and lives in the pciutils package) and apparently the
libpciutils on NetBSD needs the NetBSD-native libpci (no equivalent on
other platforms).
Thanks to Jonathan A. Kollasch for reporting.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Acked-by: Jonathan A. Kollasch <jakllsch(a)kollasch.net>
Modified:
trunk/Makefile
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile Sat Jun 5 01:20:21 2010 (r1032)
+++ trunk/Makefile Sat Jun 5 01:24:57 2010 (r1033)
@@ -220,8 +220,10 @@
FEATURE_CFLAGS += -D'NEED_PCI=1'
PROGRAMMER_OBJS += pcidev.o physmap.o hwaccess.o
ifeq ($(OS_ARCH), NetBSD)
-LIBS += -lpciutils # The libpci we want.
-LIBS += -l$(shell uname -p) # For (i386|x86_64)_iopl(2).
+# The libpci we want is called libpciutils on NetBSD and needs NetBSD libpci.
+LIBS += -lpciutils -lpci
+# For (i386|x86_64)_iopl(2).
+LIBS += -l$(shell uname -p)
else
ifeq ($(OS_ARCH), DOS)
# FIXME There needs to be a better way to do this
Here is the output of the requested information for the HP NetServer E
800, chipset not detected by flashrom.
BIOS and other onboard firmware (SCSI controller/s):
http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&…
The name is the name of the machine, I don't know if the board has a
different identifier.
--
Andrew.
Hello,
I tried out flashrom on an ASUS A8N-VM CSM board: read seemed to go fine, but
write failed. Information about the board:
http://www.asus.com/product.aspx?P_ID=JBqqlpj4cspbSa3s
flashrom -V, lspci -nnvvxxx, superiotool -deV, flashrom -rV and flashrom -wV
output is attached. The BIOS I was trying to write was the rev 1001 one
available from the above ASUS page.
Per agaran's and roysjosh's friendly help on IRC I checked the BIOS I read
with -r with -v and it says VERIFIED so I suppose I'll go ahead and reboot
later today.
One note about the board testing Wiki page you may want to clarify:
"To check if you can read the existing BIOS image from the chip, run flashrom
-r backup.bin. Make sure that backup.bin contains a useful BIOS image. (Some
chipsets will return 0xff for large areas of flash without any error
messages.)"
For a BIOS newbie like me, the remark in parenthesis doesn't tell much - is it
a good or a bad sign if a chipset returns 0xff for large areas of flash
without any error messages? (Bad, I guess ;))
The internal programmer needs correct information about flash_base and
chip window top/bottom alignment on non-x86 before it can be used. Abort
any internal programmer action for now until the code is fixed.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Index: flashrom-disable_internal_nonx86/internal.c
===================================================================
--- flashrom-disable_internal_nonx86/internal.c (Revision 1013)
+++ flashrom-disable_internal_nonx86/internal.c (Arbeitskopie)
@@ -165,16 +165,22 @@
pci_init(pacc); /* Initialize the PCI library */
pci_scan_bus(pacc); /* We want to get the list of devices */
- /* We look at the lbtable first to see if we need a
+#if defined(__i386__) || defined(__x86_64__)
+ /* We look at the cbtable first to see if we need a
* mainboard specific flash enable sequence.
*/
coreboot_init();
-#if defined(__i386__) || defined(__x86_64__)
dmi_init();
/* Probe for the Super I/O chip and fill global struct superio. */
probe_superio();
+#else
+ /* FIXME: Enable cbtable searching on all non-x86 platforms supported
+ * by coreboot.
+ * FIXME: Find a replacement for DMI on non-x86.
+ * FIXME: Enable SuperI/O probing once port I/O is possible.
+ */
#endif
/* Warn if a laptop is detected. */
@@ -200,6 +206,7 @@
}
}
+#if __FLASHROM_LITTLE_ENDIAN__
/* try to enable it. Failure IS an option, since not all motherboards
* really need this to be done, etc., etc.
*/
@@ -220,7 +227,25 @@
* The error code might have been a warning only.
* Besides that, we don't check the board enable return code either.
*/
+#if defined(__i386__) || defined(__x86_64__)
return 0;
+#else
+ msg_perr("Your platform is not supported yet for the internal "
+ "programmer due to missing flash_base and top/bottom "
+ "alignment information.\n"
+ "Aborting.\n");
+ return 1;
+#endif
+#else
+ /* FIXME: Remove this unconditional abort once all PCI drivers are
+ * converted to use little-endian accesses for memory BARs.
+ */
+ msg_perr("Your platform is not supported yet for the internal "
+ "programmer because it has not been converted from native "
+ "endian to little endian access yet.\n"
+ "Aborting.\n");
+ return 1;
+#endif
}
int internal_shutdown(void)
--
http://www.hailfinger.org/
Author: hailfinger
Date: Fri Jun 4 21:05:39 2010
New Revision: 1031
URL: http://flashrom.org/trac/coreboot/changeset/1031
Log:
The internal programmer needs correct information about flash_base and
chip window top/bottom alignment on non-x86 before it can be used.
Abort any internal programmer action for now until the code is fixed.
Add the concept of a processor enable for systems where flashing is
impacted by processor settings or processor model.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Acked-by: Uwe Hermann <uwe(a)hermann-uwe.de>
Added:
trunk/processor_enable.c
Modified:
trunk/Makefile
trunk/flash.h
trunk/internal.c
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile Fri Jun 4 19:07:39 2010 (r1030)
+++ trunk/Makefile Fri Jun 4 21:05:39 2010 (r1031)
@@ -124,7 +124,7 @@
ifeq ($(CONFIG_INTERNAL), yes)
FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1'
-PROGRAMMER_OBJS += chipset_enable.o board_enable.o cbtable.o dmi.o internal.o
+PROGRAMMER_OBJS += processor_enable.o chipset_enable.o board_enable.o cbtable.o dmi.o internal.o
# FIXME: The PROGRAMMER_OBJS below should only be included on x86.
PROGRAMMER_OBJS += it87spi.o ichspi.o sb600spi.o wbsio_spi.o
NEED_PCI := yes
Modified: trunk/flash.h
==============================================================================
--- trunk/flash.h Fri Jun 4 19:07:39 2010 (r1030)
+++ trunk/flash.h Fri Jun 4 21:05:39 2010 (r1031)
@@ -361,6 +361,9 @@
/* chipset_enable.c */
int chipset_flash_enable(void);
+/* processor_enable.c */
+int processor_flash_enable(void);
+
/* physmap.c */
void *physmap(const char *descr, unsigned long phys_addr, size_t len);
void *physmap_try_ro(const char *descr, unsigned long phys_addr, size_t len);
Modified: trunk/internal.c
==============================================================================
--- trunk/internal.c Fri Jun 4 19:07:39 2010 (r1030)
+++ trunk/internal.c Fri Jun 4 21:05:39 2010 (r1031)
@@ -165,16 +165,28 @@
pci_init(pacc); /* Initialize the PCI library */
pci_scan_bus(pacc); /* We want to get the list of devices */
- /* We look at the lbtable first to see if we need a
+ if (processor_flash_enable()) {
+ msg_perr("Processor detection/init failed.\n"
+ "Aborting.\n");
+ return 1;
+ }
+
+#if defined(__i386__) || defined(__x86_64__)
+ /* We look at the cbtable first to see if we need a
* mainboard specific flash enable sequence.
*/
coreboot_init();
-#if defined(__i386__) || defined(__x86_64__)
dmi_init();
/* Probe for the Super I/O chip and fill global struct superio. */
probe_superio();
+#else
+ /* FIXME: Enable cbtable searching on all non-x86 platforms supported
+ * by coreboot.
+ * FIXME: Find a replacement for DMI on non-x86.
+ * FIXME: Enable Super I/O probing once port I/O is possible.
+ */
#endif
/* Warn if a laptop is detected. */
@@ -200,6 +212,7 @@
}
}
+#if __FLASHROM_LITTLE_ENDIAN__
/* try to enable it. Failure IS an option, since not all motherboards
* really need this to be done, etc., etc.
*/
@@ -220,7 +233,26 @@
* The error code might have been a warning only.
* Besides that, we don't check the board enable return code either.
*/
+#if defined(__i386__) || defined(__x86_64__)
return 0;
+#else
+ msg_perr("Your platform is not supported yet for the internal "
+ "programmer due to missing\n"
+ "flash_base and top/bottom alignment information.\n"
+ "Aborting.\n");
+ return 1;
+#endif
+#else
+ /* FIXME: Remove this unconditional abort once all PCI drivers are
+ * converted to use little-endian accesses for memory BARs.
+ */
+ msg_perr("Your platform is not supported yet for the internal "
+ "programmer because it has\n"
+ "not been converted from native endian to little endian "
+ "access yet.\n"
+ "Aborting.\n");
+ return 1;
+#endif
}
int internal_shutdown(void)
Added: trunk/processor_enable.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/processor_enable.c Fri Jun 4 21:05:39 2010 (r1031)
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2010 Carl-Daniel Hailfinger
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * Contains the processor specific flash enables and system settings.
+ */
+
+#include "flash.h"
+
+#if defined(__i386__) || defined(__x86_64__)
+
+int processor_flash_enable(void)
+{
+ /* 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
+
+int processor_flash_enable(void)
+{
+ /* Not implemented yet. Oh well. */
+ return 1;
+}
+
+#endif
Hi,
I separated the direct io access code from the flashrom changes, to make
this code easily available for the other coreboot utilities, too.
The remaining windows patch is rather small.
I'll clean up the directio code some more and make a release asap.
Best regards,
Stefan
--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info(a)coresystems.de • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866
Right now flashrom uses a mix of #ifdef and #if defined() and due to
that, readability suffers.
Should we use #if defined() everywhere and kill #ifdef? Should we
evaluate the preprocessor defines for their value instead of their
presence to avoid strange problems once someone defines anything to 0?
Regards,
Carl-Daniel
--
http://www.hailfinger.org/
Handle insufficient DOS timer precision by measuring a 100 ms delay
instead of a 100 us delay. This should reduce the likelihood of flashrom
timer complaints from 100% to 50%. If you want less complaints, use 1000
ms instead. This is mostly a proof of concept and I'd appreciate tests.
Once I know which #defines to look for on MinGW and Cygwin, I can modify
the #if to cover them as well.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Index: flashrom-measure_delay_precision_dos/udelay.c
===================================================================
--- flashrom-measure_delay_precision_dos/udelay.c (Revision 1008)
+++ flashrom-measure_delay_precision_dos/udelay.c (Arbeitskopie)
@@ -93,7 +93,19 @@
* a scheduler delay or something similar.
*/
for (i = 0; i < 4; i++) {
- if (measure_delay(100) < 90) {
+#if !defined(__DJGPP__)
+ timeusec = measure_delay(100);
+#else
+ /* This zero delay workaround should be active for
+ * DOS and Windows and maybe libpayload. The criterion
+ * here is insufficient (worse than 100 us) OS timer
+ * resolution which will result in measure_delay(100)=0
+ * whereas a longer delay (100 ms) will be sufficient
+ * to get a nonzero time measurement.
+ */
+ timeusec = measure_delay(100000) / 1000;
+#endif
+ if (timeusec < 90) {
msg_pdbg("delay more than 10%% too short, "
"recalculating... ");
goto recalibrate;
--
http://www.hailfinger.org/
Author: hailfinger
Date: Thu Jun 3 23:48:13 2010
New Revision: 1028
URL: http://flashrom.org/trac/coreboot/changeset/1028
Log:
Do not trust the OS at all and measure timer precision before
calibrating the delay loop and use that measurement to get reasonable
precision for our own delay code.
Print a measurement for a delay of 4x the OS timer resolution.
Be precise about how bad the deviation was if we had to recalculate.
Tested on Windows XP, 32 bit, built using MinGW by Uwe.
Tested on FreeDOS v1.0 Final, 32bit, built using DJGPP 4.3.2 by Idwer.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Acked-by: Uwe Hermann <uwe(a)hermann-uwe.de>
Acked-by: Idwer Vollering <vidwer+lists.flashrom(a)gmail.com>
Modified:
trunk/udelay.c
Modified: trunk/udelay.c
==============================================================================
--- trunk/udelay.c Thu Jun 3 18:35:51 2010 (r1027)
+++ trunk/udelay.c Thu Jun 3 23:48:13 2010 (r1028)
@@ -37,6 +37,30 @@
}
}
+unsigned long measure_os_delay_resolution(void)
+{
+ unsigned long timeusec;
+ struct timeval start, end;
+ unsigned long counter = 0;
+
+ gettimeofday(&start, 0);
+ timeusec = 0;
+
+ while (!timeusec && (++counter < 1000000000)) {
+ gettimeofday(&end, 0);
+ timeusec = 1000000 * (end.tv_sec - start.tv_sec) +
+ (end.tv_usec - start.tv_usec);
+ /* Protect against time going forward too much. */
+ if ((end.tv_sec > start.tv_sec) &&
+ ((end.tv_sec - start.tv_sec) >= LONG_MAX / 1000000 - 1))
+ timeusec = 0;
+ /* Protect against time going backwards during leap seconds. */
+ if ((end.tv_sec < start.tv_sec) || (timeusec > LONG_MAX))
+ timeusec = 0;
+ }
+ return timeusec;
+}
+
unsigned long measure_delay(int usecs)
{
unsigned long timeusec;
@@ -61,10 +85,16 @@
void myusec_calibrate_delay(void)
{
unsigned long count = 1000;
- unsigned long timeusec;
+ unsigned long timeusec, resolution;
int i, tries = 0;
msg_pinfo("Calibrating delay loop... ");
+ resolution = measure_os_delay_resolution();
+ if (resolution) {
+ msg_pdbg("OS timer resolution is %u usecs, ", resolution);
+ } else {
+ msg_pinfo("OS timer resolution is unusable. ");
+ }
recalibrate:
count = 1000;
@@ -94,9 +124,27 @@
* a scheduler delay or something similar.
*/
for (i = 0; i < 4; i++) {
- if (measure_delay(100) < 90) {
- msg_pdbg("delay more than 10%% too short, "
- "recalculating... ");
+ if (resolution && (resolution < 10)) {
+ timeusec = measure_delay(100);
+ } else if (resolution &&
+ (resolution < ULONG_MAX / 200)) {
+ timeusec = measure_delay(resolution * 10) *
+ 100 / (resolution * 10);
+ } else {
+ /* This workaround should be active for broken
+ * OS and maybe libpayload. The criterion
+ * here is horrible or non-measurable OS timer
+ * resolution which will result in
+ * measure_delay(100)=0 whereas a longer delay
+ * (1000 ms) may be sufficient
+ * to get a nonzero time measurement.
+ */
+ timeusec = measure_delay(1000000) / 10000;
+ }
+ if (timeusec < 90) {
+ msg_pdbg("delay more than 10%% too short (got "
+ "%lu%% of expected delay), "
+ "recalculating... ", timeusec);
goto recalibrate;
}
}
@@ -113,6 +161,8 @@
msg_pdbg("1000 myus = %ld us, ", timeusec);
timeusec = measure_delay(10000);
msg_pdbg("10000 myus = %ld us, ", timeusec);
+ timeusec = measure_delay(resolution * 4);
+ msg_pdbg("%ld myus = %ld us, ", resolution * 4, timeusec);
msg_pinfo("OK.\n");
}