1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

1600 Commits

Author SHA1 Message Date
Sergey Lichack
98f4710b57 Add support for Realtek RTL8169
And some cleanups including the removal of any left traces of the
nicsmc1211 programmer. The RTL8169 still needs someone to test it,
but it's good enough to be in the tree now.

Corresponding to flashrom svn r1586.

Signed-off-by: Sergey Lichack <shadowpilot34@gmail.com>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Mathias Krause <mathias.krause@secunet.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-27 01:24:15 +00:00
Carl-Daniel Hailfinger
1c6d2ff03d Some ISO C fixes
This patch just fixes a limited number of bits not conforming to c99 by using
 - __asm__ instead of just asm
 - {0} instead of {} for struct initialization
 - h_addr_list[0] instead of h_addr to access the host address in
   struct hostent
 - #include <strings.h> where needed (for ffs and strcasecmp)

Based on a previous patch by Carl-Daniel.

Corresponding to flashrom svn r1585.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-27 00:44:42 +00:00
Stefan Tauner
6745d6f39d Use getpagesize() to determine the physmap's length in nicintel_spi.c
Corresponding to flashrom svn r1584.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-26 21:50:36 +00:00
Stefan Tauner
7bf4ed9277 Rename AT25F512B-specific code
The AT25F512B is quite different from the other (older and yet
unsupported) chips in the AT25F* familiy, hence rename 512B-specific
stuff to make room for the generic AT25F* code.

Corresponding to flashrom svn r1583.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-26 21:04:27 +00:00
Stefan Reinauer
62218c39de Clean up enable_flash_ich and attempt to disable SMM write protection
This is based on chromiumos commit a5f4e82c59d6bcaf06b94623e5516d1db8cb843a.
http://git.chromium.org/gitweb/?p=chromiumos/third_party/flashrom.git;a=commit;h=a5f4e82c59d6bcaf06b94623e5516d1db8cb843a
See also http://www.flashrom.org/pipermail/flashrom/2011-November/008191.html

Besides disabling the SMM protection this also fixes something that bothered
me for a long time: the content of BIOS_CNTL was shown before we try to modify
it. This is usually not what interests us and contradicts other outputs.
With this patch we try to set the write enable and disable the SMM protection
first and show the state of BIOS_CNTL afterwards.

We now return an error only if the write enable is not set (which should be
equivalent to the previous behavior on sane hardware, but it seems to be
'more correct' and makes the code clearer to do this explicitly).

Corresponding to flashrom svn r1582.

Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-26 02:35:13 +00:00
Tadas Slotkus
3dcdc03a72 Add untested board enable for DFI AD77
Corresponding to flashrom svn r1581.

Based on http://patchwork.coreboot.org/patch/2983/
Signed-off-by: Tadas Slotkus <devtadas@gmail.com>

PCI IDs are generic therefore requiring manual activation.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-25 03:53:12 +00:00
Stefan Tauner
61b4cfa29f Clean up satasii.c
Corresponding to flashrom svn r1580.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-25 02:07:20 +00:00
Carl-Daniel Hailfinger
5a7cb847f0 Make struct flashchip a field in struct flashctx instead of a complete copy
All the driver conversion work and cleanup has been done by Stefan.
flashrom.c and cli_classic.c are a joint work of Stefan and Carl-Daniel.

Corresponding to flashrom svn r1579.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-25 01:17:58 +00:00
Helge Wagner
dd73d830f7 Fix VIA VX*** support
Helge Wagner's patch that added VIA VX900 chipset support made me look
closer at the datasheets which led to some concise documentation about
newer VIA chipsets: http://flashrom.org/VIA

Based on that this patch adds full support for VX800/VX820, VX855/VX875
and VX900, including SPI and LPC. VT8237S was not changed (SPI support
only) because there is no public datasheet and it is not clear how to
distinguish between LPC and SPI strapping and investigations in (NDAed)
documents have not brought up anything conclusively.

enable_flash_vt823x could probably be enhanced too due to various
ignored LPC options of the chipset.

Corresponding to flashrom svn r1578.

