Commit Graph

2481 Commits

Author SHA1 Message Date
Nico Huber 37743a913f cbfstool/Makefile: Also rm fmd_(parser|scanner).[ch] in clean
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>
2015-10-22 23:02:40 +02:00
Nico Huber 5e731a7cfc cbfstool/Makefile: Drop unused, irritating definition of `obj`
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>
2015-10-22 23:02:01 +02:00
Nico Huber 954a55b950 gma ACPI: Make brightness levels a per board setting
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>
2015-10-22 23:01:36 +02:00
Martin Roth bf6b83abe0 Revert "Remove sandybridge and ivybridge FSP code path"
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 fb50124d22.

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>
2015-10-22 21:51:01 +02:00
Patrick Georgi 821bcd6456 cbfstool: Fix typo in error message
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>
2015-10-19 21:09:35 +02:00
Aaron Durbin 285111f822 cbfstool: Fix removing and adding file with same name
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>
2015-10-17 06:57:50 +00:00
Paul Menzel 831bbe8446 cbfstool/cbfs_image.c: Just use one space before `=`
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>
2015-10-17 06:57:42 +00:00
Martin Roth 606ca51530 lint: Fix shellcheck warnings, add comments
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>
2015-10-17 06:16:49 +00:00
Martin Roth b6d739d449 lint: Add junit.xml output for jenkins
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>
2015-10-17 06:16:40 +00:00
Martin Roth e4fc407e3f lint: Move the lint script out of Makefile.inc
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>
2015-10-17 06:16:05 +00:00
Timothy Pearson bea714088b util/cbmem: Fix failure with certain cbmem base alignments
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>
2015-10-16 20:23:33 +00:00
Martin Roth 21ca9beda4 abuild: add a command line parameter for junit filename
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>
2015-10-15 12:21:19 +00:00
Martin Roth 58562405c8 Revert "Remove FSP Rangeley SOC and mohonpeak board support"
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 959478a763.

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>
2015-10-14 22:49:03 +00:00
Vladimir Serbinenko fb69a69fce inteltool: Add function to generate SPD dump.
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>
2015-10-11 15:01:05 +00:00
Vladimir Serbinenko 6286e3512a autoport: Fix ectool arguments.
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>
2015-10-11 10:25:17 +00:00
Vladimir Serbinenko c48f5ef3cc Kill lvds_num_lanes
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>
2015-10-11 10:07:17 +00:00
Vladimir Serbinenko 551cff08d5 Derive lvds_dual_channel from EDID timings.
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>
2015-10-11 10:07:12 +00:00
Andrey Petrov a2bed346a1 cbfstool: allow printable characters in image name
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>
2015-10-08 22:39:36 +00:00
zbao f35f5ff3cd buildgcc: Fix the binutils-no-doc patch with 2.25
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>
2015-10-05 17:22:41 +00:00
zbao 05d39ffbf4 buildgcc: Add patch for building binutils by clang 6.0
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>
2015-10-05 17:22:15 +00:00
zbao 282dd95143 buildgcc: Show the progress when downloading
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>
2015-10-05 17:21:55 +00:00
Alexandru Gagniuc 959478a763 Remove FSP Rangeley SOC and mohonpeak board support
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>
2015-10-03 22:23:54 +00:00
Alexandru Gagniuc fb50124d22 Remove sandybridge and ivybridge FSP code path
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>
2015-10-03 22:23:24 +00:00
Alexandru Gagniuc ecf2eb463f sandybridge ivybridge: Treat native init as first class citizen
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>
2015-10-03 22:22:54 +00:00
Aaron Durbin 8a414a0943 cbfstool: relocate FSP blobs on cbfstool add
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>
2015-10-02 12:17:21 +00:00
Aaron Durbin d38e3de68c cbfstool: provide printk() to cbfstool code
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>
2015-10-02 12:16:09 +00:00
Werner Zeh 8c3780a142 cbfstool: Allow anonymous structs/unions for older gcc versions
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>
2015-10-02 08:54:51 +00:00
Patrick Georgi 89f20340d5 cbfstool: Add support for hashes as file metadata
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>
2015-10-01 20:14:26 +00:00
Patrick Georgi 44853371f1 kconfig: fix build for xconfig, too
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>
2015-10-01 20:14:13 +00:00
Patrick Georgi ca97fa7ac3 cbfstool: Add bintohex function
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>
2015-10-01 14:43:43 +00:00
Patrick Georgi 9595ed4731 kconfig: kconfig_warnings needs to be defined for all frontends
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>
2015-09-30 10:48:21 +00:00
Stefan Reinauer 57a31317a2 kconfig: Allow KCONFIG_STRICT outside of confdata.c
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>
2015-09-30 06:58:57 +00:00
Patrick Georgi 2f953d304e cbfstool: prefer fmap data over cbfs master header if it exists
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>
2015-09-28 10:13:33 +00:00
Patrick Georgi 6dd99fcafe cbfstool: have update-fit always work from CBFS
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>
2015-09-28 10:13:22 +00:00
Paul Kocialkowski 34ce438e6f cbfstool: Proper commonlib include path with no dependency on $(src)
$(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)
2015-09-24 17:08:20 +00:00
Aaron Durbin dc9f5cd546 coreboot: introduce commonlib
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>
2015-09-22 21:21:34 +00:00
Aaron Durbin 4b93a4f47a cbfstool: don't use endian to fix BSD hosts
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>
2015-09-21 19:10:26 +00:00
Patrick Georgi b946f12ed0 cbfstool: make fmap search more strict
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>
2015-09-21 16:04:22 +00:00
Patrick Georgi 59e52b975e cbfstool: add new add-master-header command
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>
2015-09-21 16:03:48 +00:00
Patrick Georgi a9992d3da5 ifdfake: allow "base+size" description of regions
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>
2015-09-21 13:01:22 +00:00
Patrick Georgi 239c74231b cbfstool: introduce new file types
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>
2015-09-19 12:07:10 +00:00
Stefan Reinauer 1bb487c474 cbfstool: Don't use fileno() to get file size
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>
2015-09-17 19:17:06 +00:00
Shawn Nematbakhsh d2cb11811c ifdtool: Properly set + decode flmstr regs for IFD v2
flmstr register bits have slightly different meaning for IFD v2.

BUG=chrome-os-partner:45091, chrome-os-partner:43461
TEST=Run `ifdtool -d image.bin` on IFD v1 locked squawks image:

Found Master Section
FLMSTR1:   0x0a0b0000 (Host CPU/BIOS)
  Platform Data Region Write Access: disabled
  GbE Region Write Access:           enabled
  Intel ME Region Write Access:      disabled
  Host CPU/BIOS Region Write Access: enabled
  Flash Descriptor Write Access:     disabled
  Platform Data Region Read Access:  disabled
  GbE Region Read Access:            enabled
  Intel ME Region Read Access:       disabled
  Host CPU/BIOS Region Read Access:  enabled
  Flash Descriptor Read Access:      enabled
  Requester ID:                      0x0000

FLMSTR2:   0x0c0d0000 (Intel ME)
  Platform Data Region Write Access: disabled
  GbE Region Write Access:           enabled
  Intel ME Region Write Access:      enabled
  Host CPU/BIOS Region Write Access: disabled
  Flash Descriptor Write Access:     disabled
  Platform Data Region Read Access:  disabled
  GbE Region Read Access:            enabled
  Intel ME Region Read Access:       enabled
  Host CPU/BIOS Region Read Access:  disabled
  Flash Descriptor Read Access:      enabled
  Requester ID:                      0x0000

FLMSTR3:   0x08080118 (GbE)
  Platform Data Region Write Access: disabled
  GbE Region Write Access:           enabled
  Intel ME Region Write Access:      disabled
  Host CPU/BIOS Region Write Access: disabled
  Flash Descriptor Write Access:     disabled
  Platform Data Region Read Access:  disabled
  GbE Region Read Access:            enabled
  Intel ME Region Read Access:       disabled
  Host CPU/BIOS Region Read Access:  disabled
  Flash Descriptor Read Access:      disabled
  Requester ID:                      0x0118

Then, run `ifdtool -l image.bin` and verify newly locked image is identical.
Next, run `ifdtool -l image.bin` on unlocked glados image. Verify that locked
and unlocked regions are identical to above.
Finally, burn glados image, run `flashrom -V`, and verify ME regions is
locked and descriptor region is RO.
BRANCH=None

Change-Id: I8a65bdc5edd0d888138b88c1189f8badd1404b64
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 11c434835a66a50ab2c0c01a084edc96cbe052da
Original-Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Original-Change-Id: I875dfce6f5cf57831714702872bfe636f8f953f4
Original-Reviewed-on: https://chromium-review.googlesource.com/298968
Original-Commit-Ready: Shawn N <shawnn@chromium.org>
Original-Tested-by: Shawn N <shawnn@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11658
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-17 14:17:31 +00:00
Patrick Georgi ae570d5cee cbfstool: deduplicate Makefiles
There's no need to maintain two lists of dependencies that need to be
changed every. single. time.

Change-Id: I26bb8c884e98afe74fd9df11464bcf88e130cd92
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11674
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-17 07:41:02 +00:00
Patrick Georgi cdeb1c4f61 cbfstool: actually use no-ms-bitfields flag on mingw
It was added to an unused variable.

Change-Id: I869ffdda7e04b5c615931473c760d66b803fb98b
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11673
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-17 07:40:44 +00:00
Aaron Durbin 9b9d4b3a47 cbfstool: remove locate command
The locate command was previously being used for x86 romstage
linking as well as alignment handling of files. The add command
already supports alignment so there's no more users of the
locate command. Remove the command as well as the '-T' (top-aligned)
option.

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built rambi. Noted microcode being directly added.

Change-Id: I3b6647bd4cac04a113ab3592f345281fbcd681af
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11671
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-16 14:11:25 +00:00
Aaron Durbin 4be1674d32 cbfstool: add --xip support to add-stage for x86
Instead of going through the locate then add-stage
dance while linking romstage twice allow for adding romstage
with --xip flags to perform the relocation while adding it
into CBFS. The -P (page-size) and -a (alignment) parameters
were added as well so one could specify the necessary
parameters for x86 romstage.

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built and booted on glados.

Change-Id: I585619886f257e35f00961a1574009a51c28ff2b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11669
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-16 14:11:10 +00:00
Aaron Durbin d7339411a9 cbfstool: provide metadata size to cbfs_locate_entry()
The cbfs_locate_entry() function had a hack in there which
assumed a struct cbfs_stage data was being added in addition
to the struct cbfs_file and name. Move that logic out to the
callers while still maintaining the logic for consistency.
The only impacted commands cbfs_add and cbfs_locate, but
those are using the default 'always adding struct cbfs_stage'
in addition to cbfs_file + name. Eventually those should be
removed when cbfs_locate is removed as cbfs_add has no smarts
related to the cbfs file type provided.

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built rambi.

