aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* test_build.sh: Use multiple cores if Make is usedFelix Singer2022-09-231-2/+2
| | | | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ia67e9202e49f1b4bc3301399a8ec741ac01c3ce0 Reviewed-on: https://review.coreboot.org/c/flashrom/+/67244 Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* test_build.sh: Build all programmers individually using MesonFelix Singer2022-09-231-3/+23
| | | | | | | | | | | | | | | | | | | | | | The test build script already builds each programmer individually when Make is used. To check if the Meson build system is working properly, build each programmer individually and in addition to that build-test the programmer groups individually. Builds are done in the directory `out`, while for each build a new subdirectory with the name of the programmer option is created. Also, return when scan-build is used and the group `all` isn't selected, since it's not needed to run scan-build in combination with the other options. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I703127a2dc31d316d3d1c842b5bcb0b22c39c0d4 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66475 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Patrick Georgi <patrick@coreboot.org>
* test_build.sh: Delete old build dir when Meson is usedFelix Singer2022-09-231-4/+7
| | | | | | | | | | | | Make sure to start from a clean environment when Meson is used. Also, rename the variable "builddir" to "build_dir" for better readability and to avoid typos. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I050ed916685728cbed9c10601a6bcad6d59a4eda Reviewed-on: https://review.coreboot.org/c/flashrom/+/67541 Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* test_build.sh: Improve robustness when dealing with empty $CCPatrick Georgi2022-09-211-1/+1
| | | | | | | | | | | | | Add quotes so that = knows what to compare, otherwise the shell complains: ./test_build.sh: 16: [: =: unexpected operator Change-Id: Ia289b31291949f5cbc11484b8f1a7cb7a49bd2bb Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67740 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* test_build.sh: Identify runs for Coverity ScanPatrick Georgi2022-09-211-1/+1
| | | | | | | | | | | | | For Coverity Scan[0] the same build rules apply as for scan-build. [0] https://scan.coverity.com/projects/flashrom Change-Id: I75147799b1c3213866e343a0384c94d0a1f5c249 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67739 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* internal.c: Pass `programmer_cfg` to `try_mtd()`Angel Pons2022-09-212-4/+7
| | | | | | | | | | | | | | | | | Programmer params are now passed via the `programmer_cfg` struct, but the internal programmer did not pass them to the `try_mtd()` function which was still using `NULL`. This problem resulted in a segmentation fault when trying to use the internal programmer. TEST=Make sure internal programmer does not segfault on Haswell ULT. Change-Id: I9e74bd68a1f9509a201dc518dbff96c27d68a3c3 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67752 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: Edward O'Callaghan <quasisec@chromium.org>
* tests: Add unit test for initialisation with NULL programmer paramAnastasia Klimchuk2022-09-204-1/+18
| | | | | | | | | | | | | | | | Programmer param can be NULL and this is a valid case which can be covered by unit test. `run_lifecycle` needs an adjustment to handle NULL as programmer param, which is also included in the patch. Change-Id: I409f1c9ac832943e54107f7cf8652d1f46ac67df Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67642 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>
* tests/parade_lspcon.c: Replace spaces with tabsAnastasia Klimchuk2022-09-201-10/+10
| | | | | | | | | | | | Spaces were accidentally introduced in previous commit, replace with tabs as it should be. Change-Id: Ic3a7d3004b8358953917a6666bcf8f1cdade02fd Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67643 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* flashrom_tester: Fix cargo check and clippy warningsEvan Benn2022-09-198-45/+33
| | | | | | | | | 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.c: Drop `programmer_param` global variableAngel Pons2022-09-181-11/+11
| | | | | | | | | | | | | | | | | | | The `programmer_param` global variable is only valid within the scope of the `programmer_init()` function, which calls a programmer-specific init function that calls `extract_programmer_param_str()` to obtain the value of programmer-specific parameters. Get rid of this global variable by piping the "programmer_param" string through a function parameter specifically added for this purpose in the past, but was not used yet. Change-Id: I59397451ea625bd431b15848bad5ec7cb926f22d Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67649 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* programmer_init: Work on a mutable copy of programmer paramsNico Huber2022-09-181-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | The signature of extract_param() was wrong all the time. It actually modifies the passed, global `programmer_param` string. This only com- piled w/o warnings because of a deficiency of the strstr() API. It takes a const string as argument but returns a mutable pointer to a substring of it. As we take a const parameter string in the libflashrom API and should not change that, we create a copy in programmer_init() instead. Now that we free our copy of the programmer parameters at the end of programmer_init() it's more obvious that the string can only be used during initialization. So also clear `programmer_param` inside programmer_init() instead of programmer_shutdown(). Change-Id: If6bb2e5e4312b07f756615984bd3757e92b86b0a Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67094 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: Thomas Heijligen <src@posteo.de>
* tests: Add workaround to allow tests mock fileno on FreeBSDAnastasia Klimchuk2022-09-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | fileno can be a function and a macro in FreeBSD, depending on whether the environment in multi-threaded or single-threaded. For single thread, macro is used. Macro is expanded into a inline code which accesses private field of file descriptor. This is impossible to mock in tests. Pretending that environment is multi-threaded makes fileno function to be called instead of a macro. Function can be mocked for tests. BUG=b:237606255 TEST=ninja test tests pass on two environments: 1) FreeBSD 13.1-RELEASE-p2 GENERIC amd64 2) Debian 5.17.11 x86_64 GNU/Linux Change-Id: I3789ea9107a4cf8033cf59bb96d3c82aa58de026 TICKET: https://ticket.coreboot.org/issues/411 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67312 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* Revert "flashrom.c: Remove programmer_param global state"Thomas Heijligen2022-09-141-27/+25
| | | | | | | | | | | | | | | | | | This reverts commit 3b8b93e17f6ad861acb2a0810ae1dcf03285fb10. Invoking flashrom with no parameters crashes when calling strdup(NULL) in programmer_init(). Change-Id: I3b689ad4bdd0c9c3b11f30becafc878c78630f0b Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67621 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: Nico Huber <nico.h@gmx.de> Reviewed-by: Jonathon Hall <jonathon.hall@puri.sm> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* print.c: Fix format string for WindowsThomas Heijligen2022-09-131-1/+2
| | | | | | | | | | | | | | dwMajorVersion and dwMinorVersion are DWORDS. Cast them to `unsigned long` to avoid a format error. TEST=Builds on Cygwin (Windows 10, amd64, gcc 11.3.0) Change-Id: I049220089f42e488fcc88e6738522f64171720eb Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66547 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* flashrom.c: Remove programmer_param global stateEdward O'Callaghan2022-09-121-25/+27
| | | | | | | | | | | | | By leveraging the programmer_cfg state machine passed into programmer init() entry-points we may now directly pass programmer parameterisation values and thus rid ourseleves of the singleton pattern around programmer_param. Change-Id: I778609e370e44ad2b63b8baa4984ac03ff4124d8 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66659 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* tests: Guard Linux-specific linux/spidev.h header fileAnastasia Klimchuk2022-09-121-0/+2
| | | | | | | | | | | | | | | | | | This allows unit tests to build on non-Linux platforms. BUG=b:237606255 TEST=unit tests compile on two environments: 1) FreeBSD 13.1-RELEASE-p2 GENERIC amd64 2) Debian 5.17.11 x86_64 GNU/Linux Change-Id: Icdb1b0cb29c5d62187153788ad5e0e631e8d0b62 TICKET: https://ticket.coreboot.org/issues/411 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67311 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* tests: Use MOCK_FD instead of NON_ZERO for file operationsAnastasia Klimchuk2022-09-121-2/+2
| | | | | | | | | | | | | | | | | | NON_ZERO can be a negative number, so MOCK_FD is safer option to use as a mock file descriptor. Also it is more readable. BUG=b:237606255 TEST=ninja test (on linux) Change-Id: I097dd59f69c3fb532ac136796fcf5cae8839af7b TICKET: https://ticket.coreboot.org/issues/411 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67310 Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Alexander Goncharov <chat@joursoir.net> Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* Documentation: Add build instructions for mesonThomas Heijligen2022-09-121-0/+127
| | | | | | | | Change-Id: I3476f17fa274cd71e3e0e84f791d547d08165ecb Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66862 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* meson: Refactor the programmer selectionThomas Heijligen2022-09-124-342/+463
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements a positive selection choice of which programmers should be built. - Each programmer is represented through an entry in the programmer dictionary - The entry contains: - A list of systems and CPU families where the programmer can run on - A list of required dependencies - A list of sources needed to build the programmer - A list of compiler flags - A flag to determin if the programmer should be build on 'auto' - If an entry is not given it is set to the default value - If a programmer gets selected, an 'active' flag is added to the entry on runtime - All programmers with an 'active' flag will be included in the build - One or more programmers can be selected through '-Dprogrammer=<>' - 'auto' enables all programmers which are available, deps are found and have the 'default' flag - 'all' enables all programmers which are available and deps are found - 'group_***' enables all programmers which are available, deps are found and the programmer belongs to the selected group - '_programmer_name_' forces the programmer to be built or the build will fail. Change-Id: Ib44b26e3748fc71f116184082b4aed0bb208b4c1 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/63724 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* meson: Overhaul the print_wiki optionThomas Heijligen2022-09-122-5/+11
| | | | | | | | | | | | | | - Rename `print_wiki` to `classic_cli_print_wiki` - Make it a meson feature type - `classic_cli` must be enabled to enable `classic_cli_print_wiki` - `classic_cli_print_wiki` is disabled by default Change-Id: Ic6c959b8b64ec2756b4535bd1b3320860f836aa5 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66703 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* meson: Build the classic cli / flashrom cli executable as featureThomas Heijligen2022-09-122-13/+16
| | | | | | | | | | | | | | Provide the meson option `-Dclassic_cli=auto/enabled/disabled` to determine if the classic cli flashrom executable should be built. This is needed to support targets, like libpayload, which can only build libflashrom. Change-Id: If39981ad0b3281edd6fc7e220362d2938dddf814 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66705 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* test_build.sh: Enforce tests to be enabledFelix Singer2022-09-081-1/+1
| | | | | | | | | | | Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I00c23a17926ed112522b083f8594596d051cf9f8 Reviewed-on: https://review.coreboot.org/c/flashrom/+/67243 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* Revert "cmocka: Drop as meson subproject"Nico Huber2022-09-083-3/+17
| | | | | | | | | | | | | | | | | | This reverts commit 99eca0899b931b21b7c44ed1753c5f01b35798af. The environment provided by our Jenkins builder doesn't have cmocka. It's not exactly known why it worked as a subproject. However, if it allows us to enforce tests in the CI, we should revert now and drop the subproject again once the environment is updated. Change-Id: Iafdab92eb8ab96d02fb2c29524d785bdc7a54034 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67345 Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* dmi.c: Retype variable `anchored` with boolFelix Singer2022-09-081-3/+4
| | | | | | | | | | | | Use the bool type instead of an integer for the variable `anchored`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I5bedaf47cdd2fd5d152f69b6b02aab69fd1285c6 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66903 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* dummyflasher.c: Retype appropriate variables and attributes with boolFelix Singer2022-09-081-11/+12
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables and attributes, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I712b1ef7e1ad74d3e004dcf36c82898c88072c63 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66901 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* it87spi.c: Retype attribute `fast_spi` with boolFelix Singer2022-09-081-3/+4
| | | | | | | | | | | | Use the bool type instead of an integer for the attribute `fast_spi`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Id28c2c9043dda7a400b8c4e9ca218cb445e97d24 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66900 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* ich_descriptors.c: Retype variable `has_forbidden_opcode` with boolFelix Singer2022-09-081-3/+4
| | | | | | | | | | | | Use the bool type instead of an integer for the variable `has_forbidden_opcode`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I6214956e377547b894fc76237832b6f7b2db41dd Reviewed-on: https://review.coreboot.org/c/flashrom/+/66899 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* fmap.c: Retype appropriate variables with boolFelix Singer2022-09-081-5/+8
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I323d40cabe9c580057d870e742b3b55942c78321 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66896 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* ft2232_spi.c: Retype variable `clock_5x` with boolFelix Singer2022-09-081-2/+3
| | | | | | | | | | | | Use the bool type instead of an integer for the variable `clock_5x`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ie3005f9dcb2dcfe63261c52a36d865d175a0a75c Reviewed-on: https://review.coreboot.org/c/flashrom/+/66895 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* spi25.c: Retype appropriate variables with boolFelix Singer2022-09-081-5/+5
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Icd7e6478848c6f72817da16a5350d450bcc0bb5d Reviewed-on: https://review.coreboot.org/c/flashrom/+/66890 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* tree: Retype variable `laptop_ok` with boolFelix Singer2022-09-084-7/+8
| | | | | | | | | | | | Use the bool type instead of an integer for the variable `laptop_ok`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I5d9fc3516bc2d29f11b056e35b3e5e324ce93423 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66891 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* ichspi.c: Retype appropriate variables with boolFelix Singer2022-09-081-10/+11
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: If7eeacc44921f52aa593ab1302f17a5c5190f830 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66892 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* tree: Retype variable `programmer_may_write` with boolFelix Singer2022-09-085-6/+9
| | | | | | | | | | | | Use the bool type instead of an integer for the variable `programmer_may_write`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I69958527ae018a92f1c42734a7990d0c532dee0c Reviewed-on: https://review.coreboot.org/c/flashrom/+/66885 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* flashrom.c: Retype appropriate variables with boolFelix Singer2022-09-081-5/+6
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I6629f391284c8f1266e4ba66c9976f3df43955d4 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66883 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* linux_mtd.c: Retype appropriate attributes with boolFelix Singer2022-09-081-4/+5
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate attributes, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I8be4e08e714047d155dcc032cc3d8dabb422b27f Reviewed-on: https://review.coreboot.org/c/flashrom/+/66881 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* 82802ab.c: Retype appropriate variables with boolFelix Singer2022-09-081-6/+8
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I5dfd9ed4856c37dd70706b2dd71fbb9a8acbdf4c Reviewed-on: https://review.coreboot.org/c/flashrom/+/66879 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* serprog.c: Retype variable `have_device` with boolFelix Singer2022-09-081-3/+4
| | | | | | | | | | | | Use the bool type instead of an integer for the variable `have_device`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Ia12f1503ae3f7be20a065f22b4ab84c4140cd23e Reviewed-on: https://review.coreboot.org/c/flashrom/+/66878 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* raiden_debug_spi.c: Retype variable `found` with boolFelix Singer2022-09-081-3/+4
| | | | | | | | | | | | Use the bool type instead of an integer for the variable `found`, since this represents its purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I18c69e678017a9c0655a31c0487fd1fb0d85ecf2 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66877 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* pony_spi.c: Retype appropriate variables with boolFelix Singer2022-09-081-28/+29
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables and attributes, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: Iecd98c391a74794647caeeb2715707ccd681463c Reviewed-on: https://review.coreboot.org/c/flashrom/+/66875 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* mstarddc_spi.c: Retype appropriate variables with boolFelix Singer2022-09-081-5/+6
| | | | | | | | | | | | Use the bool type instead of an integer for appropriate variables, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I3a72a0877b47f67f8984c28cbf5b5d429ec1534e Reviewed-on: https://review.coreboot.org/c/flashrom/+/66874 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* internal.c: Retype appropriate variables with boolFelix Singer2022-09-082-14/+16
| | | | | | | | | | | | | Use the bool type instead of an integer for the variables `force_laptop`, `not_a_laptop`, `force_boardenable` and `force_boardmismatch` since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I159d789112d7a778744b59b45133df3928b8445e Reviewed-on: https://review.coreboot.org/c/flashrom/+/66870 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* buspirate_spi.c: Retype appropriate variables with boolFelix Singer2022-09-081-7/+8
| | | | | | | | | | | | Use the bool type instead of integer for appropriate variables, since this represents their purpose much better. Signed-off-by: Felix Singer <felixsinger@posteo.net> Change-Id: I245616168796f2c7fe99388688b0f606bd3405bf Reviewed-on: https://review.coreboot.org/c/flashrom/+/66868 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* usb_device.c: release the usb interface on shutdownThomas Heijligen2022-09-071-1/+4
| | | | | | | | | | | | | | | Following the libusb documentaion: `You should release all claimed interfaces before closing a device handle.` https://libusb.sourceforge.io/api-1.0/group__libusb__dev.html libusb_release_interface() Change-Id: If916574314cd86fad3429065a11707da0a809e0d Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67072 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* ch341a_spi: detach/attach kernel driver explicitlyThomas Heijligen2022-09-071-5/+6
| | | | | | | | | | | | | | | Use `libusb_detach_kernel_driver` and `libusb_attach_kernel_driver` instead of `libusb_auto_detach_kernel_driver` to be compatible with older libusb versions without changing the behavior. TEST=Build with libusb >= 1.0.9 Read spi flash with ch341a programmer on linux Change-Id: Ia649722e64cc97c6b689dd3b764e5c9145959f92 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67071 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* tests: Add wrappers for libusb_(attach|detach)_kernel_driverThomas Heijligen2022-09-073-0/+16
| | | | | | | | | Change-Id: Ia463824a209db65e82ccfbf320368b2ce82eb36f Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67079 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* chipset_enable.c: plumb programmer_cfg into sb600 and ich initEdward O'Callaghan2022-09-071-5/+5
| | | | | | | | | Change-Id: Ic25014cbb983bda6e949bc62e30f2cca51f57a4c Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66674 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* tree: plumb programmer_cfg into chipset_flash_enable()Edward O'Callaghan2022-09-073-4/+4
| | | | | | | | | Change-Id: I963c674d212ce791ee155020fa97bcf26cefca0c Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66673 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* ichspi.c: Allow passing programmer_cfg directlyEdward O'Callaghan2022-09-073-10/+10
| | | | | | | | | | | | | | Modify the type signature of the programmer entry-point xxx_init() functions to allow for the consumption of the programmer parameterisation string data. Also plumb programmer_cfg though get_params. Change-Id: I480589bb50b47fdf5af259d068f49fedfce88ea5 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66661 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* chipset_enable.c: Change doit() and enable_flash_\S() signaturesEdward O'Callaghan2022-09-072-112/+112
| | | | | | | | | | | | | | | Ran; ``` $ sed -Ei 's/int enable_flash_(\S+)\(/int enable_flash_\1(const char *prog_param, /g' chipset_enable.c $ sed -Ei 's/return enable_flash_(\S+)\(/return enable_flash_\1(cfg, /g' chipset_enable.c ``` and dealt with special cases manually. Change-Id: I62c5d49a83ed4afb86ac3f0fae56defa1338ab4f Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66672 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
* tree: Fix drivers to pass programmer_cfg to pcidev_init()Edward O'Callaghan2022-09-0719-20/+22
| | | | | | | | | | | | Allow for programmer_cfg plumbing in pcidev.c The pci drivers impacted are plumbed here as well. Change-Id: Ie0c9d1c0866d44f64d037c596f2e30547fcfd58f Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66671 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>