Signed-off-by: Helge Wagner <Helge.Wagner@ge.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-24 23:03:46 +00:00
Stefan Tauner
b4e06bde9b Refactor the -p internal:mainboard handling
This patch gets rid of some global variables and makes lots of bits along
the code path that control the board enable execution more generic and
clearer. From now on flashrom aborts on a few more occasions that should be
safer for the user. For example it aborts if the enable function for the
specified mainboard (enable) can not be found.

Parts of the board_match_cbname refactoring were done by Carl-Daniel.

Corresponding to flashrom svn r1577.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-20 00:24:22 +00:00
Carl-Daniel Hailfinger
a16a892ca4 Bus Pirate init cleanup and fixes
The Bus Pirate firmware (at least v6.1 and earlier) can't handle UART
input buffer overflow in BBIO mode, and sending a sequence of 0x00 too
fast apparently triggers such an UART input buffer overflow. Wait 10 ms
after sending each 0x00 byte during init to give the Bus Pirate enough
time to handle the input. This fixes a Bus Pirate hang if the previous
flashrom run was aborted by the user.

The Bus Pirate firmware v6.1 and earlier use the wrong (too slow) SPI
speed if more than 2 MHz are requested. Automatically downgrade SPI
speed to 2 MHz for affected firmware versions.

Detect Bus Pirate hardware and firmware versions to allow quirk
handling.

The Bus Pirate init sequence has lots of open-coded sequences which wait
for a given string on the serial line. Refactor them into
buspirate_wait_for_string().

Corresponding to flashrom svn r1576.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-17 17:30:43 +00:00
Carl-Daniel Hailfinger
a8da224c63 Allow specifying CPPFLAGS
The user may know better which CFLAGS/CPPFLAGS are appropriate.
Use flashrom_CFLAGS for flags which flashrom definitely needs to build.

Thanks to Stefan Tauner for pointing out the flaw in r1574.

Corresponding to flashrom svn r1575.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-15 23:06:32 +00:00
Carl-Daniel Hailfinger
b7bce8a6cf Allow the user to specify CFLAGS without breaking the build
GNU make has a very interesting quirk: If you set a variable on the
command line, any changes to that variable in the Makefile are ignored
unless marked with the "override" keyword.

Use CFLAGS only for optimization and warning options, and use CPPFLAGS
for the dependency and other preprocessor related options.
That way packagers can specify their own CFLAGS without breaking the
build.

As a side benefit, the ich_descriptors_tool Makefile now behaves exactly
the same whether called standalone or as part of the main Makefile.

Corresponding to flashrom svn r1574.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-14 21:36:11 +00:00
Ilya A. Volynets-Evenbakh
7c36d52652 Call ftdi_set_interface right after ftdi_init and before ftdi_usb_open
Else libftdi complains that it is impossible to set interface on an already
open device since 1c5fa36b67bc30742eee94ed3e3648fcd4640f24
(which will probably end up in libftdi 0.21).

Corresponding to flashrom svn r1573.

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-14 01:32:46 +00:00
Andrew Morgan
8dd97f9c9e Add support for Atmel AT49(H)F010, AT49F080 and AT49F080T
Also, alter the page size of the other family members to indicate that it is
unused. Maybe this accelerates the deletion of this field... haha.

Corresponding to flashrom svn r1572.

Signed-off-by: Andrew Morgan <ziltro@ziltro.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-13 23:43:46 +00:00
Stefan Tauner
b98f6eb3ac serprog: Add support for setting the SPI frequency
Introduce a new opcode (0x14) that sends the requested frequency as a 32b
long value in Hertz to the programmer and receives the frequency eventually
chosen by the programmer. The user can specify this with the programmer
parameter "spispeed" (named after the similar parameter for the buspirate)
including an optional suffix of 'M' or 'k' for specifying megahertz or kilohertz
respectively (lowercase suffixes are also accepted).

Thanks to Idwer and Uwe (and maybe others) for their feedback especially
regarding the unit of frequency to use.

Corresponding to flashrom svn r1571.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-13 16:33:04 +00:00
Stefan Tauner
a1a14ec5d2 Clean up ICH descriptor code
- allows for compilation with -Werror=shadow,
 - use extended line limit to fix the most awful line breaks.