Change-Id: I2771116ea1ff439ea53b8886e1f33e0e637a79d4
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11668
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-16 14:11:03 +00:00
Aaron Durbin b39a974d75 cbfstool: expose rmodule logic
In order to allow cbfstool to add XIP romstage on x86 without
doing the 'cbfstool locate', relink, then 'cbfstool add' dance
expose the core logic and of rmodule including proving an optional
filter. The filter will be used for ignoring relocations to the
.car.global region.

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built rambi.

Change-Id: I192ae2e2f2e727d3183d32fd3eef8b64aacd92f4
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11598
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-16 14:10:51 +00:00
Aaron Durbin 051a181f0c cbfstool: prepare for exposing rmodule logic
The core logic of the rmodule parser is ideal for
processing romstage ELF files for XIP. To that
end start the work of exposing the logic from
rmodule so cbfstool can take advantage of it.

The properties that both need require:
- Single program segment
- Relocation information
- Filter relocation processing

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built rambi.

Change-Id: I176d0ae0ae1933cdf6adac67d393ba676198861a
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11595
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-16 14:10:42 +00:00
Patrick Georgi a0e7738463 abuild: don't complain about missing junit reports for skipped boards
There's no need to whine about missing files, so test for them first.

Change-Id: I906fd04a315de70340ce76d7c38eaaf88cc6580a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11642
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-09-16 07:43:55 +00:00
Patrick Georgi 053322f891 abuild: log bulding tools
We build the coreboot utilities in a separate step as a minor
optimization. When logging in junit format (for jenkins), we want to
have a report on those as well (instead of an xml error).

Change-Id: Ibcd3b02bce9a314c30b5f7414e9e4cf0149ffd6a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11641
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-16 07:43:43 +00:00
Patrick Georgi 098c4a8096 abuild: don't create junit tests with empty testclass field
Variable expansion made abuild create board..foo/bar, which are annoying
on jenkins' web UI because it doesn't cope properly with the empty
namespace between the dots. make it create board.foo/bar or
board.$class.foo/bar.

Change-Id: Ifa79cbfd1f263e11a458b3cc320baeed6a3fbc98
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11640
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2015-09-16 07:43:34 +00:00
Patrick Georgi dc37dab7fd cbfstool: drop extra copy of filetype->string map
We had two mappings of filetype IDs to strings. We shouldn't.

Change-Id: I08e478b92f3316139f14294e50ede657c7d5fb01
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11626
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-09-14 16:27:36 +00:00
Alexandru Gagniuc 71a7ba2e5d ifdtool: Enable warnings as errors, and fix any issues
Change-Id: Id462a10c2affac54ec48a1cc2a5b2ca66112848e
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/11613
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2015-09-11 02:02:10 +00:00
Nico Huber 135ca51314 crossgcc: Preparations for building Ada frontend
As with most other languages, a pre-installed Ada toolchain is needed
to build gcc's Ada frontend. To support building with older host tool-
chains, the patch `gcc-5.2.0_gnat.patch` disables warnings for unknown
pragmas. Building has been tested with host gcc-4.9 and hopefully works
with newer versions, too.

For convenience, the gnattools (e.g. gnatmake etc.) will be build if
'ada' is specified as a target language.

Change-Id: Ia78c29d1aba2943de5238421a324cfff8eb08875
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/11590
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-09-10 09:17:08 +00:00
Nico Huber bb313bf221 crossgcc: Add option to build gcc for specific languages
Add an option `--languages` which takes a list of target languages to
buildgcc. That list gets passed through to the configure step for
building gcc.

Also alter the Makefile to pass $(BUILD_LANGUAGES) to that option, if
this variable is set.

Change-Id: I6a74ab2c75871ea8d03a499cca33d88938b59c8d
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/11589
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-10 09:12:00 +00:00
zbao 5e1fb2d074 genbuild_h: Add Mac OS to case of "data -r"
Change-Id: I2a43a1b1749da207b7a23b8eb252c13605121533
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11599
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2015-09-10 02:14:04 +00:00
Aaron Durbin c9b053d07d rmodtool: make rmodule parameter section optional
There are currently 2 uses for rmodule programs: stand alone
programs that are separate from the coreboot stages and a
relocatable ramstage. For the ramstage usage there's no reason
to require a rmodule parameter section. Therefore make this
optional.

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built ramstage w/ normal linking (w/o a rmodule parameter
     section). No error.

Change-Id: I5f8a415e86510be9409a28068e3d3a4d0ba8733e
Signed-off-by: Aaron Durbin <adubin@chromium.org>
Reviewed-on: http://review.coreboot.org/11523
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-09 19:36:01 +00:00
Aaron Durbin dde7629e9c rmodule: use program.ld for linking
Bring rmodule linking into the common linking method.
The __rmodule_entry symbol was removed while using
a more common _start symbol. The rmodtool will honor
the entry point found within the ELF header. Add
ENV_RMODULE so that one can distinguish the environment
when generating linker scripts for rmodules. Lastly,
directly use program.ld for the rmodule.ld linker script.

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built rambi and analyzed the relocatable ramstage,
     sipi_vector, and smm rmodules.

Change-Id: Iaa499eb229d8171272add9ee6d27cff75e7534ac
Signed-off-by: Aaron Durbin <adubin@chromium.org>
Reviewed-on: http://review.coreboot.org/11517
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-09 19:35:30 +00:00
Alexandru Gagniuc 38bc916def cbfstool: Allow adding file with specific alignment requirement
Whenever we want to add a file to CBFS with a specific alignment, we
have to do two cbfstool invocations: one to find a place for the file,
and another to actually add the file to CBFS. Get rid of this nonsense
and allow this to be done in one step.

Change-Id: I526483296b494363f15dc169f163d93a6fc71bb0
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/11525
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-07 08:44:06 +00:00
Patrick Georgi ab5754da66 cbfstool: off-by-one on the gcc version that provides _Static_assert
According to https://gcc.gnu.org/gcc-4.6/changes.html it's only in gcc 4.6,
not 4.5, which I mistakenly believed.

Change-Id: I8212e7921bd9d1436a0ba491cbe6c4d473228956
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11476
Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Tested-by: build bot (Jenkins)
2015-09-01 16:30:24 +00:00
Patrick Georgi 57c67e5aa5 cbfstool: guard _Static_assert
This isn't required for correct execution, and doesn't need to be tested
on every single compiler out there.

Since GCC < 4.5 has no idea about _Static_assert, hide it there. Our
build tests will make sure that the test is run before changes are
submitted to master.

Change-Id: I4141f4aa23b140d2d1017ca7b4dace5aa7db0c04
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11475
Tested-by: build bot (Jenkins)
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
2015-09-01 14:52:20 +00:00
Patrick Georgi 23aeaff41b cbfstool: implement decompression support for cbfstool extract
Change-Id: I5142b03d3c3e028eeb179f225848f762186f94a8
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11363
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-01 14:52:02 +00:00
Patrick Georgi 61c822900e cbfstool: add decompression wrappers
... and document the interface.

Change-Id: I86a071a61fd6c1ef842f8ffe51f12f0cefdaf2fe
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11362
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2015-09-01 14:51:53 +00:00
Patrick Georgi a71c83fa5c cbfstool: factor out parsing compression file attributes
cbfstool extract also needs it.

Change-Id: I8302bb18c5f797eb0a43ec4e4269790f3d49a896
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11361
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-01 14:51:41 +00:00
Patrick Georgi c82725c5b9 cbfstool: support compressed files in cbfstool print
Display compressed and decompressed sizes, as well as the compression
algorithm used, when a compressed file is encountered.

Change-Id: I13c2332702c4a5bec379e1ebda72753e06f8e135
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11359
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-01 14:51:29 +00:00
Daisuke Nojiri 8984a637c1 cbfstool: allow compression at file header level
Currently, compression is only allowed at subheader level (e.g. cbfs_stage,
cbfs_payload_segment). This change adds compression field to each file's
header so that any cbfs file can be compressed.

With the necessary additions in coreboot and libpayload, the following sample
code can load a compressed file:

	const char *name = "foo.bmp";
	struct cbfs_file *file = cbfs_get_file(media, name);
	void *dst = malloc(ntohl(file->uncompressed_size));
	dst = cbfs_get_file_content(media, name, type, file, dst);

cbfs_stage and cbfs_payload_segment continue to support compression at
subheader level because stages and payloads have to be decompressed to the load
address, which is stored in the subheader. For these, file level compression
should be turned off.

Change-Id: I9a00ec99dfc68ffb2771bb4a3cc5ba6ba8a326f4
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10935
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-01 14:51:19 +00:00
Patrick Georgi 2c61506630 cbfstool: add extended file attributes for cbfs_file
cbfs_file_first_attr(struct cbfs_file *) and
cbfs_file_next_attr(struct cbfs_file *, struct cbfs_file_attribute *)
help navigate through extended attributes.

cbfs_add_file_attr(header, tag, size) adds a new file attribute to
header.

Change-Id: I325965286c44f31abd95df684d340cebb0e68b75
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10934
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-09-01 14:51:09 +00:00
Aaron Durbin fbff301f78 util/cbmem: add -T option for machine parseable timestamps
In order to make analysis easier provide an option (-T) to
print timestamps in a parseable format:

ID<tab>raw timestamp<tab>time from previous entry<tab>description

BUG=chrome-os-partner:44669
BRANCH=firmware-strago-7287.B
TEST=Built and tested on glados. Used the following script:
cbmem  -T | awk 'BEGIN { FS="\t" } { tot += $3 } END { print tot }'

Change-Id: I06dc0487d1462b6a78924130f0ad74b0d787d3f8
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11471
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-31 13:58:02 +00:00
Aaron Durbin c49014e750 timestamp: add tick frequency to exported table
Add the timestamp tick frequency within the timestamp table so
the cbmem utility doesn't try to figure it out on its own. Those
paths still exist for x86 systems which don't provide tsc_freq_mhz().
All other non-x86 systems use the monotonic timer which has a 1us
granularity or 1MHz.

One of the main reasons is that Linux is reporting
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq as the true
turbo frequency on turbo enables machines. This change also fixes
the p-state values honored in cpufreq for turbo machines in that
turbo p-pstates were reported as 100MHz greater than nominal.

BUG=chrome-os-partner:44669
BRANCH=firmware-strago-7287.B
TEST=Built and booted on glados. Confirmed table frequency honored.

Change-Id: I763fe2d9a7b01d0ef5556e5abff36032062f5801
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11470
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-31 13:55:28 +00:00
zbao d22b9ea1cb buildgcc: Show the exit status of wget if downloading fails.
Change-Id: Ie3a44c6db9c9c186c52b4743334266ec5411ba8a
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11472
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-31 06:45:13 +00:00
zbao ff3f15cd4d buildgcc: remove getopt when doing clean.
Change-Id: I9f59a00e735f39df813b2216290da62eea3c595d
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11372
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-31 06:44:57 +00:00
Damien Zammit 9c98664480 inteltool: Add Intel 4-Series chipset detection
Previously, X4X was incorrectly named because it provides
support for SKUs within XX4X range.  This is renamed.

This patch provides support for all X4X SKUs according to
datasheet Intel 4 Series Chipset Family Specification Update,
namely: Q45, Q43, P45, P43, G45, G43, G41 and B43 (both versions).

Tested on Gigabyte GA-G41M-ES2L

