1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +02:00

189 Commits

Author SHA1 Message Date
Carl-Daniel Hailfinger
2f43616873 Add Nvidia nForce MCP61/MCP65/MCP67/MCP78S/MCP73/MCP79 SPI flashing support
Huge thanks go to Michael Karcher for reverse engineering the interface
and to Johannes Sjölund for testing the first iterations of my patch on
his hardware until it worked.

Thanks to the following testers of the patch:
* MCP61, 10de:03e0, LPC OK, ECS Geforce6100SM-M, Andrew Cleveland
* MCP61, 10de:03e0, LPC OK, Biostar NF520-A2 NF61D-A2, Vitaliy Buchynskyy
* MCP65, 10de:0441, SPI OK, MSI MS-7369 K9N Neo-F v2, Kjell Braden
* MCP65, 10de:0441, SPI OK, MSI MS-7369, Wolfgang Schnitker
* MCP65, 10de:0441, SPI OK, MSI MS-7369, Johannes Sjölund
* MCP65, 10de:0441, SPI OK, MSI MS-7369, Melchior Franz
* MCP78S, 10de:075c, SPI OK, Asus M3N78 PRO, Brad Rogers
* MCP78S, 10de:075c, SPI OK, Asus M3N78-VM, Marcel Partap
* MCP78S, 10de:075c, SPI OK, Asus M4N78 PRO, Kimmo Vuorinen
* MCP78S, 10de:075c, SPI OK, Asus M4N78 PRO, Vikram Ambrose
* MCP79, 10de:0aad, SPI OK, Acer Aspire R3600, Andrew Morgan
* MCP79, 10de:0aae, LPC ??, Lenovo Ideapad S12 laptop, Christian Schmitt
* MCP79, 10de:0aae, SPI OK, Apple iMac9,1 Mac-F2218EA9, David "dledson"

flashrom will refuse to write/erase for safety reasons if MCP6x/MCP7x
SPI is detected.

Corresponding to flashrom svn r1113.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2010-07-28 15:08:35 +00:00
Carl-Daniel Hailfinger
5b997c3ed6 Split off programmer.h from flash.h
Programmer specific functions are of absolutely no interest to any file
except those dealing with programmer specific actions (special SPI
commands and the generic core).

The new header structure is as follows (and yes, improvements are
possible):
flashchips.h  flash chip IDs
chipdrivers.h  chip-specific read/write/... functions
flash.h  common header for all stuff that doesn't fit elsewhere
hwaccess.h hardware access functions
programmer.h  programmer specific functions
coreboot_tables.h  header from coreboot, internal programmer only
spi.h SPI command definitions

Corresponding to flashrom svn r1112.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2010-07-27 22:41:39 +00:00
Carl-Daniel Hailfinger
1d3a2fefbc Convert MMIO accesses of non-internal PCI-based programmers to be endian-agnostic
Convert all PCI-based external programmers to use special little-endian
accessors for all MMIO regions of PCI devices. This patch does _not_
touch the internal programmer (which is PCI-based as well).

Huge thanks go to Misha Manulis who worked with me to create a first
version of this patch for the satasii programmer based on modification
of generic code.

Huge thanks also go to Segher Boessenkool for suggesting the pci_mmio_
prefix for the abstraction layer.

NOTE to package maintainers: With this patch, compilation and usage of
flashrom should be safe on x86, x86_64, MIPS (little and big endian) and
PowerPC (big endian).

The internal programmer is disabled on non-x86/x86_64 (but it
compiles). The atahpt, nic3com, nicnatsemi, nicrealtek and rayer_spi
can not be compiled on non-x86/x86_64 because port space I/O is
not (yet) supported. Please compile with default settings on
x86/x86_64 and with the following settings on all other architectures:
make CONFIG_NIC3COM=no CONFIG_NICREALTEK=no CONFIG_NICNATSEMI=no
CONFIG_RAYER_SPI=no