Corresponding to flashrom svn r1570.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-13 08:45:13 +00:00
Stefan Tauner
37e8686284 Move show_id to where it belongs
And remove the unused force parameter.

Corresponding to flashrom svn r1569.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-11 16:07:08 +00:00
Stefan Tauner
24c38dfd96 Fix broken board enables
Abit KN8 Ultra, agami/island aruma and IWILL DK8-HTX had no secondary
PCI IDs which complicates things.
Some google foo discovered some appropriate IDs, but they are all untested.
Let's pretend this breaks nothing.

Corresponding to flashrom svn r1568.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-11 02:33:20 +00:00
Carl-Daniel Hailfinger
60d9bd267e Portability fixes and cleanups
Move Mac OS X IOKit/DirectHW availability checks in the Makefile from
compiler check to pciutils check.

Print the compiler error messages for feature detection.

Add DOS libpci in the Makefile includes only if a PCI-based programmer
was requested.

Restrict mmap usage in ich_descriptors_tool to Unix style systems.

Build ich_descriptors_tool with the correct .exe extension on
DOS/Windows.

Build ich_descriptors_tool by default on x86. (Patch by Stefan Tauner)

Print the Windows version instead of "unknown machine" on Windows.

Don't #define our own __DARWIN__, use the standard OS X detection
method.

Update the README.

Add more generated files to svn:ignore

Corresponding to flashrom svn r1567.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-09 23:34:41 +00:00
Stefan Tauner
b6304c1a1a Add board enable for Biostar M7VIQ
The PCI IDs are generic VIA IDs. Only Biostar IDs are those of the LOM, but
that would not be a good choice for ID. So autodetection has been disabled
and the user needs to specify -p internal:mainboard=biostar:m7viq instead.

Corresponding to flashrom svn r1566.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-09 23:25:27 +00:00
Peter Lemenkov
975b706a7b Simplify processor_enable.c
Corresponding to flashrom svn r1565.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-09 21:09:51 +00:00
Carl-Daniel Hailfinger
a583853553 Increase flashrom release number to 0.9.6.1
Corresponding to flashrom svn r1563.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
v0.9.6.1
2012-08-08 00:13:10 +00:00
Carl-Daniel Hailfinger
06b9efa5e8 Fix missing #include hwaccess.h
In r1549 #include "hwaccess.h" was moved to individual drivers.
Unfortunately, flashrom.c was forgotten. This caused flashrom to falsely
report an unknown PCI library version and big-endianness on all
platforms.

Add #include "hwaccess.h".
Explicitly check for __flashrom_BIG_ENDIAN__

Corresponding to flashrom svn r1562.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-07 11:59:59 +00:00
Stefan Tauner
87fbb77866 Refine messages of SPI block protection disables
Make them real progress indicators with a final "done" message on success.

Corresponding to flashrom svn r1561.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-02 23:56:49 +00:00
Stefan Tauner
1ba08f6d41 Clean up a25.c, at25.c, spi25.c
- introduce spi_prettyprint_status_register_atmel_at25_wpen()
- use spi_prettyprint_status_register_bit() where possible
- generify spi_prettyprint_status_register_bp3210 and use it in at25.c too

Corresponding to flashrom svn r1560.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-02 23:51:28 +00:00
Carl-Daniel Hailfinger
cb30158fbf Increase flashrom release number to 0.9.6
Corresponding to flashrom svn r1558.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
v0.9.6
2012-08-02 22:00:05 +00:00
Niklas Söderlund
2a95e8713b Remove more exit calls
This patch removes the remaining exit calls from
 - sp_openserport
 - sp_opensocket
 - sp_docommand
 - internal_init

Almost all of this was done by Niklas.

Corresponding to flashrom svn r1557.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-07-30 19:42:33 +00:00
Stefan Tauner
00ec027368 print_wiki: fix columns calculations
For
- chipsets
- boards, and
- chips

Previously the chipset columns were not uniformly divided at all,
which led to very odd table bottoms. This patches fixes this as far
as wiki code can do (browser rendering can still create odd effects
because we do not define cell heights).