Change-Id: I032265e80d9ca51e2fef29201280832ea3210a0b
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: http://review.coreboot.org/11245
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2015-08-30 18:05:18 +00:00
Patrick Georgi bf8589e957 gitconfig/rebase.sh: adapt default branch name
Whatever it is, it likely won't be cros/chromeos-2013.04 anymore.

Change-Id: I020b65a7406e3bef7d1c8fad8c530354b1f78819
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11438
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
2015-08-28 18:41:21 +00:00
Julius Werner 4bfa29e947 arm64: xcompile: Add support for A53 erratum 843419
This patch adds support to enable a linker workaround to a hardware
erratum on some early Cortex-A53 revisions. Since the linker option was
added very recently, we use xcompile to test whether the toolchain
supports it first. It is also guarded by a Kconfig since only a few
ARM64 SoCs will need this and it incurs a performance penalty.

BRANCH=none
BUG=none
TEST=Turned it on or off for Smaug and confirmed that it (dis)appeared
in verbose make output accordingly.

Change-Id: I01c9642d3cf489134645f0db6f79f1c788ddb00d
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Original-Commit-Id: 57128785760c4dfa32d6e6d764756443a9323cb7
Original-Change-Id: Ia5dd124f484e38460d75fb864304e7e8b18d16b7
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/294745
Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11403
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2015-08-28 06:46:09 +00:00
Patrick Georgi 011b0b3af8 cbfstool: update warning on cbfstool extract
We have tons of file types now that can be safely extracted.
It's pretty much only stages and payloads that aren't.

Change-Id: Ibf58a2c721f863d654537850c6f93d68a8a5bbeb
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11360
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-27 15:07:36 +00:00
Patrick Georgi 83c2d12a3d cbfstool: update help text
cbfstool create doesn't accept alignment configuration anymore.

Change-Id: Idbf7662c605aa78e3d3413a21bfcbc1387f28701
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11358
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-27 15:07:13 +00:00
Patrick Georgi f5252f378b cbfstool: don't pass header_size as separate argument (part 2)
It's already present inside struct cbfs_file

Change-Id: Ic9682e93c3d208e2ed458940e4a9f9f5a64b6e98
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11333
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-27 15:07:00 +00:00
Patrick Georgi d5a4afa63d cbfstool: don't pass header_size as separate argument
It's already present inside struct cbfs_file

Change-Id: Ib10663c6601aa02e07b868e440f05da02af9c2d9
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11332
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-27 15:06:51 +00:00
Patrick Georgi a60e7b6da5 cbfstool: use struct cbfs_file * instead of void *
My concern was that compilers may something stupid under the assumption
of a fixed struct size, but filename is already variable, so things are
okay.

Change-Id: I5348faf68f0a7993294e9de4c0b6c737278b28af
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11331
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-27 15:01:39 +00:00
Patrick Georgi dc9dbc0059 cbfstool: passing a header is now mandatory for converters
Change-Id: Iea5377af735b06bcaefb999547a8896b1c70763a
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11330
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-27 15:01:22 +00:00
Patrick Georgi e590358064 cbfstool: cbfs_add_entry() doesn't need to know filename or type
They're passed as part of the header now.

Change-Id: I7cd6296adac1fa72e0708b89c7009552e272f656
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11327
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-27 15:01:12 +00:00
Roger Pau Monne 5cd34e2f15 inteltool: fix build for FreeBSD
Replace usage of u<bitness> types with proper uint<bitness>_t types.

Change-Id: I8359d70304a138b29bfc1358af77af26b2bc8682
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Reviewed-on: http://review.coreboot.org/11364
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-26 15:47:00 +00:00
Patrick Georgi 3ba501b86d cbfstool: move cbfs_file header creation further up the call chain
The header is now created before the "converters" are run.
Adding new capabilities (and fields to the header) will happen there,
so we're close.

Change-Id: I0556df724bd93816b435efff7d931293dbed918f
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11326
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:22:14 +00:00
Patrick Georgi 056f6a1f80 cbfstool: pass cbfs_file header into "compress" functions
These functions can do all kinds of things, such as converting an ELF
image into SELF, or (in the future) compress or checksum entire files.
This may require changing or adding fields to the header, so they
need to have access to it.

The header_size parameter that was provided (but never used) is
equivalent to cbfs_file's offset field.

Change-Id: I7c10ab15f3dff4412461103e9763a1d78b7be7bb
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11325
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:21:49 +00:00
Patrick Georgi 19c80b2391 cbfstool: drop size argument to cbfs_add_entry_at
It's sole use was comparing it to the header's "len" field.

Change-Id: Ic3657a709dee0d2b9288373757345a1a56124f37
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11324
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:21:30 +00:00
Patrick Georgi ae7efb9257 cbfstool: cut down on the debug output
Change-Id: I9a0aad42e4eb67a07c939d7cfa0d2d80838412bb
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11323
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:21:20 +00:00
Patrick Georgi 7a33b53dc0 cbfstool: Don't patch cbfs_file->len, it's already set correctly
->len used to be set to the file data length plus the size of the
padding used for the cbfs_file header. This isn't the case anymore,
so no patching of this field is necessary anymore.

->offset still needs to be patched in that case because its final
value can only be determined when the file's actual location is known.

Change-Id: I1037885f81b4ed3b68898dd7d0e515cf7a9c90a8
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11322
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:20:55 +00:00
Patrick Georgi bc39690900 cbfstool: drop unused arguments in internal function
Change-Id: Ie4edc5f9c96ffba7dcf8b974c56851658b9538e4
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11321
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:20:39 +00:00
Patrick Georgi 62c014bcf3 cbfstool: start moving cbfs_file header creation up the call chain
Up to now cbfstool creates the cbfs_file header at the latest possible
time, which is unsuitable when the idea is to add further fields to it
that need to be configured earlier.

Thus, have it ripple up the call chain.

Change-Id: I7c160681c31818bc550ed2098008146043d0ee01
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11320
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:20:24 +00:00
Patrick Georgi 4eb8abeb85 cbfstool: more descriptive variable name
"target", for what? It's the offset where the file header of the currently
added file will be located, name it as such.

