summaryrefslogtreecommitdiffstats
path: root/util/flashrom_tester/flashrom
Commit message (Collapse)AuthorAgeFilesLines
* flashrom_tester: Use path types for things that are pathsEvan Benn2022-11-093-54/+64
| | | | | | | | | | | | | | | | Use Path and PathBuf for things that are paths. BUG=b:243460685 BRANCH=None TEST=/usr/bin/flashrom_tester --flashrom_binary /usr/sbin/flashrom host TEST=/usr/bin/flashrom_tester --libflashrom host Change-Id: I69531bec5436a60430eae975eeab02c8835962bf Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/69064 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* flashrom_tester: Fix cargo check and clippy warningsEvan Benn2022-09-192-20/+13
| | | | | | | | | Change-Id: I50c5af61e06df1bb6956f347cb6806a7eca6ce0e Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67472 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* flashrom_tester: Add an implementation using libflashromEvan Benn2022-08-263-1/+176
| | | | | | | | | | | | | | | | | | | flashrom_tester 'flashrom' crate was implemented using the flashrom commandline. Add a second implementation using the libflashrom interface via the libflashrom and libflashrom-sys rust bindings. BUG=b:230545739 BRANCH=None TEST=cargo test TEST=on grunt (AMD) TEST=/usr/bin/flashrom_tester --libflashrom host TEST=/usr/bin/flashrom_tester --flashrom_binary /usr/sbin/flashrom host Change-Id: Ic4db6c829d7e8dc707a10c10e1ca0d9b8abccdec Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65282 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* flashrom_tester: Add _into_file to function namesEvan Benn2022-08-262-12/+12
| | | | | | | | | | | | | | | Rename Flashrom trait function names to reflect that the data is read to/from a file provided as an argument. BUG=None BRANCH=None TEST=cargo test; cargo check Change-Id: I0015c9bf64349a5512dbdb0ef6f3dad38aa2fd8e Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66956 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* flashrom_tester: Fix cmd read_region to read only the regionEvan Benn2022-08-181-11/+10
| | | | | | | | | | | | | | | | | | | | read_region for the CLI implementation was writing a file the size of the whole flash, with only the region filled with real data. Now write only the region to the file. This fixes the Coreboot_ELOG_sanity test which regressed in 4342cc0f14e2945d7642e75e44346c13ca23089b. BUG=b:241486407 BRANCH=None TEST=flashrom_tester /usr/sbin/flashrom host Coreboot_ELOG_sanity Change-Id: I97ff8c71861f1d0282a7d6173e196e3d0b41d746 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/3812722 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66588 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* flashrom_tester: Move all subprocess stderr logging to dispatchEvan Benn2022-08-031-62/+34
| | | | | | | | | | | | | | | Instead of printing stderr in each function separately, print all stderr in the dispatch function. BUG=None BRANCH=None TEST=/usr/bin/flashrom_tester --debug host Lock_top_quad Change-Id: Id76f83c8c089537aa44aa13533c75900eb6ed175 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65279 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* flashrom_tester: Refactor Error typeEvan Benn2022-07-212-9/+29
| | | | | | | | | | | | | | | | | Use a type implementing Error instead of a string for errors. Error implements Display so can be easily converted to a String. This will allow libflashrom to be more easily integrated. BUG=b:230545739 BRANCH=None TEST=cargo test Change-Id: Id166053c7edfd07576e7823692cfa0ea4d438948 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65277 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* flashrom_tester: Remove subprocess from elog_sanity_testEvan Benn2022-07-212-0/+24
| | | | | | | | | | | | | | | | | Make elog_sanity_test read the elog region itself, instead of calling out to elogtool. This avoids the need to subprocess and resolves a deadlock when elogtool attempts to obtain a flash reading lock. TEST=/usr/bin/flashrom_tester host Coreboot_ELOG_sanity TEST=flashrom --image RW_ELOG -p host -r /tmp/file.tmp2 # comparison TEST=hexdump the file and check magic signature == 0x474f4c45 Change-Id: I8ac63e15e063f9c0928e3e185154bb083b367ba9 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65119 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* flashrom_tester: Use Flashrom trait instead of struct FlashromCmdEvan Benn2022-07-212-280/+310
| | | | | | | | | | | | | | To allow FlashromCmd to be reimplemented with libflashrom move all concrete cmd functions into the FlashromCmd type that implements the Flashrom trait. This allows users to be generalised upon the Flashrom trait as the contract rather than the concrete FlashromCmd type. Change-Id: Ie2b4e7e91d69043fd50d1c57f6585fc9946fab10 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/64849 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* CHROMIUM: flashrom_tester: Remove --ignore-fmap optionDaniel Campello2021-05-062-10/+3
| | | | | | | | | | | | | | | | | This change removes --ignore-fmap as this is implicitly computed based on other supplied options by the user. Original-Signed-off-by: Daniel Campello <campello@chromium.org> Original-Cq-Depend: chromium:2854174, chrome-internal:3789445, chromium:2854014 Original-Change-Id: I841a56d8726644cedd7d616ddfd5656b92dd7e59 Original-Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/2851658 Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> (cherry picked from commit 2e2a5e449229e9c9604235a98b56e5dd29bf25cf) Change-Id: Ib329f3adb59ce1848d1540844d64b968f49eb22a Reviewed-on: https://review.coreboot.org/c/flashrom/+/52890 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* flashrom_tester: update syntax for --wp-rangeDaniel Campello2021-05-061-5/+4
| | | | | | | | | | | TEST=cargo test Signed-off-by: Daniel Campello <campello@chromium.org> Change-Id: If17a40fba1f7d41e09e0163b353d1602c215c8db Reviewed-on: https://review.coreboot.org/c/flashrom/+/52876 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* util/flashrom_tester: Upstream E2E testing frameworkEdward O'Callaghan2020-02-243-0/+745
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>