Corresponding to flashrom svn r1556.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-07-29 02:04:21 +00:00
Stefan Tauner
2c20b28f0e Introduce enum test_state
Previously boards in the wiki were tagged either as working or as known
bad. But we added support to various boards via board enables that were
then never tested because the owners have not reported back. This can
now be tagged with NT and is shown appropriately.

Also, the underlying data structure indicating state was converted from
macros to an enum while preserving original integer values and is used
for programmers and chipsets too.

Corresponding to flashrom svn r1555.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-07-28 19:35:26 +00:00
Stefan Tauner
d94d25d75b Add a bunch of new/tested stuff and various small changes 13
Tested Mainboards:
OK:
 - ASRock A780FullHD
   http://www.flashrom.org/pipermail/flashrom/2012-July/009599.html
 - ASRock 880G Pro3
   http://www.flashrom.org/pipermail/flashrom/2012-July/009492.html
 - ASRock N61P-S
   http://www.flashrom.org/pipermail/flashrom/2012-May/009316.html
 - ASUS M2N68-VM
   http://www.flashrom.org/pipermail/flashrom/2012-May/009334.html
 - ASUS M3N78 PRO
   http://www.flashrom.org/pipermail/flashrom/2012-July/009519.html
 - ASUS M4N68T V2
   http://www.flashrom.org/pipermail/flashrom/2012-May/009277.html
 - ASUS M5A78L-M LX
   reported by clavile on IRC
 - ASUS P8P67 PRO (rev. 3.0)
   http://www.flashrom.org/pipermail/flashrom/2012-April/009188.html
 - ASUS P8Z68-V
   reported by Kano on IRC
   http://paste.flashrom.org/view.php?id=1232
 - ASUS SABERTOOTH 990FX
   http://paste.flashrom.org/view.php?id=1214
 - Dell Inspiron 1420
   http://www.flashrom.org/pipermail/flashrom/2012-May/009196.html
 - ECS GF8200A
   http://www.flashrom.org/pipermail/flashrom/2012-May/009256.html
 - GIGABYTE GA-H61M-D2H-USB3
   http://www.flashrom.org/pipermail/flashrom/2012-May/009333.html
 - MSI MS-7250 (K9N SLI (rev 2.1))
   http://www.flashrom.org/pipermail/flashrom/2012-June/009436.html
 - MSI MS-7676 (Z68MA-G45 (B3))
   http://www.flashrom.org/pipermail/flashrom/2012-June/009424.html
 - Palit N61S
   http://www.flashrom.org/pipermail/flashrom/2012-May/009212.html

NOT OK:
 - ASRock H61M-ITX
   http://www.flashrom.org/pipermail/flashrom/2012-May/009224.html
 - Dell Latitude E6520
   http://www.flashrom.org/pipermail/flashrom/2012-May/009197.html
 - Dell Vostro 3700
   http://www.flashrom.org/pipermail/flashrom/2012-May/009197.html
 - Intel DH61AG
   http://www.flashrom.org/pipermail/flashrom/2012-June/009417.html
 - Intel DQ965GF
   http://www.flashrom.org/pipermail/flashrom/2012-May/009295.html
 - HP/Compaq 8100 Elite CMT PC (304Bh)
   http://paste.flashrom.org/view.php?id=1182
 - HP Z400 Workstation (0AE4h)
   http://www.flashrom.org/pipermail/flashrom/2012-June/009350.html
 - Supermicro X9DR3-F
   http://www.flashrom.org/pipermail/flashrom/2012-June/009422.html
   

Tested flash chips:
 - mark AMIC A25L032 as TEST_OK_PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2012-June/009363.html
 - mark Atmel AT25DF321A as TEST_OK_PREW (+REW)
   http://www.flashrom.org/pipermail/flashrom/2012-July/009492.html
 - mark Atmel AT26DF161 as TEST_OK_PR (+PR)
   http://www.flashrom.org/pipermail/flashrom/2012-June/009350.html
 - mark Eon EN25QH16 as TEST_OK_PR (+PR)
   http://www.flashrom.org/pipermail/flashrom/2012-July/009566.html
 - mark SST SST39VF010 as TEST_OK_PREW (+W)
   http://www.flashrom.org/pipermail/flashrom/2012-June/009425.html
 - mark ST M25P64 as TEST_OK_PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2012-May/009332.html