Corresponding to flashrom svn r1111.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Misha Manulis <misha@manulis.com>
2010-07-27 22:03:46 +00:00
Michael Karcher
b05b9e100a Move SB600 SPI initialization to sb600spi.c
Corresponding to flashrom svn r1099.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-07-22 18:04:19 +00:00
Michael Karcher
a4448d9aec Move Intel SPI initialisation to ichspi.c
Smarter version could decide whether SPI is vital or not depending on
straps. Straps are currently implemented for ICH7. EP80579 is in the comment,
PCH of 5 Series/3400 Series has "LPC, reserved, PCI, SPI".

Corresponding to flashrom svn r1098.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-07-22 18:04:15 +00:00
Carl-Daniel Hailfinger
ab922779e3 Fix out-of-bounds ICH FREG permission printing
A bit was masked, but not shifted, and that led to worst-case accesses
of index 24 in an array with 4 members.

I've improved readability in the variable declaration block as well.

Thanks to Stephen Kou for reporting the bug.

Corresponding to flashrom svn r1076.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stephen Kou <stephen@hyarros.com>
2010-07-13 00:04:52 +00:00
Carl-Daniel Hailfinger
2b6dcb36c4 Unify programmer parameter extraction
Make programmer_param static by converting all users to extract_programmer_param.
Programmer parameters can no longer be separated with a
colon, they have to be separated with a comma.

Corresponding to flashrom svn r1072.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2010-07-08 10:13:37 +00:00
Carl-Daniel Hailfinger
744132af4b Various places in the flashrom source feature custom parameter extraction from programmer_param
This led to wildly differing syntax for programmer parameters, and
it also voids pretty much every assumption you could make about
programmer_param. The latter is a problem for libflashrom.

Use extract_param everywhere, clean up related code and make it more
foolproof. Add two instances of exit(1) where we have no option to
return an error. Remove six instances of exit(1) where returning an
error was possible.

WARNING: This changes programmer parameter syntax for a few programmers!

Corresponding to flashrom svn r1070.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2010-07-06 09:55:48 +00:00
Carl-Daniel Hailfinger
ad3cc55e13 Kill global variables, constants and functions if local scope suffices
Constify variables where possible.
Initialize programmer-related variables explicitly in programmer_init to
allow running programmer_init from a clean state after
programmer_shutdown.
Prohibit registering programmer shutdown functions before init or after
shutdown.
Kill some dead code.
Rename global variables with namespace-polluting names.
Use a previously unused locking helper function in sst49lfxxxc.c.

This is needed for libflashrom.

Effects on the binary size of flashrom are minimal (300 bytes
shrinkage), but the data section shrinks by 4384 bytes, and that's a
good thing if flashrom is operating in constrained envionments.

Corresponding to flashrom svn r1068.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2010-07-03 11:02:10 +00:00
Joshua Roys
f93b36a6bc ICH9/10: display FRAP/FREGx access controls
Corresponding to flashrom svn r1066.

Signed-off-by: Joshua Roys <roysjosh@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-07-01 17:45:54 +00:00
Carl-Daniel Hailfinger
dcef67e468 Kill unneeded #include wherever possible
Tested on Linux, FreeBSD, NetBSD, OpenBSD, DOS.
Thanks to Jonathan A. Kollasch and Idwer Vollering for testing.

Corresponding to flashrom svn r1057.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Idwer Vollering <vidwer+lists.flashrom@gmail.com>
2010-06-21 23:20:15 +00:00
Carl-Daniel Hailfinger
7f9922dcd7 Fill in buses_supported for remaining Intel chipsets (ICH0-ICH5, Poulsbo)
Corresponding to flashrom svn r1055.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Sean Nelson <audiohacked@gmail.com>
2010-06-20 11:04:26 +00:00
Michael Karcher
89bed6d836 VIA: disable byte merging
All mentioned north bridges have been checked against data sheet. That's
all north bridges google found a datasheet for with "byte merge" included.

Runs multiple chipset enables if the first one requests further enables to
be run.

