1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-28 15:33:42 +02:00

280 Commits

Author SHA1 Message Date
Luc Verhaegen
90e8e61318 Add NForce2 chipset enable
While the other chipset enables for nvidia could potentially also work,
this one, by not touching other bits, seems like the safest solution.

Uwe tested this on his Asus A7N8X Deluxe, so hopefully the A7N8X-E
(reporter unknown) is now no longer an issue.

Corresponding to flashrom svn r548.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-26 09:48:28 +00:00
Uwe Hermann
e8ba538d03 A bunch of output beautifications and improvements, as well as doc fixes
- Update manpage, we now report supported boards via -L.
 
 - Add some missing escaping for '-' characters in the manpage.

Corresponding to flashrom svn r543.

 - Shorten some of the really long device names, so that -L output looks
   nicer.
   
 - Display a "table header" for all entries/columns in -L output.
 
 - Make -L output tabular for all lists for better readability.
 
 - Do not print "unknown XXXX SPI chip" entries in -L output.
 
 - And random other cosmetics...
 
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
2009-05-22 11:37:27 +00:00
Carl-Daniel Hailfinger
78185dcb3c Use accessor functions for MMIO
Some MMIO accesses used volatile, others didn't (and risked
non-execution of side effects) and even with volatile, some accesses
looked dubious.

Since the MMIO accessor functions and the onboard flash accessor
functions are functionally identical (but have different signatures),
make the flash accessors wrappers for the MMIO accessors.

For some of the conversions, I used Coccinelle. Semantic patch follows:

@@ typedef uint8_t; expression a; volatile uint8_t *b; @@ - b[a] + *(b
+ a) @@ expression a; volatile uint8_t *b; @@ - *(b) |= (a); + *(b) =
*(b) | (a); @@ expression a; volatile uint8_t *b; @@ - *(b) = (a); +
mmio_writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + mmio_readb(b) @@
type T; T b; @@ ( mmio_readb | mmio_writeb ) (..., - (T) - (b) + b )

Corresponding to flashrom svn r524.

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

Uwe tested read, write, erase with this patch on a random board to make
sure nothing breaks.

Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-17 15:49:24 +00:00
Uwe Hermann
05fab75d73 List all boards which are
- Supported out of the box (no flash enables required)

 - Verifiably not yet working (unknown flash enable)

Also, move some structs to flash.h in preparation for later wiki
output support.

Corresponding to flashrom svn r523.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-16 23:42:17 +00:00
Uwe Hermann
2cac6860c3 Drop unused/duplicated #includes and some dead code
Build-tested on 32bit x86.

Corresponding to flashrom svn r521.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-16 22:05:42 +00:00
Carl-Daniel Hailfinger
9862251f89 Uwe tested the recent SB600 SPI commit and notified me of one unexpected problem
It seems some boards do not use SPI_HOLD at all. Take that into account
when trying to figure out if SPI is available.

Print the SB600 ROM strap override register status for better debugging.

Corresponding to flashrom svn r516.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-15 23:36:23 +00:00
Carl-Daniel Hailfinger
dbfa02911f Create a SB600 SPI detection heuristic
I know that the data sheets say we can't read the ROM straps, but
creative interpretation of the data sheets yielded a heuristic which
should work pretty well.

NOTE: If you test this, make sure you power down and _unplug_ the
machine for a few minutes before you boot and run flashrom with this
patch.
If the machine is not unplugged for some time, the test will yield
incorrect results.
If you run a slightly older flashrom version than svn HEAD, the test
will yield incorrect results.
If you run any flashrom version (except svn HEAD plus this patch) after
poweron, the test will yield incorrect results.

Explanation:
Older flashrom versions unconditionally write to registers which are
used for this heuristic. These registers are in the S5 power domain, so
even powering down does not clear them, you really have to unplug the
machine and remove the battery if this is a laptop.

Corresponding to flashrom svn r491.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-05-10 14:11:07 +00:00
Uwe Hermann
4179d29207 Make chipset list alphabetically ordered as the other lists
Corresponding to flashrom svn r477.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-08 17:50:51 +00:00
Uwe Hermann
b003991173 Store and display chipset test status (not only chip status)
The list of tested chipsets is synced from the wiki.

Also, split the chipset vendor and name into two fields for easier
wiki-syntax output later.

