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

2337 Commits

Author SHA1 Message Date
Edward O'Callaghan
fe6b98b91c Makefile: Fix 'CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no'
Turns out CONFIG_RAIDEN was missing in the LIBUSB1
as no overrides. Credit to HAOUAS Elyes for spotting this.

Change-Id: I7dd26665a0133175949c11717837e9de68a1bf71
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39896
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
2020-03-28 10:53:26 +00:00
Angel Pons
5f9b1d6ba5 chipset_enable.c: Add more Lewisburg PCH IDs
Change-Id: I7ba768abfa6f19f23379e5f47a6bc099fc01d3da
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39780
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2020-03-27 22:26:38 +00:00
Angel Pons
6c8bd91e29 Fix segfault when running flashrom -L
The raiden_debug programmer is of type USB. However, it does not set the
field `devs.dev`, which will result in a segfault when trying to print
the devices of the non-existing table.

Fix that by replacing `devs.note` with `devs.dev` and adding an empty
device table. Since Device IDs are not used to match programmers,
nothing could be added to the table.

TEST=Running `flashrom -L` no longer segfaults and returns normally.

Change-Id: Ie4171a11384c34abb102d1aadf86aa1b8829fc04
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39826
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2020-03-26 03:15:08 +00:00
Dino Li
548c880760 flashchips: add support for GigaDevice GD25WQ80E
Support GD25WQ80E, which is the internal flash of IT81202.

TEST=Building flashrom and flashing FW image into IT81202 successfully.

Change-Id: Ib5feaa6ecc7b11b2218e5f02c087b4331388bef8
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39820
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2020-03-25 23:23:43 +00:00
sibradzic
425dff07ba flashchips: Add Macronix MX25R3235F
32Mbit (4MiB) [x1/x2/x4] Wide Voltage Range (VCC 1.65V-3.6V). It is
similar to the already-supported MX25R6435F, but the total size is
halved.

Tested on ch341a, FT4232H and FT2232H (PicoTAP) programmers, confirmed
working probe, read, erase and write.

Fixes: https://github.com/flashrom/flashrom/issues/43

Change-Id: I6e79115adba17d13d24bc85d78707d53fd4a0be5
Signed-off-by: Samir Ibradzic <sibradzic@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39532
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-03-24 14:05:52 +00:00
Evgeny Zinoviev
e65aa96fd3 chipset_enable: Mark Intel HM75 as DEP
Tested reading and writing on a Samsung laptop (see CB:39388).

Change-Id: Idbb9c719a6f794a35293bb3b167cc1491d24d4fa
Signed-off-by: Evgeny Zinoviev <me@ch1p.io>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39389
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-03-19 09:42:40 +00:00
Angel Pons
b1e558389a chipset_enable.c: Mark Skylake U Premium as DEP
Tested reading, writing and erasing the internal flash chip using an
Acer Aspire ES1-572 laptop with an Intel i3-6006U. However, since all
ME-enabled chipsets are marked as DEP instead of OK, this one shall
follow suit as well.

Change-Id: Ib8ee9b5e811df74d2f48bd409806c72fe862bc24
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39173
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2020-03-19 09:39:10 +00:00
Edward O'Callaghan
3e67cb7b78 raiden_debug_spi.c: Add a delay following AP/EC flash enable
Add a delay following the AP and EC flash enable requests. This allows
any power rails enabled by these signals to settle and to meet the power
on to first SPI write timing requirements.

Forward ports the downstream commit:
   https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/2036738

Change-Id: I4c1777777ee67580605c6e6f4c0c228cccc392c7
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39312
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-11 06:26:37 +00:00
Edward O'Callaghan
8b191f5ced raiden_debug_spi.c: Disable retry during some error codes
Forward ports the downstream commit:
 https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/2073077

Change-Id: I77def28040fea8d1ecf102463180378f8612b00e
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39311
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-11 06:25:14 +00:00
Edward O'Callaghan
2141250162 raiden_debug_spi.c: Implement retry mechanism
This overcomes a problem with the ServoMicro where USB packets can be
ack'd by the device without triggering interrupts or loading data into
the USB endpoints. The retry mechanism attempts the USB read 3 times
before reattempting the write call to avoid performing multiple SPI
transfers due to a USB problem. This process repeats 3 times before we
return the last error code. Intermediary problems are reported in the
status code.

Based off the downstream commit:
  https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/2038271