VIA byte-merging logic tested: works.
multiple chipset logic: completely untested

Corresponding to flashrom svn r1043.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-06-13 10:16:12 +00:00
Michael Karcher
5f31ebe244 Board-enable for MS-7025 (K8N Neo2 Platinum)
Test report is
http://www.coreboot.org/pipermail/flashrom/2010-April/002967.html

Corresponding to flashrom svn r1041.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Tested-by: Valentine "Pegasus rider" Yatsenko <mr.qweo@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-06-12 23:07:26 +00:00
Carl-Daniel Hailfinger
831e8f4abb Remove unneeded #include statements completely
Unistd.h was only used to get a definition of NULL in all files. Add our
own NULL #define and remove unistd.h from flash.h
stdio.h has no place in flash.h, it should be included only in files
which really need it.
Add #include statements in individual .c files where needed.

Replace a few printf with msg_* to eliminate the need for stdio.h.

Corresponding to flashrom svn r1021.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2010-05-30 22:24:40 +00:00
Carl-Daniel Hailfinger
80f3d05e73 ichspi: try harder to conform to address restrictions
ICH SPI can enforce address restrictions for all accesses which take an
address (well, it could if the chipset implementation was not broken).
Since exploiting the broken implementation is harder than conforming
to the address restrictions wherever possible, conform to the address
restrictions instead. This patch eliminates a lot of transaction errors
people were seeing on chip probe.

Corresponding to flashrom svn r1016.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2010-05-28 15:53:08 +00:00
Carl-Daniel Hailfinger
cceafa2ad0 Handle the following architectures in generic flashrom code
- x86/x86_64 (little endian)
- PowerPC (big endian)
- MIPS (big+little endian)

No changes to programmer specific code. This means any drivers with MMIO
access will _not_ suddenly start working on big endian systems, but with
this patch everything is in place to fix them.

Compilation should work on all architectures listed above for all
drivers except nic3com and nicrealtek which require PCI Port IO which is
x86-only for now.

To compile without nic3com and nicrealtek, run
make distclean
make CONFIG_NIC3COM=no CONFIG_NICREALTEK=no

Thanks to Misha Manulis for testing early versions of this patch on
PowerPC (big endian) with the satasii programmer.
Thanks to Segher Boessenkool for design review and for helping out with
compiler tricks and pointing out that we need eieio on PowerPC.
Thanks to Vladimir Serbinenko for compile testing on MIPS (little
endian) and PowerPC (big endian) and for runtime testing on MIPS (little
endian).
Thanks to David Daney for compile testing on MIPS (big endian).
Thanks to Uwe Hermann for compile and runtime testing on x86_64.

DO NOT RUN flashrom ON NON-X86 AFTER APPLYING THIS PATCH!
This patch only provides the infrastructure, but does not convert any
drivers, so flashrom will compile, but it won't do the right thing on
non-x86 platforms.

Corresponding to flashrom svn r1013.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Misha Manulis <misha@manulis.com>
Acked-by: Vladimir 'phcoder/φ-coder' Serbinenko <phcoder@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
2010-05-26 01:45:41 +00:00
Carl-Daniel Hailfinger
f469c271ac Print found PCI IDs during chipset detection
Add debug output of the exact matched chipset PCI ID to keep track of
tested PCI IDs for chipsets with one name and multiple IDs. This will
help avoid problems similar to the Tyan S2915 OEM undetected flash in
the future.

Corresponding to flashrom svn r1008.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2010-05-22 07:31:50 +00:00
Carl-Daniel Hailfinger
33d7b6aa89 Disable probing for one variant of MCP55 to enable Tyan S2915
Fix Tyan S2915 OEM board by commenting out MCP55 LPC bridge PCI ID
10de:0361 which is the secondary LPC bridge.

The same effect could be achieved by refusing to run enable_flash_mcp55
if the device class is not ISA bridge [0601].