Tested chipset enables:
 - Intel 3420
   http://www.flashrom.org/pipermail/flashrom/2012-May/009332.html

 - Add board enable for ASUS P5GD2-X
   lspci: http://paste.flashrom.org/view.php?id=1234
   write: http://paste.flashrom.org/view.php?id=1240

Miscellaneous
 - Reorder some boards in print.c.
 - Remove broken abit URLs.
 - Whitespace changes.
 - Fix the maximum number of southbridge straps in the ICH descriptor structs.
 - Refine documentation regarding ICH region lock bits.
 - Demote verbosity of ICH Opcode reprogramming to -VV.
 - Exclude Pony-SPI for DOS targets (missing serial support).

Corresponding to flashrom svn r1554.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-07-28 03:17:15 +00:00
Helge Wagner
a0fce5f459 Intel 7 Series fixes (addition of QM77, fixed straps printing)
I looked at the datasheet to be sure that the strap names (SPI, PCI,
LPC) are the same as on the series 5 and 6 chipsets.

Corresponding to flashrom svn r1553.

Signed-off-by: Helge Wagner <Helge.Wagner@ge.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-07-24 16:33:55 +00:00
Carl-Daniel Hailfinger
4e3391f505 Always require the --programmer parameter if any flash chip access is requested
Fix a few man page oddities as well.

Corresponding to flashrom svn r1552.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-07-22 12:01:43 +00:00
Carl-Daniel Hailfinger
d6bb828b01 Automatically release I/O permissions on shutdown
Get_io_perms() is renamed to rget_io_perms() and automatically registers
a function to release I/O permissions on shutdown.

Actually release I/O permissions on Solaris and iopl()-supporting
operating systems like Linux.

This patch fixes quite a few programmers which forgot to release I/O
permissions on shutdown, and it simplifies the shutdown and error
handling code for all others.

Do not call exit(1) if I/O permissions are denied and return an error
instead. This part of the patch was written by Niklas Söderlund.

Corresponding to flashrom svn r1551.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Niklas Söderlund <niso@kth.se>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2012-07-21 17:27:08 +00:00
Carl-Daniel Hailfinger
0b9af36772 Document --output in the man page
Add an examples section to the man page.

Corresponding to flashrom svn r1550.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
2012-07-21 16:56:04 +00:00
Patrick Georgi
32508eb304 Hide hwaccess.h from public API
Move hwaccess.h #include from flash.h to individual drivers.
libflashrom users need flash.h, but they do not care about hwaccess.h
and should not see its definitions because they may conflict with
other hardware access functions and #defines used by the libflashrom
user.

Corresponding to flashrom svn r1549.

Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-07-20 20:35:14 +00:00
Carl-Daniel Hailfinger
3834c2d7e5 Check vendor_id for PCI based external programmers
Restructure PCI device detection code.
Rename pcidev_validate to pcidev_readbar.

Note: Slight changes in behaviour are possible, especially on dual/quad
chip NICs which appear as more than one PCI device. Found devices are no
longer printed at _pinfo level, but rather at _pdbg level.

Corresponding to flashrom svn r1548.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2012-07-16 21:32:19 +00:00
Joshua Roys
6e48a026f7 Add board enable for MSI K9N SLI (MS-7250 VER:2.1)
Handle PCI Device ID 0x0360 for MCP55 ISA bridge GPIO as well.

Tested-by: Stefan A. Scholtz

Corresponding to flashrom svn r1547.

Signed-off-by: Joshua Roys <roysjosh@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-06-29 23:07:14 +00:00
Nico Huber
a4b14f7de1 Add native SPI AAI write support to the Dediprog SF100 driver
To tell the programmer how to handle the data on the spi bus, a flag in
the fourth byte sent with the usb command is used. The second word was
mistaken for the size of the chunks sent over usb earlier. The third
byte (first of the second word) is now set to zero. This also adds some
checks for the size of data chunks sent over usb.