Change-Id: I382f08f81991faf660e217566849773d9a7ec227
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11319
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-26 12:20:08 +00:00
Jonathan A. Kollasch 64fc433a56 crossgcc: rename source file names from gcc-5.2.0/* to binutils-2.25/* in binutils riscv patches
Followup-To: I6f37748b4cf0852d292f8f5156fc27ab8fd481b6

Change-Id: Ib6599b2380b5f2efd92ae78b72b45f3d65681379
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-on: http://review.coreboot.org/11329
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
2015-08-26 01:39:25 +00:00
zbao 06e85acb40 buildgcc: Move a bunch of code into a function
Refactor the code to be better understandable.

Change-Id: Ia815a27f7cc83c226a32e87485d712a5fbf4168e
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11318
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-26 01:06:17 +00:00
Martin Roth 1fff0d26f8 xcompile: Force localization of objdump to C
In testing other localization changes, I found that I couldn't build
anymore because xcompile wasn't picking up my toolchain.  I traced it
to the regex comparison of '.*format \(.[a-z0-9-]*\)' to the string
'formato del fichero elf32-i386'.  Forcing the localization of
objdump to C before doing the comparison fixes the issue.

Change-Id: I6bed5a9824807dd5bc5a38b711ab47e2af4b0c29
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: http://review.coreboot.org/11304
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Zheng Bao <zheng.bao@amd.com>
2015-08-25 15:40:44 +00:00
Martin Roth 56354d503d util/kconfig: add olddefconfig target
There doesn't seem to have been an olddefconfig target in the coreboot
version of the Kconfig makefile.  It's listed in the .PHONY, but it
doesn't seem like it's ever been there.  This is useful for expanding
a miniconfig saved with 'make savedefconfig'.

Change-Id: I3798f8469135b58d32da68d4b0e434ab5351b501
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: http://review.coreboot.org/11273
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-25 15:40:12 +00:00
Patrick Georgi 410f9ad1a3 crossgcc: rename source file names from empty/* to gcc-5.2.0/* in riscv patches
Some patch implementations (eg. BSD) create new files by taking the "---" file
name instead of the "+++" one, so set both to the file name that is to be
created.

Change-Id: I6f37748b4cf0852d292f8f5156fc27ab8fd481b6
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reported-by: Idwer Vollering <vidwer@gmail.com>
Reported-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-on: http://review.coreboot.org/11303
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-24 00:09:00 +00:00
Patrick Georgi 505e609452 crossgcc: Fix x86_64-elf target's -m16 support
It still needs to pass --32 (yes, 32) to the assembler.
x86_64-linux does this (through some other config file),
x86_64-elf did not.

This fixes building SeaBIOS with our x86_64-elf multilib compiler.

Change-Id: Ibe2a70e46e64e71c947482be5ec0eaf7f7bf300d
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11289
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-21 04:08:52 +00:00
Patrick Georgi af473ede1f crossgcc: Update gcc to 5.2.0
All compilers built, incl. x86_64-elf as multilib and riscv-elf.

Change-Id: Iafa61b1d2ffc9c737ab67a417c62417593b69372
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10975
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-20 14:39:01 +00:00
Aaron Durbin 0a31e5975e ifdtool: handle region masks correctly
The get_region() function was using fixed masks for
the base and limit. However, newer descriptors (on
skylake, e.g.) use a 15-bit mask -- not a 12-bit one.
Choose the right mask based on ifd_version.

BUG=chrome-os-partner:43461
BRANCH=None
TEST=Built glados bootimage.

Original-Change-Id: Ibcbfd649a561d36b17ea2cc8fbeb30ffdbbb2c96
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/293250
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>

Change-Id: I7f2ef9fb8e5b6c7114225fecc2798668d6507ac3
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11229
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-19 14:03:35 +00:00
Duncan Laurie 1f7fd720c8 ifdtool: Update to support Skylake+ descriptor format
The descriptor format has changed with Skylake and some fields have
moved or been expanded.

This includes new SPI frequencies and chip densities, though unfortunately
30MHz in the new format conflicts with 50MHz in the old format...

There are also new regions with a few reserved regions inserted before
a new embedded controller region.

Unfortunately there does not seem to be a documented version field
so there does not seem to be an official way to determine if a
specific descriptor is new or old.  To work around this ifdtool
checks the hardcoded "SPI Read Frequency" to see if it set for
20MHz (old descriptor) or 17MHz (new descriptor).

BUG=chrome-os-partner:40635
BUG=chrome-os-partner:43461
BRANCH=none
TEST=run ifdtool on skylake and broadwell images

Original-Change-Id: I0561b3c65fcb3e77c0a24be58b01db9b3a36e5a9
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/281001
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Commit-Queue: Aaron Durbin <adurbin@chromium.org>

Change-Id: I9a08c26432e13c4000afc50de9d8473e6f911805
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/293240
Reviewed-on: http://review.coreboot.org/11228
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-19 14:03:26 +00:00
Aaron Durbin 799bf781fd util/cbmem: accumulate total time for all entries
Display the total accumulated time using each timestamp
entry. It purposefully doesn't take into account the first
timestamp because that can be a platform dependent value
that may not contribute to the concept of "total".

BUG=None
BRANCH=None
TEST=Ran cbmem on glados where TSC doesn't reset to 0 on
     reboots. Clear total value given at end.

Original-Change-Id: Idddb8b88d3aaad11d72c58b18e8fd9fd1447a30e
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/291480
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Original-Trybot-Ready: David James <davidjames@chromium.org>

Change-Id: I79a0954d3b738323aaebb3e05171bcf639e5d977
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11202
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-14 15:19:59 +02:00
Patrick Georgi dd2d3f933a cbfstool: unify actual file creation
After the preparation in earlier commits, it is now possible to handle the
more general case of position independent files using the special code path
for fixed location files.

This leads to a single place where non-empty cbfs file headers are actually
written into the image, allowing us to move it up the chain more easily.

Change-Id: I8c1fca5e4e81c20971b2960c87690e982aa3e274
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11222
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:10:53 +02:00
Patrick Georgi aa44dbd364 cbfstool: move tests for fixed-location files earlier
... and the assert is gone.
The actual action of adding a just-right file can be moved after the tests
since it's exactly the condition those tests don't continue or break on.

Change-Id: I6d0e829e0158198301136ada9a0de2f168ceee3f
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11221
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:10:27 +02:00
Patrick Georgi db01ddfd49 cbfstool: prepare moving tests earlier
The assert() makes sure the if() holds true. But that assert won't survive for
long.

Change-Id: Iab7d2bc7bfebb3f3b3ce70dc5bd041902e14bd7a
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11220
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:10:06 +02:00
Patrick Georgi 57edf16be5 cbfstool: factor out creating a cbfs file header
We will want to create headers that live outside the final image at some point
(eg. to build the file before we even know where to place it).

Change-Id: Ie4c0323df8d5be955aec3621b75309e8f11fae49
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11219
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:09:52 +02:00
Patrick Georgi edf25d9076 cbfstool: Make cbfs_create_empty_entry build a more complete header
Pass the file type into it instead of creating an entry, then modifying the
header field again after the fact.

Change-Id: I655583218f5085035b0f80efff7f91a66b5b296e
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11218
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:09:33 +02:00
Patrick Georgi 7fd14184fb cbfstool: honor larger-than-usual header sizes in cbfs_add_entry_at()
If an earlier stage built a larger header, cbfs_add_entry_at() shouldn't
decide to go with the most boring, least featureful header type (and its size)
instead.

Change-Id: Icc5dcd9a797a0f3c42f91cddd21b3b3916095b63
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11217
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:09:17 +02:00
Patrick Georgi f820497938 cbfstool: allow file data converters to modify the header size
The idea is that they can at some point add extended attributes to the header.
That also needs to be passed, but let's start simple.

Change-Id: I80359843078b149ac433ee3d739ea192592e16e7
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11216
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:09:03 +02:00
Patrick Georgi 4110abca72 cbfstool: calculate header size in cbfs_add_component()
It will at some point create the header, and pass it with its size. We can
start with the size already.

Change-Id: I8f26b2335ffab99a664d1ff7bc88e33ed62cf9ca
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11215
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:08:45 +02:00
Patrick Georgi 11ee08f1f1 cbfstool: expose cbfs_calculate_file_header_size()
Headers vary in size soon, and more places need to be able to calculate their
size.

Change-Id: I30761bb9da0756418993dee21d8fa18cf3174c40
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11214
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:08:30 +02:00
Patrick Georgi e60b55a570 cbfstool: allow passing a precalculated header size into cbfs_add_entry()
This is in preparation of creating the cbfs_file header much earlier
in the process. For now, size is enough because lots of things need to
move before it makes sense to deal with cbfs_file at a higher level.

Change-Id: I47589247c3011cb828170eaa10ef4a1e0f85ab84
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11213
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:08:15 +02:00
Patrick Georgi 4e54bf9334 cbfstool: test for duplicate files earlier
No need to read the file before bailing out.

Change-Id: Ida7226c6ec227e1105724cdb1e5a0927217a69c7
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11212
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:08:02 +02:00
Patrick Georgi c6a8da7f93 cbfstool: add cbfs file attribute structure
This is a generic structure, not unlike the cbtables design, based on which we
can build specialized TLV data structures.

Change-Id: I98a75eef19f049ad67d46cdc2790949dcd155797
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10937
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-13 16:07:52 +02:00
zbao 433fa5735c buildgcc: Fix the options check
1. Add -P|--package to build iasl
2. Remove -G|--skip-gdb, which was to skip gdb.
3. Add -S|--scripting to build gdb
4. Remove -C|--clang, which was to build clang.

All these changes are aligned with the options parsing below.
The help text is correct.

Change-Id: I897ea5e8ab002086e45bf05ff33230815b246057
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11158
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-08-13 10:06:11 +02:00
Patrick Georgi aa7dcef494 board-status: move board status back to $TMPDIR
Change-Id: I05a8c246384abfc954cfcf163a68cca71aa6b2f0
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11224
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
2015-08-13 08:30:36 +02:00
Patrick Georgi 1cbef1ce4e board_status: use command -v over which(1)
The script is pretty linux specific as-is, but more portability won't hurt.

Change-Id: I33e18606bea4e23043d748e3fe66a345e720d389
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11151
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-08-10 22:19:01 +02:00
Paul Kocialkowski 15dd6c2fa3 xcompile: crossgcc lookup in parent paths, for painless libpayload support
libpayload is calling the xcompile script from payloads/libpayload, so the
script never finds the path on its own and has to be fed the right XGCCPATH by
hand.

This makes xcompile look for the parent path too, so that it can find the
crossgcc toolchains when called from libpayload.

Change-Id: Icc41bb68e3a43810f40f03ab1eb08af07a50a3de
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-on: http://review.coreboot.org/11119
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-10 20:28:48 +02:00
Patrick Georgi c07b783716 genbuild_h: Actually use git's current commit for timestamp if possible
The test failed to trigger because top wasn't set.

Change-Id: I96de16a1b5cbc5a64d8e65ed84fd6849dd618e8f
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11147
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-10 18:17:20 +02:00
Patrick Georgi f260f51834 genbuild_h: actually make date(1) based timestamp locale independent
This fixes the botched fix in commit d9bc2fadc4

Change-Id: I0c4445af2851bc80fabb631864321a56123ce7b0
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11146
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-10 18:17:09 +02:00
Patrick Georgi 368488ae29 board-status: expand minimized config to full size
Otherwise the later processing may fail. Keep minimized version as
config.short.txt for the user's benefit.

Change-Id: I1082ff68de85027d526266cdbf2073d22ce7f2e0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10525
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-10 18:04:19 +02:00
Patrick Georgi e10c82a23a board_status: create temporary directory in coreboot tree
Otherwise there may be a filesystem boundary that breaks make oldconfig.

Change-Id: I1eb55bcabc3e1b834d54f3da9fadfc352f0c4a65
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11150
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-10 18:04:07 +02:00
Stefan Reinauer f534203f06 Kconfig: Add KCONFIG_STRICT mode
This is basically a -Werror mode for Kconfig. When exporting
KCONFIG_STRICT in the Makefile, warnings in Kconfig will produce
errors instead.

This will make it easier to spot unclean Kconfig files, settings
and dependencies.

Change-Id: I941af24c3ccb10b8b9ddc5c98327154749ebbbc6
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10977
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-09 12:39:03 +02:00
Stefan Reinauer 03597d0f01 secimage: Use libz's crc32 function
This is to trick libreboot into not deleting misc.c when checking
out coreboot.

Change-Id: I8f0bb5cb3eb5681f99c616ae03de126efab852a9
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/11134
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-09 12:34:24 +02:00
Stefan Reinauer 9dd8f88841 secimage: reformat
Change-Id: Ibfa8b6b60b2b39212cef27bb2a5f8849218164bb
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/11133
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-09 12:34:15 +02:00
Patrick Georgi 1d915cae2b abuild: avoid hanging in oldconfig for parallel builds
oldconfig may wait for some input. Since we don't care while building tools,
just provide something.

Change-Id: I1c6f1b46957301886a7645cfb6c6bd264437aa7e
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11094
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-08 12:01:02 +02:00
Patrick Georgi 58474df42a abuild: in junit output, name chromeos builds different from normal ones
This will allow building and reporting both in one pass.

Change-Id: Id7dbe63c7628cb97d9cf190c151bf23c7b264a89
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11093
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-08 12:00:37 +02:00
Patrick Georgi f43b06d0ee abuild: when using --chromeos, skip boards with no Chrome OS support
Change-Id: Ic33b9311d5f194908b0a923ef5b342bfe992bdfc
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11092
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2015-08-08 12:00:13 +02:00
Patrick Georgi 86980bb46a abuild: Make help text into a heredoc
This simplifies editing.

Change-Id: Iff7f0cb7e52788836adcc0813a7bfb6d69009eed
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11091
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-08 12:00:00 +02:00
zbao 11f1d31d78 buildgcc: Deal with gmp on 32bit Cygwin on 64bit host
Similar to what the below change says,
(
 http://review.coreboot.org/10792
  commit ddb8f80894
  Author: Patrick Georgi <patrick@georgi-clan.de>
  Date:   Sat Jul 4 17:45:54 2015 +0200

    buildgcc: Deal with gmp on 32bit Linux on 64bit CPUs

    GMP is overeager to detect 64bit ABIs even if the entire running codebase is
    32bit (but on a 64bit CPU). Enforce a 32bit build in that situation.
)
building GMP can not detect Cygwin is 32bit either if the
host which Cygwin is running is 64bit. We set ABI=32
in that case.

Change-Id: Ic53d75defebbe902325eb07f3d8631b2a53245ef
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11123
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-06 05:51:57 +02:00
zbao e05c1eac44 buildgcc: Get the clean and correct uname on Cygwin
Running `uname` on Cygwin gets "CYGWIN_NT-6.1-WOW" instead of "Cygwin".
We need to fix the $UNAME on Cygwin.

Change-Id: I540bfc52089951006fd0e20bb9893a3d891df9e1
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11124
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-08-06 05:50:35 +02:00
Stefan Reinauer 1db856d08a secimage: Don't link in gmp library
secimage does not use libgmp, so don't link it in.
(Otherwise linking fails if the library is not installed)

Change-Id: I24af21c7754ecd0109f3e86669fa34fa6991d7fe
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/11079
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-31 17:40:32 +02:00
Patrick Georgi 5da95dc4c2 crossgcc: Support /bin/sh pointing to dash
It doesn't know "source", but wants the older "." instead

Change-Id: Iafa61b1d2ffc9c737ab67a417c62417593b69374
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10974
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-22 01:44:54 +02:00
Patrick Georgi 4d1c5aa9f7 cbfstool: Deduplicate code to merge empty files
The code for removing a file had its own merge routine. Use the generic one
instead.

Change-Id: I90ed007ab86f78a2728f529fa0143c5c1dfbbdc3
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10967
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-18 15:28:33 +02:00
Patrick Georgi 0d618afc84 cbfstool: rename checksum to attributes_offset
So far it's still unused, but its purpose will change:
It will become an offset to another structure that contains additional file
attributes.

This change is compatible because the binary format doesn't change and so far
the field was always set to 0, which can serve nicely as 'unused' field.

Change-Id: I2dafb06866713d43a236556f9492641526270837
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10933
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-18 09:56:08 +02:00
Patrick Georgi 2062473492 cbfstool: move fill value to cbfs.h
Change-Id: Ie05db6d43219c65d08e2221009875f81eb29b630
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10968
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-18 09:39:33 +02:00
Stefan Reinauer b18f522bce lint/gitconfig: Enable checkpatch.pl checking of commits
This patch enables running the checkpatch script on the code portion
of each commit as part of the pre-commit hook. At this point there
is no checking of the commit message in place (e.g. for typos)

Change-Id: I7cdf0692cf372986e411f4aba4691417b73c7511
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/8419
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-07-17 18:42:50 +02:00
Patrick Georgi f61c9e9a59 release: add release script
Change-Id: Ib3cd29cf1875e7ad182262d7caa33ff35f28aa85
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10909
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-16 17:40:42 +02:00
Sol Boucher 5bb90e6999 cbfstool: Remove extra comma after {0, NULL} list element
Trailing commas are useful for lists that can be extended. These lists are
0-terminated, and there should be no elements following that.

Change-Id: Iea8c6d5579d6363e77e1f5af666948160c4a9bf9
Signed-off-by: Sol Boucher <solb@chromium.org>
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Change-Id: I1a117a9473e895feaf455bb30d0f945f57de51eb
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10932
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-16 17:39:49 +02:00
Sol Boucher ec42486055 cbfstool: Factor out compression algorithm list
Parse compression algorithm arguments using a single list.

Change-Id: Idc5b14a53377b29964f24221e42db6e09a497d48
Signed-off-by: Sol Boucher <solb@chromium.org>
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Change-Id: I1a117a9473e895feaf455bb30d0f945f57de51eb
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10931
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-16 17:39:33 +02:00
Sol Boucher 6533671ce0 cbfstool: rename field
With introducing hash algorithms, 'algo' is ambiguous, so rename it to
'compression' instead.

Change-Id: Ief3d39067df650d03030b5ca9e8677861ce682ed
Signed-off-by: Sol Boucher <solb@chromium.org>
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Change-Id: I1a117a9473e895feaf455bb30d0f945f57de51eb
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10930
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-16 17:39:17 +02:00
Sol Boucher 158dd5527c cbfstool: move bit swapping macros to swab.h
Change-Id: Id22232c45225011951e01c370e0f473af574d758
Signed-off-by: Sol Boucher <solb@chromium.org>
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Change-Id: I1a117a9473e895feaf455bb30d0f945f57de51eb
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10929
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-16 17:38:57 +02:00
Patrick Georgi c569b8bfdc cbfstool: use variable length array to model cbfs_file's filename
Change-Id: Ib056983630b2899d7e6cbcb43f6b7153f0f8e282
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10928
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-16 17:38:38 +02:00
Patrick Georgi 5dc01ac506 cbfstool: improve specification of struct cbfs_file
Lock down its size and document some of the fields

Change-Id: I09fd6c80185345da0ae17d0f4498b50995fd1ec5
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10927
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2015-07-16 17:38:19 +02:00
Patrick Georgi 45acb34ffc cbfstool: fix alignment to 64 byte
It's not like we _ever_ changed it, so drop the option and make cbfstool
use the default. always.

Change-Id: Ia1b99fda03d5852137a362422e979f4a4dffc5ed
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10918
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-15 16:34:30 +02:00
Aaron Durbin 31540fb785 cbmem: export base_time in timestamp table
It's helpful to know the base_time (1st timestamp) in the
timestamp table because it provides more information like
the accumulated time before the first timestamp was recorded.

In order to maximize this information report the base time
as an entry that is printed. It's called '1st timestamp'.
The implementation turns all the timestamp entries into absolute
times so one can observe both absolute and relative time for
each marker.

Change-Id: I1334a2d980e3bcc2968a3bd6493c68b9efcca7ae
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/10883
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-14 22:50:17 +02:00
Patrick Georgi 3ac3c4ebac abuild: Allow disabling mainboards
There may be boards that shouldn't be built for one reason or another.
Allow black-listing them by adding a file to the mainboard directory called
'abuild.disabled'. It should contain the reason that is printed by abuild and
also serves as documentation for users that want to know what's going on.

Change-Id: I78c3281a578e96ee40f6b101143d4f3763582350
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10917
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-07-14 20:43:00 +02:00
Patrick Georgi d00f180812 cbmem: convert x86 timestamps on OpenBSD
Change-Id: I16bfe42a00d73209307655601edaa3a8ffc9c902
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10905
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-14 12:23:05 +02:00
Paul Menzel b2ba3957e5 buildgcc: Show the archive URL
In case of downloading errors, the URL is handy for analyzing the cause.

Change-Id: I6874cdc3c881cfdd52c80f80323536c30723654b
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/10853
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <gaumless@gmail.com>
2015-07-14 04:34:25 +02:00
Martin Roth 403ba7726a Update crossgcc Makefile for new buildgcc arguments
The script `util/crossgcc/buildgcc` was rewritten in commit 85b07d68
(buildgcc: move to a package centric user interface) and the switches
changed.  This patch does the following:

- IASL was split out of the gcc builds, so needs a target of its own.
- Add clang build target
- Update the build-ARCH targets as buildgcc -G no longer builds gcc.
- Rework all the targets to use common targets to call buildgcc
- Split the tempfile clean from the regular clean
- Change the 'all' target to leave the tempfiles until all architectures
are built so that if one fails and needs a rebuild, it doesn't have to
start from scratch.
- Add an all_without_gdb target
- Add clang build to all

Change-Id: I4ff720eab6d9b72d00757fd2b632e6d9a6c25aa3
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: http://review.coreboot.org/10679
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-12 19:04:14 +02:00
Anatol Pomozov 8cce701b56 Fix GCC 5.1 compile issue seen at Linux Arch
rmodule.c: In function ‘rmodule_create’:
rmodule.c:287:29: error: ‘phdr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
        (phdr->p_vaddr + phdr->p_memsz))) {
                             ^
rmodule.c:204:14: note: ‘phdr’ was declared here
  Elf64_Phdr *phdr;
              ^

Change-Id: I94a235253610348484eef218ec855103a3bb5da5
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Reviewed-on: http://review.coreboot.org/10881
Tested-by: build bot (Jenkins)
Reviewed-by: Francis Rowe <info@gluglug.org.uk>
2015-07-11 04:47:38 +02:00
Stefan Reinauer f53dbfaa8c libpayload: Use top level xcompile
Instead of having a second copy that already within 2-3 days
becamer quite outdated, use the same xcompile copy for coreboot
and libpayload, as we do with Kconfig already.

This requires a simple change to the top level xcompile to understand
both CONFIG_COMPILER_GCC and CONFIG_LP_COMPILER_GCC (only one of
them will occur at the same time)

libpayload's .xcompile target was moved later so that it can make use
of $(top)

Change-Id: I44001067f551cd0776dd303cbaeaa40eb3d5c1db
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10863
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-09 08:47:16 +02:00
Stefan Reinauer b30045fd06 xcompile: switch around armv7 TCARCHes
clang probing will pick up the first one that clang does not complain about
and right now that is armv7a-eabi, even though our toolchain builds for
armv7-a-eabi (and consecutively the build fails because there is no
armv7a-eabi-as)

Change-Id: I2594151150107f8e9c1aad33647dcb2f9878f953
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10830
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-09 00:22:10 +02:00
Stefan Reinauer cfa9b99b23 cbfstool: Make sure CBFS data structures are packed gcc style
On Windows systems, structs can be packed gcc style or ms style.
Make sure we use the same one (gcc style) in our user space tools
that we use in coreboot.

Change-Id: I7a9ea7368f77fba53206e953b4d5ca219ed4c12e
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-on: http://review.coreboot.org/10794
Tested-by: build bot (Jenkins)
2015-07-07 18:30:32 +02:00
Stefan Reinauer 19ba110c2d cbfstool: Fix kv_pair on Windows
On Windows systems the archetype printf defaults to ms_printf
instead of gnu_printf. Keep the archetype print for all non-
Windows compiles to not break compatibility with other systems
out there.

Change-Id: Iad8441f4dc814366176646f6a7a5df653fda4c15
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-on: http://review.coreboot.org/10793
Tested-by: build bot (Jenkins)
2015-07-07 18:30:00 +02:00
Stefan Reinauer 4c8fa2aad2 Unconditionally compile romstage with -Wa,--divide
The option --divide is required by our assembler to ensure that
'/' is not parsed as a comment sign but as a division, because
some of the cache as ram code is using divisions.

The --divide parameter has been part of the GNU as since binutils 2.17.
Hence, compile romstage (which contains cache as ram init) with
-Wa,--divide unconditionally instead of probing for it and adding it to
all compiler invocations (because that is causing random trouble with
clang when compiling the SMM code and calling gcc with --divide instead of
-Wa,--divide)

Change-Id: Ideefb2a243dc1d657ba415a99c1f8ab1d93800e0
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10817
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-07 17:40:09 +02:00
Stefan Reinauer adf61e2926 buildgcc: update IASL to version 20150619
Change-Id: Ic0cb6826bb624e905b9c715f17a7629bc7b751c5
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10818
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-07 17:08:45 +02:00
Stefan Reinauer 8ef928af4e xcompile: Fix compiler invocation in testcc
While for GCC targets the compiler is just defined as a single
binary, for clang it is defined as a binary and some options, e.g.:
  clang -target i386-elf -ccc-gcc-name i386-elf-gcc

When executing the compiler with "$1", the shell will look for a
binary with the above name (instead of just clang) and always fail
detection of any CFLAGS.

By adding -c we prevent the compiler from failing because it can't
link a user space program (when what we're looking for, is whether
a specific compiler flag can be used to compile a coreboot object
file)

Change-Id: I1e9ff32fe40efbe3224c69785f31bc277f21d21b
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10816
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-07 17:08:16 +02:00
Stefan Reinauer e9e6e3d93c buildgcc: work around bug in --print-librt-file-name
Running "clang -target i386-elf --print-librt-file-name" prints
[..]/bin/../lib/clang/3.6.1/lib/libclang_rt.builtins-i386.a

However, the correct path is [..]/lib/linux/libclang_rt.builtins-i386.a
on a Linux host. Hence, create symbolic links to make sure that our
build system finds the file where it expects it.

Change-Id: I21ef5c4a690d83c326717ca55c5ace558257a0ec
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10815
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-07 17:07:56 +02:00
Jonathan A. Kollasch 9d6a17b549 util/cbfstool: use _XOPEN_SOURCE=700 to find strdup(3)
Change-Id: I974c6c8733356cc8ea4e0505136a34b6055abf0c
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-on: http://review.coreboot.org/10809
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2015-07-07 02:14:08 +02:00
Alexander Couzens 0004ae8f4b util/ectool: don't dump the whole ram when writing to it
Change-Id: Ib2f417ff91862c71de32b3f8929d2017a725ea47
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: http://review.coreboot.org/10767
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-07-06 23:11:03 +02:00
Jonathan A. Kollasch 1142197e27 util/cbfstool: don't override ntohl(3) and htonl(3) on NetBSD
Change-Id: I9bfc017dee86fe6cbc51de99f46429d53efe7d11
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-on: http://review.coreboot.org/10810
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-07-06 20:53:37 +02:00
Jonathan A. Kollasch fb6f78e61e util/xcompile/xcompile: use env(1) to find bash
Not all systems put bash at /bin/bash.

Change-Id: Ib58cd2f6cf330b5b2678d55bb929696872fba9c9
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-on: http://review.coreboot.org/10808
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-07-06 20:50:08 +02:00
Patrick Georgi ddb8f80894 buildgcc: Deal with gmp on 32bit Linux on 64bit CPUs
GMP is overeager to detect 64bit ABIs even if the entire running codebase is
32bit (but on a 64bit CPU). Enforce a 32bit build in that situation.

Change-Id: I23e9e57f3c8b0e3ad2e4e1e3eb106f7830aa76a1
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10792
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-07-04 23:39:34 +02:00
Patrick Georgi 8d7b719c0e xcompile: ask for compiler runtime using appropriate CFLAGS
xcompile keeps two CFLAGS around now, for GCC and CLANG. Normally they're not
required to request the libgcc/compiler-rt path, but with the multilib capable
x86_64-elf target it's required to make it pick the right libgcc when used as
i386-elf builder.

Change-Id: I700e7aa5783dc36698dd2ab8a38642a144e80fe9
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10795
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2015-07-04 23:37:01 +02:00
Patrick Georgi 630ad918d4 crossgcc: Fix binutils for aarch64
The gold linker didn't build.

Change-Id: I93c26a7715e781b001a71978d8fadbf65fdfe427
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10791
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2015-07-04 09:33:05 +02:00
Stefan Reinauer b12a448c97 kconfig: Fix defconfig targets
The syntax of "conf" has changed, but we never adapted
our Kconfig Makefile since we are not typically using those
targets (except for coreinfo)

Change-Id: Ib95b53d255d7456cc6d6bcc7048fcaa0db1ce142
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10716
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-06-30 21:45:50 +02:00
Stefan Reinauer ed56499ab1 libpayload: Drop duplicate copy of Kconfig
It's perfectly fine to have one single copy of kconfig in the tree.

Change-Id: Icfe32f0249dfc1c223009d6e7136462f8f8a7248
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10521
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-30 18:55:32 +02:00
Patrick Georgi 3270369986 util/scripts: add some support scripts
These scripts were bit-rotting on my box and may be useful for somebody else.

no-fsf-addresses.sh removes various FSF addresses from license headers

find-unused-kconfig-symbols.sh points out Kconfig variables that may be
unused. There are some false positives, but it serves as a starting point.

Change-Id: I8ddb5bea5fe87d39eed5f39f32077944b37d0665
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10675
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-30 08:24:38 +02:00
Furquan Shaikh f7a5b56297 cbfstool: Handle elf with different virtual and physical address
Adds support in cbfstool to adjust the entry field based on the
virtual and physical address in program header.

BUG=chrome-os-partner:40713
BRANCH=None
TEST=Verified correct entry point address. Trusty loads and boots correctly.

Change-Id: I215b0bea689626deec65e15fb3280e369d816406
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 32a740f0b628c124d3251cc416e2fc133bb15c57
Original-Change-Id: Ia999b5c55887c86ef1e43794ceaef2d867957f4d
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/274087
Original-Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
Original-Tested-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/10690
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-30 08:09:58 +02:00
Martin Roth 3950966e32 crossgcc/Makefile: Allow making toolchains using multiple cores
I looked for a way to pass the 'make crossgcc -j8' on to buildgcc, but
didn't find a way to get that value directly.  MAKEFLAGS turns -j8 into
a jobserver variable.

Instead, this patch allows the number of CPUs to be set on the command
line through a variable instead.

Example: 'make crossgcc BUILDJOBS=8'

Change-Id: I37608cdb4549226cb7ff8c3ff6d9f4773acf6b0b
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: http://review.coreboot.org/10620
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-24 06:15:10 +02:00
Martin Roth 32c9651705 crossgcc/Makefile: clean more, add distclean target
Update the clean target to remove the intermediate files.  These should
get removed automatically, but if the build stops in the middle, or if
the -t command is used for buildgcc, they can be left in the directory.

Add a distclean target that removes the downloaded tarballs as well as
everything else.

Change-Id: I6ea19e7a499b0c313c1d2eff7e36386204ec834e
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: http://review.coreboot.org/10621
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-06-24 06:04:22 +02:00
Stefan Reinauer f2ccc4314e autoport: Include 'default_irq_route.asl' into DSDT
After commit with Change-Id Ia1839ed3 (sandy/ivy: Include
IRQ routes from platform), update autoport to include
that file into the DSDT.

Change-Id: I14534438d0b433895f384539c8b413eaa53d943a
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10612
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-06-24 02:02:48 +02:00
Martin Roth d1da74ff9d buildgcc: Add list of valid platform to the help text.
Change-Id: Ic48a08d1067c850555cf04ad29e65e9bdb7c4243
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: http://review.coreboot.org/10619
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-06-22 21:28:21 +02:00
Marc Jones 5ee6951e5a buildgcc: Update clang search string
buildgcc fails if g++ or clang isn't found on the host. This
was failing on OSX due to the string used to check for clang
doesn't match "Apple LLVM". Add an additional search string for
clang "LLVM".

Change-Id: I05e36cfc690061b3233376d57f44f197cab933ea
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/10569
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-20 22:17:59 +02:00
Stefan Reinauer 7979dc09a8 xcompile: x86-64-elf wants -Wa,--divide, too
Change-Id: I03eb1c0f1e0b0c6213ec6b26cf41dadd4df9b910
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10574
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-06-20 18:14:27 +02:00
Stefan Reinauer bd8b2e31d2 buildgcc: Don't build iasl with gcc
There's a separate target -P iasl for that now.

Change-Id: I95c0fe8fc266859d8a31b7bea890775dc9f19694
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10567
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-17 21:15:17 +02:00
Stefan Reinauer 682a90c011 buildgcc: enable biarch support for x86_64-elf
With this change, the x86_64-elf-gcc can compile i386-elf
binaries by specifying -m32. The patch against GCC is needed
to enable building the 32bit libraries when building x86_64-elf-gcc

Change-Id: Ic86a009eccfdf3e33a398bcdcc13b15c8dfc0d31
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10497
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-17 21:15:07 +02:00
Stefan Reinauer 66e93355d1 buildgcc: Check for dependencies after printing banner
For consistency in user output, move the check for all
required utilities after printing the banner and parsing
options.

Change-Id: I5bf31368885c73e35f18b02d53d099f3f3871acc
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10566
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2015-06-17 03:11:19 +02:00
Stefan Reinauer 93a9630be3 buildgcc: Clarify required user action
When required tools are missing, try to give the user more detailed
information on how to solve the problem.

Change-Id: Ifa21c1af38a036a7d4f5a786041a87a7d45f4ec5
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10555
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-17 03:10:46 +02:00
Patrick Georgi db6dd817a2 kconfig: allow specifying the target for savedefconfig
Change-Id: Iee5ab0d3bdc8b754669356f2046d290d9ca555c2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10511
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-16 18:08:15 +02:00
Stefan Reinauer 4dcfa21e6a xcompile: Don't print error messages
Don't print error messages if an unpatched clang is detected.

Change-Id: If77722a40a59e99f01d121a0c43999f05f3c4421
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10554
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-16 17:44:41 +02:00
David Hendricks cd5cdd3ba4 buildgcc: Define $CMAKE only if clang package is built
This moves the CMAKE definition down into the case statement
for $PACKAGE so that it is only required when the user wants to
build clang.

With this approach, "./buildgcc -P clang" will error out with the
"ERROR: Missing tool:" message if cmake is not installed.

Change-Id: I1e5c1bd67ade8f93ba0390df7f234deb47b9b18a
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: http://review.coreboot.org/10556
Tested-by: build bot (Jenkins)
Reviewed-by: Francis Rowe <info@gluglug.org.uk>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-16 08:42:25 +02:00
Stefan Reinauer ae9f87fc1b xcompile: add support for x86-64
Add support for detecting an x86-64 cross compiler in xcompile.

Change-Id: Icd2c9af7903956216db1fd54902eab6da0fe3e21
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-on: http://review.coreboot.org/8669
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-16 08:41:53 +02:00
Patrick Georgi 2d119a3f01 bimgtool: initialize data header
Otherwise dummy contains uninitialized data, which leads to non-reproducible
builds (and a leak of 4 bytes of stack data).

Change-Id: Iaaf846580ec436fdd4f0800c7576b544f50d6ae0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10524
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-12 23:16:01 +02:00
Patrick Georgi c866591698 buildgcc: improve portability of 'type' use
The precise phrase returned by 'type' differs between locales and shells.
It also doesn't matter because it returns an error code when it hasn't found a
match.
Let's simply assume there's no build_$OneOfOurPackages commands around that
could also match.

Change-Id: I44f021243149701e8da9dd74c368ca2ad4509419
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Tested-on: linux bash, linux dash, solaris sh, solaris ksh.
Reviewed-on: http://review.coreboot.org/10517
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-12 08:40:54 +02:00
Vladimir Serbinenko fe5dd02c83 to-wiki: Adjust nice name retrievals to match current tree.
Change-Id: Ic6ce697af6102da7d8c53947c9d3b5ac39817d7c
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10333
Tested-by: build bot (Jenkins)
Reviewed-by: Nicolas Reinecke <nr@das-labor.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-12 05:50:10 +02:00
Patrick Georgi f2c15f5136 buildgcc: replace [[ ... == ... ]] with something more portable
using grep is an extra process invocation, but it's not a bashism.
Also match precisely, so AGCC doesn't trigger on GCC (we don't have collisions
right now, but we won't have to deal with them in the future)

Change-Id: I242833c350b7f1e6a6793f288c1aae0b50d57a26
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10518
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-12 02:31:37 +02:00
Patrick Georgi 4647bb11ca kconfig: enforce stable sort order
Locales differ in the order in which they sort entries. This ensures
predictable behavior.

Change-Id: I4ceec90a56bbc368a847d14298db0a21cc21e77c
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10510
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-11 19:00:33 +02:00
Furquan Shaikh 16c0a413ad ARM64 rmodule: Add new reloc type R_AARCH64_CONDBR19
BUG=chrome-os-partner:41185
BRANCH=None
TEST=Compiles successfully for ryu.

Change-Id: I78ccc4b5ef8b49bae533e5a82323f07aaab01a7e
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: cf9d288d4bbc91301dc814408bf5e3686b869974
Original-Change-Id: I24df0eb51883a634ec3d26d46f79a059a4f8394a
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/275749
Original-Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
Original-Tested-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/10476
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins)
2015-06-10 20:30:32 +02:00
Stefan Reinauer 2f97ebc4c9 buildgcc: build with bfd and gold linker
Build with bfd and gold linker, but use bfd linker per default
and make sure that lto is enabled in both binutils and gcc

Change-Id: I0584396b4580674cfdca24fbed0d8eeb1ee38806
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10496
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-06-10 07:32:43 +02:00
Stefan Reinauer 85b07d68c1 buildgcc: move to a package centric user interface
Instead of building IASL and GDB implicitly when building
GCC, this patch changes buildgcc to let you explicitly specify
what you want to build.

This will prevent IASL from building over and over again, when
all you need is GDB.

The new command line option is -P | --package <package> where
package is one of the following: GCC, GDB, CLANG, IASL
If no package is specified, buildgcc will default to GCC.

Change-Id: I8836bed16fc2bc39e0951199143581cc6d71cb4d
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10492
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-06-10 07:27:49 +02:00
Stefan Reinauer 429424f366 buildgcc: fix compilation of IASL
IASL was broken when compiling without GCC.

Change-Id: Ib859ce41c1dda10181781c025fc378504f5ebb91
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10495
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-06-10 06:06:36 +02:00
Stefan Reinauer bed95b22c3 buildgcc: Update and fix GDB
GDB stopped building ever since we updated from version 7.6
but nobody noticed ;)
Update from 7.9 to 7.9.1 and bring the required patches forward.

Change-Id: I2f357525a46d5540e9f57b80d830943bbd5dfcaf
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10494
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-06-10 06:06:13 +02:00
Stefan Reinauer 5dd2635af9 buildgcc: Reorder main program
This groups all tasks happening in the main program,
orders them according to their dependencies and adds
comments on the various tasks.

Change-Id: Ib62bd213977cbc3307ef62e9a7e64515563968c1
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10490
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Tested-by: build bot (Jenkins)
2015-06-10 06:05:39 +02:00
Stefan Reinauer 05bbc9208a buildgcc: Don't use BUILDDIRPREFIX
Change-Id: I7be9b39a0d92882fa437f666d7f4a85e6f0a23f6
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10489
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2015-06-10 06:05:17 +02:00
Stefan Reinauer 1c70e052aa buildgcc: solidify and remove boilerplate code
- don't capture build_$package in a subshell by piping it
- move HOSTCFLAGS to build_GMP
- only create a build directory if a build happens
- automatically collect packages to build

Change-Id: Ic5a9f3f222faecd3381b413e5f25dff87262a855
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10475
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Tested-by: build bot (Jenkins)
2015-06-10 06:04:50 +02:00
Martin Roth f099e1bcff util/kconfig/Makefile: Add savedefconfig target
Add a savedefconfig target and the help for it to the kconfig
makefile.

The main advantage I found for using defconfigs instead of the full
.config is that they require less maintenence, so long as reasonable
default values are set when adding new config options.  When the
defconfig is expanded, it will use default values for all options not
saved in the defconfig.  This cuts the size of a saved config from
500ish lines to roughly 20 lines.

savedefconfig was added to the linux kernel in commit id
7cf3d73b4360e91b14326632ab1aeda4cb26308d

Change-Id: I45f3dc87b773fb6e9ee53e32fdcafff1f53074d2
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: http://review.coreboot.org/10462
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-10 03:15:10 +02:00
Stefan Reinauer 7b40e42c49 buildgcc: use ${GDB_DIR} instead of gdb-${GDB_VERSION}
Bring gdb in sync with all other build targets.

Change-Id: I9c478947a00f044edf910a91d876bbf486a791cf
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10488
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2015-06-09 23:31:34 +02:00
Stefan Reinauer 916b8455ff buildgcc: Fail if a patch failed to apply
Otherwise one could end up with what they think is a coreboot toolchain
but in fact it'd be missing some patches.

Change-Id: Ic451f7061b822d0f4b64acc9976ba81fd544e85b
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10487
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2015-06-09 23:31:22 +02:00
Stefan Reinauer d0f837239d buildgcc: Don't run autoconf
gcc and binutils fixed their upstream tar balls, and running
autoconf created more problems than it solved

Change-Id: I0003dd597f521701405ff35923214435136b262d
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10486
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2015-06-09 23:31:14 +02:00
Stefan Reinauer dbc0087f9e buildgcc: move from if test to if [ .. ]
Change-Id: I29fe23e377045f08b8212742d84c2ee2b4a61b15
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10485
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2015-06-09 23:31:03 +02:00
Stefan Reinauer d764912e0e buildgcc: move from `..` to $( .. )
Change-Id: I7a095470d408d013a4a915e010c59ea99ca1f1c8
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10484
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2015-06-09 23:30:43 +02:00
Alexander Couzens 946bf935db genbuild_h: set LC_ALL=C to get rid of language influence to date
Change-Id: Ia0af9e332522a640dd9aaa3a62d39d691fcfa959
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: http://review.coreboot.org/10449
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-09 21:57:14 +02:00
Alexander Couzens 4dc1197ba3 genbuild_h: refactor environment variable into export's
Change-Id: Ife3fb0c86fbd065fe9957bbc79b4dd1391f930b2
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: http://review.coreboot.org/10448
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-09 21:57:05 +02:00
Marc Jones a8bda437d1 cbmem: Break out CBMEM_ID to a separate header file
The cbmem util needs the CBMEM_IDs and the strings for
reporting and shares the cbmem.h file with coreboot. Split out
the IDs so for a simpler sharing and no worries about overlap of
standard libraries and other things in the header that coreboot
requires, but the tool does not.

Change-Id: Iba760c5f99c5e9838ba9426e284b59f02bcc507a
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/10430
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-06-09 17:21:07 +02:00
Stefan Reinauer 6404dffe0c xcompile: Fix errors thrown during make gitconfig
$ make gitconfig
util/xcompile/xcompile: line 164: -print-librt-file-name: command not found
util/xcompile/xcompile: line 164: -print-librt-file-name: command not found
util/xcompile/xcompile: line 164: -print-librt-file-name: command not found
util/xcompile/xcompile: line 164: -print-librt-file-name: command not found
[..]

Change-Id: Ib477566e3841e419aa7880c912636540a0ad5432
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10464
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2015-06-08 20:56:28 +02:00
Stefan Reinauer e7757bdeee buildgcc: Unify and refactor build scripts
This removes quite a bit of boilerplate from the script, and makes
it easier to read.

Change-Id: I92348b810ff19f7d18810f842b76e0e595b3d397
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10435
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-08 20:00:21 +02:00
Stefan Reinauer 14ce213901 crossgcc: Add clang support
Add a new option -C|--clang to buildgcc to build a clang based
toolchain as opposed to a gcc based toolchain. This toolchain
comes with the required patches needed to successfully build
coreboot, and also with clang's famous scan-build script.

Change-Id: I1aea7cd6002edc4f3bb2b46dc1f69a212ad18f77
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10415
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-08 20:00:11 +02:00
Stefan Reinauer 699ac27dec buildgcc: refactor package unpacking, patching and building
- keep a list of packages to build in $PACKAGES and only download,
  patch and build a package if it is in that list (instead of having
  exceptions for GDB, EXPAT and PYTHON)
- unify interface for download() and unpack_and_patch()
- consolidate some randomly spread code like creating / removing
  build directories and calls to searchtool()

Change-Id: I2070e3b2fbb84eb18e9220658fb2d5518b8179ee
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10434
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2015-06-08 20:00:04 +02:00
Elyes HAOUAS 52648623e0 Remove empty lines at end of file
Used command line to remove empty lines at end of file:
find . -type f -exec sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \;

Change-Id: I816ac9666b6dbb7c7e47843672f0d5cc499766a3
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: http://review.coreboot.org/10446
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-08 00:55:07 +02:00
Alexander Couzens d9bc2fadc4 genbuild_h: timestamps should not depend on LANG or LC_ALL
Fixes reproducible builds.

Change-Id: I3b0a21f93daee09605c0c2a05c1739e04f44527f
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: http://review.coreboot.org/10447
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2015-06-07 01:43:42 +02:00
Stefan Reinauer 88935481c9 buildgcc: factor out downloading, unpacking and patching
This will be useful for adding clang support (and hopefully
makes the code a bit more readable)

Change-Id: Ie866fb2bd71e2a64f26f2755961bd126e101cbe5
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10433
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-06 08:41:22 +02:00
Patrick Georgi 34de29aeb3 build system: move more clang handling to xcompile
clang requires some additional options to disable warnings which
can be handled by xcompile.
Also drop the hard coded clang compilers in Makefile

Change-Id: I0f12f755420f315127e6d9adc00b1246c6e7131b
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/7612
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-04 20:02:01 +02:00
Patrick Georgi 527f3923b0 build system: move compiler runtime determination to xcompile
Instead of fetching libgcc's location and required compiler flags on every
individual build, do it once in xcompile.

Change-Id: Ie5832fcb21710c4cf381ba475589d42ce0235f96
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: http://review.coreboot.org/10425
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-06-04 20:01:45 +02:00
Patrick Georgi 8b5a051c3e xcompile: Detect clang compilers
This uses the availability of CONFIG_* variables in .xcompile and tests for
compilers in xcompile so that the build system doesn't need to probe them.

Change-Id: I359ad6245d2527efa7e848a9b38f5f194744c827
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: http://review.coreboot.org/10424
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-04 20:01:36 +02:00
Patrick Georgi 532df293da xcompile: Rename internal variable CFLAGS to CFLAGS_GCC
This is in preparation of adding support for clang to xcompile.

Change-Id: I518d077f134610082b0939b1525682f2289eec34
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10423
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-04 20:01:29 +02:00
Patrick Georgi 31bf37eb32 crossgcc: Improve compatibility of the toolchain across host systems
crossgcc builds gmp, whose build system normally optimises for the hardware
it's built on. That may give a minor performance boost but has the downside
that the compiler becomes non-portable and may break on other systems due to
illegal instructions.

Setting CFLAGS to some reasonable value prevents gmp's configure script from
choosing CPU specific -mtune flags (which may enable optimizations that only
run on CPUs with the same feature set).
Enabling "fat" builds make the build system add all optimized assembler
routines and makes the selection of the right one a runtime decision instead
of deciding at compile time.

Change-Id: I72d20627270baa082cd02ebb4c9a09cd23f30f8c
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10412
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-04 17:15:02 +02:00
Vladimir Serbinenko a4cf83df7a cbfs: Fix mismerge.
cbfs_get_file_content was replaced with cbfs_boot_map_with_leak but
36f8d27ea9 failed to get it into account.

Change-Id: I0c7840043b2ea6abaf8e70f4bf1a63c96aedebc1
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10403
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2015-06-02 21:48:24 +02:00
Felix Held 3ad6ff1054 superiotool: detect the NCT5572D
Change-Id: I99717072679a51deecd6934ce7fb4aeb45135cd6
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: http://review.coreboot.org/10386
Tested-by: build bot (Jenkins)
Reviewed-by: Nicolas Reinecke <nr@das-labor.org>
2015-06-02 09:30:30 +02:00
Vladimir Serbinenko 72ee183c38 autoport: Update documentation to mention runtime prerequisites
Change-Id: I3b5fe953fa0e00fb827b66963d69f32d63a07b16
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10369
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-31 04:22:52 +02:00
Vladimir Serbinenko 91195c6437 autoport: Improve keyboard detection.
Previously I tried to see if Linux think that port 0x60 is in use by keyboard.
Unfortunately it always thinks that it is. Instead just base off real input
busses used.

Change-Id: I4bb744938f623d29f38396165a1694fee78c3d32
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10376
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:55:38 +02:00
Vladimir Serbinenko 239d53e9dc autoport: Add a note that slot labeling is unreliable.
Change-Id: I26c78d05524e5affcd44b528895d1e19905e924b
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10375
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:54:51 +02:00
Vladimir Serbinenko db0acf84fe autoport: Fix SPD map guessing function.
It was reversed between Lenovo and non-Lenovo cases.

Change-Id: I52c3b928abda2851e97ec0b40b7da5c5191217f5
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10374
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:54:31 +02:00
Vladimir Serbinenko 5868ab4588 autoport/ec_fixme: Fix error in resulting code.
Change-Id: Icfa3874b8e3accb3aa3db44d0baa6b7b5a683b41
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10373
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:53:54 +02:00
Vladimir Serbinenko 2d615e58da autoport: Strip inc, co and corp suffixes from vendor name
Apple is named Apple Inc in DMI but is "apple" in coreboot naming.
For other vendors we should follow similar pattern.

Change-Id: I7975b19faaf942c5bd44a704bcee994815499ceb
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10372
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:53:07 +02:00
Vladimir Serbinenko 68f5f62fca autoport/bd82x6x: Fix off-by-one error
Change-Id: Ibd5c8a1364ab183f72e12cc9b450a36200fe3fde
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10371
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:52:48 +02:00
Vladimir Serbinenko 39e25eceaf autoport: Allow binary prerequisites to be placed in the autoport directory.
This allow an easy creation of standalone "autoport pack".

Change-Id: Ibe9e38aa3b4bbd7260104e1c2a11630790ff4d2f
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10370
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:51:53 +02:00
Vladimir Serbinenko a78f699807 autoport: Minor style fixes in readme.
Change-Id: I089ec3d68e734820d13bb68a7122dfdb89c3f6a3
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10368
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-30 13:31:40 +02:00
Vladimir Serbinenko 3129f792f7 autoport: Write autoport together with porting guide for sandy/ivybridge.
This should be able to generate bootable ports for sandy/ivy, possible with
minor fixes. Howto is in readme.md

Change-Id: Ia126cf0939ef2dc2cdbb7ea100d2b63ea6b02f28
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/7131
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2015-05-29 11:26:29 +02:00
Vladimir Serbinenko 6f163a64c9 board-status: Don't consider Kconfig.name a valid mainboard.
Change-Id: Ibc06b17f48f72d5f9931437ffce020023ece2445
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10328
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-05-28 09:49:27 +02:00
Vladimir Serbinenko 43931f61b9 to-wiki: Correct retreval of nice vendor name
Change-Id: Ia1590e0bac5eefd4256bbbf5e8312a3dab7b5e6b
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10332
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-05-28 08:10:14 +02:00
Patrick Georgi 25509ee245 Remove address from GPLv2 headers
Follow up for commit b890a12, some contributions brought
back a number of FSF addresses, so get rid of them again.

Change-Id: I0ac0c957738ce512deb0ed82b2219ef90d96d46b
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10322
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2015-05-28 04:21:52 +02:00
Furquan Shaikh 3c3a0fa84c xcompile: Add CROSS_COMPILE_* variable
Add CROSS_COMPILE_* variable that can be passed to third-party
component compilations.

BUG=chrome-os-partner:40414
BRANCH=None
TEST=CROSS_COMPILE_* variable is passed in correctly.

Change-Id: I053325524601adf76ea35f7e74811fbc1c31781e
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: c07bd66e25900d064d6c69bddada67112ba5f183
Original-Change-Id: I3e4a5262acd84830205f64ba9a935974dd36ebbd
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/272372
Original-Tested-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/10306
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2015-05-27 08:20:41 +02:00
Patrick Georgi 1f8e4cbd53 cbfstool: update fmd_scanner.c_shipped
We updated the source files, but not the precompiled results.

Change-Id: I49634409d01c8d7cf841944e01d36571ae66c0ac
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10296
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2015-05-26 08:26:03 +02:00
Sol Boucher 32532ac92d cbfstool: Make update-fit action work on new-style images
Because new images place the bootblock in a separate region from the
primary CBFS, performing an update-fit operation requires reading an
additional section and choosing a different destination for the write
based on the image type. Since other actions are not affected by these
requirements, the logic for the optional read and all writing is
implemented in the cbfs_update_fit() function itself, rather than
relying on the main() function for writing as the other actions do.

Change-Id: I2024c59715120ecc3b9b158e007ebce75acff023
Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10137
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-05-26 02:30:21 +02:00
Vladimir Serbinenko 188aec0640 inteltool: dump gfx registers.
Useful for autoport and other gfx-related developpement.

Change-Id: I1fc0952bc30ab15cd39a4f0c00649714dcf318f3
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10276
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin@das-labor.org>
2015-05-25 18:51:59 +02:00
Vladimir Serbinenko 5a6b8d157b VBT parser.
Change-Id: I32f6505dbf683478bf5a25b73db7ab0c60eff29c
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/5842
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-05-25 18:19:51 +02:00
Patrick Georgi b890a1228d Remove address from GPLv2 headers
As per discussion with lawyers[tm], it's not a good idea to
shorten the license header too much - not for legal reasons
but because there are tools that look for them, and giving
them a standard pattern simplifies things.

However, we got confirmation that we don't have to update
every file ever added to coreboot whenever the FSF gets a
new lease, but can drop the address instead.

util/kconfig is excluded because that's imported code that
we may want to synchronize every now and then.

$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} +
$ find * -type f
	-a \! -name \*.patch \
	-a \! -name \*_shipped \
	-a \! -name LICENSE_GPL \
	-a \! -name LGPL.txt \
	-a \! -name COPYING \
	-a \! -name DISCLAIMER \
	-exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} +

Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/9233
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2015-05-21 20:50:25 +02:00
Paul Menzel 54e6aa7216 util/board_status: Fetch and rebase after failed push
Currently, when the remote master branch of the board-status
repository changes between cloning and pushing, `git push origin`
fails.

This race condition happens quite often with REACTS testing commits at
the same time on different systems.

If that happens, just download the objects and refs from the
board-status repository and rebase the local changes on it. Try that
three times before exiting with an error message.

Change-Id: I628ebce54895f44be6232b622d56acbcc421b847
Helped-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Helped-by: Patrick Georgi <pgeorgi@google.com>
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/10262
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
2015-05-21 07:57:48 +02:00
Paul Menzel 749e075ef3 util/board_status: Add `echo` before message string
Fix up commit 1b6e7a67 (Updates to the board status script) forgetting
to put `echo` in front of the string.

Change-Id: I7d4dfcc62545dfee2073410ba47489318a9bf5c6
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/10265
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
2015-05-20 23:27:51 +02:00
Patrick Georgi 7b32145763 cbfstool: Copy generated files to the build hierarchy before use
Instead of writing to the source tree (which we should generally avoid),
copy the pre-generated files (from lex and yacc) to $(objutil). Adapt
include paths and rules so they're found.

Change-Id: Id33be6d1dccf9a1b5857a29c55120dcc8f8db583
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10252
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-05-19 20:30:11 +02:00
Patrick Georgi 8d6e24c739 cbfstool: clarify dependencies in Makefile
While logical, make's handling of multiple targets in a rule isn't
intuitive, and was done wrong in cbfstool's Makefile.

%.c %.h: %.l encourages make to run the rule twice, once to
generate the .c file, once for the .h file. Hilarity ensues.

Change-Id: I2560cb34b6aee5f4bdd764bb05bb69ea2789c7d8
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10251
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-05-19 20:30:04 +02:00
Kyösti Mälkki d32b27383b cbfstool: Rename autogenerated targets
These names will skip the lint-whitespace tests.

Change-Id: If4ac1f8e11fd0ac62f09696f2704477b6eb30046
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/10212
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-05-19 17:03:54 +02:00
Kyösti Mälkki c877149e9d cbfstool: Fix fmd_scanner build compatibility
Fixes these errors:
error: declaration of ‘input’ shadows a global declaration [-Werror=shadow]
error: redundant redeclaration of ‘isatty’ [-Werror=redundant-decls]

Change-Id: I4563d36e5389db4fdc5be3ca4e0e88af2642f7f8
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/10162
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Sol Boucher <solb@chromium.org>
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
2015-05-19 07:17:36 +02:00
Timothy Pearson df699d545f util/cbmem: Update cbmem utility to parse the new IMD structures
This resolves the cbmem table of contents access failure introduced
in commit 0dff57dd.

Change-Id: Ie143ae11d97f26bd17fe10e1382fae9e5ad1a60e
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: http://review.coreboot.org/10236
Tested-by: build bot (Jenkins)
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-05-18 17:50:30 +02:00
Kyösti Mälkki 2e0425986f cbfstool: Fix shadowed global index
Change-Id: Ic8bccea1f2ddef874d8e440fa4fa05de1d4f9550
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/10210
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-05-17 16:05:08 +02:00
Matt DeVillier 5b667df135 util/inteltool: add Broadwell-U support
add handling of PCI IDs for Broadwell-U/Wildcat Point LP,
using same functions as Haswell-U/Lynx Point LP

Change-Id: I1094cbdace3c73f0f85c2e27c676b877b1a04bfe
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: http://review.coreboot.org/10209
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-05-16 08:14:21 +02:00
Sol Boucher 6310ccc59c cbfstool: Don't typedef the comp_algo enum
Our style discourages unnecessary typedefs, and this one doesn't gain
us anything, nor is it consistent with the surrounding code: there's
a function pointer typedef'd nearby, but non-opaque structs aren't.

BUG=chromium:482652
TEST=None
BRANCH=None

Change-Id: Ie7565240639e5b1aeebb08ea005099aaa3557a27
Signed-off-by: Sol Boucher <solb@chromium.org>
Original-Change-Id: I4285e6b56f99b85b9684f2b98b35e9b35a6c4cb7
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10146
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-05-13 22:24:39 +02:00
Sol Boucher 67d5998d97 cbfstool: Support top-aligned addresses for new-format images
The cbfstool handling of new-style FMAP-driven "partitioned" images
originally disallowed the use of x86-style top-aligned addresses with
the add.* and layout actions because it wasn't obvious how they should
work, especially since the normal addressing is done relative to each
individual region for these types of images. Not surprisingly,
however, the x86 portions of the build system make copious use of
top-aligned addresses, so this allows their use with new images and
specifies their behavior as being relative to the *image* end---not
the region end---just as it is for legacy images.

Change-Id: Icecc843f4f8b6bb52aa0ea16df771faa278228d2
Signed-off-by: Sol Boucher <solb@chromium.org>
Reviewed-on: http://review.coreboot.org/10136
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-05-13 22:23:37 +02:00