Thanks to Alessandro Polverini, Joel Robertson, Nicolas Aveline, Phil
LoCascio and Nils-Helge Garli Hegvik for testing flashrom on hardware
and Michael Karcher for analyzing the factory BIOS for clues. In the
end, no board enable was needed and it was a pure chipset issue.

Corresponding to flashrom svn r1007.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2010-05-22 07:27:16 +00:00
Sean Nelson
316a29f33f Convert various prints to use msg_p* and msg_g* respectively
Convert programmer print messages to msg_p* convert general print messages to msg_g* a few fixes as suggested by Carl-Daniel.

Corresponding to flashrom svn r997.

Signed-off-by: Sean Nelson <audiohacked@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-05-07 20:09:04 +00:00
Michael Karcher
cfa674fde7 Rename identifiers called 'byte'
Still fallout of adding "-Wshadow". Missed the ht1000 one
(chipset_enable is not compied on Windows where we had the collision
with "byte" last time) and the other occurrence is newly introduced.
Old libpci defines a global symbol called "byte" too.

Corresponding to flashrom svn r913.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-02-25 11:38:23 +00:00
Carl-Daniel Hailfinger
ce5fad038d Refactor MCP SPI detection
- Set supported buses based on ISA bridge reg 0x8a
- Use MCP55 chipset enable only if LPC is detected
- Allow LPC on MCP61
- Eliminate duplicated code where possible

Corresponding to flashrom svn r906.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2010-02-18 12:24:38 +00:00
Carl-Daniel Hailfinger
ea3b1b4db2 Add SPI mode diagnostics for all post-MCP55 (nForce 5) chipsets from Nvidia
Huge thanks to Michael Karcher for reverse engineering the MCP67 chipset
and writing a spec. Due to this, we were able to use the chinese wall
technique for 100% clean room reverse engineering.

This patch doesn't touch any of the new registers, it only reads them.
Assuming that read has no side effects, this patch is a no-op and safe.

We need "flashrom -V" output from all post-MCP55 (nForce 5) chipset
boards. Please indicate if your board uses SPI flash or LPC flash (if
you know it). Note: That output is only helpful if it is created with
patched flashrom and if is from the first run of flashrom after a cold
boot (reset or Ctrl-Alt-Del is not sufficient). There is a pattern based
on which we can probably detect which flash type is present on the
board.

Thanks to Alessandro Polverini for testing earlier iterations of this
patch.

Note: The MCP67 should work. I guessed that the other recent Nvidia
chipsets would work in a similar way, and created a simplified
do-nothing catchall chipset enable function which dumps some info and
instructs the user to send more info.

Corresponding to flashrom svn r902.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
2010-02-13 23:41:01 +00:00
David Hendricks
db7c153cdd Add Intel NM10 chipset enable
Public chipset documentation available at
http://www.intel.com/Assets/PDF/datasheet/322896.pdf

Tested on NM10-based customer reference board from Intel.

Corresponding to flashrom svn r866.

Signed-off-by: David Hendricks <dhendrix@google.com>
Acked-by: Sean Nelson <audiohacked@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-01-19 02:19:27 +00:00
Michael Karcher
4e2fb0ee3e Don't use "byte" as identifier
Some mingw declares a global identifier "byte", causing -Werror -Wshadow
to break compilation. This patch renames all identifiers called "byte".

Corresponding to flashrom svn r861.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-01-12 23:29:26 +00:00
Luc Verhaegen
9cce2f5365 Chipset: Fix sis5x0 register write verification
Also remove separate sis 5596 routine: superio code will be handled
separately, which then turns this routine into the sis 5511 chipset
enable.

Corresponding to flashrom svn r859.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-01-10 15:01:08 +00:00
Michael Karcher
9678539b79 Fix Intel FWH decode size
Fixes wrong detection of area decoded to the FWH interfaces.

Corresponding to flashrom svn r826.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2010-01-03 15:09:17 +00:00
Raúl Soriano
cd8404dd9d Add VIA VT8233A identification, mark as tested
Corresponding to flashrom svn r820.

