1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

60 Commits

Author SHA1 Message Date
Uwe Hermann
04aa59a864 Standardize on using __func__ instead of __FUNCTION__
The __func__ variant is standardized in C99 and recommended to be
used instead of __FUNCTION__ in the gcc info page.

Only _very_ old versions of gcc did not know about __func__, but we've
been using both __func__ and __FUNCTION__ for a long while now, and
nobody complained about this, so all our users seem to use recent
enough compilers.

Corresponding to flashrom svn r711.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-09-02 22:09:00 +00:00
Carl-Daniel Hailfinger
3426ef6ab8 If FT2232H SPI is not enabled, it should be compiled out completely
We can't remove ft2232_spi.o from unconditional OBJS yet due to our
makefile structure (make features), but this patch adds #ifdefs around
all FT2232H code, so the net effect is the same.

Corresponding to flashrom svn r691.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-08-19 13:27:58 +00:00
Carl-Daniel Hailfinger
ef58a9ce3f Use a common parameter variable for all programmers
This allows us to reduce #ifdef clauses a lot if we compile out some
programmers completely.

Corresponding to flashrom svn r679.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-08-12 13:32:56 +00:00
Carl-Daniel Hailfinger
116081a224 Replace remaining explicit erases in SPI programmer drivers with auto-erases
Some SPI chip drivers and the generic 1-byte SPI chip write functions
didn't include the automatic erase present in other chip drivers.

Since the majority is definitely auto-erase, change the remaining
explicit-erase cases to be auto-erase as well.

Corresponding to flashrom svn r673.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carlos Arnau Perez <cemede@gmail.com>
2009-08-10 02:29:21 +00:00
Carl-Daniel Hailfinger
142e30fcaa Use a distinct return code for SPI commands with unsupported/invalid length
Some drivers support only a few combinations of read/write length and
return error otherwise. Having a distinct return code for this error
means we can handle it in upper layers.

Corresponding to flashrom svn r653.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-07-14 10:26:56 +00:00
Carl-Daniel Hailfinger
2f1b36fb35 Convert SPI byte program to use the multicommand infrastructure
Tested-by: Jakob Bornecrantz <wallbraker@gmail.com>

Corresponding to flashrom svn r651.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Tested it on Epia-m700 worked okay.
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
2009-07-12 12:06:18 +00:00
Carl-Daniel Hailfinger
d0478299b1 Add SPI multicommand infrastructure
Some SPI opcodes need to be sent in direct succession after each other
without any chip deselect happening in between. A prominent example is
WREN (Write Enable) directly before PP (Page Program). Intel calls the
first opcode in such a row "preopcode".

Right now, we ignore the direct succession requirement completely and it
works pretty well because most onboard SPI masters have a timing or
heuristics which make the problem disappear.
The FT2232 SPI flasher is different. Since it is an external flasher,
timing is very different to what we can expect from onboard flashers and
this leads to failure at slow speeds.

This patch allows any function to submit multiple SPI commands in a
stream to any flasher. Support in the individual flashers isn't
implemented yet, so there is one generic function which passes the each
command in the stream one-by-one to the command functions of the
selected SPI flash driver.

Tested-by: Jakob Bornecrantz <wallbraker@gmail.com>

Corresponding to flashrom svn r645.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
2009-07-10 21:08:55 +00:00
Carl-Daniel Hailfinger
feea272228 ft2232_spi: Allow runtime selection of FT2232H vs. FT4232H and interface A vs
B.

Corresponding to flashrom svn r638.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Tested-by: Jakob Bornecrantz <wallbraker@gmail.com>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
2009-07-01 00:02:23 +00:00
Uwe Hermann
1432a60c85 Random minor flashrom fixes
- Properly escape '-' chars in manpage.
 
 - Fix typo in chipset_enable.c.

 - Drop useless 'return' in chip_readn().

 - Random other whitespace or cosmetic fixes.

Corresponding to flashrom svn r636.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-28 23:26:37 +00:00
Paul Fox
05dfbe67d6 This patch adds support for a new SPI programmer, based on the FT2232H/4232H chip from FTDI
FTDI support is autodetected during compilation.

Paul writes:
There are certainly possible improvements: The code has hard-coded
values for which interface of the ftdi chip to use (interface B was
chosen because libftdi seems to have trouble with A right now), what
clock rate use for the SPI interface (I've been running at 30Mhz, but
the patch sets it to 10Mhz), and possibly others. I think this means
that per-programmer options might be a good idea at some point.

Carl-Daniel writes:
There is one additional FIXME comment in the code, but AFAICS that
problem is not solvable with current libftdi.

Corresponding to flashrom svn r598.

Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-16 21:08:06 +00:00