Corresponding to flashrom svn r1546.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-06-19 12:06:53 +00:00
Niklas Söderlund
9e42376c38 Remove exit() call from show_id
The only caller is able to check the return code and handle it
correctly.

Corresponding to flashrom svn r1545.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-06-16 00:11:16 +00:00
Nico Huber
4099a8a891 Add voltage change delays to dediprog driver
Some investigations have shown that the original dediprog driver waits
about 200ms after setting voltage up and before setting voltage down.
This patch adds those delays. It helps flash chips to come up in time.

Corresponding to flashrom svn r1544.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-06-16 00:02:27 +00:00
Nico Huber
7bca126561 Let the programmer driver decide how to do AAI transfers
Currently spi_aai_write() is implemented without an abstraction
mechanism for the programmer driver. This adds another function
pointer 'write_aai' to struct spi_programmer, which is set to
default_spi_write_aai (renamed spi_aai_write) for all programmers
for now.

A patch which utilises this abstraction in the dediprog driver will
follow.

Corresponding to flashrom svn r1543.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-06-15 22:28:12 +00:00
Ilya A. Volynets-Evenbakh
3464d05eb4 Fix setting the divisor in ft2232_spi
The patch that should have improved the clock divisor setting in r1537 made
it much worse: the divisor used was from an uninitialized buffer.

Corresponding to flashrom svn r1542.

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-06-14 13:08:33 +00:00
Carl-Daniel Hailfinger
316fdfbf82 Bus Pirate buffer management revamp
The buffer management of the Bus Pirate driver has been revamped to use
grow-only buffers with a reasonable initial default size so realloc()
will not have to be called in normal operation. A side effect is the
ability to switch to a static buffer without major hassle.
Handle OOM gracefully.

Corresponding to flashrom svn r1541.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Patrick Georgi <patrick@georgi-clan.de>
2012-06-08 15:27:47 +00:00
Carl-Daniel Hailfinger
1c15548888 Add logfile support
Usage: flashrom --output logfile.txt

Logfile output has at least dbg2 verbosity or screen verbosity,
whichever is greater.

Corresponding to flashrom svn r1540.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Tested on Linux, Windows and FreeBSD.
Acked-by: Idwer Vollering <vidwer@gmail.com>
2012-06-06 09:17:06 +00:00
Kyösti Mälkki
edab1d2bc0 Add support for PMC Pm39LV512
This flash is like PMC model Pm39LV010 but capacity is 64kB.
Model ID was already defined. PREW works for me.

Corresponding to flashrom svn r1539.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
2012-05-20 23:32:33 +00:00
Michael Karcher
27c8c6cbcb Remove sharplhf00l04.c
The currently unreferenced function in sharplhf00l04.c does a standard
FWH block protection reset (writes 0 to the protection register) and a
standard FWH block erase.

Corresponding to flashrom svn r1538.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-05-16 00:15:53 +00:00
Samir Ibradžić
b482c6d5c1 ft2232_spi.c: add frequency divisor parameter
This adds an optional argument when using the ft2232_spi programmer to set
the frequency divisor. The valid values for the divisor is any even integer
between 2 and 131072.

Corresponding to flashrom svn r1537.

Signed-off-by: Samir Ibradžić <sibradzic@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-05-15 22:58:19 +00:00
Carl-Daniel Hailfinger
901a3ba023 Convert printf to msg_* where appropriate
Clean up cli_output.c to be more readable.
Use enum instead of #define for message levels.
Kill a few exit(0) calls.
Print the command line arguments in verbose mode.
Move actions (--list-supported etc.) after argument sanity checks.
Reduce the number of code paths which have their own
programmer_shutdown().

Corresponding to flashrom svn r1536.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-05-14 22:54:58 +00:00
Stefan Tauner
2cef9164ef Add support for Eon EN25QH32
Its ID was spotted in an descriptor region update by Jetway:
http://paste.flashrom.org/view.php?id=1217

Corresponding to flashrom svn r1535.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-05-14 01:51:46 +00:00