Signed-off-by: Raúl Soriano <GatoLoko@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-12-23 21:29:18 +00:00
Luc Verhaegen
73d2119473 Chipset/Board: vt8237: Set All mem cycles to LPC in chipset enable
Only done for VT8237R (possibly needed for VT8237 too), VT8235 does
not need this (even if the original bios does so: Asus A7V8X-MX SE,
MSI KT4V were verified).

This then opens a floodgate of cleanups in the board enables.
* EPIA SP board enable vanishes, taking EPIA CN match with it.
* Asus A7V8X-MX/Tyan S2498 board enable then equals
  w836xx_memw_enable_2e
* AOpen vKM400Am-S board enable then equals it8705_rom_write_enable
* Epia M board enable becomes via_vt823x_gpio15_raise
* Epia N board enable becomes via_vt823x_gpio9_raise
* Asus M2V-MX board enable becomes via_vt823x_gpio5_raise
* vt823x_gpio_set becomes via_vt823x_gpio_set, and now detects ISA
  bridge itself, in concordance with intel ich and nvidia mcp gpio.

Corresponding to flashrom svn r815.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Sean Nelson <audiohacked@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-12-23 00:54:26 +00:00
Adam Jurkowski
e4984102e9 Chipset: Add support for Intel Poulsbo chipset
Corresponding to flashrom svn r809.

Signed-off-by: Adam Jurkowski <adam.jurkowski@kontron.pl>
Acked-by: Luc Verhaegen <libv@skynet.be>
2009-12-21 15:30:46 +00:00
Carl-Daniel Hailfinger
2a9e2455cd Use the maximum decode size infrastructure
- Detect max FWH size for Intel
  631xESB/632xESB/3100/ICH6/ICH7/ICH8/ICH9/ICH10.
- Move IDSEL override before decode size checking for the chipsets
  listed above or flashrom will complain based on old values.
- Adjust supported flash buses for the chipsets listed above (none of
  them supports LPC or Parallel).
- Detect max parallel size for AMD/National Semiconductor CS5530.
- Adjust supported flash buses for CS5530/CS5530A.
- Set board-specific max decode size for Elitegroup K7VTA3.
- Set board-specific max decode size for Shuttle AK38N.

Corresponding to flashrom svn r806.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-12-17 15:20:01 +00:00
Carl-Daniel Hailfinger
66ef4e5ff3 Internal (onboard) programming was the only feature which could not be disabled
Make various pieces of code conditional on support for internal
programming. Code shared between PCI device programmers and onboard
programming is now conditional as well.

It is now possible to build only with dummy support:
make CONFIG_INTERNAL=no CONFIG_NIC3COM=no CONFIG_SATASII=no
CONFIG_DRKAISER=no CONFIG_SERPROG=no CONFIG_FT2232SPI=no

This allows building for a specific use case only, and it also
facilitates porting to a new architecture because it is possible to
focus on highlevel code only.

Note: Either internal or dummy programmer needs to be compiled in due to
the current behaviour of always picking a default programmer if -p is
not specified. Picking an arbitrary external programmer as default  
wouldn't make sense.

Build and runtime tested in all 1024 possible build combinations. The
only failures are by design as mentioned above.

Corresponding to flashrom svn r797.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Sean Nelson <audiohacked@gmail.com>
2009-12-13 22:28:00 +00:00
Luc Verhaegen
9892ca6b94 Chipset: remove sis630 chipset enable for sis540
SiS630 chipset enable is equal to sis540 plus superio "poking".

Superio poking equals IT8705F flash write enable, which is currently
dealt with on a board by board basis in board_enable.c. Not all
630 and newer based boards come with it8705/sis950 superios.

Corresponding to flashrom svn r794.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Sean Nelson <audiohacked@gmail.com>
2009-12-09 07:43:13 +00:00
Maciej Pijanka
a661e15d52 Intel PIIX* chipsets only support parallel flash (no LPC/FWH/SPI)
Corresponding to flashrom svn r793.

