aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Add Tiger Lake U Premium supportMichał Żygowski2021-11-176-8/+92
| | | | | | | | | | | | | | | | | | | | | | Tiger Lake has very low ICCRIBA (TGL=0x11, CNL=0x34 and CML=0x34) and detects as unknown chipset compatible with 300 series chipset. Add a new enum CHIPSET_500_SERIES_TIGER_POINT and treat it identically to CHIPSET_400_SERIES_COMET_POINT. There are some exceptions though, ICCRIBA is no longer present n descriptor content so a new union has been defined for new fields and used in descriptor guessing. freq_read field is not present on Tiger Lake, moreover in CannonPoint and Comet Point this field is used as eSPI/EC frequency, so a new function to print read frequency has ben added. Finally Tiger lake boot straps include eSPI, so a new bus has been added for the new straps. TEST=Flash BIOS region on Intel i5-1135G7 Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: I28f3b6fe9f8ce9e976a6808683f46b6f4ec72bdd Reviewed-on: https://review.coreboot.org/c/flashrom/+/55578 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* tests: Rename flash context in chip tests to flashctxAnastasia Klimchuk2021-11-081-22/+22
| | | | | | | | | | | | | | | Flash context used to be named `flash` which was missing the context part of it. Now it is renamed into flashctx for clarity. BUG=b:181803212 TEST=ninja test Change-Id: I3f4d9c4fe85752e16bab71ad22b0135a96cac28a Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58596 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* tests: Add tests to write on chipAnastasia Klimchuk2021-11-084-0/+72
| | | | | | | | | | | | | | | | This patch adds two tests and initialises page_size in mock chip chip_W25Q128_V. page_size was not needed for previous tests (erase and read). page_size only needed to execute writing on chip with dummyflasher, so it is added here. BUG=b:181803212 TEST=ninja test Change-Id: I6f0336613ab16a7e59857006496e3590ddb14d00 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58357 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* hwaccess.c: move function declarations from programmer.h to hwaccess.hThomas Heijligen2021-11-074-33/+34
| | | | | | | | | | | | Move declarations for functions implemented in hwaccess.c from programmer.h to hwaccess.h. Change-Id: I075fd86211c766ae3d5f29c76adbd7c5b9bdbd80 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58865 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* Makefile: Move libftdi1 detection to hwlibs targetThomas Heijligen2021-11-071-28/+24
| | | | | | | | | | Handle dependenies as part of the hwlibs target. Change-Id: Ib1e817d1e5248af5797fbb14c864527db6ad570c Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58505 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile: Move NI845X_SPI library detection to hwlibs targetThomas Heijligen2021-11-071-16/+15
| | | | | | | | | | Handle dependenies as part of the hwlibs target. Change-Id: I3a5c5a584390eaf0c5ca169cc051e471f024f15d Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58504 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile: Revise build options for Linux specific headersThomas Heijligen2021-11-075-82/+48
| | | | | | | | | | | | | Clean up the feature target by outsourcing the test to an own variable. Change the print output and don't write to the build-details file. This is in preparation for further changes. Change-Id: I18fc27252afb49fa7d1f2787faee2b5b669275aa Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58627 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile: Revise utsname and clock_gettime testThomas Heijligen2021-11-074-47/+31
| | | | | | | | | | | | | | Clean up the feature target by outsourcing the test to an own variable. Change the print output and don't write to the build-details file. HAS_CLOCK_GETTIME=no replaces DISABLE_CLOCK_GETTIME=yes This is in preparation for further changes. Change-Id: Ie1f43b3d5a8ad79bff3f9bbc21f359ec35abc42a Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58618 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile: compiler target: separate fixed text and value by a colonThomas Heijligen2021-11-071-8/+6
| | | | | | | | | | | Continue to use the "key: value" format like for the C compiler. Use only shell code for TARGET_OS comparison. Change-Id: I69959c20aa2e43ed67b3057c37e964a34cdab136 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58617 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* flashrom.c: Delete obsolete commentSimon Buhrow2021-11-071-1/+0
| | | | | | | | Change-Id: Ibd53fe34c05f87d7ecc0d6eee6463f9da3a174d4 Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58742 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* sb600spi: Cleanup spispeed and spireamode warningsRob Barnes2021-11-041-3/+3
| | | | | | | | | | | | | | | | | | These warnings are printed at error level so they are displayed with every invocation of flashrom. This clutters the flashrom output in the usual case. Move warnings to debug level, add newline and clean up text. TEST=Deploy to guybrush, observe messages are only seen when --verbose is enabled BUG=None BRANCH=None Change-Id: Idf5e735b9e504c943bf93a428da64976d723eb2c Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58529 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* Makefile: Revise C compiler checkThomas Heijligen2021-11-013-15/+14
| | | | | | | | | | | | | Clean up the compiler target by outsourcing the test to an own variable. Change the print output and don't write to the build-details file. This is in preparation for further changes. Change-Id: I3d6f08ef030744c772b4ec0dc2c9e614fb90461d Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58616 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* pony_spi: fix memory leakThomas Heijligen2021-11-011-0/+1
| | | | | | | | | | | | Free data if sp_openserport() fails and pony_spi_init() returns early with 1. Change-Id: I11858bd0bdfe8b6d03af616fe4be4fb047b8dcd9 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58583 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* flashrom_tester: Use elogtool to list firmware eventlogJack Rosenthal2021-10-272-7/+7
| | | | | | | | | | | | | | Mosys is dropping the eventlog command, in favor of the elogtool command provided in coreboot. The output is compatible with what mosys used to output. Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I8c4be82fed28b6a19746e6b93fafce23bd8ede5d Reviewed-on: https://review.coreboot.org/c/flashrom/+/58527 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Ricardo Quesada <ricardoq@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* Makefile: remove NEED_LIBUSB1 from FEATURE_CFLAGSThomas Heijligen2021-10-261-1/+0
| | | | | | | | | | | | NEED_LIBUSB1 is not used outside of the Makefile. No need to pass it to the compiler. Change-Id: Ie7cb3df39daf22cb954186d38ba32812b05d92f9 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58518 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* Makefile: meson.build: remove unused CONFIG_I2C_SUPPORTThomas Heijligen2021-10-262-2/+0
| | | | | | | | | | | | CONFIG_I2C_SUPPORT has no mention in the source code. No need to pass it to the compiler. Change-Id: I2e19335e1b8d39f44dda14edc0a496dda6bc8c9c Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58495 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* Makefile, ich_descriptors_tool/Makefile: unify behaviorThomas Heijligen2021-10-262-9/+8
| | | | | | | | | | | | | | ich_descriptors_tool/Makefile: have the same behavior as the main flashrom Makefile - only set gcc explicit on MinGW HOST_OS - don't fallback to gcc if CC was not set - set CFLAGS and EXEC_SUFFIX for TARGET_OS, not for HOST_OS Change-Id: I353c3de250167994a4aea1edfef57d839e900d78 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58468 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile: unify the use of filterThomas Heijligen2021-10-251-4/+4
| | | | | | | | | | | Make a filter statement easier to read and fix some cosmetics. Change-Id: I6cd1e169b435cadb06423836cd9d64cdd2f51a94 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58451 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* tests: Fix fread wrap to return success by defaultAnastasia Klimchuk2021-10-191-3/+3
| | | | | | | | | | | | | | | | | | Successful return value for fread is the number of items read, and default behaviour for all wraps is to return success. This worked previously because all existing tests have custom mocks for fread, so default behaviour hasn't been used. However next patch in this chain adds new test which needs default fread wrap. BUG=b:181803212 TEST=ninja test Change-Id: I17d82d281a87129843f547b87c18f52aca23314d Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58356 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* tests: Add wrap for libusb_init and use it in dediprog testAnastasia Klimchuk2021-10-184-0/+18
| | | | | | | | | | | | | | | | | | | | Missing wrap for libusb_init has been discovered while working on the test for raiden_debug_spi. Both dediprog (existing test) and raiden_debug_spi (new test, see later in this chain) are using libusb_init, so it definitely needs to be wrapped and added to io_mock. Why tests worked before, without the wrap: my understanding is that real libusb_init was called for dediprog test? Given that tests definitely should not call any real libusb functions, wrap is needed. BUG=b:181803212 TEST=builds and ninja test Change-Id: I51c9cb96db1afb3298f4d098df96509d3cb3c046 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57917 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* tests: Extract libusb wraps into separate fileAnastasia Klimchuk2021-10-183-46/+64
| | | | | | | | | | | | | | In preparation for adding more tests with lots of libusb wraps, existing wraps are extracted into separate file. BUG=b:181803212 TEST=builds and ninja test Change-Id: I17c1cc0189fcb742a99ad1b0fd615ab95504a74a Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57916 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
* tests: Move current_io to io_mock.c be visible across testsAnastasia Klimchuk2021-10-184-41/+66
| | | | | | | | | | | | | | | | | | tests.c is growing and needs to be split, specifically all libusb wraps need to be extracted into their own file. See later in the chain a lot more wraps are added for libusb functions. To be able to split it, current_io needs to be moved one level up, to be visible across tests. This allows having multiple files with wraps, and all the wraps can use current_io. BUG=b:181803212 TEST=builds and ninja test Change-Id: I5327b5de430afe13a8cc931c8b4b188dcb8c8cf6 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57915 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* tests: Move LOG_ME to include/tests.h to be available everywhereAnastasia Klimchuk2021-10-182-3/+2
| | | | | | | | | | | | | | | LOG_ME macro is very generic and can be useful anywhere in tests. Previously was only used in scope of tests.c. With time more tests are added, and more files, LOG_ME needs to be visible everywhere. BUG=b:181803212 TEST=builds and ninja test Change-Id: If7f3d256161bc8b81e996328e445cccab9a82174 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57914 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* tests: Add NON_ZERO macro and not_null function instead of MOCK_HANDLEAnastasia Klimchuk2021-10-183-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds NON_ZERO macro and not_null function into io_mock.h, so that they can be used anywhere in tests. Common usage for not_null is to indicate a valid pointer, where it doesn't matter what the pointer is, only matters it is not null. Common usage of NON_ZERO is to indicate a valid file descriptor, where it only matters the descriptor is non-zero integer. New features replace all usages of previous MOCK_HANDLE. This patch corrects return value from __wrap_ioctl to be successful by default. It used to be MOCK_HANDLE, but should be 0. Included in this patch because this is also a replacement of MOCK_HANDLE. BUG=b:181803212 TEST=builds and ninja test Change-Id: I5ad6ee4aa9091447c6c9108c92bf7f6e755fca48 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57269 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* hwaccess: replace flashrom specific macros by compiler definesThomas Heijligen2021-10-1511-112/+19
| | | | | | | | | | Replace the remaining IS_* macros with the associated compiler defines Change-Id: Ia0f022d12390722816066d292e1878824adc613c Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58280 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* buildsystem: evaluate the USE_IOPL, USE_DEV_IO, USE_IOPERM macrosThomas Heijligen2021-10-153-20/+37
| | | | | | | | | | | Determine which macro has to be set for the target system. Do this in the buildsystem instead of using preprocessor macros. Change-Id: Ic41ea025e35feb93f07ce7a94c0d15e6e84f38b9 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58278 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* buildsystem: handle the IS_WINDOWS macroThomas Heijligen2021-10-153-7/+12
| | | | | | | | | | On Windows target systems set the IS_WINDOWS=1 macro by the buildsystem. Change-Id: I334708f2dec08ec9ca6ad4161fbd7fe22ac023a6 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58277 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* platform.h: remove IS_LINUX and IS_MACOSX macrosThomas Heijligen2021-10-152-12/+2
| | | | | | | | | | | | | | Replace the remaining uses by the plain macros. Windows, Linux and MacOS are the only systems with explicit macros. Only the Windows macro is used in several places. The others can easily be handled like all other systems. Change-Id: I23ec8fdcff8202d10ddf5a7520432e5b26b01cd4 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58276 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* buildsystem: Determine the endianness only in the buildsystemThomas Heijligen2021-10-153-89/+14
| | | | | | | | | | | | | Let the buildsystem (make / meson) handle the endianness determination and set the __FLASHROM_LITTLE_ENDIAN__ or __FLASHROM_BIG_ENDIAN__ macro as cflag. Change-Id: I37093528ae55e712cc30a0267a8ceac332750e7d Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58273 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* Makefile: copy determination test for the endian to Makefile.dThomas Heijligen2021-10-153-8/+92
| | | | | | | | | | | Copy the test code for endian detection in an extra directory to split it from the main flashrom code. Change-Id: I0c2420fd60d7d6a23c94c9962b06bfd7f3c86ad8 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58270 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* Makefile: move determination test for the architecture to Makefile.dThomas Heijligen2021-10-154-21/+54
| | | | | | | | | | | Move the test code for architecture detection in a extra directory to split it from the main flashrom code. Change-Id: I29ce73be9c5cbe259a2471f8eea2f8745b68cdfa Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58269 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile: move determination test for OS to Makefile.dThomas Heijligen2021-10-155-12/+15
| | | | | | | | | | | Move the test code for OS detection in a extra directory to split it from the main flashrom code. Change-Id: Id911f17f4100f242e1fde10d23a8459ddf38b369 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58015 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* Makefile: move determination tests for target systems to one placeThomas Heijligen2021-10-151-17/+9
| | | | | | | | Change-Id: Ia1b3f0257aaeebb355700b65c51a2ba70b80d5ae Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58248 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* serprog: Move content of programmer specific header to C fileFelix Singer2021-10-152-26/+26
| | | | | | | | | | | | Move the programmer specific code into serprog.c and remove its related header file. Change-Id: I5c65f43db200129489d487ff948daa08bd0e92fa Signed-off-by: Felix Singer <felix.singer@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58300 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Nico Huber <nico.h@gmx.de>
* gfxnvidia: Fix indentsFelix Singer2021-10-151-8/+8
| | | | | | | | Change-Id: I18f916923d3574dd8c68019e4db3985444dd7bee Signed-off-by: Felix Singer <felix.singer@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58301 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* Makefile: summarize systems with the same CPPFLAGS and LDFLAGSThomas Heijligen2021-10-141-14/+4
| | | | | | | | | Change-Id: I067430e52eb41bf0af4f08246bbe59117bc09bdb Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58247 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* Makefile: use STRIP_ARGS = -s on all systemsThomas Heijligen2021-10-141-4/+1
| | | | | | | | | | | | Set -s (--strip-all) as STRIP_ARGS explicitly on all systems instead of only on systems (SunOS / Solaris) where strip-all is not the default behavior. Change-Id: I2c80d553fb54d94bc65f07e700c90dd1bae4854e Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58246 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* util: Add Nix shell fileFelix Singer2021-10-101-0/+16
| | | | | | | | | | Add a Nix shell file which is able to compile flashrom. Change-Id: I9757b952f4b034e98c2b4b70fbede52d8efb9d50 Signed-off-by: Felix Singer <felix.singer@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58012 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* raiden_debug_spi: Use new API to register shutdown functionAnastasia Klimchuk2021-10-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | This allows programmer to register shutdown function in spi_master struct, which means there is no need to call register_shutdown in init function, since this call is now a part of register_spi_master. As a consequence of using new API, two things are happening here: 1) No resource leakage anymore in case register_shutdown() would fail, 2) Fixed propagation of register_spi_master() return values. BUG=b:185191942 TEST=test in CB:57918 (Nikolai) tested probe/read/write with a servo micro and puff board Change-Id: I8927224779f24d1fda088991337e54d7272775a6 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57975 Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* raiden_debug_spi: Move shutdown function above spi_master structAnastasia Klimchuk2021-10-101-31/+31
| | | | | | | | | | | | | | | This patch prepares the programmer to use new API which allows to register shutdown function in spi_master struct. See also later patch in this chain, where the programmer is converted to new API. BUG=b:185191942 TEST=test in CB:57918 Change-Id: I567e24c9d39e24a4a1634ddcbdd05930760afcdc Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57974 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* raiden_debug_spi: Use spi data in configure_protocolAnastasia Klimchuk2021-10-101-7/+5
| | | | | | | | | | | | | | | | | | | | Spi data for this programmer now contains pointer to spi_master struct, and can be used in configure_protocol. This patch is making init code of raiden_debug_spi a bit more consistent with other programmers, for example it allows to remove data assignment `spi_config->data = data` from init function. This assignment was only needed for configure_protocol function, and now it is not needed anymore. BUG=b:185191942 TEST=test in CB:57918 Change-Id: I5df0609efcd1fdb274b8cc84536253d5dbae5270 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57973 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* raiden_debug_spi: Link spi_master struct to spi dataAnastasia Klimchuk2021-10-101-4/+5
| | | | | | | | | | | | | | | | | | | | | For this programmer, spi_master struct is dynamically allocated and needs to be freed on shutdown. Adding a pointer to spi data struct allows to link spi_master from spi data, which in turn allows to pass spi data into shutdown function. As a result, both register_spi_master and register_shutdown use the same data, and this unblocks moving raiden_debug_spi to new API (like all the other spi masters in commit a69c5196d20d136b1de120f0fa5ea1e06c3776da). See further patches in this chain. BUG=b:185191942 TEST=test in CB:57918 Change-Id: I5400802aa6961538df12fcd5339f7e2a5db145a1 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57972 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* ft2232_spi: reintroduce generic GPIOL controlMichael Niewöhner2021-10-042-9/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reintroduces a reworked version of the GPIOL pin control first introduced in commit 3207844 (CB:49637), which was reverted in commit 6518cf3 (CB:55692) due to breakage. This change introduces a new argument `gpiolX` to allow use of the four GPIOL pins either as generic gpios or as additional CS# signal(s). `X` specifies the GPIOL pin (0-3) to be set to one of [HLC] with the following meaning: * H - set the pin as output high * L - set the pin as output low * C - use the pin as additional CS# signal The third value, `C`, aims to replace the parameter `csgpiol`, that is now marked as deprecated and can be removed at some point in the future. `gpiol` and `csgpiol` are mutually exclusive and use of both results in an error. Multiple pins may be set by specifying the parameter multiple times. Documentation was updated/added accordingly. Test: All pin levels/modes have been verified to behave correctly with a logic analyzer. Change-Id: I3989f0f9596c090de52dca67183b1363dae59d3a Signed-off-by: Alan Green <avg@google.com> Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57810 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* ich_descriptors: Add explicit checks for all chipsetsDavid Hendricks2021-10-011-10/+19
| | | | | | | | | | | | | | | | This partially undoes changes made in commit cd9b7b427 (ich_descriptors: Normalize chipset detection) to re-add explicit matching of each chipset with one or more strap length values. Since ranges are checked explicitly, the `warn_if` parameter to warn_peculiar_desc() is no longer necessary and is removed. Change-Id: Ica49477492876810a6fa212768b1ab9e8c12001f Signed-off-by: David Hendricks <ddaveh@amazon.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57793 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de>
* flashrom.8: carve out `csgpiol` into its own sectionMichael Niewöhner2021-10-011-6/+11
| | | | | | | | | | | | Documentation for `csgpiol` was put into the generic programmer options section. Move it to its own section. Change-Id: Ic7379331d36b3068eacde5a983b4ccb3afc56c51 Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57893 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* ft2232_spi: prevent use of reserved pins on some programmersMichael Niewöhner2021-10-011-0/+12
| | | | | | | | | | | | | On some programmers an output buffer needs to be enabled by pulling a gpio high/low. This gpio can not be used for `csgpiol`. Prevent this by printing an error. Change-Id: Ied450fa5ef358153adefec3beabc63a62c9f60cd Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57809 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* flashchips.c: mark EN25F10 as TEST_OK_PREWSimon Buhrow2021-10-011-1/+1
| | | | | | | | | | As reported by Wolf Dieter Brandt in his e-mail from 09.Aug.2021. Change-Id: I0c19f84780e7fa3699fd706f8e105fc5937ba8bf Signed-off-by: Simon Buhrow <simon.buhrow@posteo.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58031 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* tests: Revise mock chip definition and usageAnastasia Klimchuk2021-10-011-117/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is doing few things: 1) Makes chip definitions static global so that they can be reused between test functions. 2) Promotes existing mock chip from 8KiB to 8MiB and eraseblocks are expanded accordingly. Old value of 8KiB was very small and it was confusing. Mock chip looks more realistic now. 3) Uses KiB and MiB macros from flash.h for mock chip definition 4) Renames CHIP_TOTAL_SIZE to MOCK_CHIP_SIZE to avoid confusion (there is also a W25Q128.V chip in the tests) 5) Makes chip definitions const so that every test can work on a fresh copy on the stack. BUG=b:181803212 TEST=builds and ninja test Change-Id: Ia9b5fc71e30610684e68e9aca9fb1970da8f840a Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57437 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* tests: Add tests to read from chipAnastasia Klimchuk2021-10-015-0/+146
| | | | | | | | | | | | | | | | | | | | Two tests cover the code which performs do_read operation. First one works with fake chip and dummy programmer. Fake chip has all operations defined, and a buffer to emulate chip memory. Second one uses the chip which is closer to the real one, because read/write/unlock/erase operations are real. The tests takes the advantage of dummyflasher's capability of emulating a W25Q128.V chip. BUG=b:181803212 TEST=builds and ninja test Change-Id: Ia57781ebc670c7bd6197e56fe8a20651a425c756 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57326 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* tests: Extract setup and teardown for chip testsAnastasia Klimchuk2021-10-011-55/+47
| | | | | | | | | | | | | | | Steps to setup and teardown for a chip test are repeated for every test, so they can be extracted into their own functions. BUG=b:181803212 TEST=builds and ninja test Change-Id: If59315646f06344664df08b145866d9ce846d751 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57436 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>