Corresponding to flashrom svn r472.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-05-07 13:24:49 +00:00
Peter Stuge
19997aeb00 Clarify error message in enable_flash_sb600() a little
Corresponding to flashrom svn r469.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
2009-05-06 15:05:39 +00:00
Carl-Daniel Hailfinger
9bb88acc5e Revert r466 because of inverted logic
If unprotect succeeded, it will print "SB600 unprotect failed".

Corresponding to flashrom svn r467.

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-05-06 13:51:44 +00:00
Peter Stuge
a66ceba293 Cleanup redundant condition and clarify message a little
Corresponding to flashrom svn r466.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
2009-05-06 13:43:26 +00:00
Peter Stuge
7725fa8d63 Touch up some error messages in enable_flash_cs5536()
Corresponding to flashrom svn r465.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
2009-05-06 13:38:55 +00:00
Carl-Daniel Hailfinger
f6e3efb9c4 Clean up the SB400 chipset enable code
Use pci_dev_find() instead of setting up a filter and iterating over PCI
devices.

Corresponding to flashrom svn r464.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-05-06 00:35:31 +00:00
Carl-Daniel Hailfinger
41d6bd918f Rewrite the SB600 chipset enable function
- Check for read/write protected regions first.
- Region protection is write-once according to the data sheets. Check if
the write succeeded. Don't write if the region is not protected.
- Verbose region protection dumping.
- Improve readability of BAR mapping code.
- Align BAR mapping to a page boundary (4k) instead of a 16k boundary.

This patch prepares the code for a SPI detection heuristic.

Corresponding to flashrom svn r463.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Peter Stuge <peter@stuge.se>
2009-05-05 22:50:07 +00:00
Bertrand Jacquin
b452a913d6 Here is a fix for chipset_enable.c when there is not /dev/cpu
Open fails so there is no reason to lseek in. Actually this is a trivial
fix for a bad return value from open.

Corresponding to flashrom svn r462.

Signed-off-by: Bertrand Jacquin <beber@meleeweb.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
2009-05-05 21:08:36 +00:00
Zheng Bao
284a60065d Force enabling SPI mode for SB600 is a bad idea and leads to hangs
Only access LPC ROM if we boot via LPC ROM. Only access SPI ROM if we
boot via SPI ROM.
The code to force enable SPI is commented out in case someone wants to
reenable it for a particular board with LPC and SPI flash.

Corresponding to flashrom svn r459.

Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-05-04 22:33:50 +00:00
Uwe Hermann
7b2969be53 Some coding style and consistency fixes
Corresponding to flashrom svn r429 and coreboot v2 svn r4117.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-04-15 10:52:49 +00:00
Rudolf Marek
0c2029f862 Following patch fixes VIA SPI (VT8237S)
It needs to have opcodes initialized same way as ICH7.

Corresponding to flashrom svn r413 and coreboot v2 svn r3926.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Acked-by: Peter Stuge <peter@stuge.se>
2009-02-01 18:40:50 +00:00
Peter Stuge
20ed5d104c Add VT8237A PCI ID
Corresponding to flashrom svn r411 and coreboot v2 svn r3919.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
2009-01-26 15:29:27 +00:00
Stefan Reinauer
0593f21f10 Abstract mmap() in physmap.c and only open /dev/mem on the first physmap() call
Corresponding to flashrom svn r397 and coreboot v2 svn r3903.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
2009-01-26 01:10:48 +00:00
Peter Stuge
ccf8c6c794 Check all mmap() calls and print helpful Linux error message
Corresponding to flashrom svn r386 and coreboot v2 svn r3890.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
2009-01-23 05:23:06 +00:00
FENG yu ning
37179b807c Fix ICH9 locking register address and add important debug output
Corresponding to flashrom svn r384 and coreboot v2 svn r3869.

Signed-off-by: FENG yu ning <fengyuning1984@gmail.com>
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: FENG yu ning <fengyuning1984@gmail.com>
2009-01-18 06:39:32 +00:00
Sven Schnelle
b5d677b5e3 Add AMD-768 chipset support
Corresponding to flashrom svn r372 and coreboot v2 svn r3849.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-01-07 12:15:46 +00:00
Sven Schnelle
ed2352b3b6 Add i631x LPC support
Corresponding to flashrom svn r371 and coreboot v2 svn r3848.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-01-07 12:11:13 +00:00
Peter Stuge
e8a3e4c209 Initialize ICH SPI opcodes also for ICH9 and later
Corresponding to flashrom svn r368 and coreboot v2 svn r3830.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
2008-12-22 14:12:08 +00:00
FENG yu ning
f041e9b586 Various ichspi.c refinements
* add a generic preop-opcode-pair table.