Signed-off-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-12-08 17:26:24 +00:00
Carl-Daniel Hailfinger
797a8346cf Add support for Intel 3400 series / 5 series chipset
Found in Intel document 322170 (Intel 5 Series Chipset and Intel 3400
Series Chipset Specification Update).
According to http://pciids.sourceforge.net/ we probably should match all
IDs from 0x3b00-0x3b1f, but so far I didn't find an Intel doc saying the
same.
If anybody has contacts at Intel and can check, I'd be happy to add the
rest of the IDs.

Corresponding to flashrom svn r784.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Sean Nelson <audiohacked@gmail.com>
2009-11-26 16:51:39 +00:00
Carl-Daniel Hailfinger
6a0269e491 Mark Elitegroup K7S5A as supported
Mark SiS 735 as supported.

Remove "SiS" from the model number to avoid printing it twice.

Reported by Adrian Glaubitz.

Corresponding to flashrom svn r760.

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>
2009-11-15 17:20:21 +00:00
Carl-Daniel Hailfinger
9f46cfca38 Add support for every single SiS chipset out there
The two existing SiS chipset enables (compared to the 28 in this patch)
were refactored, and one of them was fixed.

A function to match PCI vendor/class combinations was added to generic
code.

Tested on the "Elitegroup K7S5A". Results are somewhat unexpected (some
PCI settings seem to be inaccessible, but it still works).

This is not based on any docs, but rather on detailed analysis
of existing opensource code for some of the chipsets.

Thanks to for Adrian Glaubitz testing.

Corresponding to flashrom svn r759.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
2009-11-15 17:13:29 +00:00
Carl-Daniel Hailfinger
115d390f1f Add infrastructure to check the maximum supported flash size of chipsets and mainboards
The rationale is to warn users when they, for example, try to flash
a 512KB parallel flash chip but their chipset only supports 256KB,
or they try to flash 512KB and the chipset _does_ theoretically
support 512KB but their special board doesn't wire all address lines
and thus supports only 256 KB ROM chips at maximum.

This has cost Uwe hours of debugging on some board already, until he
figured out what was going on. We should try warn our users where
possible about this.

The chipset and the chip may have more than one bus in common (e.g.
SB600 and Pm49* can both speak LPC+FWH) and on SB600/SB7x0/SB8x0 there
are different limits for LPC and FWH. The only way to tell the user
about the exact circumstances is to spew error messages per bus.

The code will issue a warning during probe (which does fail for some
chips if the size is too big) and abort before the first real
read/write/erase action. If no action is specified, the warning is
printed anyway.
That way, a user can find out why probe might not have worked, and will
be stopped before he/she gets incorrect results.

Add a bitcount function to the infrastructure.

Corresponding to flashrom svn r755.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-10-31 01:53:09 +00:00
Luc Verhaegen
aad7e67004 Mark NVIDIA Nforce4/MCP04 as tested
Oops.

Corresponding to flashrom svn r747.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Luc Verhaegen <libv@skynet.be>
2009-10-06 11:32:21 +00:00
Luc Verhaegen
cd00e88587 Chipset support for the nVidia nForce 4
Add pciids for the new isa bridge, and hook it to the nforce2
chipset enable.

Corresponding to flashrom svn r744.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Martin Szulecki <opensuse@sukimashita.com>
2009-10-05 16:04:47 +00:00
Uwe Hermann
3e0774dcfe Add chipset support for VIA VT82C596 by adding a PCI ID
This is successfully tested by me on the Elitegroup P6VAP-A+ board.

Corresponding to flashrom svn r732.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-09-25 01:05:06 +00:00
Nils Jacobs
e715c7b42c Enable flashrom on Wyse Winterm S50
On the Wyse Winterm S50 lspci doesn`t show the cs5536 hostbridge and so 
flashrom doesn`t detect the cs5536.

This patch is adding the cs5536 isa id [1022:2090] for chip detect.

Corresponding to flashrom svn r729.

