summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* vgabios: fix compilation after x86emu changesStefan Reinauer2015-10-2514-84/+145
| | | | | | | | | | | | | | This utility links in coreboot code, and has been broken for a while again after removing some hacks from coreboot. I hadn't realized how bad it was broken last time, and since most of this stuff is still in a pretty bad shape, I decided to throw all of the changes together. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Change-Id: If3e4399b1b0e947433b97caa29962ef66ea2993d Reviewed-on: http://review.coreboot.org/11736 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbfstool: have decompress functions provide ouput data sizeAaron Durbin2015-10-254-7/+17
| | | | | | | | | | | | | | Currently cbfs stage files that are compressed do not have the decompressed size readily available. Therefore there's no good way to know actual size of data after it is decompressed. Optionally return the decompressed data size if requested. Change-Id: If371753d28d0ff512118d8bc06fdd48f4a0aeae7 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/12173 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbfstool: initialize offset field in buffer_init()Aaron Durbin2015-10-251-0/+1
| | | | | | | | | | | | | If one wants to use buffer_init() for initializing a struct buffer all the fields should be initialized. Change-Id: I791c90a406301d662fd333c5b65b2e35c934d0f7 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/12172 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util: Update makefiles for junit testingMartin Roth2015-10-246-23/+13
| | | | | | | | | | | | | | | | - Have clean remove junit.xml files. - Remove junit.xml target from cbmem makefile - this is in the top level Makefile.inc now. - add distclean targets to makefiles. - Make sure all makefiles have .PHONY set up. - rm commands need -f or they will fail if the file they're trying to remove doesn't exist, causing the build to fail. Change-Id: I2f0635f2c0a9417e3377a90c8d67103323c4a72f Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: http://review.coreboot.org/12120 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* intelvbttool: Add MakefilePaul Menzel2015-10-241-0/+35
| | | | | | | | | | | | | | | | | | | Add minimal Makefile based on cbmem’s Makefile. The make target `junit.xml` is removed as this is handled differently since commit de9adebb (Add junit.xml code to top Makefile.inc instead of utils). Also the `junit.xml` is removed in the make target `clean`. Additionally, the make target `distclean` is added, as the current junit.xml code in the top `Makefile.inc` requires that. Change-Id: I164b1f7733505bca6248d0711d7ad71d635fa926 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/11876 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
* cbfstool: Make sure fileno is available on CygwinStefan Reinauer2015-10-231-1/+7
| | | | | | | | | | | | | | | | | | | | | This patch fixes compilation of cbfstool on Cygwin. As reported in http://review.coreboot.org/#/c/10027 cbfstool on Cygwin likes to be compiled with -D_GNU_SOURCE. That patch was abandoned because it would unwantedly turn on more GNU extensions. Instead of doing that, only enable the define on Cygwin, switch to -std=gnu99 instead of -std=c99 to make fileno and strdup actually available. A MINGW32 check that was forgotten in Makefile was copied over from Makefile.inc to keep the two files in sync. This patch has no impact on non-Windows builds. Change-Id: I068b181d67daf9c7280110e64aefb634aa20c69b Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/11667 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
* MAINTAINERS: Add script to test database and find maintainersStefan Reinauer2015-10-231-0/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This utility should make it easier to complete and maintain the database of coreboot subsystem maintainers (MAINTAINERS file) This will need a bit of tender love and care to print information in an easily machine readable output for the build system, but its a first start to query the maintainers database. Build with: $ go build util/scripts/maintainers.go Find a maintainer for a set of files with: $ ./maintainers Makefile Makefile.inc Makefile is in subsystem BUILD SYSTEM Maintainers: [Patrick Georgi <patrick@georgi-clan.de>] Makefile.inc is in subsystem BUILD SYSTEM Maintainers: [Patrick Georgi <patrick@georgi-clan.de>] Check the maintainer database with: $ ./maintainers .gitignore has no subsystem defined in MAINTAINERS .gitmodules has no subsystem defined in MAINTAINERS .gitreview has no subsystem defined in MAINTAINERS 3rdparty/arm-trusted-firmware has no subsystem defined in MAINTAINERS 3rdparty/blobs has no subsystem defined in MAINTAINERS 3rdparty/vboot has no subsystem defined in MAINTAINERS COPYING has no subsystem defined in MAINTAINERS Documentation/AMD-S3.txt has no subsystem defined in MAINTAINERS Documentation/CorebootBuildingGuide.tex has no subsystem defined in MAINTAINERS Documentation/Doxyfile.coreboot has no subsystem defined in MAINTAINERS [..] Change-Id: I49c43911971152b0e4d626ccdeb33c088e362695 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/12119 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool: Fix tolower() calls on CygwinStefan Reinauer2015-10-231-2/+2
| | | | | | | | | | | | | | | | Cygwin complains: cbfstool.c: 1075:5 error: array subscript has type 'char' [-Werror=char-subscripts] so add an explicit cast. Change-Id: Ie89153518d6af2bacce3f48fc7952fee17a688dd Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/11666 Tested-by: build bot (Jenkins) Reviewed-by: Zheng Bao <zheng.bao@amd.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* cbfstool/Makefile: Also rm fmd_(parser|scanner).[ch] in cleanNico Huber2015-10-221-0/+1
| | | | | | | | | Change-Id: I783aa4b2319aaedd57ce9a67ca935392a611298f Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/12127 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* cbfstool/Makefile: Drop unused, irritating definition of `obj`Nico Huber2015-10-221-1/+0
| | | | | | | | | Change-Id: Id8dda8a973dcf991ac494c2d50258d1b51e43c6a Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/12126 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* gma ACPI: Make brightness levels a per board settingNico Huber2015-10-221-0/+2
| | | | | | | | | | | | Those are actually board specific. Keep the old value as defaults, though. The defaults are included by all affected boards. Change-Id: Ib865c7b4274f2ea3181a89fc52701b740f9bab7d Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11705 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
* Revert "Remove sandybridge and ivybridge FSP code path"Martin Roth2015-10-221-1/+1
| | | | | | | | | | | | | | | Please don't remove chipsets and mainboards without discussion and input from the owners. Someone was asking about cougar canyon 2 just a couple of weeks ago - there's obviously still interest. This reverts commit fb50124d22014742b6990a95df87a7a828e891b6. Change-Id: Icd7dcea21fa4a7808b25bb8727020701aeebffc9 Signed-off-by: Martin Roth <martinroth@google.com> Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/12128 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* cbfstool: Fix typo in error messagePatrick Georgi2015-10-191-1/+1
| | | | | | | | | Change-Id: Iaee7e2c74fe9f63d4d4878278bd445af393942f4 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: http://review.coreboot.org/11920 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* cbfstool: Fix removing and adding file with same nameAaron Durbin2015-10-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, cbfstool regressed that removing a file from CBFS the space is marked as empty but the filename is still shown, preventing adding a file with the same name again. [1] ``` $ echo a > a $ echo b > b $ ./util/cbfstool/cbfstool test.rom create -m x86 -s 1024 Created CBFS (capacity = 920 bytes) $ ./util/cbfstool/cbfstool test.rom add -f a -n a -t raw $ ./util/cbfstool/cbfstool test.rom add -f b -n b -t raw $ cp test.rom test.rom.original $ ./util/cbfstool/cbfstool test.rom remove -n $ diff -up <(hexdump -C test.rom.original) <(hexdump -C test.rom) --- /dev/fd/63 2015-08-07 08:43:42.118430961 -0500 +++ /dev/fd/62 2015-08-07 08:43:42.114430961 -0500 @@ -1,4 +1,4 @@ -00000000 4c 41 52 43 48 49 56 45 00 00 00 02 00 00 00 50 |LARCHIVE.......P| +00000000 4c 41 52 43 48 49 56 45 00 00 00 02 ff ff ff ff |LARCHIVE........| 00000010 00 00 00 00 00 00 00 28 61 00 00 00 00 00 00 00 |.......(a.......| 00000020 00 00 00 00 00 00 00 00 61 0a ff ff ff ff ff ff |........a.......| 00000030 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| $ ./util/cbfstool/cbfstool test.rom add -f c -n c -t raw $ ./util/cbfstool/cbfstool test.rom print test.rom: 1 kB, bootblocksize 0, romsize 1024, offset 0x0 alignment: 64 bytes, architecture: x86 Name Offset Type Size c 0x0 raw 2 b 0x40 raw 2 (empty) 0x80 null 792 ``` So it is “deteled” as the type changed. But the name was not changed to match the *(empty)* heuristic. So also adapt the name when removing a file by writing a null byte to the beginning of the name, so that the heuristic works. (Though remove doesn't really clear contents.) ``` $ ./util/cbfstool/cbfstool test.rom remove -n c $ ./util/cbfstool/cbfstool test.rom print test.rom: 1 kB, bootblocksize 0, romsize 1024, offset 0x0 alignment: 64 bytes, architecture: x86 Name Offset Type Size (empty) 0x0 null 2 b 0x40 raw 2 (empty) 0x80 null 792 ``` [1] http://www.coreboot.org/pipermail/coreboot/2015-August/080201.html Change-Id: I033456ab10e3e1b402ac2374f3a887cefd3e5abf Signed-off-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/11632 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
* cbfstool/cbfs_image.c: Just use one space before `=`Paul Menzel2015-10-171-1/+1
| | | | | | | | Change-Id: Id31c889d1e83e7ddfb0f0f98b78601f37b71cfa2 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/11631 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* lint: Fix shellcheck warnings, add commentsMartin Roth2015-10-171-15/+22
| | | | | | | | | | | | | When the script was pulled out of the makefile, it was left as it was written in the makefile to show the continuity with the original. This patch cleans up issues identified by shellcheck and adds comments. Change-Id: I5e6573a4fdfbb397e15db38e2e3dfadeb3430573 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: http://review.coreboot.org/11931 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* lint: Add junit.xml output for jenkinsMartin Roth2015-10-171-1/+22
| | | | | | | | | | | | To add lint to jenkins testing, we need junit.xml output. This adds an optional --junit command line parameter to enable output to an xml file in the lint directory. Change-Id: I5588190cb050b9dbe99458cb18a71a147769f50e Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: http://review.coreboot.org/11891 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* lint: Move the lint script out of Makefile.incMartin Roth2015-10-171-0/+50
| | | | | | | | | | | | | | In preparation for adding junit xml to the lint tests, move the script out of Makefile.inc and into its own file. Add a copyright, usage, and error checking that was not needed inside the Makefile. Change-Id: I32bebc6a5f1f6fa652812c8a014d84006e2e6c8a Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: http://review.coreboot.org/11890 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* util/cbmem: Fix failure with certain cbmem base alignmentsTimothy Pearson2015-10-161-23/+38
| | | | | | | | Change-Id: Icd28af388c49ad36d7a8e414b3c82e18e1f8f523 Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-on: http://review.coreboot.org/11932 Tested-by: build bot (Jenkins) Reviewed-by: Peter Stuge <peter@stuge.se>
* abuild: add a command line parameter for junit filenameMartin Roth2015-10-151-4/+6
| | | | | | | | | | | | | The 'what-jenkins-does' makefile target was renaming the junit filename after abuild finished. Instead, just add a command line parameter to send it to a different filename. Change-Id: I66f7d80d621573d77a5154f36f2db49d7b2e948a Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: http://review.coreboot.org/11878 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* Revert "Remove FSP Rangeley SOC and mohonpeak board support"Martin Roth2015-10-141-0/+4
| | | | | | | | | | | | | | This chip is still being used and should not have been deleted. It's a current intel chip, and doesn't even require an ME binary. This reverts commit 959478a763c16688d43752adbae2c76e7764da45. Change-Id: I78594871f87af6e882a245077b59727e15f8021a Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: http://review.coreboot.org/11860 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc@marcjonesconsulting.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* inteltool: Add function to generate SPD dump.Vladimir Serbinenko2015-10-114-7/+41
| | | | | | | | | | | | | E.g. on my MacbookAir to generate spd.bin to be used with coreboot I do: ./inteltool -S spd.bin Change-Id: If165475ed3e1f3262a8926ef619128d25b1e2896 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/11847 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
* autoport: Fix ectool arguments.Vladimir Serbinenko2015-10-111-1/+1
| | | | | | | | Change-Id: I207fa981370d72c26e6fb1f07f3cd2d1f9d44d04 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/11855 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* Kill lvds_num_lanesVladimir Serbinenko2015-10-111-5/+0
| | | | | | | | | | | | Only one value would work with corresponding gma code currently (which one depends on board). Going forward, it's possible to compute which number can be used, so there is no need to keep this info around. Change-Id: Iadc77ef94b02f892860e3ae8d70a0a792758565d Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/11862 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* Derive lvds_dual_channel from EDID timings.Vladimir Serbinenko2015-10-111-1/+0
| | | | | | | | | | Based on the info by Felix Held. Change-Id: Iab84dd8a0e3c942da20a6e21db5510e4ad16cadd Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/11857 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* cbfstool: allow printable characters in image nameAndrey Petrov2015-10-081-4/+4
| | | | | | | | | | | | | Currently cbfstool would reject non-alpanumeric characters in image names. Underscore is not alphanumeric and is used in some default fmaps. This change allows image names to contain all "printable" characters except spaces. Change-Id: I6ba2b581d5623f5b028149ece0169892ea63fd04 Signed-off-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-on: http://review.coreboot.org/11807 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* buildgcc: Fix the binutils-no-doc patch with 2.25zbao2015-10-051-5/+5
| | | | | | | | | | | | | | The binutils-2.25 has added some new line, making the hunk move downward a little. The utility patch can fix the offset with "fuzz" message. So, recreate the patch to avoid that message. Change-Id: Ie659a8faf923465f6d47f7c0c0bf903c5eb903ab Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/11639 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* buildgcc: Add patch for building binutils by clang 6.0zbao2015-10-051-0/+18
| | | | | | | | | | | | | | | | Clang is the default compiler on BSD and OS X. With this change, we don't have to install gcc any more. Clang can act as host cc. This is a known issue on GNU mail list. Please refer the link below. https://sourceware.org/bugzilla/show_bug.cgi?id=17473 Change-Id: I0f014b776e86e6d0cbebd560cb17f469f31e1dfb Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/11638 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* buildgcc: Show the progress when downloadingzbao2015-10-051-3/+12
| | | | | | | | | | | | | Grep the output of wget, showing only the percentage. Leave the final "100%" unerased. Checking return code of wget is removed. Change-Id: I4559e88d541738a594dce92e23589992f234cb9b Signed-off-by: Zheng Bao <zheng.bao@amd.com> Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: http://review.coreboot.org/11520 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* Remove FSP Rangeley SOC and mohonpeak board supportAlexandru Gagniuc2015-10-031-4/+0
| | | | | | | | | | | | | mohonpeak is the reference board for Rangeley. I doubt anyone uses it or cares about it. We jokingly refer to it as "Moron Peak". It's code with no known users, so we shouldn't be hauling it around for the eventuality that someone might use it in the future. Change-Id: Id3c9fc39e1b98707d96a95f2a914de6bbb31c615 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/11790 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese <zaolin@das-labor.org>
* Remove sandybridge and ivybridge FSP code pathAlexandru Gagniuc2015-10-031-1/+1
| | | | | | | | | | | | | We already have two other code paths for this silicon. Maintaining the FSP path as well doesn't make much sense. There was only one board to use this code, and it's a reference board that I doubt anyone still owns or uses. Change-Id: I4fcfa6c56448416624fd26418df19b354eb72f39 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/11789 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese <zaolin@das-labor.org>
* sandybridge ivybridge: Treat native init as first class citizenAlexandru Gagniuc2015-10-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a sad story. We have three different code paths for sandybridge and ivybridge: proper native path, google MRC path, and, everyone's favorite: Intel FSP path. For the purpose of this patch, the FSP path lives in its own little world, and doesn't concern us. Since MRC was first, when native files and variables were added, they were suffixed with "_native" to separate them from the existing code. This can cause confusion, as the suffix might make the native files seem parasitical. This has been bothering me for many months. MRC should be the parasitical path, especially since we fully support native init, and it works more reliably, on a wider range of hardware. There have been a few board ports that never made it to coreboot.org because MRC would hang. gigabyte/ga-b75m-d3h is a prime example: it did not work with MRC, so the effort was abandoned at first. Once the native path became available, the effort was restarted and the board is now supported. In honor of the hackers and pioneers who made the native code possible, rename things so that their effort is the first class citizen. Change-Id: Ic86cee5e00bf7f598716d3d15d1ea81ca673932f Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/11788 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese <zaolin@das-labor.org>
* cbfstool: relocate FSP blobs on cbfstool addAaron Durbin2015-10-023-1/+158
| | | | | | | | | | | | | | | | | | | | | When adding an FSP blob relocate it to its final destination. This allows FSP to not be hard coded in the cbfs. In order for the include paths to work correctly w/ the edk 2 headers we need to supply a neutered ProcessorBind.h to match up with the tool environment such that one can get the UEFI Platform Initialization type definitions. BUG=chrome-os-partner:44827 BRANCH=None TEST=Built glados and booted. Also added FSP with -b and manually adjusted location in fsp cache-as-ram. Booted as well. Change-Id: I830d93578fdf745a51195109cf18d94a83ee8cd3 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11778 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbfstool: provide printk() to cbfstool codeAaron Durbin2015-10-022-8/+51
| | | | | | | | | | | | | | | | | | For shared compilation units between coreboot proper and cbfstool that means one needs to provide printk logging. Therefore, provide printk() at <console/console.h> to mimic coreboot's environment. BUG=chrome-os-partner:44827 BRANCH=None TEST=Built cbfstool with code that includes and uses <console/console.h>. Change-Id: I8e54d403526a397e4fd117738a367a0a7bb71637 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11774 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbfstool: Allow anonymous structs/unions for older gcc versionsWerner Zeh2015-10-021-0/+1
| | | | | | | | | | | | Older gcc versions throws a warning when a struct or union is declared without a valid name (anonymous). This patch enables the feature for older gcc versions so that no warning will be issued. Change-Id: Idc5481f4d5723c5090a6f7d7dbb0686a737e11fc Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: http://review.coreboot.org/11779 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbfstool: Add support for hashes as file metadataPatrick Georgi2015-10-015-8/+163
| | | | | | | | | | | | | | | | | | | | They allow optimizing a verification of a whole CBFS image by only dealing with the headers (assuming you choose to trust the hash algorithm(s)). The format allows for multiple hashes for a single file, and cbfstool can handle them, but right now it can't generate such headers. Loosely based on Sol's work in http://review.coreboot.org/#/c/10147/, but using the compatible file attribute format. vboot is now a hard dependency of the build process, but we import it into the tree for quite a while now. Change-Id: I9f14f30537d676ce209ad612e7327c6f4810b313 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11767 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* kconfig: fix build for xconfig, tooPatrick Georgi2015-10-011-0/+2
| | | | | | | | | Change-Id: I1c5e3424cb56f1f10e75bb07db084c3500f3ba07 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11768 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* cbfstool: Add bintohex functionPatrick Georgi2015-10-012-0/+24
| | | | | | | | | | We need to emit some hex strings. Change-Id: I9e7e184282f6ad0470f2e269f5dc874e78f8b697 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11766 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* kconfig: kconfig_warnings needs to be defined for all frontendsPatrick Georgi2015-09-302-0/+4
| | | | | | | | | Change-Id: Iecefdd1e827e4eb8b4da573e4291850d6c47767f Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/11754 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
* kconfig: Allow KCONFIG_STRICT outside of confdata.cStefan Reinauer2015-09-306-5/+34
| | | | | | | | | | | | | | | | | To catch dependency errors in symbol.c (such as the ones fixed by I51b4ee326f082c6a656a813ee5772e9c34f5c343) we need to check for global kconfig warnings before saving config files. This patch will produce errors for wrong dependencies and add catching of errors to conf, nconf and mconf. Sorry, gconf users, you will have to wait. Change-Id: Idf7ee406ce3869941af319219aea16fab826df84 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/11291 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* cbfstool: prefer fmap data over cbfs master header if it existsPatrick Georgi2015-09-284-46/+14
| | | | | | | | | | | Up to now, if both fmap and a master header existed, the master header was used. Now, use the master header only if no fmap is found. Change-Id: Iafbf2c9dc325597e23a9780b495549b5d912e9ad Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11629 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cbfstool: have update-fit always work from CBFSPatrick Georgi2015-09-281-9/+2
| | | | | | | | | | | | On x86, the bootblock can (and will) become part of the regular file system, so there's no distinct fixed-size region for the bootblock there. Change-Id: Ie139215b73e01027bc0586701361e9a0afa9150e Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11691 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cbfstool: Proper commonlib include path with no dependency on $(src)Paul Kocialkowski2015-09-241-1/+1
| | | | | | | | | | | | $(src) is not defined when building directly from the cbfs directory (that is, when building cbfs as standalone, running make in the cbfs directory), so we need to define the path to the commonlib include path relative to $(top). Change-Id: I72e80b030d4a156ec653ded5ab1457b16f612526 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: http://review.coreboot.org/11706 Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Tested-by: build bot (Jenkins)
* coreboot: introduce commonlibAaron Durbin2015-09-224-8/+6
| | | | | | | | | | | | | | | Instead of reaching into src/include and re-writing code allow for cleaner code sharing within coreboot and its utilities. The additional thing needed at this point is for the utilities to provide a printk() declaration within a <console/console.h> file. That way code which uses printk() can than be mapped properly to verbosity of utility parameters. Change-Id: I9e46a279569733336bc0a018aed96bc924c07cdd Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11592 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
* cbfstool: don't use endian to fix BSD hostsAaron Durbin2015-09-211-2/+1
| | | | | | | | | | | | endian.h lives in under sys on the BSDs. Replace htole32() with swab32(htonl(..)) as a proxy for little endian operations. Change-Id: I84a88f6882b6c8f14fb089e4b629e916386afe4d Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11695 Tested-by: build bot (Jenkins) Reviewed-by: Idwer Vollering <vidwer@gmail.com> Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
* cbfstool: make fmap search more strictPatrick Georgi2015-09-211-6/+39
| | | | | | | | | | | | | | | | | Since fmap doesn't come with a checksum, we resort to a number of heuristics to determine if a given location hosts an fmap (instead of another data structure that happens to store the fmap magic string at the right location). The version test is particularly effective against strings containing the magic (which either terminate with 0, or have some other ASCII data, but rarely a '\001' byte inside the string). Change-Id: Ic66eb0015c7ffdfe25e0054b7838445b8ba098e9 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11690 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cbfstool: add new add-master-header commandPatrick Georgi2015-09-211-0/+74
| | | | | | | | | | | | | | | | | | The command adds a new cbfs file, fills in the CBFS meta data in cbfs master header format, then points the master header pointer (which resides at the last 4 bytes of the CBFS region) to the data area of the new file. This can leak some space in CBFS if an old-style CBFS with native master header gets the treatment, because a new header is created and pointed at. flashmap based images have no such header, and the attempt to create a second file with the (hardcoded) name will fail. Change-Id: I5bc7fbcb5962b35a95261f30f0c93008e760680d Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11628 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* ifdfake: allow "base+size" description of regionsPatrick Georgi2015-09-211-6/+21
| | | | | | | | | | This is more in line with how fmd/fmap specify ranges. Change-Id: Iecf8250e84d6eb267711ded446909b21147f1a9c Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11623 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cbfstool: introduce new file typesPatrick Georgi2015-09-191-0/+4
| | | | | | | | | | | | Let's move x86 style bootblocks (and later the others) and the master header into the CBFS structure. Prepare for this by adding file types. Change-Id: I1b4149c7f3b8564ee358a2c18ba91e6a7a6797da Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11627 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* cbfstool: Don't use fileno() to get file sizeStefan Reinauer2015-09-171-6/+6
| | | | | | | | | | | fileno() is a mess on some operating systems. Don't deliberately convert between FILE * and file handles. Change-Id: I5be62a731f928333ea2e5843d81f541453fdb396 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/11636 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>