* rename ich_check_opcodes to ich_init_opcodes.

* let ich_init_opcodes do not need to access flashchip structure:
  . move the definition of struct preop_opcode_pair to a better place
  . remove preop_opcode_pairs from 'struct flashchip'
  . modify ich_init_opcodes and generate_opcodes so that they do not access the flashchip structure

* call ich_init_opcodes during chipset enable. Now OPCODES generation mechanism works.

* fix a coding style mistake.

Corresponding to flashrom svn r367 and coreboot v2 svn r3814.

Signed-off-by: FENG yu ning <fengyuning1984@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>
2008-12-15 02:32:11 +00:00
FENG yu ning
c05a295dc3 Generates OPCODES struct from the ICH7/ICH9/VIA chipset if its SPI configuration is locked down
Corresponding to flashrom svn r364 and coreboot v2 svn r3805.

Signed-off-by: FENG yu ning <fengyuning1984@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2008-12-08 18:16:58 +00:00
Niels Ole Salscheider
f63c0dcba9 Add AMD SB700 flash enable
This patch adds SB700 support to flashrom. The code for enabling the flash
rom is the same as for SB600. It was tested (read, write, verify) with an
ASUS M3A-H/HDMI which contains a Macronix MX25L8005.

Corresponding to flashrom svn r361 and coreboot v2 svn r3799.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Acked-by: Peter Stuge <peter@stuge.se>
2008-12-05 11:58:43 +00:00
Stefan Reinauer
9a6d1764a2 Replace #ifdefs for sc520 systems by run time probing
Fixes #109

Corresponding to flashrom svn r355 and coreboot v2 svn r3790.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-12-03 21:24:40 +00:00
Jason Wang
a3f04be761 Add support for the AMD/ATI SB600 southbridge SPI functionality
This has been tested by Uwe Hermann on an RS690/SB600 board.

Corresponding to flashrom svn r351 and coreboot v2 svn r3779.

Signed-off-by: Jason Wang <Qingpei.Wang@amd.com>
Reviewed-by: Joe Bao <zheng.bao@amd.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2008-11-28 21:36:51 +00:00
Carl-Daniel Hailfinger
d3b0e39f4c Dump ICH8/ICH9/ICH10 SPI registers
This helps a lot if we have to track down configuration weirdnesses.

Corresponding to flashrom svn r338 and coreboot v2 svn r3723.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2008-11-03 00:20:22 +00:00
Ed Swierk
b759db2cb5 Enable SPI boot flash support on EP80579, which has the ICH7 register set
Corresponding to flashrom svn r332 and coreboot v2 svn r3706.

Signed-off-by: Ed Swierk <eswierk@aristanetworks.com>
Acked-by: Ed Swierk <eswierk@aristanetworks.com>
2008-10-29 14:54:36 +00:00
Uwe Hermann
c556d32000 Add support for the Intel 82371MX (MPIIX) southbridge
Untested, but should work just as well as the other *PIIX* southbridges
according to the datasheets.

Corresponding to flashrom svn r330 and coreboot v2 svn r3696.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2008-10-28 11:50:05 +00:00
Uwe Hermann
8720345d07 Add support for the Intel 82371FB PIIX and 82371SB (PIIX3) southbridges
Tested on PIIX3 hardware.

Corresponding to flashrom svn r329 and coreboot v2 svn r3694.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Corey Osgood <corey.osgood@gmail.com>
2008-10-26 18:40:42 +00:00
Uwe Hermann
190f8497d7 Add support for the VIA VT82C586A/B chipset, improve documentation
Corresponding to flashrom svn r328 and coreboot v2 svn r3693.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-10-25 18:03:50 +00:00
Uwe Hermann
394131ef14 Coding-style fixes for flashrom, partly indent-aided
Corresponding to flashrom svn r326 and coreboot v2 svn r3669.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2008-10-18 21:14:13 +00:00
Urja Rannikko
a88daa731d Allow the SiS 620 chipset to detect and read at least 256kb chips
Based on the 5595 datasheet and uniflash 1.40 sources, only looking for info
about SiS620.

