aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* flashrom_tester: Call crossystem with write protect argumentEvan Benn2022-08-233-92/+22
| | | | | | | | | | | | | | | | | | | | crossystem uses flashrom to gather data on some platforms. To avoid firmware lock deadlock, call crossystem before initialising libflashrom. When querying hardware write protect status, provide an argument to crossystem so that only that field is queried. This also avoids the deadlock, and improves performance. BUG=b:239496316 BRANCH=None TEST=on trogdor(arm), grunt(amd), hatch(intel): TEST=flashrom_tester --libflashrom /usr/sbin/flashrom host Coreboot_ELOG_sanity TEST=flashrom_tester /usr/sbin/flashrom host Coreboot_ELOG_sanity Change-Id: I7d94cfc6ccbfbec91f12151eb0004724ccfc4e00 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65962 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* drkaiser: restore flash writing access state explicitlyAlexander Goncharov2022-08-221-3/+12
| | | | | | | | | | | | | | | | | | Instead of using reversible write (rpci_write_word) that relies on global state, do it manually. Save original PCI config space register contents to programmer's structure during initialization and restore it in programmer's shutdown. TOPIC=reduce_global_pci_state TEST=builds Change-Id: Ie99a7cb3e049b29e6838dd4af587eee8c3b18919 Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/389 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66838 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* bindings/rust: Document the rust bindingsEvan Benn2022-08-192-1/+40
| | | | | | | | | | | | | | | Add an explanation of the two rust libraries, and instructions for building. Note that the bindings are not included in the tarball. BUG=None BRANCH=None TEST=None Change-Id: I05b1b5821554f8faee7728f899d51b6e8e9bf5be Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66618 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* bindings/rust/libflashrom: Create fat rust bindingEvan Benn2022-08-195-0/+1194
| | | | | | | | | | | | | | | | Create a rust library wrapping libflashrom-sys in a more idiomatic rust API. BUG=b:230545739 BRANCH=None TEST=cargo test Change-Id: Ie3bcfde40dc475f6a9439ccab8e2446967f7d6dd Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65281 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* bindings/rust/libflashrom-sys: Create thin rust bindgen bindingEvan Benn2022-08-196-0/+53
| | | | | | | | | | | | | | | | Use bindgen to create a rust library that calls into libflashrom using FFI. BUG=b:230545739 BRANCH=None TEST=cargo test Change-Id: I36ba70de2bca8f83d2fdd6fd4c9b7c28a11624ee Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65280 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.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: Write a newline with the wp promptEvan Benn2022-08-181-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Write a newline after the hardware write protect prompt. Automated tests read stdout and wait for this message, and split on newline, so write a newline. Also modify the function to not be recursive. Try to handle a closed input correctly - panicing in that case. Behaviour is now to wait for a newline instead of for 1 character. BUG=b:240512896 BRANCH=None TEST=tast run localhost:2222 firmware.FlashromTester TEST=flashrom_tester < /dev/null TEST=flashrom_tester; type some things, hold enter, then close stdin Change-Id: I07ec242ca0d41787030d5d27fc88d78ed884d746 Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/3809595 Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66587 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* spi25_statusreg: Fix checks for FEATURE_WRSR_EXT3Nico Huber2022-08-171-2/+3
| | | | | | | | | | | | | | FEATURE_WRSR_EXT3 contains multiple bits, hence we need to check for all of them. Change-Id: I188911890361999cd8cca9b6405f57a91075f6b4 Signed-off-by: Nico Huber <nico.h@gmx.de> Reported-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66712 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-by: Thomas Heijligen <src@posteo.de>
* cmocka: Drop as meson subprojectThomas Heijligen2022-08-173-17/+3
| | | | | | | | | | | | | | | | | Depend exclusive on the cmocka package provided by the build environment. Cmocka is widely available in Linux distributions and BSD systems. Besides that, it is suboptimal to fetch own dependencies in the build process. Most packaging systems even forbid fetching additional assets at build time. Change-Id: I751c85d5f72e47356113cf55dfbaec73cbd8028c Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66696 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* parade_lspcon: Rename PAGE_SIZE to avoid redefinitionThomas Heijligen2022-08-171-10/+10
| | | | | | | | | | | | | PAGE_SIZE is defined in musl libc include/limits.h as _GNU_SOURCE _BSD_DOURCE or _XOPEN_SOURCE Change-Id: Ib6162f87f021f0085073253b73528bbe0737a48e Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66745 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* ichspi.c: Make ich_hwseq_wait_for_cycle_complete() take addr_mask as argEdward O'Callaghan2022-08-151-8/+8
| | | | | | | | | | | | | | | Move towards functions depending less on globals. BUG=b:237839418 TEST=builds Change-Id: I7c02a33c0984f24efcaff967c496880d70922575 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65204 Reviewed-by: Alexander Goncharov <chat@joursoir.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* ichspi.c: Fix ich_hwseq_get_erase_block_size() type signatureEdward O'Callaghan2022-08-151-6/+6
| | | | | | | | | | | | | | | Move towards functions depending less on globals. BUG=b:237839418 TEST=builds Change-Id: Id1de6eb184340b3cac8a6bdbb94c22c8e37d8d2c Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65203 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Alexander Goncharov <chat@joursoir.net>
* ichspi.c: Let ich_hwseq_set_addr() take addr_mask as a argumentEdward O'Callaghan2022-08-151-9/+9
| | | | | | | | | | | | | | | Move towards functions depending less on globals. BUG=b:237839418 TEST=builds Change-Id: I891119fd9ed528f6b3578b7a84f66f1b058500e1 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65202 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Alexander Goncharov <chat@joursoir.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* pickit2_spi.c: Use one variable to store raw parameter valuesFelix Singer2022-08-141-9/+11
| | | | | | | | | | | | | Currently, each programmer parameter has their own temp variable to store their raw value into it. That's not needed since these variables are only used for a short time to do some configuration and stay unused then. Thus, use only one variable for all of them. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ib4ebc0e6354aad007145e1b0a761d9011c59ff7c Reviewed-on: https://review.coreboot.org/c/flashrom/+/66571 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* linux_spi.c: Use one variable to store raw parameter valuesFelix Singer2022-08-141-16/+16
| | | | | | | | | | | | | Currently, each programmer parameter has their own temp variable to store their raw value into it. That's not needed since these variables are only used for a short time to do some configuration and stay unused then. Thus, use only one variable for all of them. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I31e0baa2c5800c722a9ba853bcd40d71ed343f6d Reviewed-on: https://review.coreboot.org/c/flashrom/+/66568 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* linux_mtd.c: Rename variable param to param_strFelix Singer2022-08-141-8/+8
| | | | | | | | | | | | Rename the variable param to param_str to indicate that this is the raw string representation. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I78a207f11b964424a85e693f0004a33ee7de2e7e Reviewed-on: https://review.coreboot.org/c/flashrom/+/66567 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Thomas Heijligen <src@posteo.de>
* digilent_spi.c: Rename variable p to param_strFelix Singer2022-08-141-11/+11
| | | | | | | | | | | That's not a very meaningful name and it makes searching within the code hard. Thus, rename the variable to `param_str`. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I88a78b612d4d2373943f8daa1b6b6d89329405c2 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65928 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* stlinkv3_spi.c: Use one variable to store raw parameter valuesFelix Singer2022-08-141-16/+15
| | | | | | | | | | | | | Currently, each programmer parameter has their own temp variable to store their raw value into it. That's not needed since these variables are only used for a short time to do some configuration and stay unused then. Thus, use only one variable for all of them. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I548bb2e0786be0af20114e6bf1450c5fedb83d23 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65910 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* realtek_mst_i2c_spi.c: Use one variable to store raw parameter valuesFelix Singer2022-08-141-15/+15
| | | | | | | | | | | | | | Currently, each programmer parameter has their own temp variable to store their raw value into it. That's not needed since these variables are only used for a short time to do some configuration and stay unused then. Thus, use only one variable for all of them. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I48502161add9b59d97f5eeb46f5984c075ad924a Reviewed-on: https://review.coreboot.org/c/flashrom/+/65909 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* sb600spi.c: Use one variable to store raw parameter valuesFelix Singer2022-08-141-24/+23
| | | | | | | | | | | | | Currently, each programmer parameter has their own temp variable to store their raw value into it. That's not needed since these variables are only used for a short time to do some configuration and stay unused then. Thus, use only one variable for all of them. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I247012523c5e864ddb9e1e635df51e4311e5d5c5 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65908 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* dediprog.c: Use one variable to store raw parameter valuesFelix Singer2022-08-141-37/+37
| | | | | | | | | | | | | | Currently, each programmer parameter has their own temp variable to store their raw value into it. That's not needed since these variables are only used for a short time to do some configuration and stay unused then. Thus, use only one variable for all of them. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I198c0da88bfc01fe15280cbd58d2ef27564c1dbc Reviewed-on: https://review.coreboot.org/c/flashrom/+/65886 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* dummyflasher.c: Remove unnecessary empty lineFelix Singer2022-08-141-1/+0
| | | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I28db5ec721e77a34396cd77fbe6ed85b38c7098e Reviewed-on: https://review.coreboot.org/c/flashrom/+/66569 Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* cli_classic.c: Make use of bool type in the main functionFelix Singer2022-08-141-34/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the bool type instead of integer in the main function where possible, since this represents the purpose of some variables much better. Also, then we don't have to use the "!!" operator to turn any number into one or zero, which is used as an equivalent to true and false. Also, since we have booleans and integers now, slightly change the ordering of the variable declarations, so that the integers come before the booleans. Tested some parameters using the following commands: flashrom -L flashrom -p dummy flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -v foo1 flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -w foo1 flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -r foo1 flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -E Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I06572da040e12ac88f8e5fc39f60a9e212b86bd7 Reviewed-on: https://review.coreboot.org/c/flashrom/+/64564 Reviewed-by: Evan Benn <evanbenn@google.com> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Alexander Goncharov <chat@joursoir.net>
* MAINTAINERS: Add Evan Benn for flashrom_testerEvan Benn2022-08-141-0/+5
| | | | | | | | | | | | | | BUG=None BRANCH=None TEST=../coreboot/util/scripts/get_maintainer.pl -f util/flashrom_tester/build.rs Change-Id: Ibc7f77b7f8ba2f078d7edf47843a0d7cb288ab9e Signed-off-by: Evan Benn <evanbenn@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66624 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* Makefile: Fix build for WindowsThomas Heijligen2022-08-121-0/+3
| | | | | | | | | | | | | | | Mark programmers requiring RAW_MEM_ACCESS, X86_IO_PORT and X86_MSR as unsupported on Windows TEST=Buils on Cygwin (Windows 11, amd64, gcc 11.3.0) Change-Id: If70691a9eae40c394a06d11349bedefa40586f4a Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66546 Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* tests/realtek_mst_i2c_spi.c: Fix macro closing commentFelix Singer2022-08-101-1/+1
| | | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I7b130c58305f4a8b2afbfdb7dcead9d6535d98af Reviewed-on: https://review.coreboot.org/c/flashrom/+/66509 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* tests: Test allow_brick is required for i2c programmers initAnastasia Klimchuk2022-08-105-0/+54
| | | | | | | | | | | | | | | | | | | | | | Add tests for i2c programmers that assert that initialisation fails when allow_brick parameter is not provided. Example of logs from test run: [ RUN ] parade_lspcon_no_allow_brick_test_success Testing init error path for programmer=parade_lspcon with params: bus=254 ... ... init failed with error code -1 as expected [ OK ] parade_lspcon_no_allow_brick_test_success BUG=b:181803212 TEST=ninja test Change-Id: I382f563016502f3342131d5f9c0de41dc665b03a Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66508 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de>
* tests: Add function to test programmer init error pathsAnastasia Klimchuk2022-08-102-0/+21
| | | | | | | | | | | | | | | New function tests an error path for programmer initialisation, and expects programmer init to fail with given error code. BUG=b:181803212 TEST=ninja test Change-Id: Icc59396e604d74442852b4bbd575440df3347c3f Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66507 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de>
* atahpt: restore flash access state explicitlyAlexander Goncharov2022-08-091-6/+13
| | | | | | | | | | | | | | | | | | | Instead of using reversible write (rpci_write_long) that relies on global state, do it manually. Save original PCI config space register contents to programmer's structure during initialization and restore it in programmer's shutdown. TOPIC=reduce_global_pci_state TEST=builds Change-Id: I9996bb4d71801034e66ba0c233846e19fa29224d Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/389 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65386 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* test_build.sh: Build all programmers individually using MakeFelix Singer2022-08-091-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing CB:63724, which reworks the Meson build system, it showed that some programmers have dependency issues, which were invisible since test_build.sh builds flashrom with all programmers enabled and thus all sources are included. Building flashrom with each programmer individually made these issues visible. However, as commit 877b7741fcf9 and commit b6a439e45ef2 show, the Make build system also had some similar issues, which were invisible for the same reason. Thus, in addition to building all programmers at once using the Make build system, build each programmer individually. Also, when clang analyzer is used, it's not needed to run it on each programmer individually. Just return after flashrom was built with all programmers enabled in this case. An equivalent patch for the Meson build system is made separately. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I3bacb3ba9c6708f1e7ef5a111290d0ea3af36f1d Reviewed-on: https://review.coreboot.org/c/flashrom/+/66094 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile.d/arch_test.h: Add detection for ARC64 architectureVeronika Kremneva2022-08-091-0/+2
| | | | | | | | | Change-Id: I8707394871994f600b345d76614c5689fd081db4 Signed-off-by: Veronika Kremneva <kremneva@synopsys.com> Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/flashrom/+/63896 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* Makefile: Add support for Elbrus (e2k) architectureAnton Samsonov2022-08-092-1/+3
| | | | | | | | Signed-off-by: Anton Samsonov <devel@zxlab.ru> Change-Id: Ifc834e943ae93c59447afc86454b22ca662d3ef6 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66426 Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* Makefile: fix rebuild issuesThomas Heijligen2022-08-091-2/+2
| | | | | | | | | | | | | | | | | Flashrom does no longer rebuild everything if `make` is executed. Now the rule config will run, if needed, before any ‘.o’ is built, but no ‘.o’ will be built because there is no config file. https://www.gnu.org/software/make/manual/make.html#Prerequisite-Types Change-Id: Ie9225b79c0eb27cb041654d703cde5efc769cbf2 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66130 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Idwer Vollering <vidwer@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de>
* ich_descriptors.c: Reduce i/o op paths in read_descriptor_reg()Edward O'Callaghan2022-08-081-4/+11
| | | | | | | | | | | | Simplify I/O operations to one path after all branch logic is complete. Work towards consolidated enum ich gen branch logic. Change-Id: I37d22217a7cfc4cffc4f6cfe7b1df6f30df3ca92 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66349 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de>
* include/ich_descriptors.h: Add missing includeEdward O'Callaghan2022-08-081-0/+1
| | | | | | | | | | | | | Avoid transitively including the bool type for the ich_descriptor functionality. Change-Id: I2d9eb833ca9198c0586543d3f0074893aac5c6fb Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66348 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matei Dibu <matdibu@protonmail.com> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* test_build.sh: Move commands into functionsFelix Singer2022-08-081-5/+14
| | | | | | | | | | | In preparation to follow up commits, move the commands into functions so that it's clear what belongs to what. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ia2dc6f1d4d53b4d6a1255ef31c66799a484302fc Reviewed-on: https://review.coreboot.org/c/flashrom/+/66093 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* tests: Add basic lifecycle test for mediatek_i2c_spiAnastasia Klimchuk2022-08-084-0/+39
| | | | | | | | | | | | | | | | | | | | | | This unit test does not require any additional mocks because init and shutdown of i2c infra was covered in realtek programmer lifecycle. Default mocking of i2c is sufficient to run a basic lifecycle. To run the test, config option for the programmer needs to be enabled explicitly, since by default this programmer is disabled. BUG=b:238816884 TEST=meson configure -Dconfig_mediatek_i2c_spi=true ninja test Change-Id: I98a12067d165c90013d33ffc45d20dab5c364c83 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66261 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Alexander Goncharov <chat@joursoir.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* tests: Add basic lifecycle test for parade_lspconAnastasia Klimchuk2022-08-084-0/+39
| | | | | | | | | | | | | | | | | | | | | This unit test does not require any additional mocks because init and shutdown of i2c infra was covered in realtek programmer lifecycle. Default mocking of i2c is sufficient to run a basic lifecycle. To run the test, config option for the programmer needs to be enabled explicitly, since by default this programmer is disabled. BUG=b:238816889 TEST=meson configure -Dconfig_parade_lspcon=true ninja test Change-Id: I0dcfae4a58c64b2e8d56ec51b4b050534cbb4cd2 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66003 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* pickit2_spi.c: Use a variable to store the total packetsizeFelix Singer2022-08-051-2/+3
| | | | | | | | | | | | Instead of calculating the total packetsize multiple times, use a variable instead. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I714054669e16dcf531a57174f9522b3af72d2754 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66251 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* pickit2_spi.c: Replace hard-coded value with define in msg_perr()Felix Singer2022-08-051-2/+2
| | | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ia3fa89285d8761e51078afa486df50a7b8247fc5 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66250 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* nicnatsemi: Refactor singleton states into reentrant patternAlexander Goncharov2022-08-051-6/+28
| | | | | | | | | | | | | | | | | | | | | Move global singleton states into a struct and store within the par_master data field for the life-time of the driver. This is one of the steps on the way to move par_master data memory management behind the initialisation API, for more context see other patches under the same topic specified below. TOPIC=register_master_api TEST=builds Change-Id: I58ad1f0222338fc107e7ac2b9cdd361ae7033912 Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/391 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65970 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* satasii: drop unused variable from par data structAlexander Goncharov2022-08-051-2/+0
| | | | | | | | | Change-Id: I17725195d0523068453325742d7e2aae31a0208d Signed-off-by: Alexander Goncharov <chat@joursoir.net> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66293 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* satasii: Drop sii_ prefix for par data struct membersAlexander Goncharov2022-08-051-11/+11
| | | | | | | | | | | | | | The name of the struct type already contains satasii_ prefix, so prefix doesn't need to be repeated in members name TEST=builds Change-Id: I92e59bf89e44cde631dfde2df4c9ff0f86b5f417 Signed-off-by: Alexander Goncharov <chat@joursoir.net> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66292 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* satasii: Refactor singleton states into reentrant patternAlexander Goncharov2022-08-051-20/+41
| | | | | | | | | | | | | | | | | | | | | | | Move global singleton states into a struct and store within the par_master data field for the life-time of the driver. This patchset also includes stdlib.h to be able to work with memory allocation. This is one of the steps on the way to move par_master data memory management behind the initialisation API, for more context see other patches under the same topic specified below. TOPIC=register_master_api TEST=builds Change-Id: I63fea00623c149ad304b44aa6265f32ecc1c53eb Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/391 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66075 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* satamv: Drop mv_ prefix for par data struct membersAlexander Goncharov2022-08-051-6/+6
| | | | | | | | | | | | | | The name of the struct type already contains satamv_ prefix, so prefix doesn't need to be repeated in members name TEST=builds Change-Id: I10ddb734e0d091cbafb439b288b393cf209dfc2e Signed-off-by: Alexander Goncharov <chat@joursoir.net> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66294 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* satamv: Refactor singleton states into reentrant patternAlexander Goncharov2022-08-051-21/+44
| | | | | | | | | | | | | | | | | | | | | Move global singleton states into a struct and store within the par_master data field for the life-time of the driver. This is one of the steps on the way to move par_master data memory management behind the initialisation API, for more context see other patches under the same topic specified below. TOPIC=register_master_api TEST=builds Change-Id: I084cf826a8a594ade80eed43008e286c7bd1b553 Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/391 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65978 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* nicintel: Refactor singleton states into reentrant patternAlexander Goncharov2022-08-031-10/+33
| | | | | | | | | | | | | | | | | | | | | Move global singleton states into a struct and store within the par_master data field for the life-time of the driver. This is one of the steps on the way to move par_master data memory management behind the initialisation API, for more context see other patches under the same topic specified below. TOPIC=register_master_api TEST=builds Change-Id: I839baad1e6085958a29652f23c9027b6a10edd15 Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/391 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65974 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* maintainers: Add Felix Singer for Nix shellFelix Singer2022-08-031-0/+9
| | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I1d246ad8e1270a53275ab12adb8c3d858009d176 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66006 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* maintainers: Add Anastasia Klimchuk for MAINTAINERSFelix Singer2022-08-031-0/+1
| | | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ibd024b07c3cf2b537bb055694ff2654fed305400 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66005 Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* maintainers: Add Felix Singer for MAINTAINERSFelix Singer2022-08-031-0/+9
| | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I9ad71346111a0c42a4424557b3bda6ee1cc3484f Reviewed-on: https://review.coreboot.org/c/flashrom/+/66004 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>