Signed-off-by: Nils Jacobs <njacobs8@hetnet.nl>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-09-23 02:09:23 +00:00
Carl-Daniel Hailfinger
174962dd29 Use correct name for SB700/SB710/SB750 instead of calling them SB700
Corresponding to flashrom svn r706.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Luc Verhaegen <libv@skynet.be>
2009-09-01 22:13:42 +00:00
Carl-Daniel Hailfinger
95baaadee5 Add support for ICH9 engineering sample
Anne Le Coq <annyvonne.le_coq@alcatel-lucent.fr> reported that flashrom
didn't recognize her ICH9 LPC controller on the Green City Intel
Customer Reference Board with ICH9 + Tylersburg Chipset. According to
http://pci-ids.ucw.cz/read/PC/8086/2910 the ID 0x8086/0x2910 was used
for engineering samples. No intel doc mentions this ID at all.

Corresponding to flashrom svn r696.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Anne Le Coq <annyvonne.le_coq@alcatel-lucent.fr>
2009-08-21 17:26:13 +00:00
Carl-Daniel Hailfinger
4449868623 Allow the user to override FWH IDSEL on ICH6 and later
Usage:
flashrom -p internal=fwh_idsel=0

Corresponding to flashrom svn r685.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Log:
flashrom v0.9.0-r670
coreboot table found at 0xcf7f3c00.
Vendor ID: KONTRON, part ID: 986LCD-M
Found chipset "Intel ICH7/ICH7R", enabling flash write...
Setting IDSEL=0 for top 8 MBOK.
This chipset supports the following protocols: LPC,FWH.
Disabling flash write protection for board "Kontron 986LCD-M"... OK.
Calibrating delay loop... OK.
Found chip "SST SST49LF016C" (2048 KB, FWH) at physical address
0xffe00000.
No operations were specified.

Acked-by: Chris Kinney <cmkinne@sandia.gov>
2009-08-13 23:23:37 +00:00
Stefan Reinauer
8fa64816ae Fix up MSR handling to support more OSes than Linux.
Corresponding to flashrom svn r677.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-08-12 09:27:45 +00:00
Stefan Reinauer
630c79d494 Make debug messages printf_debug().
Corresponding to flashrom svn r676.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-08-11 12:15:39 +00:00
Carl-Daniel Hailfinger
4c7ea38581 Add ICH6,ICH7,ICH8,ICH9,ICH10 FWH IDSEL settings and flash decode settings to the debug output
This can help debug cases where the BIOS does not set up a correct flash
decode for the given flash size. The Intel docs state that the decode
applies to FWH and SPI flash.

Corresponding to flashrom svn r675.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Chris Kinney <cmkinne@sandia.gov>
2009-08-10 23:30:45 +00:00
Carl-Daniel Hailfinger
be726817f7 Remove unnecessary #include files
Serprog compilation is now controlled by a Makefile variable.
Replace munmap with physunmap where appropriate.

Corresponding to flashrom svn r671.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-08-09 12:44:08 +00:00
Carl-Daniel Hailfinger
f8555e24a4 This is a workaround for a bug in SB600 and SB700
If we only send an opcode and no additional data/address, the SPI
controller will read one byte too few from the chip. Basically, the
last byte of the chip response is discarded and will not end up in the
FIFO. It is unclear if the CS# line is set high too early as well. That
hardware bug is undocumented as of now, but I'm working with AMD to add
a detailed description of it to the errata.

Add loads of additional debugging to SB600/SB700 init.

Add explanatory comments for unintuitive code flow.

Thanks go to Uwe for testing quite a few iterations of the patch.

Kill the SB600 flash chip status register special case, which was a
somewhat misguided workaround for that hardware erratum.

Note for future added features in the SB600 SPI driver: It may be
possible to read up to 15 bytes of command response with overlapping
reads due to the ring buffer design of the FIFO if the command can be
repeated without ill effects. Same for skipping up to 7 bytes between
command and response.

Corresponding to flashrom svn r661.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-07-23 01:36:08 +00:00