Corresponding to flashrom svn r325 and coreboot v2 svn r3668.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>
2008-10-18 13:54:30 +00:00
Marc Jones
3af487d419 SB600 has four write once LPC ROM protect areas
It is not possible to write enable that area once the register is set so
print a warning.

Corresponding to flashrom svn r324 and coreboot v2 svn r3659.

Signed-off-by: Marc Jones <marcj.jones@amd.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-10-15 17:50:29 +00:00
Carl-Daniel Hailfinger
28ec74b229 Add ICH10 support
The ICH9 and ICH10 data sheets are identical regarding FWH/SPI flash
interfaces, so this just adds the required PCI IDs.

Corresponding to flashrom svn r323 and coreboot v2 svn r3648.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Peter Stuge <peter@stuge.se>
2008-10-10 20:54:41 +00:00
Ed Swierk
cd2ed475ad Recognize the Intel EP80579 LPC flash interface
Corresponding to flashrom svn r310 and coreboot v2 svn r3532.

Signed-off-by: Ed Swierk <eswierk@arastra.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-08-20 20:31:41 +00:00
Stefan Reinauer
7f27464c8a Adding support for flashing system with Nvidia MCP67
Corresponding to flashrom svn r298 and coreboot v2 svn r3414.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2008-07-05 09:48:30 +00:00
Stefan Reinauer
2cb94e183b First attempt to clean up SPI probing and create a common construct: the flash bus
At some point the flash bus will be part of struct flashchip.

Pardon me for pushing this in, but I think it is important to beware of further
decay and it will improve things for other developers in the short run.

Carl-Daniel, I will consider your suggestions in another patch. I want to keep
things from getting too much for now. The patch includes Rudolf's VIA SPI
changes though.

Corresponding to flashrom svn r285 and coreboot v2 svn r3401.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-06-30 23:45:22 +00:00
Rudolf Marek
3fdbccf697 This patch adds support for VIA SPI controller on VT8237S
It is similar with few documented exceptions to ICH7 SPI controller.

Corresponding to flashrom svn r282 and coreboot v2 svn r3398.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Acked-by: Peter Stuge <peter@stuge.se>
2008-06-30 21:38:30 +00:00
Peter Stuge
7e2c079367 Fix ICH7 non-SPI that broke in r3393
r3393 assumed that ICH7 always used SPI. This patch resets ich7_detected back
to 0 when BOOT BIOS Straps indicate something else than SPI.

Also fixes a build error in ichspi.c with gcc 4.2.2.

Corresponding to flashrom svn r280 and coreboot v2 svn r3395.

Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-06-29 01:30:41 +00:00
Stefan Reinauer
a9424d597d Multiple unrelated changes
* ICH7 SPI support
* fix some variable names in ichspi.c (Offset -> offset)
* Dump ICH7 SPI bar with -V
* Improve error message in case IOPL goes wrong. (It might not even be an IOPL)

Corresponding to flashrom svn r278 and coreboot v2 svn r3393.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Peter Stuge <peter@stuge.se>
2008-06-27 16:28:34 +00:00
Uwe Hermann
793bdcd71e A bunch of cosmetic improvements
- Fix typos and inconsistencies.
 - Drop duplicate line which tells us the chip name twice.
 - Also print the chip vendor, not only the name.

Corresponding to flashrom svn r249 and coreboot v2 svn r3348.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2008-05-22 22:47:04 +00:00
Andriy Gapon
65c1b86fe7 Changes to make flashrom compile (and work) on FreeBSD
This patch addresses different argument order of outX() calls,
FreeBSD-specific headers, difference in certain type names and system
interface names, and also FreeBSD-specific way of gaining IO port
access.

Corresponding to flashrom svn r245 and coreboot v2 svn r3344.

Signed-off-by: Andriy Gapon <avg@icyb.net.ua>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-05-22 13:22:45 +00:00
Carl-Daniel Hailfinger
1b18b3c076 ICH8 and ICH9 have an almost identical SPI interface, only the location of the SPIBAR differs
Add ICH8 support to the ICH9 code.

Corresponding to flashrom svn r241 and coreboot v2 svn r3327.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2008-05-16 14:39:39 +00:00
Dominik Geyer
b46acba6e0 Add support for SPI chips on ICH9
This is done by using the generic SPI interface.

Corresponding to flashrom svn r239 and coreboot v2 svn r3325.

Signed-off-by: Dominik Geyer <dominik.geyer@kontron.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2008-05-16 12:55:55 +00:00