Change-Id: I76cde68852fa4963582d57c7dcb9f24de32c6da8
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39310
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-11 06:24:10 +00:00
Edward O'Callaghan
e8c0ee7c7e raiden_debug_spi.c: Clean up RW ops into sep paths
- The USB SPI interface has been split up into write and read stages.
 - The packet packing has been transitioned from array based to a
   struct.

This was based off the downstream commit:
  https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/2036508

Change-Id: Id3a2a544c1c7e1d969a5157977b8a1c7af18371b
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39309
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-11 06:23:05 +00:00
Edward O'Callaghan
4847496062 raiden_debug_spi.c: Fix indents to be consistent
Change-Id: I414d6e5fcb590a006dd53fa93df80ec2a765c5d1
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39308
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-11 06:21:03 +00:00
sibradzic
a43e44b6ab ft2232_spi: Fix broken GPIOL cs_bits state (#126)
This only sets 3rd CS# bit be asserted during read/write operations.

Tested and confirmed working on 4232H & PicoTap ft2232 programmers
against MX25R6435F & S25FL128S chips.

Signed-off-by: Samir Ibradzic <sibradzic@gmail.com>
Change-Id: Ia0ac14b9a52f251306887500dae3e57d73322157
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38898
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2020-03-09 09:22:18 +00:00
sibradzic
ba6575de82 ft2232_spi: Enhance csgpiol parameter for FT2232
This allows multiple 'csgpiol' bits to be set to active state at the
same time. Previously, only one GPIOL could be activated. I have an
use-case such that FT4232H is wired to two different SPI chips, and in
order to select one of them two GPIOLs have to be set.

Now, one can enable any particular GPIOL, for example:

csgpiol=01

would activate GPIOL0 and GPIOL1 at the same time.

The change is backward-compatible with previous csgpiol formatting.

Signed-off-by: Samir Ibradzic <sibradzic@gmail.com>
Change-Id: I645ddaa9852e9995bd2a6764862fda2b2ef0c26b
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38705
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-03-09 04:54:49 +00:00
Rob Barnes
703de983d8 sb600spi: Add spireadmode
Added spireadmode for >= Bolton.
Do not override speed or read mode for >= Bolton if parameter not
specified.
Minor cleanup of sb600spi.c code.

TEST=Manual: deploy on tremblye read flash using various parameters
BUG=b:147665085,b:147666328
BRANCH=master

Change-Id: Id7fec7eb87ff811148217dc56a86dca3fef122ff
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38833
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-03-03 13:01:54 +00:00
Edward O'Callaghan
ad08aef69c raiden_debug: Upstream ChromiumOS servo debug board prog
Initial check-in of the Raiden debugger programmer.

Squash in,
  raiden_debug: Add missing .write_aai cb fn
  raiden_debug: greatly improve protocol documentation

BUG=b:143389556
BRANCH=none
TEST=builds

Change-Id: Ifad273a708acea4de797a0808be58960635a8864
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38209
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-03 06:02:23 +00:00
Edward O'Callaghan
d3396408d8 raiden_debug: Upstream ChromiumOS usb_device helpers
These are helpful usb device accessors and helpers that
are later used for the so-called Raiden debugger programmer.

BUG=b:143389556
BRANCH=none
TEST=builds

Change-Id: Ic928220fc919fe4958c8150e61e11470dac88f13
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38936
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-02 07:05:09 +00:00
Edward O'Callaghan
0f510a7458 util/flashrom_tester: Upstream E2E testing framework
The following is a E2E tester for a specific chip/chipset
combo. The tester itself is completely self-contained and
allows the user to specify which tests they wish to preform.
Supported tests include:

 - chip-name
 - read
 - write
 - erase
 - wp-locking

Change-Id: Ic2905a76cad90b1546b9328d668bf8abbf8aed44
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38951
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2020-02-24 09:15:00 +00:00
David Hendricks
7a7fee1695 ubertest: Add blackbox test uber-script
This modifies CB:23025 further to work with upstream as it is now,
without the syntax changes in the patch chain. I also gave it a new
name since this script is, well, uber.

Since flashrom currently only supports reading/writing ROM-sized files
we can't easily determine a targeted region offset and size except
when a layout file is used. Therefore, some extra arithmetic is needed
in the partial write test and the only modes allowed are clobber mode
and layout mode.

A few other changes:
- Update paths and script name
- Remove write-protect testing support
- Use ROM-sized files only, no region-sized files
- Return error if flashmap or ifd mode are used

Documentation is ported from https://goo.gl/3jNoL7 into a markdown
file and accompanying SVGs. Minor changes were made for clarity and
formatting, and references to write protect testing have been removed
for the time being.

Tested using a Raspberry Pi with a W25Q16

Change-Id: I1af55d5088c54ee33853009797adbd535a506b49
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38788
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2020-02-23 19:02:16 +00:00
Bernhard Urban-Forster
05c629be29 flashchips: Add Spansion S25FL512S
As found on the Tesla AP2.5 board.

Based on https://mail.coreboot.org/pipermail/flashrom/2013-June/011066.html

Tested with:
    flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 -r content.bin

Signed-off-by: Bernhard Urban-Forster <lewurm@gmail.com>
Change-Id: Ifa9b7615951125b6bbc1f051370ef54896bf506c
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38596
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
v1.2
2020-02-09 06:21:46 +00:00
Johanna Schander
b5433b782f chipset_enable.c: Add Ice Lake U to known and tested systems
Intel Ice Lake systems use an 495 Series Chipset
that behaves compatible to pch300 chips but chip names
are undocumented at this point.

This change was tested in read/write/erase on the Razer
Blade Stealth (late 2019) with intel 1065G7 CPU and
"Ice Lake U Premium PCH".

Change-Id: I6227d32f4476420cf1aeec37ebd4b7648e0b3d15
Signed-off-by: Johanna Schander <git@mimoja.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/37987
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Christoph Pomaska <github@slrie.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-02-09 06:00:51 +00:00
Angel Pons
3eae695319 Fix building with meson, again
Change-Id: Iea40da587729f3975a8901d3933e7567805242c5
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38659
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2020-02-01 17:36:22 +00:00
Wim Vervoorn
3799a1cc1a chipset_enable: Add Kaby Lake U Prem. to known and tested systems
Intel Kaby Lake U (with the 9d4e device id) support is available but
marked not tested.

Tested reading, writing and erasing both internal flash chips on the
Facebook Monolith system with the Intel i3 7100U SoC. However, since all
ME-enabled chipsets are marked as DEP instead of OK, this one shall follow
suit as well.

Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Change-Id: Ie35cc896e29baffa63fe9e37c14770001b54e7ec
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38481
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-01-22 14:15:33 +00:00
Carl-Daniel Hailfinger
e4c2b48f39 Fix typos
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Change-Id: Ia5ed00c488b0719b2bdd6c8f304900511684f445
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38477
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-20 13:02:48 +00:00
Nico Huber
67710afe4e Revert "pcidev.c: Factor out pcidev_validate() into pure fn"
This reverts commit e28d75ed7204d7fac2c0fac13978098530b0574e.

This is broken in multiple ways, e.g. pcidev_init() can only return
NULL.

Change-Id: I06242147ba9d3a062d442f645eb0800ef51af19f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Reported-by: Michael Bishop <cleverca22@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38319
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-01-19 23:48:48 +00:00
Nico Huber
370a9f3eea stlinkv3_spi: Move a declaration out of for-loop head
GCC 4.8 wants an explicit `-std=c99` or something for this to work. It
seems easier to keep the common declaration style.

Change-Id: Ic0819f82169df4d66cc949494229b0749c06e8f6
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38034
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Miklós Márton <martonmiklosqdev@gmail.com>
2020-01-02 16:15:10 +00:00
Miklós Márton
324929c3d7 Add support for STLINK V3 debugger/programmer via its SPI bridge
Change-Id: Icffab87ac8f2c570187ed753ec70f054541873a4
Signed-off-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34661
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-12-31 17:25:41 +00:00
Angel Pons
728062f7ff chipset_enable.c: Mark Intel HM76 as DEP
Tested reading, writing and erasing the internal flash chip using a
Samsung NP530U3C laptop with an Intel HM76 PCH. However, since all
ME-enabled chipsets are marked as DEP instead of OK, this one shall
follow suit as well.

Change-Id: I1097c5fcf782e7ecf52f05c571ad188456307d00
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/37803
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2019-12-21 11:47:21 +00:00
David Hendricks
a9d6d1a817 mysteries_intel: Add a section about SMM_BWP
Something to point users to when SMM_BWP might be causing problems.

Change-Id: I394c033e8d4ff96433162f86aefb428d8acf6349
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36986
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-12-14 15:50:36 +00:00
Rosen Penev
34d07f00b2 flashrom: Add support for ARC platform
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Change-Id: I88cbe74b716d5fab16133fbf2ce9c35b74c25f32
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35831
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-12-14 15:29:21 +00:00
darkarnium
4139438943 flashchips: Add AT25SF321
This commit adds support for the Adesto AT25SF321 SPI flash chip. Probe
and read operations have been tested via FT2232H interface, but writes
have not been verified.

Datasheet is available at the following URL:
https://www.adestotech.com/wp-content/uploads/DS-AT25SF321_047.pdf

Change-Id: I7410815e063ffe154a97d7ea5881c8eb82025f56
Signed-off-by: Peter Adkins <pete@kernelpicnic.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36904
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-12-14 15:25:30 +00:00
Nico Huber
89622674b2 nicintel_eeprom: Reduce usage of is_i210()
Don't entagle the code paths for the two NIC classes if it's not necessary.

Only compile tested.

Change-Id: I59164ccf54afbbd64a0598282d13e80ff7fd6fa4
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/33637
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-12-10 16:38:50 +00:00
Nico Huber
5d068ddca4 Revert "print.c: Dedup 'test_state_to_text()' logic"
This reverts commit 61e16e549a52194ac80ef40504f2dc661d1ff99c.

Obviously throws alignment in the table off and changes output
class from `general` to `programmer` for no visible reason.

Change-Id: I864044b9fac6af9cf6a89c053eccdcb36f17c7bd
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36909
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-12-06 02:50:41 +00:00
Russ Dill
7bd31a435b ft2232_spi: Add support for Tin Can Tools Flyswatter/Flyswatter 2
The Tin Can Tools Flyswatter and Flyswatter 2 have a FT2232H
with a  JTAG interface wired to port A. The buffers that drive the
JTAG pins need to be enabled with an nOE signal from the
FT2232H ADBUS6 and ADBUS7 pins.

Flyswatter has an ARM-14 JTAG interface and Flyswatter 2 has
an ARM-20 JTAG interface.

Change-Id: I56b1fb76dcda32bb02980cd54a2853506bfc9dfd
Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36896
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-12-01 22:23:08 +00:00
Edward O'Callaghan
e28d75ed72 pcidev.c: Factor out pcidev_validate() into pure fn
This makes writing unit-tests easier.

Change-Id: Ia2718f1f40851d3122741cd0e50b0c2b647b727a
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/37264
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2019-11-28 14:00:52 +00:00
Edward O'Callaghan
1d80d64587 cbtable.c: Factor out lb_table_validation logic
Write a pure function for the table validation logic, it is
easier to unit-test.

Change-Id: I07b0f95ec0443fa6a8f54eb93f4a7ea1875cccad
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/37239
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2019-11-28 10:00:21 +00:00
Edward O'Callaghan
4a55e68858 cbtable.c: Factor out lb_header_validation logic
Write a pure function for the header validation logic, it is
easier to unit-test.

Change-Id: Ia288bcbc5c371329952a6efba30ccf0e18965a3d
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/37238
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2019-11-28 10:00:11 +00:00
Edward O'Callaghan
61e16e549a print.c: Dedup 'test_state_to_text()' logic
Change-Id: I72164323d7ff98fc50cb0c47b69741a4f047e098
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36905
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-11-17 11:32:46 +00:00
Ryan O'Leary
301ae22b45 dediprog.c: Add id parameter to dediprog programmer
When multiple dediprog programmers are connected, the 'id' parameter
allows you to specify which one to use. The id is a string like SF012345
or DP012345. The value is printed on a sticker on the back of the dediprog.

This is an improvement over the 'device' parameter which is based on
enumeration order and changes when you plug/unplug devices or reboot the
machine.

To find the id without the sticker, run flashrom with the -V option.
This prints the ids as they are enumerated.  Alternatively, with dpcmd,
you can use the --list-device-id and --fix-device commands to list and
write device ids respectively.

Note this only supports SF100 at the moment, but SF600 support is
possible with more work.

Change-Id: I4281213ab02131feb5d47bf66118a001cec0d219
Signed-off-by: Ryan O'Leary <ryanoleary@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34160
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-11-15 09:29:37 +00:00
Evgeny Zinoviev
83c56b870b Fix building with GCC 4.9
It doesn't like empty initializers.

Change-Id: If2988e60401155f87ee3369c77f00ccf9332012c
Signed-off-by: Evgeny Zinoviev <me@ch1p.io>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36629
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-11-14 22:47:32 +00:00
Edward O'Callaghan
93737bcaf5 sb600spi.c: Generalise determin_generation() after Yangtze
Drop dead USE_YANGTZE_HEURISTICS code and add Promontory support.

Change-Id: I5aa7370025f5c1af56c6cb96194b6f3007d0ede7
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36426
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-11-14 22:42:37 +00:00
Edward O'Callaghan
9355e6faf6 sb600spi.c: Fold up debug logic into determine_generation()
Change-Id: I6c722e29b321285bf20fb5ee30c912dcdd83411b
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36425
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2019-11-14 22:42:22 +00:00
Edward O'Callaghan
c0a27e1f17 sb600spi.c: Consolidate smbus dev revision derivation
V.2: Rename 'find_smbus_dev()' -> 'find_smbus_dev_rev()'.

Change-Id: I766b29cc1c7d01aa0bcf6cb9ff5ab73fa1995dcd
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36420
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: Nico Huber <nico.h@gmx.de>
2019-11-14 22:41:10 +00:00
Miklós Márton
2d20d6db39 Add support for National Instruments USB-845x devices
Change-Id: I9477b6f0193bfdf20bbe63421a7fb97b597ec549
Signed-off-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/25683
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-11-14 22:40:21 +00:00
Peichao Wang
1a119498b4 flashchips: Add W25Q128JW_DTR
Port the code from chromeos flashrom

BUG=b:144297264
TEST=Tested using W25Q128JWDTR in SPI mode

Signed-off-by: Peichao.Wang <peichao.wang@bitland.corp-partner.google.com>
Change-Id: Ifc28878b17dc10da2cfd8f82fffbd57adb22799e
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36717
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-13 12:32:11 +00:00
Jacob Creedon
80e8dc4df7 flashchips: Add missing N25Q/MT25Q variants
This adds missing voltage and capacity variants for N25Q and MT25Q
series devices. This also fixes a typo in some model numbers where the
last letter should have been a G instead of an E. Added devices include:

N25Q256..1E
N25Q512..1G
N25Q00A..1G
N25Q00A..3G
MT25QU128
MT25QL128
MT25QU256
MT25QU512 tested by Jacob Creedon <jcreedon@google.com>
MT25QL01G tested by Konstantin Grudnev <grudnevkv@gmail.com>
MT25QU01G
MT25QL02G
MT25QU02G

Two have been tested as indicated, all other variants added are marked
untested.

Signed-off-by: Jacob Creedon <jcreedon@google.com>
Change-Id: I85630e4f6c0aa3b261f9871b7d363dad278b997e
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34491
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2019-11-11 02:53:01 +00:00
Nico Huber
2f6936bd92 util/getversion,meson: Add script to allow version info with Meson
Add `util/getversion.sh` that retrieves version information from a
`versioninfo.inc` (what we use for releases) if present or uses
`util/getrevision.sh` if not.

Let Meson use it for flashrom's version. It seems Meson doesn't
generate the manual page at all, so the `--man-date` command is
currently unused.

Change-Id: I401e5638509c4a573bc0cb17ebc5fa76df9700b5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35561
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mario Limonciello <superm1@gmail.com>
Reviewed-by: Richard Hughes <hughsient@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-11-06 08:46:07 +00:00
Edward O'Callaghan
b863127a6f usbdev.c: Add missing <inttypes.h> include
Change-Id: Ie23612226a48d6732750f51547642da0a6257dd8
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36219
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-10-22 23:24:16 +00:00
Edward O'Callaghan
8b60fc7a5b cli_classic: Tidy up some repeated handling patterns into funcs
Introduce cli_classic_single_operation() to consolidate the repeating
pattern of multiple CLI operations at once. Also modify
cli_classic_abort_usage() to take an optional error abort string and
print it to stderr, this allows for trimming a few more lines off the
cli implementation.

V.2: A few fixes upon review:
  - Trim off some unnecessary braces for single line branches.
  - Pass 'operation_specified' by reference.
  - Rename a function.
V.3: Fix print order of cli_classic_abort_usage().

Change-Id: I54598efdaee2b95cb278b0f2aac05f48bbd95bef
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35611
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-10-17 08:29:35 +00:00
Edward O'Callaghan
16ec45c0fc cli_classic: Fix first line of --help to match manpage
Make the first line of --help in usage to align with the
format of the man page, including fixing any missing options.

V.2: Add an extra space.

Change-Id: I44f82c6a54fddb54bf268fe6eb22e50acb6025cf
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35793
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-10-17 01:26:21 +00:00