summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* console/flashsconsole: Add spi flash console for debuggingYouness Alaoui2017-06-042-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | If CONSOLE_SPI_FLASH config is enabled, we write the cbmem messages to the 'CONSOLE' area in FMAP which allows us to grab the log when we read the flash. This is useful when you don't have usb debugging, and UART lines are hard to find. Since a failure to boot would require a hardware flasher anyways, we can get the log at the same time. This feature should only be used when no alternative is found and only when we can't boot the system, because excessive writes to the flash is not recommended. This has been tested on purism/librem13 v2 and librem 15 v3 which run Intel Skylake hardware. It has not been tested on other archs or with a driver other than the fast_spi. Change-Id: I74a297b94f6881d8c27cbe5168f161d8331c3df3 Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm> Reviewed-on: https://review.coreboot.org/19849 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
* ifdtool: avoid potential unaligned pointer usageRonald G. Minnich2017-06-021-12/+14
| | | | | | | | | | | | | | | | | | | | In get_region, ifdtool assigns a not-known-to-be-aligned pointer to a uint32_t *. Now you know and I know that it is almost certainly aligned, but clang on OSX doesn't like this, and it's a dicey thing to do in any event, just waiting to hit someone hard at some future date. Assign the pointer to a void * and use memmove to copy the value to a uint32_t. This usage is more portable to all little-endian architectures, now, but is still not endian-safe. I doubt we'll ever care. Change-Id: Ifb2f260c3363ab0f5b4a59e5a4e0b5ecf049fa96 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: https://review.coreboot.org/19921 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* util/abuild: Start junit testcase block on kconfig failureMartin Roth2017-05-271-0/+1
| | | | | | | | | | | This should allow Jenkins to parse the build failures when Kconfig generates an error. Change-Id: I5f9083c346ac7b6502f854b7e1f1054e81954d76 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/19861 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbfscomptool: fix display of time_tMike Frysinger2017-05-271-1/+1
| | | | | | | | | | | Not all systems have sizeof(time_t) == sizeof(long), so cast the delta here to a long to match the %ld format. Change-Id: If235577fc35454ddb15043c5a543f614b6f16a9e Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://review.coreboot.org/19902 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* util/hugo: no need to enable an interactive terminalPatrick Georgi2017-05-261-1/+1
| | | | | | | | Change-Id: Iac4cdb003b2fe967b303c1f8e0eeb61673a02858 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: https://review.coreboot.org/19930 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: Patrick Georgi <pgeorgi@google.com>
* util/hugo: mark source mounts read-onlyPatrick Georgi2017-05-261-1/+1
| | | | | | | | | | | hugo has no need to write there, it should only write to the output directory. Change-Id: Ie320f5017feccfa2e9ecba3c802e040487b44d67 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: https://review.coreboot.org/19929 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util/hugo: Add framework to build www.coreboot.org/DocumentationPatrick Georgi2017-05-259-0/+1150
| | | | | | | | | | | | | www.coreboot.org/Documentation is now built with hugo (www.gohugo.io) based on files in this repo's /Documentation directory. Also clarify that new additions to Documentation are under CC-BY 4.0 terms. Change-Id: I000e15b29a182bb88b40de3d0178bf8cc54ba8af Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: https://review.coreboot.org/19881 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
* util/lint: ignore some more binary file typesPatrick Georgi2017-05-251-1/+1
| | | | | | | | | | Namely png (images) and eot, ttf, woff (fonts) Change-Id: I41e773c0adab796876a3b1e91e089ae89cbb04df Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: https://review.coreboot.org/19880 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
* cbmem_console: Improve 'cbmem -1' behavior for truncated pre-CBMEM logsJulius Werner2017-05-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The 'cbmem -1' flag that cuts off console output before the last boot will ignore content from earlier stages if it was truncated due to lack of pre-CBMEM console space. This patch makes the "log truncated" message more specific and adds it as an additional cut-off marker to 'cbmem -1' to counteract that problem. Also raise the log level of the coreboot banner one step to BIOS_NOTICE to make it more likely to be included in the output for 'cbmem -1' to find. (I believe NOTICE is reasonable but I wouldn't want to go as far as WARN which should be reserved for actual problems. Of course this is not ideal, but then again, our whole log-level system really isn't... it would be better if we could make it always print a banner to the CBMEM console without affecting the UART at the same time, but that would require a larger amount of work.) Change-Id: I58288593dfa757e14f4a9da4ffa7e27b0b66feb9 Reported-by: https://ticket.coreboot.org/issues/117 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/19720 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* util/release: Update build-release scriptMartin Roth2017-05-161-9/+11
| | | | | | | | | | | | | | | | - Put parameter comments and help text in the same order as the actual parameters. - Don't clone a new release tree from coreboot.org if a tree already exists. - Change COMMIT_ID parameter from optional to required. If it was omitted previously, the head of the master branch would be used. Change-Id: Ifa434a4911dec777004788e3cf4e3436875d929b Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/19126 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
* xcompile: replace -print-librt-file-name with -print-libgcc-file-namePatrick Georgi2017-05-161-1/+1
| | | | | | | | | | | | | | The former only exists with a custom patch while the latter is supported by clang and in the absense of libgcc even points to clang's own runtime libraries. Change-Id: I1e30d5518cf78e1d66925d6f2ccada60a43bb4f8 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/19658 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@google.com> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
* util/cbmem: mmap underflow on low addressesAaron Durbin2017-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is code to adjust the mapping down if a mmap fails at a physical address. However, if the address is less than the page size of the system then the physical offset will underflow. This can actually cause a kernel panic on when operating on /dev/mem. The failing condition happens when the requested mapping at 0 fails in the kernel. The fallback path is taken and page size is subtracted from 0 making a very large offset. The PAT code in the kernel fails with a BUG_ON in reserve_memtype() checking start >= end. The kernel needs to be fixed as well, but this fallback path is wrong as well. BUG=b:38211793 Change-Id: I32b0c15b2f1aa43fc57656d5d2d5f0e4e90e94ef Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/19679 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* util: Add tools for dumping and inserting KBC1126 firmware images.Iru Cai2017-05-114-0/+303
| | | | | | | | Change-Id: Ic521b177b9602ff042312cccaaa89371db7c5855 Signed-off-by: Iru Cai <mytbk920423@gmail.com> Reviewed-on: https://review.coreboot.org/19071 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* intelmetool: Enable warning *set-but-unused-variable*Paul Menzel2017-05-111-1/+1
| | | | | | | | | | | | | | There are no GCC warnings anymore about set but unused variables, and Clang warns about this switch, as it doesn’t know it. So remove the switch to use the default set by the switch `Wall`. Change-Id: Ie9eb26d4f8b298af231b952b547b71d68c649eaf Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: https://review.coreboot.org/19613 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
* intelmetool: Comment out unused variablePaul Menzel2017-05-111-3/+3
| | | | | | | | | | | | | | | | | | | | Only commented out code uses the variable `csr`, and GCC complains about it, when enabling the warning *unused-but-set-variable*. ``` Checking for pciutils and zlib... me.c: In function ‘mei_dump’: me.c:50:18: warning: variable ‘csr’ set but not used [-Wunused-but-set-variable] struct mei_csr *csr; ^~~ ``` As the code is commented, also comment out the declaration of the variable. Change-Id: I4ecb2b5e9f32906ccfc8a0628d2e0f2d3ad39a02 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: https://review.coreboot.org/19612 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* intelmetool: Enhance missing packages helpVincent Legoll2017-05-111-2/+3
| | | | | | | | | | On Ubuntu 16.04 the libpci-dev package is required. Change-Id: I942b3e96f5b8112166a105eb5a61f8f3cf16cb7c Signed-off-by: Vincent Legoll <vincent.legoll@gmail.com> Reviewed-on: https://review.coreboot.org/19617 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
* superiotool: Add registers of LPC47N217Iru Cai2017-05-081-0/+13
| | | | | | | | Change-Id: I460663593dc32f5b52c19c3f19fbc35b8252ed4d Signed-off-by: Iru Cai <mytbk920423@gmail.com> Reviewed-on: https://review.coreboot.org/19606 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* intelmetool: Use correct type for pointerPaul Menzel2017-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Use `uintptr_t` instead of `uint32_t`, fixing the error below on 64-bit systems, where pointers are 64-bit wide. ``` cc -O0 -g -Wall -W -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-sign-compare -Wno-unused-function -c -o intelmetool.o intelmetool.c intelmetool.c: In function ‘dump_me_memory’: intelmetool.c:85:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] dump = map_physical_exact((off_t)me_clone, (void *)me_clone, 0x2000000); ^ ``` BUG=https://ticket.coreboot.org/issues/111 Change-Id: Id8d778e97090668ad9308a82b44c6b2b599fd6c3 Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-on: https://review.coreboot.org/19567 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Paul Wise (Debian) <pabs@debian.org>
* blobtool/ifd-x200.set: Fix flashmap0 NRArthur Heymans2017-05-051-1/+1
| | | | | | | | | | | | NR indicates the last non empty region, which in this case is GbE (region3). Needed for flashrom ifd layout support. Change-Id: I3f4dcb0d41718dd176982679f8e045681fd3f486 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/19565 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* intelmetool: handle failures to mmap MEI memoryPaul Wise2017-05-052-0/+14
| | | | | | | | | | | | | | Fixes crashes when there is an error mapping memory. Error mapping physical memory 0x0000004275159040 [0x4000] ERRNO=1 Segmentation fault (core dumped) Change-Id: I5becc0c2870dd97297c4e8d1b101b95b31792ca7 Signed-off-by: Paul Wise <pabs3@bonedaddy.net> Reviewed-on: https://review.coreboot.org/19562 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* intelmetool: free sb pci_dev struct allocated by pci_get_dev()Paul Wise2017-05-051-0/+1
| | | | | | | | | | | This fixes a memory leak in the activate_me() function. Change-Id: I011b2f96122d8f88aed121352afe3f0d41edef60 Signed-off-by: Paul Wise <pabs3@bonedaddy.net> Reviewed-on: https://review.coreboot.org/19561 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* intelmetool: Print strerror() results for mmap errorsPaul Wise2017-05-051-4/+5
| | | | | | | | | | | These are more human readable for folks not familiar with errno values. Change-Id: I21352a00b583163472ccd3302a83adf1f8396c61 Signed-off-by: Paul Wise <pabs3@bonedaddy.net> Reviewed-on: https://review.coreboot.org/19560 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
* util/autoport: Add the PCI ID of the iGPU for the Intel i7 3770KOmar Pakker2017-05-031-1/+1
| | | | | | | | | | | | This adds one of the Xeon labeled PCI IDs used in Sandy-/Ivy Bridge generation processors. This ID is used by the non-Xeon i7 3770K. Change-Id: Iad7745136efeb10ff745001413f4ccb6488b5ec0 Signed-off-by: Omar Pakker <omarpakker+coreboot@gmail.com> Reviewed-on: https://review.coreboot.org/19516 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* cbmem: Add new command line flag to dump console for one boot onlyJulius Werner2017-05-021-4/+37
| | | | | | | | | | | | | | | | | | | | Even though the persistent CBMEM console is obviously awesome, there may be cases where we only want to look at console output from the last boot. It's easy to tell where one boot ends and another begins from the banner message that coreboot prints at the start of every stage, but in order to make it easier to find that point (especially for external tools), let's put that functionality straight into the cbmem utility with a new command line flag. Use the POSIX/libc regular expression API to find the banner string for maximum compatilibity, even though it's kinda icky. Change-Id: Ic17383507a884d84de9a2a880380cb15b25708a1 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/19497 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
* mb/*/mainboard.c: Get rid of SPI AFC registerPatrick Rudolph2017-05-011-1/+1
| | | | | | | | | | | | | The AFC—Additional Flash Control Register is set by southbridge code. Remove redundant calls and get rid of it in autoport. Change-Id: I627082e09dd055e3b3c4dd8e0b90965a9fcb4342 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/19493 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
* util/inteltool: Add support for Wildcat Point-LP PremiumYouness Alaoui2017-05-015-0/+6
| | | | | | | | | | | | The Wildcat Point-LP Premium is handled the same as the Wildcat Point-LP, but it wasn't supported by inteltool. Change-Id: I694514e1963f074582a3f5f81d63c20e7fa49189 Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm> Reviewed-on: https://review.coreboot.org/19445 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* util/inteltool: Break long lines in supported_chips_listYouness Alaoui2017-05-011-25/+50
| | | | | | | | | | | | | | Lint prevents my next commit which adds a new line to the table so it's better to break all the > 80 character lines so it will be consistent with the new line I'm about to add. Change-Id: Ic7ad0cb90e861cd830db1186225d4f839250792a Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm> Reviewed-on: https://review.coreboot.org/19444 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Martin Roth <martinroth@google.com>
* crossgcc: disable libsanitizer for the bootstrapped compilerPatrick Georgi2017-04-281-0/+1
| | | | | | | | | | | | | | | | | | Ironically enough, libsanitizer is notorious for creating "uninitialized variable" warnings with different compiler versions than the one it's shipping with. Since we don't need it for building the real compiler, just skip it. Fixes building our compilers using the gnat-gpl 2014 compilers. Change-Id: I2130dfdf3eaf07d77cd70777419fc0ae4642b843 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/19478 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
* amdfwtool: Move normal firmware 2 after fanless firmware2sMarc Jones2017-04-271-2/+2
| | | | | | | | | | | | | | | Move the images around in the image stitching. This addresses an issue found with PSP firmware loading on the Google Kahlee mainboard. Note firmware1 must come before firmware2 in the image or the PSP will not allow APU to execute. Change-Id: I85963fa93d6efd707cedfbc04b92d302ad5de3b1 Signed-off-by: Marc Jones <marcj303@gmail.com> Reviewed-on: https://review.coreboot.org/19170 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
* crossgcc: fix DESTDIR buildsPatrick Georgi2017-04-271-1/+12
| | | | | | | | | | | | | We need to rewrite libtool's files (foo.la) a couple of times so it knows where to look (while still whining that $DESTDIR$TARGET != $TARGET. well, duh.) Change-Id: I54cafd47c76d855222ba905b5eb4533a23bdfd34 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/19463 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* util/ectool: Dump ram by defaultArthur Heymans2017-04-251-2/+1
| | | | | | | | | | | | | | | | According to the comment above the default should dump the EC ram, though is never reached since the variable 'write_addr' is not 0, but initialized at -1. Also removes brackets around one line statement below if to make checkpatch.pl happy. Change-Id: I390996b253f2f20682cd9ab2d4f560de6eccfc57 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/19152 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
* util/ectool: Fix timeout on sending EC commandArthur Heymans2017-04-251-1/+1
| | | | | | | | | | | | | | When setting output to verbose, it incorrectly reports that it times out on every command. TESTED on Thinkpad X60. Change-Id: I24f05f0c165462d5ba2604c7e2fe139400683275 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/19151 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
* lib: provide clearer devicetree semanticsAaron Durbin2017-04-251-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | The devicetree data structures have been available in more than just ramstage and romstage. In order to provide clearer and consistent semantics two new macros are provided: 1. DEVTREE_EARLY which is true when !ENV_RAMSTAGE 2. DEVTREE_CONST as a replacment for ROMSTAGE_CONST The ROMSTAGE_CONST attribute is used in the source code to mark the devicetree data structures as const in early stages even though it's not just romstage. Therefore, rename the attribute to DEVTREE_CONST as that's the actual usage. The only place where the usage was not devicetree related is console_loglevel, but the same name was used for consistency. Any stage that is not ramstage has the const C attribute applied when DEVTREE_CONST is used. Change-Id: Ibd51c2628dc8f68e0896974f7e4e7c8588d333ed Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/19333 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
* util/nvidia/cbootimage: Update to upstream masterMartin Roth2017-04-241-0/+0
| | | | | | | | | | | | | | | | This brings in 2 new commits from the upstream cbootimage repository, merged to the upstream tree April 12, 2016 and July 28, 2016 64045f9 bct_dump: don't crash on devices without RSA support ea1e03d sign.sh: Add more features Change-Id: I3b6c0c2c855044d7fce87eff9954bce5035ca966 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/18955 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util/lint: Don't run checkpatch on the documentationMartin Roth2017-04-241-1/+2
| | | | | | | | | | Change-Id: Ib95a7c9c64c481af7dcf1074ffc0fc76dc6b6ff9 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/19144 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* mma: update mma setup script for v2.1018Pratik Prajapati2017-04-241-9/+18
| | | | | | | | | | | | | MMA blobs internal version 2.1018 adds more tests. This patch updates the script to accommodate that change. MMA blobs are part of chrome private repository. Change-Id: Iff660fdfdfcd7acc3820c5550740276be6213877 Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com> Reviewed-on: https://review.coreboot.org/19259 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* util/blobtool: Update blobtool.yMartin Roth2017-04-242-124/+152
| | | | | | | | | | | | | | - Refactor the spec & setter file reads into a separate function. - Make sure files can actually be opened before reading from them. - Check all malloced variables. - Set functions with no declatations as static. - Update blobtool.tab.c_shipped to the latest version. Change-Id: Ie97fff84493a06f48d8673d388c3882028d048ca Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/19231 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util/blobtool: clean up blobtool.l a bitMartin Roth2017-04-242-111/+77
| | | | | | | | | | | | | | | | | | | | - Rewrite STRING and COMMENT expressions to remove need for CHARS. - Clean up regular expressions - get rid of unnecessary expressions. - Remove extra newline from the end of the file. - Clean up stripquotes() function -- Remove unnecessary backslashes in '\"' -- Check malloc for failure -- Remove unnecessary assignment of 0 to the end of the new string, snprintf will take care of it. - Update blobtool.lex.c_shipped to the new version. Change-Id: I002962cfae0816ed3c7a5811dfb1b8b48fdc5729 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/19230 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* Turn CBMEM console into a ring buffer that can persist across rebootsJulius Werner2017-04-201-24/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows the CBMEM console to persist across reboots, which should greatly help post factum debugging of issues involving multiple reboots. In order to prevent the console from filling up, it will instead operate as a ring buffer that continues to evict the oldest lines once full. (This means that if even a single boot doesn't fit into the buffer, we will now drop the oldest lines whereas previous code would've dropped the newest lines instead.) The console control structure is modified in a sorta backwards-compatible way, so that new readers can continue to work with old console buffers and vice versa. When an old reader reads a new buffer that has already once overflowed (i.e. is operating in true ring buffer mode) it will print lines out of order, but it will at least still print out the whole console content and not do any illegal memory accesses (assuming it correctly implemented cursor overflow as it was already possible before this patch). BUG=chromium:651966 TEST=Rebooted and confirmed output repeatedly on a Kevin and a Falco. Also confirmed correct behavior across suspend/resume for the latter. Change-Id: Ifcbf59d58e1ad20995b98d111c4647281fbb45ff Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/18301 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* util/inteltool: Add ICH10 (Consumer Base) supportArthur Heymans2017-04-156-0/+7
| | | | | | | | | | | | Reuses ICH10R functions. TESTED on Intel DG43GT (Not supported by coreboot) Change-Id: If9ae8ba8b95e3a7bf6596ae639eb8cafab583298 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/19232 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
* util/blobtool & sconfig: Update GENPARSER Kconfig questionMartin Roth2017-04-142-2/+2
| | | | | | | | | | | | | | | | | blobtool uses the same sort of update mechanism for the .l & .y files, so update the SCONFIG_GENPARSER Kconfig question to encompass both utilities. - Change the name to UTIL_GENPARSER, and update the help text. - Update sconfig's makefile. - Add the check to blobtool's makefile. - Update the makefiles to check for y, not defined. Change-Id: I6215791c9a019bce37d4a150b65d1fdbb9073156 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/19229 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util/blobtool: Hook into coreboot buildMartin Roth2017-04-144-0/+3975
| | | | | | | | | | | | | | | | Add a Makefile.inc, based on sconfig's, to use the _shipped variants so that the build doesn't have to generate them with flex & bison. The GENPARSER check is inactive, and will be updated in the next commit. Add the c_shipped & h_shipped files for the current .l & .y files. Change-Id: Ia6c68bfb6e0611ceb6bc76cc66e43266bafc98ad Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/19228 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbmem: Add custom aligned memcpy() implementationJulius Werner2017-04-141-1/+31
| | | | | | | | | | | | | | | | On some architectures (like AArch64), /dev/mem mappings outside of the area marked as normal RAM use a memory type that does not support unaligned accesses. The libc memcpy() implementation on these architectures may not know or expect that and make an unaligned access for certain source/dest/length alignments. Add a custom memcpy() implementation that takes these restrictions into account and use it anywhere we copy straight out of /dev/mem memory. Change-Id: I03eece380a14a69d4be3805ed72fba640f6f7d9c Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/18300 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* util/intelmetool: Check for NULL return from pci_lookup_nameYouness Alaoui2017-04-041-0/+4
| | | | | | | | | | | | pci_lookup_name might return NULL from using format_name internally which could cause a crash when trying to print that value. We check for NULL and print a more appropriate value in that case. Change-Id: I499f0b5e1681f3926df0d8a325aab2c666ebd632 Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm> Reviewed-on: https://review.coreboot.org/19089 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
* abuild: add timeless build command line parameterMartin Roth2017-04-041-3/+8
| | | | | | | | | | Update ABUILD_VERSION for the timeless & checksum parameters. Change-Id: I96b4c027ccf3e5563dbf4598a0d1fb5e83a5985a Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/19034 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util/abuild: Save checksums of build filesMartin Roth2017-04-041-1/+11
| | | | | | | | | | | | | | | | - Add --checksum command line parameter to specify a base path and filename for the checksums to be saved into. - Save checksums of each platform into the specified file appended with "_platform" - Save a sha256 checksum of the sorted config.h into the base file appended with "_config" Change-Id: Id24dc4b10afbd35cdb8750f75b934419e6e80290 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/19033 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util/docker: Update makefile for servers and local useMartin Roth2017-04-041-8/+104
| | | | | | | | | | | | | | | | | | | | | - Add some variables to allow server customizations. - Verify that coreboot images and containers exist before trying to remove them. - Add a couple of convenience targets: clean & cleanall to remove coreboot containers and images or ALL containers and images. - Add docker-what-jenkins-does target to run a test build locally inside a docker image. - Add docker-jenkins-server target to test the server configuration and run the jenkins docker image. - Add docker-jenkins-shell and docker-shell targets to run the coreboot-sdk and coreboot-jenkins-server images. - Update the help. Change-Id: I1896f33e7eddfe3248f44ae780de65ce50d5dd99 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/18004 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* util/intelmetool: Fix access to deleted data on stackYouness Alaoui2017-04-041-6/+7
| | | | | | | | | | | | | | | | pci_me_interface_scan was returning (via argument 'name') a pointer to the interface name which was stored in a stack variable. This caused part of the name to be printed as garbage stack data in some situations if stack data was overwritten. This moves the name buffer to the calling function so it can be accessed before it gets overwritten. Change-Id: I947a4c794ee37fe87e035593eaabcaf963b9875e Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm> Reviewed-on: https://review.coreboot.org/19066 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
* cbfstool/ifwitool: Remove unnecessary assignmentPaul Menzel2017-03-291-2/+2
| | | | | | | | | | | | | | | | | Fix the warning below. ``` util/cbfstool/ifwitool.c:551:2: warning: Value stored to 'offset' is never read offset = read_member(data, offset, sizeof(h->fit_tool_version), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Found-by: scan-build from clang 3.8.1 Change-Id: I6c322a335a371a20561b32e04e7dcc7310dab607 Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-on: https://review.coreboot.org/18667 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
* util/futility/Makefile: Update clean targetMartin Roth2017-03-291-2/+3
| | | | | | | | | | | | | | - Fix clean target to pass if output doesn't exist - Make sure $(RM) is actually defined Change-Id: Ibcdb0e329084f58b27c3f53213a237d02c922a51 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/18998 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>