Commit Graph

3304 Commits

Author SHA1 Message Date
Martin Roth a564811e71 util: change coreboot to lowercase
The word 'coreboot' should always be written in lowercase, even at the
start of a sentence.

Change-Id: I0a024d82d331c0794fe087e440b4e1924129a13c
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20030
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-27 18:26:01 +00:00
Nico Huber cd87e1ba2d buildgcc: Adapt messages about GNAT and bootstrapping
Don't ask for bootstrapping in case of a different host GCC major
version. GCC's versioning scheme changed starting with the release
of GCC 5. There are no big changes between the versions any more.
Instead, show the message when the host GCC's version is below 4.

In case GNAT can't be found, ask the user to abort and install it.
Also give hints for Ubuntu where the package versions are a little
messy (e.g. the meta packages gcc and gnat often point to different
versions).

In case GNAT is found but is too old (< 4.9), enable bootstrapping
by default and tell the user that building will take longer.

In all three cases show a timeout to draw the user's attention.

v2: Update GNAT check to also look for `gnatbind`. It has to be
    somewhere in $PATH.

Change-Id: I4d9de11d7469e137ede8ad138296d20c0f8ba78f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20332
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-27 18:24:29 +00:00
Nico Huber 18c74d69af buildgcc: Rename quit() to exit_handler()
"quit" is a signal name. The FreeBSD `sh` interprets

    trap quit 1 2 3 15

as command to reset all the respective signal handlers, instead
of setting quit() as handler.

Change-Id: I69b813ab583f15a9dd89a115f7aea66d966f981b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20391
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-27 18:24:10 +00:00
Martin Roth 33906d2347 util/blobtool: add spec files for DDR3 SPDs
Because of how blobtool works, we need different files for the 128 and
256 byte versions.

Change-Id: I9a3a532515eaeeb65ae05ce4f7a37c88500c6193
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20094
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-27 16:06:53 +00:00
Patrick Georgi df9a71443e util/crossgcc: Fix building gcc 6.3.0 with clang
It assumes that __builtin_longjmp takes a void **, which is decidedly
distinctive from void *.

Change-Id: I1930bb01dd62bd6abf0688b118236db2a9299e40
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/20366
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-27 05:27:56 +00:00
Patrick Georgi a7a5a56370 crossgcc: Fix building with clang++ in the presence of gcc
Some environments (<grumble>cros_sdk</grumble>) provide gcc as $CC and
clang++ as $CXX. The latter needs the higher bracket-depth while the
former has no idea what it means, so tell CC and CXX individually.

Change-Id: I72b75fb9bb5df3a9b1561ee8821ec43ada29b24f
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/20365
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-27 05:27:53 +00:00
Lee Leahy 6796d787c5 libpayload: Enable building libpayload with march=i586
Add a Kconfig value to enable building libpayload with the 586 compiler.
Update the cross compiler script to add the Kconfig value name that is
used when libpayload builds.

The Quark SOC does not support some of the instructions generated with
the 686 compiler (e.g. CMOV).  Success occurs when
payloads/libpayload/build/config.h indicates that
CONFIG_LP_USE_MARCH_586=1.

TEST=Build and run on Galileo Gen2.

Change-Id: I04907e9a38ee139bae2e8b227821f54614707c25
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/20322
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-06-26 23:14:05 +00:00
Nico Huber 08bb837268 buildgcc: Allow environment to override $CC/$CXX
Also check for the presence of the given commands or "gcc", "cc" in this
order if $CC is empty. To untangle the given compilers from boostrapped
ones, introduce hostcc() and hostcxx() functions that return the respec-
tive compilers to be used.

Change-Id: Ic947be53eec25331173ac82ed742017ca3fbf83c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20331
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-26 20:28:27 +00:00
Martin Roth d55f5ebe44 crossgcc/buildgcc: update file location code
- Change from 'which' to 'command -v'. 'which' is not a posix command.

Change-Id: Icdf18e7e496447157554b8e61b1528f03456536d
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20230
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-06-25 08:45:05 +00:00
Stefan Reinauer 72dc21cb7c xcompile: Fix clang compiler runtime detection
clang, like gcc, needs a compiler runtime library. Unlike gcc, it can
use either its own runtime library (compiler-rt), or gcc's version
(libgcc). Also unlike gcc, the version of clang that is currently part
of our reference toolchain does not provide the necessary versions of
compiler-rt for all platforms we support. Hence, for now, use libgcc
even on clang builds.  This patch allows switching between the two, but
switching to compiler-rt will break clang builds, unless someone fixes
our reference toolchain to provide libclang_rt.builtins-${ARCH}.a for
each of our supported platforms.

Change-Id: I5001a4b62ed34df19312f980b927ced8cbaf07db
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/20303
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-06-25 01:38:13 +00:00
Stefan Reinauer 81693d41b1 crossgcc: cosmetic overhaul of output
Straighten up output from the buildgcc script

Change-Id: Iee6775b97560063bbdff0d31ceab2dddc58783b3
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/20302
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-06-22 23:24:41 +00:00
Stefan Reinauer c66fd3c267 crossgcc: Rename print_stable to print_supported
That's what the option is called in the help text. Not
sure where the divergence came from, so let's fix it.

Change-Id: I621aa203da2d314b93de665dbdadbe4a43725375
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/20301
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-06-22 23:24:29 +00:00
Stefan Reinauer ca117e7f49 crossgcc: Update to clang 4.0
Drop Edward's cfe patch because it has been implemented by
upstream clang differently. Instead of

 $ clang --print-librt-file-name

the right way to get ahold of the compiler-rt builtin library is

 $ clang -rtlib=compiler-rt --print-libgcc-file-name

Change-Id: I8aac5256da5bfb6f7bebeff0959f16b53867c581
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/20274
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-21 18:17:54 +00:00
Stefan Reinauer 3b5934936e Add CMake 3.9.0-rc3 to coreboot toolchain
Newer versions of clang will need newer versions of CMake (at least
3.4.3) to compile. This patch will enable us to switch to clang 4.0.

Change-Id: I6c91163ce0efd4eb2410cdb433de8be23d510ecd
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/20273
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-06-21 18:17:34 +00:00
Patrick Georgi 8f8668d87f util/scripts/gerrit-rebase: allow skipping old history
This might provide a minor speedup but more importantly it allows
skipping commits without Reviewed-on line (which we have a couple of
due to mistakes with git push).

To use, add a line starting with "Gerrit-Rebase-Ignore-CLs-Before:"
pointing out a match string (ie "something that comes after Reviewed-on")
prior to which no changes are considered on the originating branch. The
target branch is still fully considered to avoid issues with changes
that were retargetted out of order around the new cut and would then
make a reappearance (or be skipped).

Change-Id: I9f2679891e93f6d28a781315aebd2aa60a1e3b23
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/20185
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-06-19 18:44:13 +02:00
Philipp Deppenwiese 9a848dde8b util/crossgcc: Fix musl libc support
Disable NLS for libelf.

Change-Id: Ia4d01393771ccdff9e0498d7efd1bbdd11cff8db
Signed-off-by: Philipp Deppenwiese <zaolin@das-labor.org>
Reviewed-on: https://review.coreboot.org/20235
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-06-17 20:00:03 +02:00
Nico Huber cde2bdf496 inteltool/Makefile: Clean .dependencies too
Change-Id: Ib4fc326c6612f2d142c8a5220949fbb4b97c37a1
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20176
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-14 12:54:40 +02:00
Nico Huber cce508fed2 inteltool/Makefile: Separate CPPFLAGS from CFLAGS
Separate the required CPPFLAGS from environment overridable CFLAGS.

Change-Id: I0c1c0a1cebc7f7971634bf57d4a2370939c43fda
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20175
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-06-14 12:54:36 +02:00
Julius Werner be3aa04f21 cbmem: Escape literal asterisks in log banner regex
I had a stupid. :( Asterisks have a special meaning in regexes, but I
just wanted to match three literal ones. This kills the regex parser.

Change-Id: Ia6149e72715d651c914583ed3235680ce5b7a2e0
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/20171
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-06-14 02:17:14 +02:00
Paul Menzel 459d2198eb msrtool: Remove `no-pic` from `CFLAGS`
Commit 7c634ae8 (msrtool: added support for Intel CPUs) adds `no-pic` to
the compiler flags.

GCC 7.0.1 20170316 fails to built with the error below.

```
/usr/bin/ld: msrtool.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: msrutils.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: sys.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: linux.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: freebsd.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
```

Removing the flag causes the build to succeed with GCC 7, 6.3, and clang
4.0.

Change-Id: I3d7aed27ce7f84aa27305c68e2d5f14607c58ec8
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/18907
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-09 16:32:54 +02:00
Nico Huber 21e7424fc9 inteltool: Add Skylake PCI id in memory.c
Change-Id: I751e887bd90a258a69d13ea4ee9a409c8c86a3c3
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19591
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-09 16:25:20 +02:00
Paul Kocialkowki 37afb270b4 crossgcc: Resolve pointer and integer comparison in GCC
GCC version 7 is being a bit picky about pointer and integer comparison
by default, which triggers a crossgcc build error.

This backports a patch from upstream GCC to fix the issue.

Change-Id: I8b1e806c10604c0df080ac5edc667bf1141e2c17
Signed-off-by: Paul Kocialkowki <contact@paulk.fr>
Reviewed-on: https://review.coreboot.org/20103
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-08 23:29:15 +02:00
Martin Roth 811d93af39 util/lint: Give better warning for help spacing issue
Because the help block uses significant whitespace to determine whether
or not text is inside the help block, a mixture of spaces and tabs
confuses the parser.
If there's an unrecognized line, and the previous line was inside a help
block, it's likely that this line is too.

Additionally, this was found with a line that started '  configuration',
and threw a perl warning about an uninitialized value because the parser
thought this was the start of a new config line, but couldn't find the
symbol.  Now we make sure that config statements have whitespace after
the 'config' statement.

Change-Id: I46375738a18903b266ea9fff3102a1a91235e609
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/19155
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-07 23:13:38 +02:00
Martin Roth 8849f3be4a util/lint/kconfig_lint: update help checking
- Turn the check for help text with no indentation from a warning to
an error.
- Show an error if the help text is at the same indentation level as
the 'help' keyword.

Change-Id: Ibf868c83e2a128ceb6c4d3da7f2cf7dc237054e6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/19851
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2017-06-07 23:12:40 +02:00
Paul Menzel d2bbaffe40 abuild: Remove space before tab
Fix up commit 26174c97 (abuild: Build saved config files)
unintentionally adding a space before a tabulator.

Change-Id: Ic51dee6ed9d640335c2bde5bd5dfad3691c505e0
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/17778
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-07 20:37:35 +02:00
Paul Menzel 59e2113670 Use www.coreboot.org over coreboot.org
<https://coreboot.org> is redirected to <https://www.coreboot.org>.

```
$ curl -I https://coreboot.org
HTTP/1.1 301 Moved Permanently
Server: nginx/1.8.1
Date: Mon, 05 Jun 2017 10:41:33 GMT
Content-Type: text/html
Content-Length: 184
Connection: keep-alive
Location: https://www.coreboot.org/

```

So use the command below to use the final location to save a redirect.

```
$ git grep -l https://coreboot.org \
| xargs sed -i 's,https://coreboot.org,https://www.coreboot.org,g'
```

Change-Id: I4176c20ef31399f0063b41e3a0029cca0c1b0ff3
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/20035
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-07 12:05:44 +02:00
Paul Menzel a8843dee58 Use more secure HTTPS URLs for coreboot sites
The coreboot sites support HTTPS, and requests over HTTP with SSL are
also redirected. So use the more secure URLs, which also saves a
request most of the times, as nothing needs to be redirected.

Run the command below to replace all occurences.

```
$ git grep -l -E 'http://(www.|review.|)coreboot.org'
| xargs sed -i 's,http://\(.*\)coreboot.org,https://\1coreboot.org,g'
```

Change-Id: If53f8b66f1ac72fb1a38fa392b26eade9963c369
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/20034
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-07 12:04:50 +02:00
Iru Cai 7f46fff24c superiotool: Add SMSC KBC1126
Device ID is read from HP Elitebook 2760p.

Based on:
- superio/smsc/kbc1100 (LDNs, keyboard, EC)
- DSDT from OEM firmware (COM1 and mailbox)
- Datasheet "KBC1122 Priliminary DS Rev. 0.8"

Change-Id: Id172ae42411a6d42a4ae7c7f30f96aeda3e6c384
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/18480
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2017-06-06 21:13:16 +02:00
Arthur Heymans 54fd92bc34 util/cbfstool/lz4frame.c: Add comment to fall through
GCC7 has a new feature called -Wimplicit-fallthrough enabled by
default which checks for fallthrough in switch statements which is a
common error. When a fallthrough is actually intended a comment saying
so will satisfy GCC.

Fixes cbfstool not building with GCC7.

Change-Id: I83252fc96be7ce0971d4251b0fc88fbbd7440e71
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/20036
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-06-06 19:37:21 +02:00
Nico Huber 3af6985050 util/nvramtool: Bail out on unaligned multi-byte entries
coreboot doesn't support CMOS options that are not byte aligned but
span multiple bytes. So treat them as error.

Change-Id: I2bcff62f153932e9c6646b4ce08e8da1c1532947
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18246
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-06-06 19:31:38 +02:00
Nico Huber af83db2659 inteltool: #include <commonlib/helpers.h>
Change-Id: I66a243486a347313103ffd2cb2ca0447228e4054
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19586
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:46:54 +02:00
Nico Huber c269211149 buildgcc: Fix color output in download_showing_percentage
Probably this was never tested as the return to no color "\033[0m"
was printed verbatim.

Change-Id: I7e6e1049b062ffb138ebdaeb62ddc49581ff8db1
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/19811
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:45:15 +02:00
Nico Huber c272a87f5c inteltool/ahci: Don't print reserved, all-zero registers
Behavior matches with other dumps of inteltool.

Change-Id: Id9755d251fc42185c9e8d574deb55c76e129b718
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19585
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:34:57 +02:00
Nico Huber da94e171b5 inteltool/ahci: Add Skylake support
The SATA device moved from 0:1f.2 to 0:17.0, 0:1f.2 became PMC. We
detect that by checking the PCI device class.

The ABAR MMIO space has grown to 2KiB and up to 8 ports are supported
now. For backwards compatibility, only dump port registers of ports
that are enabled in the Ports Implemented (PI) register.

Change-Id: I8e0f07d7359d92f689882b5afefa5ffb3766ee8b
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19584
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:27:10 +02:00
Nico Huber 0660c6c1ff inteltool: Fix clean-up and close related TODO
We have to call pci_free_dev() for each device we allocated with
pci_get_dev(). Since that's not the case for `sb`, we can close
this TODO.

Change-Id: I1ef80c837263a205467f835156dcb8fa667d3a8f
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19587
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:22:12 +02:00
Nico Huber ed9c9ce268 inteltool: Add first Skylake PCI IDs
Change-Id: Ia5ef6b04f01e381174a4d8f73ddafeb18d488803
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19583
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:19:50 +02:00
Nico Huber ac826c8fd7 inteltool: Don't use PCI_FILL_SIZES
This is supposed to fill the `size[]` array with the actual sizes of
a device' MMIO ranges, but apparently isn't implemented for every
access method in libpci (we let the library choose one). It tells us
by clearing `PCI_FILL_SIZES` in the return value of `pci_fill_info()`
(which we don't check). Since we don't ever use `size`, we can just
make it clear and don't ask for it.

Change-Id: I3fb9334472f1c7563a9e17910190f73affbe067a
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19582
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:19:45 +02:00
Youness Alaoui c4b4ff3b1f console/flashsconsole: Add spi flash console for debugging
If CONSOLE_SPI_FLASH config is enabled, we write the cbmem
messages to the 'CONSOLE' area in FMAP which allows us to grab the
log when we read the flash.

This is useful when you don't have usb debugging, and
UART lines are hard to find. Since a failure to boot would
require a hardware flasher anyways, we can get the log
at the same time.

This feature should only be used when no alternative is
found and only when we can't boot the system, because
excessive writes to the flash is not recommended.

This has been tested on purism/librem13 v2 and librem 15 v3 which
run Intel Skylake hardware. It has not been tested on other archs
or with a driver other than the fast_spi.

Change-Id: I74a297b94f6881d8c27cbe5168f161d8331c3df3
Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm>
Reviewed-on: https://review.coreboot.org/19849
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-06-04 18:44:56 +02:00
Ronald G. Minnich 8db3c2a485 ifdtool: avoid potential unaligned pointer usage
In get_region, ifdtool assigns a not-known-to-be-aligned
pointer to a uint32_t *. Now you know and I know that it is
almost certainly aligned, but clang on OSX doesn't like this,
and it's a dicey thing to do in any event, just waiting
to hit someone hard at some future date.

Assign the pointer to a void * and use memmove to copy
the value to a uint32_t.

This usage is more portable to all little-endian architectures,
now, but is still not endian-safe. I doubt we'll ever care.

Change-Id: Ifb2f260c3363ab0f5b4a59e5a4e0b5ecf049fa96
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: https://review.coreboot.org/19921
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-02 01:58:20 +02:00
Martin Roth 16c49b5ff5 util/abuild: Start junit testcase block on kconfig failure
This should allow Jenkins to parse the build failures when Kconfig
generates an error.

Change-Id: I5f9083c346ac7b6502f854b7e1f1054e81954d76
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/19861
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-05-27 16:54:23 +02:00
Mike Frysinger a8ca03223a cbfscomptool: fix display of time_t
Not all systems have sizeof(time_t) == sizeof(long), so
cast the delta here to a long to match the %ld format.

Change-Id: If235577fc35454ddb15043c5a543f614b6f16a9e
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://review.coreboot.org/19902
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-05-27 01:45:17 +02:00
Patrick Georgi 6b697ef207 util/hugo: no need to enable an interactive terminal
Change-Id: Iac4cdb003b2fe967b303c1f8e0eeb61673a02858
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: https://review.coreboot.org/19930
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: Patrick Georgi <pgeorgi@google.com>
2017-05-26 18:36:47 +02:00
Patrick Georgi dc5eea1cfa util/hugo: mark source mounts read-only
hugo has no need to write there, it should only write to the
output directory.

Change-Id: Ie320f5017feccfa2e9ecba3c802e040487b44d67
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: https://review.coreboot.org/19929
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-05-26 18:36:19 +02:00
Patrick Georgi 04edaefad7 util/hugo: Add framework to build www.coreboot.org/Documentation
www.coreboot.org/Documentation is now built with hugo (www.gohugo.io)
based on files in this repo's /Documentation directory.

Also clarify that new additions to Documentation are under CC-BY 4.0 terms.

Change-Id: I000e15b29a182bb88b40de3d0178bf8cc54ba8af
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: https://review.coreboot.org/19881
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-05-25 23:04:36 +02:00
Patrick Georgi 9ec25f7678 util/lint: ignore some more binary file types
Namely png (images) and eot, ttf, woff (fonts)

Change-Id: I41e773c0adab796876a3b1e91e089ae89cbb04df
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: https://review.coreboot.org/19880
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-05-25 23:04:29 +02:00
Julius Werner d906bb68c3 cbmem_console: Improve 'cbmem -1' behavior for truncated pre-CBMEM logs
The 'cbmem -1' flag that cuts off console output before the last boot
will ignore content from earlier stages if it was truncated due to lack
of pre-CBMEM console space. This patch makes the "log truncated" message
more specific and adds it as an additional cut-off marker to 'cbmem -1'
to counteract that problem.

Also raise the log level of the coreboot banner one step to BIOS_NOTICE
to make it more likely to be included in the output for 'cbmem -1' to
find. (I believe NOTICE is reasonable but I wouldn't want to go as far
as WARN which should be reserved for actual problems. Of course this is
not ideal, but then again, our whole log-level system really isn't... it
would be better if we could make it always print a banner to the CBMEM
console without affecting the UART at the same time, but that would
require a larger amount of work.)

Change-Id: I58288593dfa757e14f4a9da4ffa7e27b0b66feb9
Reported-by: https://ticket.coreboot.org/issues/117
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/19720
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-05-18 19:49:43 +02:00
Martin Roth 7a00a63829 util/release: Update build-release script
- Put parameter comments and help text in the same order as the actual
parameters.
- Don't clone a new release tree from coreboot.org if a tree already
exists.
- Change COMMIT_ID parameter from optional to required.  If it was
omitted previously, the head of the master branch would be used.

Change-Id: Ifa434a4911dec777004788e3cf4e3436875d929b
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/19126
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-05-16 10:54:06 +02:00
Patrick Georgi 6d3ce3a996 xcompile: replace -print-librt-file-name with -print-libgcc-file-name
The former only exists with a custom patch while the latter is supported
by clang and in the absense of libgcc even points to clang's own runtime
libraries.

Change-Id: I1e30d5518cf78e1d66925d6f2ccada60a43bb4f8
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/19658
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-05-16 10:52:37 +02:00
Aaron Durbin 7ad44eed08 util/cbmem: mmap underflow on low addresses
There is code to adjust the mapping down if a mmap fails
at a physical address. However, if the address is less
than the page size of the system then the physical offset will
underflow. This can actually cause a kernel panic on when
operating on /dev/mem.

The failing condition happens when the requested mapping at 0
fails in the kernel. The fallback path is taken and page size
is subtracted from 0 making a very large offset. The PAT code
in the kernel fails with a BUG_ON in reserve_memtype() checking
start >= end. The kernel needs to be fixed as well, but this
fallback path is wrong as well.

BUG=b:38211793

Change-Id: I32b0c15b2f1aa43fc57656d5d2d5f0e4e90e94ef
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/19679
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-05-15 19:45:49 +02:00
Iru Cai 5fd00ce71a util: Add tools for dumping and inserting KBC1126 firmware images.
Change-Id: Ic521b177b9602ff042312cccaaa89371db7c5855
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/19071
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-05-11 16:48:40 +02:00
Paul Menzel 10984d1034 intelmetool: Enable warning *set-but-unused-variable*
There are no GCC warnings anymore about set but unused variables, and
Clang warns about this switch, as it doesn’t know it.

So remove the switch to use the default set by the switch `Wall`.

Change-Id: Ie9eb26d4f8b298af231b952b547b71d68c649eaf
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/19613
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-05-11 16:42:11 +02:00
Paul Menzel 90d41779d1 intelmetool: Comment out unused variable
Only commented out code uses the variable `csr`, and GCC complains about
it, when enabling the warning *unused-but-set-variable*.

```
Checking for pciutils and zlib... me.c: In function ‘mei_dump’:
me.c:50:18: warning: variable ‘csr’ set but not used [-Wunused-but-set-variable]
  struct mei_csr *csr;
                  ^~~
```

As the code is commented, also comment out the declaration of the variable.

Change-Id: I4ecb2b5e9f32906ccfc8a0628d2e0f2d3ad39a02
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/19612
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-05-11 16:41:56 +02:00
Vincent Legoll 0d2ff132e6 intelmetool: Enhance missing packages help
On Ubuntu 16.04 the libpci-dev package is required.

Change-Id: I942b3e96f5b8112166a105eb5a61f8f3cf16cb7c
Signed-off-by: Vincent Legoll <vincent.legoll@gmail.com>
Reviewed-on: https://review.coreboot.org/19617
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-05-11 09:44:44 +02:00
Iru Cai 1f355178d6 superiotool: Add registers of LPC47N217
Change-Id: I460663593dc32f5b52c19c3f19fbc35b8252ed4d
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/19606
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2017-05-08 17:45:40 +02:00
Paul Menzel 57d912bacc intelmetool: Use correct type for pointer
Use `uintptr_t` instead of `uint32_t`, fixing the error below on 64-bit
systems, where pointers are 64-bit wide.

```
cc -O0 -g -Wall -W -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-sign-compare -Wno-unused-function   -c -o intelmetool.o intelmetool.c
intelmetool.c: In function ‘dump_me_memory’:
intelmetool.c:85:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  dump = map_physical_exact((off_t)me_clone, (void *)me_clone, 0x2000000);
                                             ^
```

BUG=https://ticket.coreboot.org/issues/111
Change-Id: Id8d778e97090668ad9308a82b44c6b2b599fd6c3
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/19567
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Paul Wise (Debian) <pabs@debian.org>
2017-05-06 07:54:47 +02:00
Arthur Heymans 915a4cadf4 blobtool/ifd-x200.set: Fix flashmap0 NR
NR indicates the last non empty region, which in this case is
GbE (region3). Needed for flashrom ifd layout support.

Change-Id: I3f4dcb0d41718dd176982679f8e045681fd3f486
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/19565
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-05-05 22:43:46 +02:00
Paul Wise e311f94279 intelmetool: handle failures to mmap MEI memory
Fixes crashes when there is an error mapping memory.

    Error mapping physical memory 0x0000004275159040 [0x4000] ERRNO=1
    Segmentation fault (core dumped)

Change-Id: I5becc0c2870dd97297c4e8d1b101b95b31792ca7
Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Reviewed-on: https://review.coreboot.org/19562
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-05-05 22:40:54 +02:00
Paul Wise 769f46625b intelmetool: free sb pci_dev struct allocated by pci_get_dev()
This fixes a memory leak in the activate_me() function.

Change-Id: I011b2f96122d8f88aed121352afe3f0d41edef60
Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Reviewed-on: https://review.coreboot.org/19561
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-05-05 22:38:20 +02:00
Paul Wise 3c02699dd7 intelmetool: Print strerror() results for mmap errors
These are more human readable for folks not familiar with errno values.

Change-Id: I21352a00b583163472ccd3302a83adf1f8396c61
Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Reviewed-on: https://review.coreboot.org/19560
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-05-05 22:37:28 +02:00
Omar Pakker ecf3489df8 util/autoport: Add the PCI ID of the iGPU for the Intel i7 3770K
This adds one of the Xeon labeled PCI IDs used in Sandy-/Ivy Bridge
generation processors. This ID is used by the non-Xeon i7 3770K.

Change-Id: Iad7745136efeb10ff745001413f4ccb6488b5ec0
Signed-off-by: Omar Pakker <omarpakker+coreboot@gmail.com>
Reviewed-on: https://review.coreboot.org/19516
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-05-03 20:14:05 +02:00
Julius Werner b7b64a9f68 cbmem: Add new command line flag to dump console for one boot only
Even though the persistent CBMEM console is obviously awesome, there may
be cases where we only want to look at console output from the last boot.
It's easy to tell where one boot ends and another begins from the banner
message that coreboot prints at the start of every stage, but in order
to make it easier to find that point (especially for external tools),
let's put that functionality straight into the cbmem utility with a new
command line flag. Use the POSIX/libc regular expression API to find the
banner string for maximum compatilibity, even though it's kinda icky.

Change-Id: Ic17383507a884d84de9a2a880380cb15b25708a1
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/19497
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
2017-05-02 21:29:42 +02:00
Patrick Rudolph 0a4a4f7ae4 mb/*/mainboard.c: Get rid of SPI AFC register
The AFC—Additional Flash Control Register is set by
southbridge code.

Remove redundant calls and get rid of it in autoport.

Change-Id: I627082e09dd055e3b3c4dd8e0b90965a9fcb4342
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/19493
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-05-01 14:02:19 +02:00
Youness Alaoui 1244a510f1 util/inteltool: Add support for Wildcat Point-LP Premium
The Wildcat Point-LP Premium is handled the same as the Wildcat Point-LP,
but it wasn't supported by inteltool.

Change-Id: I694514e1963f074582a3f5f81d63c20e7fa49189
Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm>
Reviewed-on: https://review.coreboot.org/19445
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-05-01 00:43:52 +02:00
Youness Alaoui 085d87bcca util/inteltool: Break long lines in supported_chips_list
Lint prevents my next commit which adds a new line to the table
so it's better to break all the > 80 character lines so it will be
consistent with the new line I'm about to add.

Change-Id: Ic7ad0cb90e861cd830db1186225d4f839250792a
Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm>
Reviewed-on: https://review.coreboot.org/19444
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-05-01 00:43:38 +02:00
Patrick Georgi 97a9df4f77 crossgcc: disable libsanitizer for the bootstrapped compiler
Ironically enough, libsanitizer is notorious for creating "uninitialized
variable" warnings with different compiler versions than the one it's
shipping with.

Since we don't need it for building the real compiler, just skip it.

Fixes building our compilers using the gnat-gpl 2014 compilers.

Change-Id: I2130dfdf3eaf07d77cd70777419fc0ae4642b843
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/19478
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-04-28 06:47:37 +02:00
Marc Jones d81250cebc amdfwtool: Move normal firmware 2 after fanless firmware2s
Move the images around in the image stitching. This addresses
an issue found with PSP firmware loading on the Google Kahlee
mainboard.

Note firmware1 must come before firmware2 in the image or
the PSP will not allow APU to execute.

Change-Id: I85963fa93d6efd707cedfbc04b92d302ad5de3b1
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/19170
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-04-27 23:27:06 +02:00
Patrick Georgi 790aab6c77 crossgcc: fix DESTDIR builds
We need to rewrite libtool's files (foo.la) a couple of times so it
knows where to look
(while still whining that $DESTDIR$TARGET != $TARGET. well, duh.)

Change-Id: I54cafd47c76d855222ba905b5eb4533a23bdfd34
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/19463
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-04-27 18:11:25 +02:00
Arthur Heymans 878c2de41b util/ectool: Dump ram by default
According to the comment above the default should dump the EC ram,
though is never reached since the variable 'write_addr' is not 0, but
initialized at -1.

Also removes brackets around one line statement below if to make
checkpatch.pl happy.

Change-Id: I390996b253f2f20682cd9ab2d4f560de6eccfc57
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/19152
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2017-04-25 18:46:04 +02:00
Arthur Heymans 2873a4aea4 util/ectool: Fix timeout on sending EC command
When setting output to verbose, it incorrectly reports that it times
out on every command.

TESTED on Thinkpad X60.

Change-Id: I24f05f0c165462d5ba2604c7e2fe139400683275
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/19151
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2017-04-25 18:44:46 +02:00
Aaron Durbin e4d7abc0d4 lib: provide clearer devicetree semantics
The devicetree data structures have been available in more than just
ramstage and romstage. In order to provide clearer and consistent
semantics two new macros are provided:

1. DEVTREE_EARLY which is true when !ENV_RAMSTAGE
2. DEVTREE_CONST as a replacment for ROMSTAGE_CONST

The ROMSTAGE_CONST attribute is used in the source code to mark
the devicetree data structures as const in early stages even though
it's not just romstage. Therefore, rename the attribute to
DEVTREE_CONST as that's the actual usage. The only place where the
usage was not devicetree related is console_loglevel, but the same
name was used for consistency. Any stage that is not ramstage has
the const C attribute applied when DEVTREE_CONST is used.

Change-Id: Ibd51c2628dc8f68e0896974f7e4e7c8588d333ed
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/19333
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2017-04-25 18:14:38 +02:00
Martin Roth 64a3210eba util/nvidia/cbootimage: Update to upstream master
This brings in 2 new commits from the upstream cbootimage
repository, merged to the upstream tree April 12, 2016 and
July 28, 2016

64045f9 bct_dump: don't crash on devices without RSA support
ea1e03d sign.sh: Add more features

Change-Id: I3b6c0c2c855044d7fce87eff9954bce5035ca966
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18955
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-24 19:19:39 +02:00
Martin Roth 2a063beb71 util/lint: Don't run checkpatch on the documentation
Change-Id: Ib95a7c9c64c481af7dcf1074ffc0fc76dc6b6ff9
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/19144
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-24 19:18:06 +02:00
Pratik Prajapati 0bb611d125 mma: update mma setup script for v2.1018
MMA blobs internal version 2.1018 adds more tests.
This patch updates the script to accommodate that
change. MMA blobs are part of chrome private
repository.

Change-Id: Iff660fdfdfcd7acc3820c5550740276be6213877
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/19259
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-04-24 19:11:34 +02:00
Martin Roth 6338189d0e util/blobtool: Update blobtool.y
- Refactor the spec & setter file reads into a separate function.
- Make sure files can actually be opened before reading from them.
- Check all malloced variables.
- Set functions with no declatations as static.
- Update blobtool.tab.c_shipped to the latest version.

Change-Id: Ie97fff84493a06f48d8673d388c3882028d048ca
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/19231
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-24 19:01:15 +02:00
Martin Roth 6d189cc47b util/blobtool: clean up blobtool.l a bit
- Rewrite STRING and COMMENT expressions to remove need for CHARS.
- Clean up regular expressions - get rid of unnecessary expressions.
- Remove extra newline from the end of the file.

- Clean up stripquotes() function
-- Remove unnecessary backslashes in '\"'
-- Check malloc for failure
-- Remove unnecessary assignment of 0 to the end of the new string,
snprintf will take care of it.

- Update blobtool.lex.c_shipped to the new version.

Change-Id: I002962cfae0816ed3c7a5811dfb1b8b48fdc5729
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/19230
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-24 19:00:45 +02:00
Julius Werner d67c6876b5 Turn CBMEM console into a ring buffer that can persist across reboots
This patch allows the CBMEM console to persist across reboots, which
should greatly help post factum debugging of issues involving multiple
reboots. In order to prevent the console from filling up, it will
instead operate as a ring buffer that continues to evict the oldest
lines once full. (This means that if even a single boot doesn't fit into
the buffer, we will now drop the oldest lines whereas previous code
would've dropped the newest lines instead.)

The console control structure is modified in a sorta
backwards-compatible way, so that new readers can continue to work with
old console buffers and vice versa. When an old reader reads a new
buffer that has already once overflowed (i.e. is operating in true ring
buffer mode) it will print lines out of order, but it will at least
still print out the whole console content and not do any illegal memory
accesses (assuming it correctly implemented cursor overflow as it was
already possible before this patch).

BUG=chromium:651966
TEST=Rebooted and confirmed output repeatedly on a Kevin and a Falco.
Also confirmed correct behavior across suspend/resume for the latter.

Change-Id: Ifcbf59d58e1ad20995b98d111c4647281fbb45ff
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/18301
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-04-20 00:29:07 +02:00
Arthur Heymans 026f7df763 util/inteltool: Add ICH10 (Consumer Base) support
Reuses ICH10R functions.

TESTED on Intel DG43GT (Not supported by coreboot)

Change-Id: If9ae8ba8b95e3a7bf6596ae639eb8cafab583298
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/19232
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-04-15 20:06:08 +02:00
Martin Roth f411b701c5 util/blobtool & sconfig: Update GENPARSER Kconfig question
blobtool uses the same sort of update mechanism for the .l & .y files,
so update the SCONFIG_GENPARSER Kconfig question to encompass both
utilities.

- Change the name to UTIL_GENPARSER, and update the help text.
- Update sconfig's makefile.
- Add the check to blobtool's makefile.
- Update the makefiles to check for y, not defined.

Change-Id: I6215791c9a019bce37d4a150b65d1fdbb9073156
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/19229
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-14 17:26:48 +02:00
Martin Roth cfce793052 util/blobtool: Hook into coreboot build
Add a Makefile.inc, based on sconfig's, to use the _shipped variants
so that the build doesn't have to generate them with flex & bison.

The GENPARSER check is inactive, and will be updated in the next
commit.

Add the c_shipped & h_shipped files for the current .l & .y files.

Change-Id: Ia6c68bfb6e0611ceb6bc76cc66e43266bafc98ad
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/19228
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-14 17:26:30 +02:00
Julius Werner 127a79e0b6 cbmem: Add custom aligned memcpy() implementation
On some architectures (like AArch64), /dev/mem mappings outside of the
area marked as normal RAM use a memory type that does not support
unaligned accesses. The libc memcpy() implementation on these
architectures may not know or expect that and make an unaligned access
for certain source/dest/length alignments. Add a custom memcpy()
implementation that takes these restrictions into account and use it
anywhere we copy straight out of /dev/mem memory.

Change-Id: I03eece380a14a69d4be3805ed72fba640f6f7d9c
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/18300
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-04-14 16:33:27 +02:00
Youness Alaoui b85ddc787e util/intelmetool: Check for NULL return from pci_lookup_name
pci_lookup_name might return NULL from using format_name internally
which could cause a crash when trying to print that value. We
check for NULL and print a more appropriate value in that case.

Change-Id: I499f0b5e1681f3926df0d8a325aab2c666ebd632
Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm>
Reviewed-on: https://review.coreboot.org/19089
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-04-04 20:48:34 +02:00
Martin Roth 333142636f abuild: add timeless build command line parameter
Update ABUILD_VERSION for the timeless & checksum parameters.

Change-Id: I96b4c027ccf3e5563dbf4598a0d1fb5e83a5985a
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/19034
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-04 17:47:21 +02:00
Martin Roth c7e6ad7be2 util/abuild: Save checksums of build files
- Add --checksum command line parameter to specify a base path and
filename for the checksums to be saved into.
- Save checksums of each platform into the specified file appended
with "_platform"
- Save a sha256 checksum of the sorted config.h into the base file
appended with "_config"

Change-Id: Id24dc4b10afbd35cdb8750f75b934419e6e80290
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/19033
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-04-04 17:46:47 +02:00
Martin Roth 85782b2152 util/docker: Update makefile for servers and local use
- Add some variables to allow server customizations.
- Verify that coreboot images and containers exist before trying to
remove them.
- Add a couple of convenience targets: clean & cleanall to remove
coreboot containers and images or ALL containers and images.
- Add docker-what-jenkins-does target to run a test build locally inside
a docker image.
- Add docker-jenkins-server target to test the server configuration and
run the jenkins docker image.
- Add docker-jenkins-shell and docker-shell targets to run the
coreboot-sdk and coreboot-jenkins-server images.
- Update the help.

Change-Id: I1896f33e7eddfe3248f44ae780de65ce50d5dd99
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/18004
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-04-04 01:49:59 +02:00
Youness Alaoui e0c53af470 util/intelmetool: Fix access to deleted data on stack
pci_me_interface_scan was returning (via argument 'name') a pointer
to the interface name which was stored in a stack variable.  This
caused part of the name to be printed as garbage stack data in some
situations if stack data was overwritten.

This moves the name buffer to the calling function so it can be accessed
before it gets overwritten.

Change-Id: I947a4c794ee37fe87e035593eaabcaf963b9875e
Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm>
Reviewed-on: https://review.coreboot.org/19066
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-04-04 00:22:29 +02:00
Paul Menzel deb9b03af9 cbfstool/ifwitool: Remove unnecessary assignment
Fix the warning below.

```
util/cbfstool/ifwitool.c:551:2: warning: Value stored to 'offset' is never read
        offset = read_member(data, offset, sizeof(h->fit_tool_version),
        ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Found-by: scan-build from clang 3.8.1
Change-Id: I6c322a335a371a20561b32e04e7dcc7310dab607
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/18667
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-03-29 15:43:38 +02:00
Martin Roth b4f2b15f05 util/futility/Makefile: Update clean target
- Fix clean target to pass if output doesn't exist
- Make sure $(RM) is actually defined

Change-Id: Ibcdb0e329084f58b27c3f53213a237d02c922a51
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/18998
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Kocialkowski <contact@paulk.fr>
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-03-29 05:16:49 +02:00
Marshall Dawson f4b9b41c47 util/amdfwtool: Add fanless SMU firmware options
The Stoney Ridge program has OPNs that are considered fanless.  These
APUs are strapped to search for unique SMU firmware, indicated by
Type[8]=1 in the directory table entry.

Add new options to amdfwtool and include the blobs in the build with
the appropriate bit set in the Type encoding.

Original-Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Original-Reviewed-by: Marc Jones <marcj303@gmail.com>
(cherry picked from commit 8df0d6847c39bb021271983018ac6f448f9ff9da)

Change-Id: I4b80ccf8fd9644f9a9d300e6c67aed9834a2c7a7
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/18991
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-03-28 22:26:19 +02:00
Julius Werner 893eda0cc5 abuild: Treat command line for recursive invocations as bash array
This fix changes the $cmdline variable that is used for recursive
parallel abuild invocations through xargs from a string to a true bash
array (like $@). This allows bash to properly preserve and pass on
whitespace in parameters, like you get from invocations such as:

 util/abuild/abuild -c 32 -t "MY_FIRST_BOARD MY_SECOND_BOARD"

Also add a mechanism to better spread CPUs across targets, since
otherwise we can leave a lot of CPUs idle if we're trying to build only
a few boards in parallel.

Change-Id: I76a1c6456ef8ab21286fdc1636d659a3b76bc5d7
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/18975
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-03-28 22:10:15 +02:00
Martin Roth aa206478cb util/lint: Show an error if a symbol is created in two choice blocks
Kconfig shows a warning about this, but we want to catch it earlier
and halt the build.

Change-Id: I0acce1d40a6ca2b212c638bdb1ec65de5bd4d726
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18970
Tested-by: build bot (Jenkins)
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-03-27 05:53:57 +02:00
Martin Roth f0eda827b8 util/docker: Update coreboot-sdk dockerfile
- Update the dockerfile which generates the base docker image for the
coreboot builders to include gnat.  This matches the changes made in
the crossgcc/Dockerfile in commit 6b28fff0b (crossgcc/Dockerfile: Add
gnat to build the Ada toolchain).

- Remove the -b from the toolchain build command line.  This doesn't
seem to be needed.

Change-Id: I26d4dca5805f57cab50065cf1c25164b909a0b3d
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18961
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-03-24 23:20:35 +01:00
Nico Huber 6b28fff0be crossgcc/Dockerfile: Add gnat to build the Ada toolchain
If gnat is installed, buildgcc automatically enables Ada support.
Instead of the general `gnat` package we install `gnat-6` which saves
us about 80 MiB of downloads of unused "dependencies".

Change-Id: Ie0b8564d016d458cd33ff75a2ee7bbd5de33afe2
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18772
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-03-23 18:55:18 +01:00
Nico Huber d5829e9bdb buildgcc: Relax GNAT version checks
Compiling the GNAT frontend of GCC seems to have stabilized since GCC
4.9.0. So build it by default if GNAT >= 4.9 is installed.

TEST=Bootstrapped all GCC versions from 4.9.0 to 6.2 and built the
     i386 cross toolchain with each.

Change-Id: I9d1127595dc6b9bcece9c5e5cc7e45f467744ab9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18777
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-23 18:41:21 +01:00
Nico Huber cdf79e6a8d buildgcc: Fix check for a .success file
We were looking for the wrong file for some time. With bootstrapping
enabled, this resulted in a spurious message about the host GCC being
already built.

Change-Id: Ieb52c5925ea5615c83311319f22693b72f4987f9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18776
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-23 18:41:09 +01:00
Patrick Georgi dce629b2f8 util/cbfstool: avoid memleaks and off-by-ones
Change-Id: Iac136a5dfe76f21aa7c0d5ee4e974e50b955403b
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: scan-build 3.8
Reviewed-on: https://review.coreboot.org/18134
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-03-20 20:05:09 +01:00
Arthur Heymans 98e77c77fd util/autoport: Create superiotool logs
Change-Id: I29797ac6078c0488cb75a8e510bfd5ddf49e4b8b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/18483
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
2017-03-14 23:03:29 +01:00
Nico Huber 0ff3b392a9 buildgcc: Search for `xz` too
Change-Id: I05d5f26f7cf9ab41b14aaecfe421b88ef9a2394a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18775
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-03-14 16:59:45 +01:00
Arthur Heymans 1b69d73530 board_status/towiki.sh: Fix Socket for Sandy and Ivy Bridge
Change-Id: I4c94209c424f56516033c07c4365401a6b217a37
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/18478
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-03-14 02:32:36 +01:00
Nicola Corna 4fbd1aab33 util/superiotool: Add support for Fintek F71808A
Default values taken from the datasheet and from the dump of
an uninitialized F71808A on a Sapphire Pure Platinum H61.

Both the control registers and the HWM configuration registers
are added.

Change-Id: Ia6e2a7c13a5086d19ebdb426f2f975b43220a273
Signed-off-by: Nicola Corna <nicola@corna.info>
Reviewed-on: https://review.coreboot.org/18562
Tested-by: build bot (Jenkins)
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2017-03-13 17:10:02 +01:00
Hannah Williams 589fc3473e ifdtool: Add SPI_FREQUENCY_50MHZ_30MHZ as a valid freq
Without this change, error "Unknown descriptor version: 4" will be
returned if this frequency is selected (seen on GLKRVP)

Change-Id: Ib5bfb996b85c7245d8f9c70988bfd5bbac882d74
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/18688
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2017-03-10 11:20:39 +01:00
Idwer Vollering 171d1a5979 toolchain: fix compilation of GMP on FreeBSD
Built on FreeBSD -CURRENT
Obtained from FreeBSD: bbedec80e3

Change-Id: Ic6b6db8e3a9d86a30c50a09d58566846446031ea
Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-on: https://review.coreboot.org/18675
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-03-09 12:15:56 +01:00
Martin Roth 010905ed2f uti/lint/checkpatch: Fix __attribute__ struct errors for OPEN_BRACE
The __attribute__((weak)) lines on structs were being read as functions,
causing a warning that the brace should be on the next line.
Add a check to see if it's a struct with an attribute, and ignore it for
the OPEN_BRACE check if it is.

Change-Id: Ieb0c96027e8df842f60ca7c9de7aac941eed1dc2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18570
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>
2017-03-09 04:37:43 +01:00
Martin Roth a3cac87ea8 uti/lint/checkpatch: add --exclude to ignore specific directories
checkpatch: add option for excluding directories
when importing code from external sources

Using --exclude <dir> we should be able to exclude a list of well
defined locations in the tree that carry sources from other projects
with other styles.

This comes from the 01org/zephyr project in github:
Original-Change-Id: I7d321e85eed6bc37d5c6879ae88e21d20028a433
Original-Signed-off-by: Anas Nashif <anas.nashif@intel.com>

Change-Id: Icc9e841e7d84026d6ab857ff90b0f093515ccaad
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18568
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-03-09 04:37:11 +01:00
Huan Truong 8c247a2a79 util/intelmetool: Add support for Wildcat Point LP
This adds support for the Wildcat Point LP for intelmetool.

When the tool detected a Wildcat Point LP,
then the ME will be reported as  difficult-to-remove.

Change-Id: I35423db11cdc1e21e7f02ce90dace7fb4d236c45
Signed-off-by: Huan Truong <htruong@tnhh.net>
Reviewed-on: https://review.coreboot.org/18575
Tested-by: build bot (Jenkins)
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-03-08 04:36:04 +01:00
Huan Truong 2a1ae05316 util/intelmetool: Fix segfault on edge cases
The intel ME checker tool would segfault if it reaches the end of
the loop without having the dev pointer set. This happens when
it gets to the end of the previous loop without knowing what to do
with any of the devices it sees.

This patch makes sure the pointer is not NULL before accessing it.

Change-Id: Ia13191799d7e00185947f9df5188cb2666c43e2a
Signed-off-by: Huan Truong <htruong@tnhh.net>
Reviewed-on: https://review.coreboot.org/18573
Tested-by: build bot (Jenkins)
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-03-08 04:34:34 +01:00
Martin Roth 93757f8543 util/scripts/get_maintainer.pl: Remove linux tree check
This was removed from the previous version, but we'd like it in
a separate patch, so it's obvious and can easily be applied to the
next version.

Change-Id: I9396009e82e762aa0cc037dbe9e7133962af6354
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18577
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-07 15:03:45 +01:00
Martin Roth ae34e97ad7 util/scripts: Update get_maintainer.pl to latest from linux kernel
This is version 03aed21 from linux/scripts, updated on Dec 12, 2016.

The version needs to be updated because Perl version 5.20 deprecated the
/C regex expression.  Perl version 5.24 removed it completely, so the
old version fails to run on the coreboot builders.

Change-Id: Ib97997237ca64c65d7f91d568ae4bec000804331
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18571
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-03-07 15:03:29 +01:00
Martin Roth 561f368a2f util/docker: Update dockerfiles & build method
All files:
- Previously, various things were hardcoded into the docker containers
that made it necessary to update the Dockerfile files for each new
version of the sdk.  Turn those into 'Variables" that are updated during
the build step.  Because the makefile is piping the dockerfile through
the sed command and back into the docker build command, the normal
docker "COPY" keyword doesn't work.

coreboot-jenkins-node changes:
- Run ssh-keygen -A to explicitly generate the ssh keys.  This fixes an
error:  Could not load host key: /etc/ssh/ssh_host_dsa_key

coreboot-sdk changes:
- Remove apt-get upgrade command - The Dockerfile guide recommends
not to run this.
- Change libssl-dev to libssl1.0-dev. libssl-dev's header files won't
build the Chrome-EC codebase.
- Add libisl-dev, needed to build the riscv toolchain.
- Build the toolchain using the -b option
- Add environment variables containing the version and commit that the
coreboot-sdk was built from.

Makefile:
- Update targets to use the version and commit variables

Change-Id: I2c1376fe4b791da2a62fca11bc92c4774cbef1c8
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/18001
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-03-06 00:30:35 +01:00
Iru Cai 03353de80b buildgcc: Update GCC, Binutils, GMP, MPFR, GDB, IASL and LLVM
- GCC gets updated from 5.2.0 to 6.3.0:
gcc-6.3.0_riscv.patch is a diff between 5fcb8c4 and 173684b in
riscv-gcc, and it needs gcc-6.3.0_memmodel.patch.

- Binutils goes from 2.26.1 to 2.28:
There is a build error for MIPS gold so I add patch for it.

- GMP gets a bump from 6.1.0 to 6.1.2
- MPFR is updated from 3.1.4 to 3.1.5
- GDB is upgraded from 6.1.1 to 6.1.2
- IASL is changed from 20160831 to 20161222
- LLVM is changed from 3.8.0 to 3.9.1

Change-Id: I20fea838d798c430d8c4d2cc6b07614d967c60c5
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17189
Tested-by: build bot (Jenkins)
2017-03-05 18:35:18 +01:00
Nicola Corna e38f85915f util/me_cleaner: Pull the latest changes from upstream
Relevant changes (commit 250b2ec):
 * Fix a bug for ME6 Ignition images.
 * Fix signature checking for ME11 and later.
 * Add command line arguments.
 * Add an option to relocate the FTPR partition to the top of the
    ME region, recovering most of the ME region space.
 * Print the image minimum size.
 * Add write boundary checks, to prevent writes on other regions
    in case of bugs.

The new changes have been tested on multiple platforms by the
me_cleaner users. They have been tested also on the author's
X220T with coreboot, where the ME region has been shrinked up to
84 kB without any issue.

Change-Id: I3bd6b4cba9f5eebc3cd4892dd9f188744a06c42b
Signed-off-by: Nicola Corna <nicola@corna.info>
Reviewed-on: https://review.coreboot.org/18473
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2017-03-02 22:04:08 +01:00
Iru Cai bc5112029b autoport: add "-d" option to ectool to dump registers
Change-Id: I7de37a026a0899c2d07ea17c9377c8d2283450ab
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/18481
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-03-02 21:59:27 +01:00
Denis 'GNUtoo' Carikli efd9dee646 board-status: Add README
It explains the prerequisites to run the script, some
background on how to setup the computer running the script,
and the board it gathers the information from.

That information is too long to fit inside the script's
help.

Change-Id: Iecba7310ff1583149c02728e955716775bcbbdc4
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: https://review.coreboot.org/6660
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-02-20 04:43:39 +01:00
Denis 'GNUtoo' Carikli 418e808fa6 boardstatus: wiki: Update XiVO's coreboot fork source address
This company doesn't do custom hardware anymore and doesn't
host the sources anymore. We therefore point to the archived
sources instead.

Change-Id: I5ce4f6a468b852fc1d0947fe2b28a5297f14c437
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: https://review.coreboot.org/11889
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Tested-by: build bot (Jenkins)
2017-02-18 23:40:51 +01:00
Furquan Shaikh e67002968b sconfig: Add a new "SPI" device type
Update sconfig lex and yacc files to add support for a new "SPI" device
type in the devicetree. SPI device takes only parameter i.e. chip select
number for the device on the SPI bus.

Re-generate the shipped files for sconfig using flex 2.6.0 and bison
3.0.4 (make CONFIG_SCONFIG_GENPARSER=1). Clean up local paths that leak
into generated files.

BUG=chrome-os-partner:59832
BRANCH=None
TEST=Compiles successfully.

Change-Id: If0831e25b3e4ed87827ad92356d7bf47b6387884
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/18339
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2017-02-16 08:41:15 +01:00
Martin Roth 03e9d6aa13 util/lint: Don't check license text for files with under 5 lines
Change-Id: I7c1e3cf558d447838819b4d6a63d93d48d5f13e0
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18316
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2017-02-14 18:37:40 +01:00
Patrick Georgi ded1e05d11 util/romcc: Don't reference a variable after checking it for NULL
Change-Id: Ic8e850bdf75d38fc061fb3a8c55d38bcf09c305a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1129146
Reviewed-on: https://review.coreboot.org/17886
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-02-10 18:01:52 +01:00
Damien Zammit 0685322f4a util/blobtool: Add new tool for compiling/decompiling data blobs
Given a specification of bitfields defined e.g. as follows:

	specfile:
		{
			"field1" : 8,
			"field2" : 4,
			"field3" : 4
		}
and a set of values for setting defaults:
	setterfile:
		{
			"field1" = 0xff,
			"field2" = 0xf,
			"field3" = 0xf
		}

You can generate a binary packed blob as follows:
	./blobtool specfile setterfile binaryoutput
	binaryoutput:	ff ff

The reverse is also possible, i.e. you can regenerate the setter:
	./blobtool -d specfile binaryoutput setterorig
	setterorig:
		# AUTOGENERATED SETTER BY BLOBTOOL
		{
			"field1" = 0xff,
			"field2" = 0xf,
			"field3" = 0xf
		}

This tool comes with spec/set files for X200 flash descriptor
and ICH9M GbE region, and can be extended or used to decompile
other data blobs with known specs.

Change-Id: I744d6b421003feb4fc460133603af7e6bd80b1d6
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/17445
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-02-04 23:18:35 +01:00
Patrick Rudolph 8a06cc7ec8 util/ifdtool: Fix ICH Gbe unlock
With coreboot 4.4 switched to "Descriptor mode" for Lenovo T500
it automatically unlocks all flash regions. For Gbe region
the "Requester ID" was hardcoded resulting in *dead* Gbe.

Keep board specific "Requester ID" while unlocking Gbe region.

Allows Lenovo T500 to boot with IFD "Descriptor mode" with unlocked
flash regions.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>

Change-Id: Ia4b5d1928e84bee42182fc83020e3a13fadc93c4
Reviewed-on: https://review.coreboot.org/18055
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2017-02-04 17:36:21 +01:00
Steven Dee 3236f7be09 ectool: Support OpenBSD
Adds checks for OpenBSD in all the places that were already checking for
NetBSD. This fixes e.g.:

    ec.c:21:20: error: sys/io.h: No such file or directory

which was caused by defaulting to Linux.

Also, OpenBSD calls its amd64 iopl amd64_iopl instead of x86_64_iopl.
This change just defines iopl appropriately depending on the
OS and architecture.

TEST=Build on OpenBSD 6.0 or -current from 2017-01-25.

Change-Id: If6d92a9850c15cd9f8e287cc4f963d3ff881f72c
Signed-off-by: Steven Dee <i@wholezero.org>
Reviewed-on: https://review.coreboot.org/18260
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-02-02 15:29:10 +01:00
Patrick Georgi be182ad380 util/xcompile: parallelize compiler checks
Speed up the execution of this script from ~6 seconds to ~1 on my
system.

There are some changes to its output, but they're actually _more_
correct: so far, architectures without compiler support kept compiler
options for architectures that ran successfully earlier.

Change-Id: I0532ea2178fbedb114a75cfd5ba39301e534e742
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/18262
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-31 18:51:47 +01:00
Iru Cai 8bf53a9f4e autoport: add missing parameter for pc_keyboard_init()
This fixes the build for the generated code for boards with PS/2
keyboard, since commit 448e386309 updated the pc_keyboard_init()
function.

Change-Id: I776b49b847985296eaca4af6d6e49ab5d6abbafe
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/18242
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-29 00:36:24 +01:00
Arthur Heymans 017b56558f board_status/towiki.sh: Add socket LGA775
Intel Core 2 is not further specified since not all chipsets support
quad cores, which could confuse users.

Change-Id: I86c0a41743fe784f432347fa639d3c26604e058e
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/18235
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-01-27 19:42:36 +01:00
Martin Roth 9ee70ce587 util/docker: Update makefile target names
- Use dashes instead of underscores for consistency and to match other
coreboot targets
- Fix a couple of places where old target names were referenced
- Remove double 'help' target from .PHONEY target list

Change-Id: I3b464ebf74653a8cc880e982316fd883757ec728
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/18000
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-01-27 19:41:05 +01:00
Martin Roth af25fd78e8 util/docker: Update makefile with command to kill docker images
Kill running docker containers before trying to remove images or
containers.

Change-Id: Id2de90edbe5d0dc6ecb906be7101ad9744dbd11e
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/17999
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-01-27 19:40:41 +01:00
Martin Roth 27f3ce6337 board_status/to-wiki: Update bucketize script
- Fix TODO: restrict $1 to allowed values.
- Specifically exclude 'oem' board status directories.
- Exclude any directory that doesn't follow the date format to keep
the script from breaking again in the future if something it doesn't
recognize is pushed.  Just ignore it for the wiki.
- Fix shellcheck warnings.

Change-Id: I2864f09f5f1b1f5ec626d06e4849830400ef5814
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/18225
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineering.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-01-27 04:37:33 +01:00
Nicola Corna 9bcc002f1e util: Add me_cleaner
me_cleaner is a tool to strip down Intel ME/TXE images by removing all
the non-fundamental code, while keeping the ME/TXE image valid and
suitable for booting the system. The remaining code (ROMP and BUP
modules) is the one responsible for the very basic initialization of
the ME/TXE subsystem and can't be removed.

This tool exploits the fact that:
 * Each ME/TXE partition is signed individually and it is possible to
    remove both the partition and the signature.
 * The ME/TXE modules are not signed directly, instead they are hashed
    and the list of their hashes is hashed again and signed: this
    means that modifying a module doesn't invalidate the signature,
    but only the hash of that single module.
 * The modules hashes are checked only when the corresponding module
    needs to be executed.
 * The system can boot after the execution of the first module (BUP,
    inside the FTPR partition), even if the subsequent stages fail.

Currently me_cleaner works on every Intel platform with Intel ME or
Intel TXE with the following limitations:
 * Doesn't work when Intel Boot Guard is set in Verified Boot mode.
 * Doesn't fully work on Nehalem yet.
 * On Skylake and later generations, since the partitions' internal
    structure has changed, me_cleaner leaves intact the FTPR
    partition, removing all the the other partitions.

This tool has been tested on multiple platforms and architectures by
different users, and seems to be stable. The reports are available
here:
https://github.com/corna/me_cleaner/issues/3

A more in-depth description of me_cleaner is available here:
https://github.com/corna/me_cleaner/wiki/How-does-it-work%3F

Change-Id: I9013799e9adea0dea0775b9afe718de5fc4ca748
Signed-off-by: Nicola Corna <nicola@corna.info>
Reviewed-on: https://review.coreboot.org/18203
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-01-25 18:19:58 +01:00
Patrick Georgi b46c4ecaba cbfs-compression-tool: catch compression failures
If compression failed, just store the uncompressed data, which is what
cbfstool does as well.

Change-Id: I67f51982b332d6ec1bea7c9ba179024fc5344743
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18201
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-24 09:35:49 +01:00
Dan Elkouby e8ad3c7b95 util/intelmetool: Try to activate the ME before scanning PCIe for it
When the ME is hidden (most likely because it was disabled), it cannot
be found until activate_me() is called.

Change-Id: Ie1f65f61eb131577d7254af582e2709660f4da27
Signed-off-by: Dan Elkouby <streetwalrus@codewalr.us>
Reviewed-on: https://review.coreboot.org/18149
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-20 17:22:54 +01:00
Nico Huber 607796a4ff cbfstool: Don't use le32toh(), it's non-standard
It's a BSD function, also, we missed to include `endian.h`.

Just including `endian.h` doesn't fix the problem for everyone.
Instead of digging deeper, just use our own endian-conversion from
`commonlib`.

Change-Id: Ia781b2258cafb0bcbe8408752a133cd28a888786
Reported-by: Werner Zeh <werner.zeh@siemens.com>
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18157
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2017-01-18 17:43:20 +01:00
Patrick Georgi 6f27edd377 util/scripts: extend cross-repo-cherrypick
The script now automatically discovers the original branch (if known)
and configures itself appropriately.
Additionally, commit messages for changes coming _from_ upstream will
be prefixed with "UPSTREAM: ".
With the optional --cros argument, it also adds a BUG/BRANCH/TEST block
at the right place in the commit message (right above the metadata) if
one doesn't already exist.

Change-Id: I81864ddca62fd99a9eb905d7075e5b53f58c4eb5
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18135
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-17 18:01:10 +01:00
Patrick Georgi ecaa570b60 util/cbfstool: Enable adding precompressed files to cbfs
cbfstool ... add ... -c precompression assumes the input file to be
created by cbfs-compression-tool's compress command and uses that to add
the file with correct metadata.

When adding the locale_*.bin files to Chrome OS images, this provides a
nice speedup (since we can parallelize the precompression and avoid
compressing everything twice) while creating a bit-identical file.

Change-Id: Iadd106672c505909528b55e2cd43c914b95b6c6d
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18102
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-13 13:50:46 +01:00
Patrick Georgi c88d16baaf util/cbfstool: Add cbfs-compression-tool
cbfs-compression-tool provides a way to benchmark the compression
algorithms as used by cbfstool (and coreboot) and allows to
pre-compress data for later consumption by cbfstool (once it supports
the format).

For an impression, the benchmark's results on my machine:

measuring 'none'
compressing 10485760 bytes to 10485760 took 0 seconds
measuring 'LZMA'
compressing 10485760 bytes to 1736 took 2 seconds
measuring 'LZ4'
compressing 10485760 bytes to 41880 took 0 seconds

And a possible use for external compression, parallel and non-parallel
(60MB in 53 files compressed to 650KB on a machine with 40 threads):

$ time (ls -1 *.* |xargs -n 1 -P $(nproc) -I '{}' cbfs-compression-tool compress '{}' out/'{}' LZMA)

real	0m0.786s
user	0m11.440s
sys	0m0.044s

$ time (ls -1 *.* |xargs -n 1 -P 1 -I '{}' cbfs-compression-tool compress '{}' out/'{}' LZMA)

real	0m10.444s
user	0m10.280s
sys	0m0.064s

Change-Id: I40be087e85d09a895b1ed277270350ab65a4d6d4
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18099
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-12 21:40:25 +01:00
Patrick Georgi 8474e7d7e8 util/cbfstool: compile with -O2 by default
This speeds up the lzma encoder approximately four-fold.

Change-Id: Ibf896098799693ddd0f8a6c74bda2e518ecea869
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18098
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-01-12 21:40:00 +01:00
Patrick Georgi df1ff231e4 buildgcc: try curl if wget is not present
There are systems that come with curl but not wget (eg macOS) and they
now have to install one less additional dependency.

Also fix some cosmetic issues in console output and require valid
certificates on https downloads.

Change-Id: Idc2ce892fbb6629aebfe1ae2a95dcef4d5d93aca
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18048
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-10 14:43:49 +01:00
Martin Roth 047c2f44b0 util/abuild: Print list of failed boards at the end of the abuild
When running abuild outside of jenkins, because all of the builds are
printed intermixed, it's easy to miss when a board has failed the build
by looking at the output.  This saves a list of failed builds and prints
the list at the end of the run.

- Add a command line option to mark when abuild is being called
recursively.
- Add all failed builds to a list.
- Print the list when a non-recursive abuild run exits.

Change-Id: Icb40ed8083a57bbcde49297d2b0814f98dcbb6c8
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17890
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-09 18:26:38 +01:00
Sebastian 'Swift Geek' Grzywna e6bd18f6b5 util/autoport: Fix gfx dump of log_maker
Variable name of inteltoolArgs was fixed.

The way of passing arguments to inteltool was changed from "-a -f"
to "-af" which is better as the string seems to be parsed
as a single argument.

Change-Id: I0c48fb1e912261748ba9e2b91c291bac28b9e856
Signed-off-by: Sebastian 'Swift Geek' Grzywna <swiftgeek@gmail.com>
Reviewed-on: https://review.coreboot.org/18050
Reviewed-by: Stefan Tauner <stefan.tauner@gmx.at>
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-09 18:17:45 +01:00
Martin Roth 23ceb7d240 util/lint: Add check for the signed-off-by line
Gerrit will let you push a patch without a signed-off-by line,
although I believe it can't actually be merged.  Instead of catching
it either manually, or when the patch is attempting to be merged,
catch this in the jenkins builder.

Change-Id: I80161befa157266dd4e3209839a06ff398aab6bb
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17941
Tested-by: build bot (Jenkins)
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2017-01-09 18:14:10 +01:00
Patrick Georgi 766c3fec2d util/romcc: avoid shifting more than the variable's width
That's undefined behavior in C

Change-Id: I671ed8abf02e57a7cc993d1a85354e905f51717d
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1229557
Reviewed-on: https://review.coreboot.org/18014
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-06 18:40:04 +01:00
Martin Roth ab8f7d315e util/crossgcc: update jenkins-build-toolchain
This allows the make jenkins-build-toolchain to use the
BUILDGCC_OPTIONS variable.  Previously, the options were hardcoded.

Change-Id: I5f4c1d3fc8c714ec3640356ae3c86ae157f486d2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17766
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-04 22:18:55 +01:00
Nico Huber 2c1c02ea6a buildgcc: Remove quotes around a $CC call
If we use ccache we have to interpret spaces in $CC as separation
characters. The downside is that we can't support spaces in the
compiler's path. But, well...

Change-Id: I4e6e6324389354669a755f570083a40ff00b1bbf
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18018
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins)
2017-01-04 22:18:24 +01:00
Manoj Gupta cf84619dd6 util/cbfstool: Fix to build with latest llvm
cbfs-payload-linux.c:255:43: note: add parentheses around left
hand side expression to silence this warning

if ((hdr->protocol_version >= 0x200) && (!hdr->loadflags & 1)) {

[pg: also fix the semantics. Thanks Nico for catching this]

BUG=chromium:665657
TEST=coreboot-utils builds

Change-Id: I025c784330885cce8ae43c44f9d938394af30ed5
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 35c4935f2a89c3d3b45213372bcf0474a60eda43
Original-Change-Id: I8758e7d158ca32e87107797f2a33b9d9a0e4676f
Original-Reviewed-on: https://chromium-review.googlesource.com/411335
Original-Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Original-Tested-by: Manoj Gupta <manojgupta@chromium.org>
Original-Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://review.coreboot.org/17568
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-01-04 21:37:39 +01:00
Patrick Georgi 37935573bf util/romcc: remove dead assignments
Change-Id: Iab6fe065faeacfca3b41eb5bae1075dcfb1a2b05
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: scan-build (clang 3.8)
Reviewed-on: https://review.coreboot.org/18021
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 22:18:39 +01:00
Patrick Georgi e7724f1e1a util/romcc: Ensure that bit shift is valid
Change-Id: Idbe147c1217f793b0360a752383203c658b0bdce
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1287090
Reviewed-on: https://review.coreboot.org/18020
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 22:18:06 +01:00
Patrick Georgi d057125290 util/romcc: avoid leaking a type
Only allocate ptr_type when it's actually used.

Change-Id: Iea5f93601a42f02a1866bdff099f63935fdd5b8d
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1129117
Reviewed-on: https://review.coreboot.org/18017
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 22:17:04 +01:00
Patrick Georgi d8051896fd util/romcc: avoid dereferencing NULL pointer
argv is only filled for macro->argc > 0.

Change-Id: I5ff21098384afc823efa14be3d5565507fb2b3b2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1287089
Reviewed-on: https://review.coreboot.org/18016
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 22:16:50 +01:00
Patrick Georgi 61dbbf65c3 util/romcc: free variable after use
closure_type is copied then never used again. Close that leak.

Change-Id: Idd4201f7fc6495fde5ad2e1feb7e499e38986e92
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1287073
Reviewed-on: https://review.coreboot.org/18015
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 22:16:15 +01:00
Martin Roth 14b9b9380a util/abuild: Don't set XGCCPATH if it's in the environment
Change-Id: I0fa231ca3d33300a671810e994c5be54ac10a18b
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17723
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-01-03 17:45:24 +01:00
Arthur Heymans 7ff4fe1237 util/inteltool: Add ICH6-10 to BIOS_CNTL list
Without this change inteltool cannot read BIOS_CNTL values nor can it
read the SPIBAR values.

Change-Id: I9ff16e060aca66e3cb11c8315a6843ccecd1d3c2
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/17979
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 17:40:34 +01:00
Arthur Heymans a5798a9b8f util/inteltool: Fix ICH SPIBAR registers
The ICH7 SPIBAR offset and registers are different from later
generation.
ICH8 has a different offset from later generation.
ICH6 has no SPI controller.

Change-Id: I7691bce619089b15805114047bcb1fd121a5722b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/17978
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 17:40:11 +01:00
Arthur Heymans 072a69e82e superiotool: Add support for HWM registers on W83627EHG
Based on datasheet: "W83627EHF/EF W83627EHG/EG WINBOND LPC I/O,
Revision : 1.0"

Change-Id: Ia2e5ab8bc454a34a89fe2cf06bfba55261109785
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/17457
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 17:34:12 +01:00
Arthur Heymans 4cd95ec155 superiotool: Add support for HWM registers on W83627DHG
Based on datasheet: "W83627DHG WINBOND LPC I/O, Version: 1.4"

Change-Id: Id20dff7539d926ef6f68265efbfc7420539d9bca
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/17964
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-03 17:33:50 +01:00
Patrick Georgi 2ed7295cd9 util/cbfstool: Don't print region information on stderr by default
It's usually not too interesting, so hide it behind -v.

Change-Id: Icffb5ea4d70300ab06dfa0c9134d265433260368
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17899
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-02 16:29:02 +01:00
Paul Menzel 1e7911e8aa util/intelmetool: Fix warning building with 32-bit
On a 32-bit system, pointers are 32-bit wide, and not 64-bit, resulting
in the warning below.

```
mmap.c: In function ‘map_physical_exact’:
mmap.c:26:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   virt_addr = mmap((void*)mapto, len, PROT_WRITE | PROT_READ,
                    ^
```

Fix this by using compatible types.

Change-Id: I4ede26127efcbd5668b978e6880a0535607e373d
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/17970
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-28 17:25:56 +01:00
Nico Huber 010ecf8009 buildgcc: Indicate CXXFLAGS for binutils
CXXFLAGS seems to be used a lot and have to be specified independently
from CFLAGS.

Change-Id: Iff4c76e54a46e908299b532fd848165a3dc04d43
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17937
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-28 03:36:58 +01:00
Nico Huber ae6187f01f buildgcc: Fix string comparison operator
Change-Id: I8ff8d51507dcf12cd554c8b4713074a99e47c11e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17942
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-28 03:36:36 +01:00
Nico Huber 8bbd596de6 buildgcc: Build GMP `--with-pic` if GCC defaults to `-pie`
GCC 6 can optionally default to building all binaries as position
independent executables (PIE). This breaks linking against static
libraries that are compiled without position independent code (PIC).

Building GMP `--with-pic` in this case seems to be the least fragile
solution.

TEST=Run `make all` and `make BUILDGCC_OPTIONS=-b build-i386` in
     util/crossgcc on Debian Stretch.

Change-Id: I5f3185af9c8d599379a628e18724b217b88be974
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17936
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
2016-12-27 23:34:12 +01:00
Patrick Georgi adcad7f046 util/romcc: Don't read 'member' if it might be NULL
The earlier loop exits gracefully iff i == index. In other cases, member
might be NULL, so check that the scan was successful before using its
results.

Change-Id: I818c233d797d82fa819243c4626dd9c4b7de3ac6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1129147
Reviewed-on: https://review.coreboot.org/17887
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 18:45:56 +01:00
Patrick Georgi ca80196ae2 util/broadcom: Check for successful file access
Change-Id: I5c77b3c5ea3fbc249a8c564a521c2c3c45e1c560
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323510
Reviewed-on: https://review.coreboot.org/17877
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 18:22:43 +01:00
Patrick Georgi da8421d1e2 util/romcc: remove self-assignment
Change-Id: I0f78b55b28011cdefc90665bca2a7ea17647e955
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1129127
Reviewed-on: https://review.coreboot.org/17885
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-16 15:57:24 +01:00
Patrick Georgi f78e658dac util/romcc: Move access after NULL-check
Change-Id: I7f9c38fd6e75b32fe1ed8a60c7054f4dd1fcd5c0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1129104
Reviewed-on: https://review.coreboot.org/17884
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:57:04 +01:00
Patrick Georgi f23cba082c util/romcc: Fix resource leak
Change-Id: I0d260254bab714ec939fc199b3a133b0fc05b10d
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1129112
Reviewed-on: https://review.coreboot.org/17883
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:56:50 +01:00
Patrick Georgi 8c47b1f833 util/broadcom: Add two more NULL checks
Change-Id: I088730fd87dd39fa2c36a06c5770fad05a5808b0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323511, #1323512
Reviewed-on: https://review.coreboot.org/17882
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:56:35 +01:00
Patrick Georgi a3e928cdf6 util/broadcom: Check return value of stat()
Change-Id: Ib53408e8b186c07aa8e42c67131d39c4add05983
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323515
Reviewed-on: https://review.coreboot.org/17881
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:56:08 +01:00
Patrick Georgi 3d51a6ac99 util/broadcom: Initialize variable
It's later tested for NULL, but never initialized to make that test work
reliably.

Change-Id: Iadee1af224507a6dd39956306f3eafa687895176
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323515
Reviewed-on: https://review.coreboot.org/17880
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:55:53 +01:00
Patrick Georgi 6e50e33aea util/broadcom: Close file after use
Change-Id: Ieea7ac7fbc618cd12f843f1606f9ebab37cae67e
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323508
Reviewed-on: https://review.coreboot.org/17879
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:55:33 +01:00
Patrick Georgi 856a3ab7c7 util/broadcom: Terminate string
filebuffer is treated like a string, so it should be zero-terminated
like a string.

Change-Id: I078aa39906394be64023424731fe0c7ae2019899
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323473
Reviewed-on: https://review.coreboot.org/17878
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:55:18 +01:00
Patrick Georgi 5f771dca27 util/broadcom: close file on error
Change-Id: I5193c6a9f08398b881c971c7175654ba5775b34a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323509
Reviewed-on: https://review.coreboot.org/17876
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-16 15:54:51 +01:00
Nico Huber e70bfee425 util/ifdfake: Add number of regions
To make the generated descriptor compatible with latest libflashrom.

Change-Id: I005159dd24e72da9cc43119103c96c5dd5b90a55
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17447
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-15 23:47:09 +01:00
Patrick Georgi 8099803c46 util/cbfstool: Handle error condition more carefully
Change-Id: I72a7776d530d1cf0b8fa39e558990df3dc7f7805
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1295494
Reviewed-on: https://review.coreboot.org/17861
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
2016-12-15 22:58:38 +01:00
Patrick Georgi 6b2d2db9eb util/cbfstool: check that buffer_create worked
We might not care much about this buffer, but we really use it later
on...

Change-Id: Ia16270f836d05d8b454e77de7b5babeb6bb05d6d
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1294797
Reviewed-on: https://review.coreboot.org/17860
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
2016-12-15 22:19:45 +01:00
Patrick Georgi 862df924e3 util/cbfstool: Fix memory leak
Change-Id: I66cb1c88155ef58610bacfb899e0132e4143c7ac
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1325836
Reviewed-on: https://review.coreboot.org/17859
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-15 22:19:17 +01:00
Patrick Georgi a2ce710df7 util/cbfstool: Add NULL-ptr check
Change-Id: I8b5caf5423135fe683a24db6700b895a2685cb98
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1323507
Reviewed-on: https://review.coreboot.org/17858
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-15 22:18:25 +01:00
Martin Roth 6bc4416968 util/abuild: Fix update_config function
- Because $configoptions contains embedded newlines that we want to be
interpreted when we pipe it out to the config file, change that back to
a printf, and tell shellcheck that we want to do it.
- 'make olddefconfig' & 'yes "" | make oldconfig' give us the same
output for the config file, but olddefconfig doesn't generate the log
the way oldconfig does.  Go back to the previous behavior.
- Don't overwrite the config log with make savedefconfig.

Change-Id: I4966a3bb2541b452eeb4ca73ac3cd727f8525636
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17853
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-15 04:08:21 +01:00
Patrick Georgi d9edb18037 util/cbfstool: Enable filling fmap regions with a given value
So far, cbfstool write, when used with the -u/-d options (to "fill
upwards/downwards") left the parts of the region alone for which there
was no new data to write.

When adding -i [0..255], these parts are overwritten with the given
value.

BUG=chromium:595715
BRANCH=none
TEST=cbfstool write -u -i 0 ... does the right thing (fill the unused
space with zeroes)

Change-Id: I1b1c0eeed2862bc9fe5f66caae93b08fe21f465c
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: baf378c5f2afdae9946600ef6ff07408a3668fe0
Original-Change-Id: I3752f731f8e6592b1a390ab565aa56e6b7de6765
Original-Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/417319
Original-Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Original-Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-on: https://review.coreboot.org/17787
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-12-13 19:45:37 +01:00
Patrick Georgi 16b3e4bd2c util/cbfstool: require -i argument for cbfstool add-int
We never specified what value add-int should write by default.

Change-Id: I240be4842fc374690c4a718fc4d8f0a03d63003c
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17796
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-13 19:10:46 +01:00
Martin Roth 08705f1e90 lint/kconfig_lint: Make sure all symbols have a type defined
Show an error if a symbol does not have a defined type.

This caused a problem of an undefined symbol in check_defaults, so
we just skip those symbols there as we can't verify the default pattern
without knowing the type.

Change-Id: I28711a77962e16f6fc89789400363edd0fdd0931
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17345
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 18:07:51 +01:00
Martin Roth 1c9c4b8db8 util/lint: add check for auto-included headers
Since we've removed them from the tree, add a check to keep them out.

Change-Id: I2995da765fee8796a297963d54a1c34f56376efe
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17658
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 18:07:27 +01:00
Martin Roth 00cbc7f72f Kconfig: Change symbol override from warning to notice
Overriding symbols within a .config is pretty common when doing
automated builds with various different options.  The warning
text makes it sound like this is an issue, so change it to say
'notice' instead.  We could get rid of it completely, but it's
not a bad thing to know that we have two copies of the same symbol
in the .config.

BUG=chrome-os-partner:54059
TEST=copy a disabled kconfig option to the end and set it to y.
See notice text instead of warning.

Change-Id: I9f575b2275233f638e42676263348c807e6515bd
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16691
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-12 17:53:32 +01:00
Martin Roth cbaab7ee3c util/docker: Add a makefile for common docker tasks
Commands for working with docker images:
build-coreboot-sdk           - Build coreboot-sdk container
upload-coreboot-sdk          - Upload coreboot-sdk to hub.docker.com
build-coreboot-jenkins-node  - Build coreboot-jenkins-node container
upload-coreboot-jenkins-node - Upload coreboot-jenkins-node to hub.docker.com
clean_coreboot_containers    - remove all docker coreboot containers
clean_coreboot_images        - remove all docker coreboot images

Commands for using docker images
docker_build_coreboot <BUILD_CMD=target>  - Build coreboot under coreboot-sdk
docker_abuild <ABUILD_ARGS='-a -B'>       - Run abuild under coreboot-sdk

Change-Id: I3a75b0615747d32f593948f53eab076f303271bf
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16388
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 17:52:57 +01:00
Martin Roth 9fdb41ab9a util/abuild: Add more error handling for command line options
- Show an error if a directory is added after the command line options
to catch scripts using the old parameters.
- If an invalid parameter is specified, show the parameter.

Change-Id: Ie8948361f1c51e89a99bdb13df8c554747cd521d
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17741
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 17:44:48 +01:00
Martin Roth 5b0d2dbdce util/abuild: Add argument -R to specify root directory
cbroot was previously specified by just adding it to the end of the
command line with no explicit identifier.  This change allows it to
go anywhere in the command line and adds the -R or --root identifier.

This makes the command line more consistent.  Most of the time, this
argument isn't even needed, as the automatic detection finds cbroot.

Change-Id: I1d6fd8f51765d0d8b29be8af1e8105e06dd44cc8
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17740
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 17:44:31 +01:00
Martin Roth b06bfa4d39 util/abuild: Clean up usage
- Indent with spaces for consistency
- Change lbroot to cbroot
- Remove incomplete list of options from usage line
- Capitalize first word of all option text
- Alphabetize options other than version and help
- Move version and help options to the end

Change-Id: Id5bd4db8d7e3705cbbb93895a46a3608cd1b09e2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17724
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 17:44:10 +01:00
Martin Roth 02c93b9b1f util/abuild: Fix or disable shellcheck warnings
This cleans up the shellcheck warnings in abuild.

Warning count:
1 Unexpected ==.
1 Use "${var:?}" to ensure this never expands to / .
1 VARIABLE appears unused. Verify it or export it.
1 Use "$@" (with quotes) to prevent whitespace problems.
2 Consider using { cmd1; cmd2; } >> file instead of individual redirects.
2 Expressions don't expand in single quotes, use double quotes for that.
3 Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
4 $/${} is unnecessary on arithmetic variables.
5 Check exit code directly with 'if mycmd;', not indirectly with $?.
5 Use cd ... || exit in case cd fails.
11 Declare and assign separately to avoid masking return values.
13 Use $(..) instead of legacy `..`.
20 Don't use variables in the printf format string.
104 Double quote to prevent globbing.

Change-Id: I9c77e122435ba87ce3a4aee76b5022f7265f9ef2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17722
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 17:42:51 +01:00
Martin Roth 26174c97fe abuild: Build saved config files
Update abuild to allow for building saved miniconfig files.

If one or more config files exist for a platform under
coreboot/configs, they will be built instead of the automatically
generated default config.

The config filename needs to start with "config.$VENDOR_$BOARD" to be
picked up by the abuild script.

- Update to version 0.10.0
- Add -d parameter to specify the saved config file directory
- Break 2nd half of create_config function into update_config
to set the payload for saved config files.
- Unset new payload Kconfig options that could be set in a saved
config file.
- Update a bunch of MAINBOARD variable names to BUILD_NAME since
the build name isn't necessarily the same as the mainboard name.
- Split build_target into two functions - build_target and
build_config because one mainboard can now build multiple
configurations.
- Update remove target and call it directly from build_target()
instead of from build_targets()

Change-Id: I1a276d3e507b178f7dcd9dc125fa9c59f1ab47bd
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17590
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-09 00:36:08 +01:00
Martin Roth c01ff74a6a util/kconfig/conf.c: Fix newline in error printf
For some reason the \n in the defconfig save error was not escaped.

Change-Id: I6a76b258f461a194fe17aae2b4fa04326b46d8d6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17742
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-12-09 00:35:51 +01:00
Martin Roth 21c99af0c8 util/lint: Add check to verify saved configs are miniconfigs
Change-Id: Ifc5ec645dd27663c1b1fde9ff16d48534606a554
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17600
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
2016-12-09 00:35:16 +01:00
Kyösti Mälkki 4015608ed7 autoport: Fix romstage generator
Prototype changed here:
   e258b9a intel sandy/ivy: Improve DIMM replacement detection

Change-Id: Id79238db2e497b9163f3bd1b1d5d4bc11fe4da9e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/17711
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-12-07 23:30:16 +01:00
Nico Huber 26267a7a41 buildgcc: Be less restrictive when trying to build GNAT
It turned out that newer GNAT versions can build our current (5.3.0)
GNAT without bootstrapping. So adapt the version enforcement.

Change-Id: Ie7189e8bcadeee56cf5c2172e8c0ae7cd534685a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17706
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-06 23:56:38 +01:00
Nico Huber aa89fb4618 buildgcc: Fix function prototype in GCC
With some newer versions of GCC (experienced with GCC 6.2.1 on Arch-
Linux) the first stage of a boostrapping fails due to a mismatching
function prototype. Also add a missing `static` to the signature.

Change-Id: Ia927036ccd725550f1191890515578bc80c74f80
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17704
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-06 23:56:05 +01:00
Furquan Shaikh 1d56eef728 cbfstool: Fix off-by-one error in checking hash_type
Change-Id: Iaf208705d0cd450288af721d53053b2d3407a336
Found-by: Coverity Scan #1325836
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/17698
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-04 03:03:37 +01:00
Martin Roth adcba9438d util/lint: Add check for symbolic links in the coreboot tree
Because of the varied environments that coreboot is built under, we
don't want to have symbolic links in the tree.

Change-Id: I4cf9d95a437626cb52e3032a5e6cba83320a334b
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17633
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-11-30 00:22:10 +01:00
Naresh G Solanki 358b2b379b util/lint: Exclude devicetree files with custom name from license check
As devicetree files can have different name followed by extension cb
Exclude all .cb file from the license header check.

Change-Id: I37b651eedd77cbf3d3e65ff0f027f971b0a2d2ac
Signed-off-by: Naresh G Solanki <naresh.solanki@intel.com>
Reviewed-on: https://review.coreboot.org/17186
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-11-30 00:10:05 +01:00
Martin Roth 2c6a8060da crossgcc/buildgcc: Show additional information while building
- Show number of threads being used to build.
- Show the version number of each package when skipping it.
- Show whether the tool is a host or target build.

Change-Id: I1134c08b417a731859e6b25fe38aecf01a85927b
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17418
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-11-28 18:58:47 +01:00
Martin Roth ab273d3f16 kconfig_lint: More updates for excluded files
- All of the symbols are in the .config, so if .config is include in
the search all of the symbols are always found.
- There are now some Kconfig symbols in the Documentation directory,
so that needs to be excluded.
- 3rdparty has lots of Kconfig symbols that are unrelated to what
is being searched for.

Change-Id: I0ff56d0a0916338a8b94f5210b8e0b3be5194f41
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17588
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-11-28 01:05:40 +01:00
Martin Roth e69c58d7c8 kconfig_lint: exclude payloads from search, add back specific files
Don't search for symbols in the payloads directory, except for specific
files that are actively added back to the search.

Change-Id: I6f28dc7dee040b8061fa5644066f3613367b6d84
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17443
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-11-28 01:05:01 +01:00
Patrick Georgi 1b593e5ad7 util/crossgcc: fix using -D
Otherwise errors similar to "touch: cannot touch
'${TARGETDIR}/.GMP.6.1.0.success': No such file
or directory" might occur.

Change-Id: I4f24c93a25b7d567d3ce14a0415d20fd0778c9c8
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17603
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-11-28 01:01:58 +01:00
Marshall Dawson 5c325491ca util/inteltool: Fix bay trail ahci device
Use a unique bus/device/function if a bay trail LPC bridge was found.

TEST=Run on MinnowBoard MAX Turbot and customer's LynxPoint-LP.

Change-Id: Ib4b50aaf9817ac94f46c28925081540676226d84
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/17464
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-11-21 23:38:40 +01:00
Martin Roth 8955d5572f util/amdfwtool: Wrap long lines, excluding comments
Change-Id: I35c4340cf14ca1609ce3bfcac78cc4e286eff34a
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/17326
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-11-21 23:37:08 +01:00
Martin Roth cd15bc86f1 util/amdfwtool: Fix whitespace
Change-Id: I33e41b745e7ec55ed39d7125fc74b1619d28bb54
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/17325
Tested-by: build bot (Jenkins)
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-11-21 23:36:49 +01:00
Martin Roth c295d5e249 crossgcc/buildgcc: Add package version to saved .success file
Previously, the .success file for each target didn't save the version,
of the package that was built.  This created problems when someone
wanted to update to a new version and could not rebuild.

Change-Id: I9975b198ac4a7de8ff9323502e1cbd0379a1dbb8
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17417
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-11-17 17:57:47 +01:00
Martin Roth 31d95a2eb2 util/amdfwtool: unify return values, verify the file open
- Return an error if the specified file could not be opened. To do this
cleanly, the return value was added.
- Since there's now a unified return value, use it where it makes sense.
- Don't return an error from --help.  If you've asked for usage, it's
not an error.

Change-Id: I7c712d1e1927c2d4957b044b87ad26475b7a0e3b
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/17324
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2016-11-10 00:26:45 +01:00
Martin Roth 0e94062c2b util/amdfwtool: add usage text
Change-Id: I0ddb4516c03b0240d9134b35753ad901932d3f53
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/17323
Tested-by: build bot (Jenkins)
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2016-11-10 00:26:06 +01:00
Martin Roth 8806f7f662 util/amdfwtool: fix clang warnings
Various fixes for clang warnings:

warning: arithmetic on a pointer to void is a GNU extension
- change *rom from void* to char* and cast back to void* as needed

warning: implicit conversion changes signedness
- In ALIGN macro, pass in value as unsigned

warning: no previous prototype for function
- Change functions to static

warning: no previous extern declaration for non-static variable
- Change global variables to static

warning: comparison of integers of different signs
- Make loop variable 'i' unsigned

warning: variable 'output' may be uninitialized
- Make sure an output filename was specified

warning: implicit conversion loses integer precision
- cast fd_stat.st_size to the appropriate type

Change-Id: I0134a79c00938e121e63b52fd63bd502f4cb9e99
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/17322
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2016-11-10 00:25:45 +01:00
Martin Roth 60f1551461 util/amdfwtool: Update with ROM size command line parameter
Previously, the ROM size was passed into amdfwtool solely as a #define,
meaning that all boards built with the tool would assume the same size
ROM.  This became a problem when the default rom for abuild was updated
to be a board with a 256KB ROM.

The temporary solution was to build amdfwtool individually for each
board that needed it.  This replaces that workaround by allowing the
ROM size to be passed in as a command line parameter.

- Add the -f | --flashsize option to accept a hex value for the ROM
size.
- Add checks to make sure the ROM size supplied is large enough.
- Because the ROM size is not hardcoded, it needs to be passed to
various functions.

Signed-off-by: Martin Roth <martinroth@chromium.org>
Change-Id: I0ca69cbba54797e0387a6e85935767b4136ef615
Reviewed-on: https://review.coreboot.org/17321
Tested-by: build bot (Jenkins)
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2016-11-10 00:24:46 +01:00
Andrey Petrov 96ecb77905 ifdtool: Add option to specify platform (-p) quirks
Apollo Lake uses yet another descriptor format where only two masters
are used: CPU/BIOS and CSE/TXE. CSE stores data in a region number 5
that has not been used previously and CPU must not write it. Add quirk
(-p aplk) that locks descriptor according to recommended values.

BUG=chrome-os-partner:58974
TEST=ifdtool -p aplk -l bios.bin; ifdtool -d bios.bin.new. Make sure
FLMSTR1 and FLMSTR2 are set correctly. unlock with -l and make sure
FLMSTRs are restored.

Change-Id: I3f33372bef3ff75d0e34030694c79cd07d5540de
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/17202
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-08 23:11:29 +01:00
Marc Jones 350630aefb util/amdfwtool: Increase space used for structures
Double the space for psp2dir to 0x200.

Based on advice from AMD, increase the region containing
the signature to 4K.

Original-Signed-off-by: Marc Jones <marcj303@gmail.com>
Original-Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
(cherry picked from commit e03a9402711c3a210816d0aa32865491a0523639)

Change-Id: If60132f913928bab0c2fe4aacedf342080929599
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/17148
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Zheng Bao <fishbaozi@gmail.com>
2016-11-02 18:39:53 +01:00
Marc Jones 90099b6803 util/amdfwtool: Add PSP2 options to optstring
Original-Signed-off-by: Marc Jones <marcj303@gmail.com>
Original-Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
(cherry picked from commit 482b65c219b932fd374f2ac469a023db219a66de)

Change-Id: I0a24a0aa4c7d9f4a8cc3ee9b7da60ea7704e6f17
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/17147
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Zheng Bao <fishbaozi@gmail.com>
2016-11-02 18:39:42 +01:00
Marshall Dawson e7d892c651 util/amdfwtool: Fix duplicate long option name
Make the PSP2 smufirmware2 name unique so the command-line option
gets picked up.

Original-Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Original-Reviewed-by: <marcj303@gmail.com>
(cherry picked from commit 98cf3880797f72aeb7169c3f8718a10092af9624)

Change-Id: I5430cf8b81fb03c95e6ee9d7e53455e6224256ff
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/17146
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-11-02 18:39:29 +01:00
Nico Huber 25445dca17 superiotool: Add undocumented registers of ITE IT8783E/F
Dumping and behavioral analysis have shown that there are more registers
in the environment control of the IT8783E/F than documented in my data-
sheet. This adds every register that wasn't 0x00/0xff by default. The
default values are guesswork: those that looked like sensor readings
became NANA, others are taken from dumps.

Change-Id: I7e39700c9b98ed5be9f085bc8ffd848006310254
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17005
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-10-31 20:29:56 +01:00
Nico Huber e35a374179 superiotool: Add register definitions for ITE IT8783E/F
Values are taken from an unpublished datasheet. With the exception of
the default value for register 0x55 in the environment controller space:
Looks like this was just documented wrong. The dumped value of 0x50 also
makes more sense.

Change-Id: I2bd23d30b7158b2e05fcee7c6280df82570d1401
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17004
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-10-31 20:29:13 +01:00
Nico Huber 3812a72907 superiotool: Add an alternative dump format
Add new dump format to superiotool that prints each register on a
separate line. This should be more suitable for diff'ing dumps of
multiple superiotool runs.

Change-Id: I226ee82b903bf77e760d3396d02fa50688adb9f2
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17003
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-10-31 20:28:28 +01:00
Paul Menzel 246051c22c util/xcompile/xcompile: Add a space before `&&`
Change-Id: I07fd4d6f6db220e23da8daced6014ce39894c604
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/17159
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-10-28 20:16:13 +02:00
Martin Roth 78f73353a3 util/lint/lint: Show lint script output as it's running
The checkpatch script takes a really long time to run, and when the
output is buffered to wait until it's finished, it's hard to tell if
the script is actually doing anything.

Instead, use tee to log the output and display it at the same time.

Change-Id: I3cf36e5e6ca28584103888ee1c6f125320ac068a
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17125
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-10-27 22:20:22 +02:00
Patrick Georgi 4003283c51 util/scripts: add copyright notices
Change-Id: Ia40543e5585845e5e6c178a620052c6a25927a5c
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17102
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-10-25 17:10:14 +02:00
Patrick Georgi cd48d19836 Rename and move util/gitconfig/rebase.sh
It has nothing to do with git configuration, but is one of our
convenience scripts. It also has nothing to do with rebases (except that
it can be comfortably used through git rebase --exec)

Change-Id: Icc60c4de486a0027fe2230e93b441e62ba022193
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17101
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-10-25 17:09:19 +02:00
Patrick Georgi 45037c8732 Drop convert-all-depthcharge-fmap.dts.sh script
The relevant data is gone in Chrome OS depthcharge's master branch, and
so the script outlived its usefulness.

Change-Id: I04f3f168e23d4bc7c31692263a8eec3f97ee50de
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17100
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-10-25 17:09:12 +02:00
Elyes HAOUAS de2918bd1a util/inteltool: Remove unnecessary whitespace
Change-Id: Id42a2901cf76e6b867f62a752a38bbd6f6e5f54e
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/17059
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-20 20:22:05 +02:00
Elyes HAOUAS 9450150892 util/inteltool: Use tabs for indents
Change-Id: I9d27c276053c51021166f4b22d150060e415d08f
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/17025
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
2016-10-20 20:21:51 +02:00
Elyes HAOUAS 3baa7e7073 util/msrtool: Use tabs for indents
Change-Id: Ib1aa4ad04dc8a584a751677aac5652cfa2e457df
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/17031
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-10-19 17:02:07 +02:00
Patrick Georgi 5b6bdcc1a5 cbfstool: Fix typo in help text
Change-Id: Ic5a3be1128f2f9a53d21e0a2c577192962260df6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/17018
Tested-by: build bot (Jenkins)
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-10-17 15:09:42 +02:00
Patrick Georgi 01fbc3a1dd util/cbfstool: Allow overwriting CBFS regions with raw data on request
Add a --force/-F option and enable it for cbfstool write, where it has
the effect of not testing if the fmap region contains a CBFS or if the
data to write is a CBFS image.

Change-Id: I02f72841a20db3d86d1b67ccf371bd40bb9a4d51
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16998
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-17 15:09:00 +02:00
Ronald G. Minnich 3401f5a20c RISCV: change make-spike-elf to use the coreboot toolchain.
Change-Id: I81ced8c6e02b00a3835e3b42c9cf2669b1b2bd3e
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
[jn: Added XGCC_BIN variable to avoid requiring the tools in $PATH]
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/16955
Tested-by: build bot (Jenkins)
2016-10-15 00:34:27 +02:00
Patrick Georgi 519c4b7298 util/scripts: add gerrit-rebase script
gerrit-rebase is a gerrit-context aware rebase script. Given a source
and a target branch (that need to have a common ancestor), it prepares
a rebase todo list that applies all commits from source that aren't
already found on target.

It matches commits using Reviewed-on lines in the commit message that
are added by gerrit when submitting commits using the "cherry-pick"
strategy.
This has been shown to be the best preserved meta data to work from in
existing data (Change-Id was mangled in all kinds of ways).

Change-Id: I9618c1b66ebc1fb7ed006efbc1665fb08386e1a5
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16695
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-10 20:18:57 +02:00
Alexander Couzens eff596b51a ifdtool: don't write unused regions into a layout file
flashrom treats them as invalid because start > end.

Change-Id: I1c8b4563094823ebd9b1193b91e7b4a748955228
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16936
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-10 18:01:00 +02:00
Alexander Couzens fd5c658871 ifdtool: use max_regions to reflect ifd header version
Change-Id: I71a12235196d478673d2816a9ee64f1373f3a63d
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16935
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-10-09 19:10:01 +02:00
Alexander Couzens a81bef1bd6 ifdtool: promote max_regions as global
max_regions is set to the maximal regions based on the ifd version

Change-Id: I9fa5a4565f4dbd67b5c6df97756311560e2a18bc
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16934
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-10-09 19:09:23 +02:00
Ronald G. Minnich aa9df0f0de RISCV: have the make-spike-elf.sh script use the riscv tools
We do this so that the riscv objdump can be used on the coreboot.elf file.

Change-Id: Ib8bf85a3299dd75b779e7fa3757f5b62c9c7170b
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: https://review.coreboot.org/16918
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
2016-10-08 16:03:22 +02:00
Martin Roth 1a9035988a util/release/build-release: Update tar command
Between GNU Tar 1.28 & 1.29, the files excluded by --exclude-vcs was
updated.  This breaks the reproducibility.  Instead, just manually
exclude the files to match what was excluded in v 1.28 and earlier.

Change-Id: Ie0717891506f4a6d750ff264f9cc2494a296265b
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16900
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-10-07 18:18:47 +02:00
Martin Roth dd78aa665a util/release/build-release: Update script
- Add more help text.
- Remove braces from variables where the variable is isolated.
- Remove --recurse-submodules from clone.  This breaks on old coreboot
versions.
- Add some whitespace between blocks.
- Fix all shellcheck warnings.
- Verify tar version and fail if it doesn't support --sort.

Change-Id: I4a49df99532d9a92a4a05bceff16f96a4fc3e205
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16883
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-10-07 18:18:36 +02:00
Martin Roth fb190ed764 util/release: Update genrelnotes.script to the latest version
Internal changes:
- Fix shellcheck issues.
- Add some help text and update section header text.
- Reorder sections to try to get better estimates of what the commits
were mainly touching.
- Start making the script slightly less coreboot-centric.
- Don't print git errors.

Changes in output:
- Find new and deleted CPUs, SOCs, northbridges, southbridges, and SIOs.
- Show new users.
- Show before and after commit count for all authors.

Change-Id: I9858436f9458b2859a91273a525901df34796df4
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16848
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-10-04 19:10:52 +02:00
Martin Roth a7d0027083 Revert "util/lint/kconfig_lint: change warning levels and text"
This reverts commit dfdb0733a6a71b11d15006dafc13841e84fab7cd.

Change-Id: I91bf5e42f4ac241f544742ce161bae651f9f9947
Reviewed-on: https://review.coreboot.org/16868
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2016-10-03 23:13:09 +02:00
Martin Roth 8bc8be4d0e util/lint/kconfig_lint: change warning levels and text
- Add an exception for MAINBOARD_POWER_ON_AFTER_POWER_FAIL when checking
- With those exceptions set, we don't have anymore #define or #ifdef
warnings, so turn them to errors so no more can be pushed.
- Change the definition of an unused symbol from a warning to a note.
There are times when unused symbols are expected.
- Upgrade the warning for loading Kconfig files multiple times from
a warning to an error.

Change-Id: I6dcb06d4f0b099d5ccaf7643e72dd790719bdf58
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16840
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-10-03 22:05:54 +02:00
Martin Roth fa95625867 util/lint/kconfig_lint: Check default types
The type of the default value wasn't being checked to make sure that it
matched the type of the Kconfig symbol.

This makes sure that the symbol is being set to either a reasonable
looking value or to another Kconfig symbol.

Change-Id: Ia01bd2d8b387f319d29f0a005d55cb8e20cd3853
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16839
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-10-03 22:05:37 +02:00
Ronald G. Minnich fa74e4705d cbfstool: set init_size for linux payloads.
We were not setting the init_size for linux payloads.
A proper value of init_size is required if the kernel
is x86_64.

This is tested in qemu and fixes the observed problem
that 974f221c84b05b1dc2f5ea50dc16d2a9d1e95eda and later would not
boot, and would in fact fail in head_64.S.

Change-Id: I254c13d16b1e014a6f1d4fd7c39b1cfe005cd9b0
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://review.coreboot.org/16781
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-09-28 23:05:00 +02:00
Patrick Georgi fe222005b8 crossgcc: Add Dockerfile
The dockerfile allows building an image with the current tree's
crossgcc code.

Change-Id: I59cd85b0acdf8776e3e090742d7f5d89d1c154e7
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: https://review.coreboot.org/16636
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-26 21:47:52 +02:00
Nico Huber 66c2c1a2d4 buildgcc: Build gnat by default if host compiler seems compatible
Change-Id: I2a13e188ddb0b7d64d3c0ec979a1a493bf160afc
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16678
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-21 22:10:30 +02:00
Nico Huber 04a1f6a3bc buildgcc: Ask the user to install gnat if it's missing
Change-Id: Ib840eac29fc8cedfaef4847fd9700bd4a70300ba
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16677
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-21 22:08:32 +02:00
Nico Huber 75797166ce buildgcc: Don't try to build gnat with a different version
Change-Id: I64a33d2cc4793e54a50fa439a4461c40d424b569
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16676
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-09-21 22:07:59 +02:00
Nico Huber 156d87c024 buildgcc: Warn when building GCC with a different major version
GCC build instruction recommend to bootstrap a native compiler first.
Not sure, when that is really necessary. A major version change seems
reasonable.

Change-Id: I80a9ec25739b7d33a1d1c7b4b2140d19d89a99ae
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16675
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-21 17:03:23 +02:00
Nico Huber aee7f46cd3 buildgcc: Add functions to test GCC versions
Just add some helpers that show parts (major, major.minor) of the GCC
version to be built (buildcc_*) and of the host compiler (hostcc_*).
They will be used in follow-up commits.

Change-Id: I37c12ad1a2d08645f40a9f0f0a479c8d7cc3e127
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16674
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-09-21 17:03:09 +02:00
Nico Huber bd74d561ad buildgcc: Show excessive arguments and bail out
Also remove a dead line that checks for unknown options: We already let
`getopt` check that.

Change-Id: I0e829b266e192757d6e455ee4cc608315bb4b7be
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16681
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-21 17:02:20 +02:00
Nico Huber 78df0bf46d buildgcc: Check exit status of `getopt`
We accidentally checked the status of `eval` instead.

Change-Id: I1ba258944184ed707ed1f176e528d8266656cb59
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16680
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-21 17:02:05 +02:00
Nico Huber cc414dd47f buildgcc: Fix GNU getopt usage
Looks like this never worked correctly: There are three argument formats
to GNU getopt and none of them matches what we fed it. The missing
double dash before the `set` arguments proves that we always called it
with parameters that `getopt` did NOT parse.

Change-Id: Ib8343976ef31774b18567a9fc9745a9f58dd287a
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16679
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-09-21 17:01:54 +02:00
Nico Huber 152e78e794 buildgcc: Fix option arguments
As we support `getopt` versions that don't know long options, every
option arguments needs a short option.

Also add the long options `--urls` and `--nocolor` to the `getopt`
string.

Change-Id: I11c393c3d90c7a16cdda119594221c85f902ed40
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16682
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-09-21 17:01:16 +02:00
Iru Cai 904538bcc1 inteltool: add --ahci for printing AHCI registers
According to datasheets for Intel ICH/PCH, it works for chipsets from
ICH7 to 9-series PCH, with PCI device address D31:F2.

Change-Id: If1ddd7208108bda949b5a94894a7bf9e8bfe1e5f
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/15106
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-21 14:16:55 +02:00
Martin Roth 2ab981b87e buildgcc: Update to acpica version 20160831
Change-Id: I3e3973e1c47505718cf73435156104ab73680441
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16387
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-20 22:20:38 +02:00
Martin Roth 57bfbb0508 checkpatch.pl: ignore '#define asmlinkage'
checkpatch warns that the asmlinkage storage class should be at the
beginning of the declaration when we define it to be an empty value.

Change-Id: I12292d5b42bf6da9130bb969ebe00fca8efcf049
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16358
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-20 21:44:11 +02:00
Martin Roth 1ce2ba6832 lint/lint-007-checkpatch: Update lint script
- Check Kconfig files as well.
- Accept a list of directories to check as a command line argument.
- Only look at src & util directories by default.
- Skip src/vendorcode.
- Remove bypass of payloads/coreinfo/util/kconfig directory, it no
longer exists.

Change-Id: Ia522d3ddc29914220bdaae36ea23ded7338c48fd
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16359
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-20 21:43:11 +02:00
Nico Huber be5492aec0 Add minimal GNAT run time system (RTS)
Add a stripped-down version of libgnat. This is somehow comparable to
libgcc but for Ada programs. It's licensed under GPLv3 but with the
runtime library exception. So it's totally fine to link it with our
GPLv2 code and keep it under GPLv2.

Change-Id: Ie6522abf093f0a516b9ae18ddc69131bd721dc0c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/11836
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2016-09-19 11:14:49 +02:00
Alexander Couzens 871da8e580 util/release: make release archives reproducible
tar doesn't sort by default and takes the order of the OS which is in
most cases the order of creation. Sort by name and set influencing
environment TZ and language to be reproducible.

Change-Id: I3d043952417000d12e81353677f1ea4aa2da4fc1
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16556
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-09-15 20:01:51 +02:00
Martin Roth 96a48f1489 checkpatch.pl: Force raw_line to return a defined value
Fixes the warning:
Use of uninitialized value in concatenation (.) or string at
util/lint/checkpatch.pl line 4739

Change-Id: Idc3c631735a595517d77cb8b8ec67e1ac00b6685
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16357
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-09-15 02:27:42 +02:00
Martin Roth ab9395f612 lint/checkpatch.pl: Pull in coreboot fixes
This pulls in two fixes that were added to coreboot's checkpatch.pl
script:

- commit 82ef8ada (src/commonlib/lz4_wrapper: Correct inline asm for
unaligned 64-bit copy):
modify checkpatch.pl to ignore spaces before opening brackets when
used in inline assembly.

- commit ebef00fa (lint/checkpatch.pl: escape \{ in perl regex to fix
warnings):
Unescaped left brace in regex is deprecated, passed through in regex;

Change-Id: Ia2c712c5b1bb5f67953a9098b5a076e31e3bd8d3
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16348
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-09-15 02:27:28 +02:00
Martin Roth 8448ac47d2 cbmem: Exit with an errorlevel of 0 after printing help
cbmem --help should not return an error to the OS.

Change-Id: Id00091c679dbb109bc352cf8a81d67c2ae5666ec
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16574
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-09-15 00:43:02 +02:00
Alexander Couzens 746b6abea5 ifdtool/Makefile: use static dependencies
The generated dependencies doesn't work when
used together with our main build system.

Change-Id: I93d26858e961d7e275d586a1b8a26b3d33f3bd41
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16572
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-12 20:03:28 +02:00
Alexander Couzens d12ea11c01 ifdtool: fix one whitespace format error
Change-Id: I5b1846eb3ef8253695066b315e8a105803390579
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16570
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-12 20:01:24 +02:00
Hakim Giydan 43e5b576b9 arch/arm: Add armv7-r configuration
This change adds armv7-r support for all stages.

armv7-r is an ARM processor based on the Cortex-R series.

Currently, there is support for armv7-a and armv7-m and
armv7-a files has been modfied to accommodate armv7-r by
adding ENV_ARMV7_A, ENV_ARMV7_R and ENV_ARMV7_M constants
to src/include/rules.h.

armv7-r exceptions support will added in a later time.

Change-Id: If94415d07fd6bd96c43d087374f609a2211f1885
Signed-off-by: Hakim Giydan <hgiydan@marvell.com>
Reviewed-on: https://review.coreboot.org/15335
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-12 19:58:43 +02:00
Idwer Vollering ba349ab12e buildgcc: Quote command substitution
There are shells where the result of a command substitution is subject
to word splitting (e.g. dash when assigning a value inside an export
statement).

Change-Id: I70a5bc124af7ee621da2bdb4777f3eaba8adafbb
Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/15820
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
2016-09-11 14:27:42 +02:00
Philipp Deppenwiese 6e4204a0d1 util/release: Add support for signed tags and releases
* Add gpg key command-line parameter for signing.
* Add username command-line parameter for secure ssh clone.
* Tag and releases are signed.
* Generates ascii amored signature files.

Change-Id: I41347a85145dd0389e3b69939497fb8543db4996
Signed-off-by: Philipp Deppenwiese <zaolin@das-labor.org>
Reviewed-on: https://review.coreboot.org/16553
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-09 23:39:42 +02:00
Stefan Reinauer c6080c6bfc util/lint: Update to latest checkpatch.pl
Taken from upstream Linux kernel.

Change-Id: Id8c9d48b8ca3c7592dc4d78cfd092714bbbb2abf
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/15980
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-04 05:51:47 +02:00
zbao 5cf758d45b buildgcc: Search the cksum command without checking OS type
The checksum command might appear to be unpredictable only by
checking the OS. Just list the candidates, sorted by possibility.

Change-Id: Ia3f4f5f0f98ff47d322a4f70689cca0bd4fa79fa
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/11483
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-02 18:06:38 +02:00
Martin Roth 26d484a237 Fix newlines at the end of files
All but ga-g41m-es2l/cmos.default had multiple final newlines.
ga-g41m-es2l/cmos.default had no final newline.

Change-Id: Id350b513d5833bb14a2564eb789ab23b6278dcb5
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16361
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Antonello Dettori <dev@dettori.io>
2016-09-02 18:04:48 +02:00
Julius Werner f975e55dcd cbfs: Add "struct" file type and associated helpers
This patch adds functionality to compile a C data structure into a raw
binary file, add it to CBFS and allow coreboot to load it at runtime.
This is useful in all cases where we need to be able to have several
larger data sets available in an image, but will only require a small
subset of them at boot (a classic example would be DRAM parameters) or
only require it in certain boot modes. This allows us to load less data
from flash and increase boot speed compared to solutions that compile
all data sets into a stage.

Each structure has to be defined in a separate .c file which contains no
functions and only a single global variable. The data type must be
serialization safe (composed of only fixed-width types, paying attention
to padding). It must be added to CBFS in a Makefile with the 'struct'
file processor.

Change-Id: Iab65c0b6ebea235089f741eaa8098743e54d6ccc
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/16272
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-27 01:16:22 +02:00
Marshall Dawson 1bc2b0bed0 util/scripts: Support cygwin in ucode conversion tool
Check for the existence of TMPFILE with a .exe extension and if found
rename it with no extension.  This allows the program to be run and
removed properly.

Change-Id: I26928f9b8bf82d1c07fa456a88d624f7a8838bd3
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/15437
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-08-22 04:19:24 +02:00
Martin Roth 2e03fbced7 util/lint: Add a tool to verify a single newline at the end of files
This takes way too long to run - currently about 30 seconds to look
at the entire coreboot tree.

Change-Id: I403934014b422528715ea95ff652babe5e18c88b
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15976
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-19 18:08:25 +02:00
Martin Roth 2d97cb1be5 util/docker: Update docker files for coreboot-sdk & jenkins builders
- Check out the specific toolchain version we want before building
the toolchain (This version uses 1.42).
- Add additional libraries and tools needed to build coreboot related
packages.
- Move everything required to build any of the coreboot or related
packages into the coreboot-sdk from coreboot-jenkins-node Dockerfile.
- Separate the text of the commands in the Dockerfiles.
- Use nproc to get the number of processors for building the toolchain
- Add some additional comments about why things are done the way that
they are to the README
- Update the version of coreboot-sdk that coreboot-jenkins-node uses to
1.42. (This matches the toolchain version)
- Move ccache setup from jenkins-node to coreboot-sdk.
- Update the maintainer.

Change-Id: I293285ef72e3e70259355d924d425fea98ee773d
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16239
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-18 06:15:26 +02:00
Martin Roth f75d1dfad3 util/docker: Add docker files for coreboot-sdk & jenkins builders
Add the coreboot specific docker configuration files to the coreboot
repo.  These have been copied directly from Patrick's repo where they
had been being stored.

- coreboot-sdk: debian sid with the coreboot toolchain
- coreboot-jenkins-node: built on top of the coreboot-sdk, adds the
pieces required for building everything with the coreboot jenkins
builders.

Change-Id: I8628d4edb298264e814e02e124a8bfb4bc04e0c7
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14830
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-18 06:14:40 +02:00
Iru Cai 9cc8cb2090 xcompile: add riscv64 name to riscv toolchain
In newer toolchain with binutils 2.26 and GCC 5.3.0, we build binutils
and GCC with machine type riscv32 and riscv64 instead of riscv. We can
see it in this riscv-gnu-toolchain commit:
https://github.com/riscv/riscv-gnu-toolchain/commit/dedbf07

Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Signed-off-by: Martin Roth <martinroth@google.com>
Change-Id: Id552859ec256d80108e073d25cd51dd1fc3fbfac
Reviewed-on: https://review.coreboot.org/14257
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-17 03:55:02 +02:00
Martin Roth 589ef9de8f crossgcc: Update make to latest version: 4.2.1
Change-Id: I4af90fd2fcfb2a823f9e6b1e975c71581f0b55e9
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16164
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-08-13 23:31:29 +02:00
Martin Roth 109a7db2bb crossgcc: Add gnumake target so that make can be built directly
Previously, make could be built as one of the crosgcc* targets, but
there was no way to just rebuild make, as there is for IASL.

- Add an independent target - gnumake.
- Add gnumake to the help text.
- Add gnumake to the list of NOCOMPILE targets (Not compiling coreboot)

Change-Id: I4df25f2e209ca14944d491dbfb8e9b085ff7aca3
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16163
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-08-13 23:31:19 +02:00
Martin Roth 34e4a1c01a util/gitconfig: add cborg2cros.py script
This is a python script that does basically the same thing as the
rebase.sh script, but in the other direction.  rebase.sh takes files
from the chromium tree (cros) and pulls them to the coreboot.org tree.
cborg2cros, as the name implies, updates patches to go into the cros
tree from coreboot.

It adds the 'UPSTREAM: ' identifier to the start of the commit message,
and uses the text '(cherry-picked from commit #####)' instead of
'Original-Commit-Id: #####'

It also adds the 'TEST=', 'BRANCH=', and 'BUG=' lines if they aren't
there.

Change-Id: Ibad9a5f0d0d2c713cf08e103c463e2e82768c436
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15323
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-08-13 23:30:06 +02:00
Zheng Bao bb003c8126 buildgcc: printf no-color before quiting
On some kind of terms (shell in emacs), the color-ctrl
letters don't work. The backspaces can not delete
correct number of letters. So we don't print color-ctrl
letters in loop.

Change-Id: I1f1729095e8968a9344ed9f1f278f7c78f7110e9
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/16066
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-08-11 15:14:53 +02:00
Jonathan Neuschäfer 5de5458c2c util/cbfstool: Initialize elf_writer pointer to avoid crash
If some error happens in cbfs_payload_make_elf, the code jumps to "out",
and elf_writer_destroy(ew) is called. This may happen before an elf
writer is allocated.
To avoid accessing an uninitialized pointer, initialize ew to NULL;
elf_writer_destroy will perform no action in this case.

Change-Id: I5f1f9c4d37f2bdeaaeeca7a15720c7b4c963d953
Reported-By: Coverity Scan (1361475)
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/16124
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-10 21:13:06 +02:00
Stefan Reinauer 1bf00079c1 flashmap: Allocate at least one entry in kv_pair_new()
Change-Id: I971fa85ed977884d050790560a5a8f2ce955eb7c
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14444
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-09 15:00:50 +02:00
Paul Kocialkowski 8f0b4f40bf buildgcc: Use upstream patch for aarch64 build issue
Upstream proposed and merged a patch fixing the ARM Trusted Firmware
build issue that occurs with recent version sof binutils. This includes
this patch instead of the previous one.

See binutils commit 7ea12e5c3ad54da440c08f32da09534e63e515ca:
"Fix the generation of alignment frags in code sections for AArch64."

The issue was reported at:
https://sourceware.org/bugzilla/show_bug.cgi?id=20364

Change-Id: I16a8043d3562107b8e84e93d3f3d768d26dac7e4
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-on: https://review.coreboot.org/16110
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-09 10:37:20 +02:00
Martin Roth bec07535ac sconfig: Reformat C code
Change-Id: Idfd1bd8240413026b992ae1382a57bccf9d8ddb5
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16082
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-08 19:16:24 +02:00
Martin Roth c9c27bb14e sconfig: Remove mainboard chip.h support
The mainboard chip.h files were (mostly) removed long ago.

Change-Id: I1d5a9381945427c96868fa17756e6ecabb1048b2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16080
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-08 19:16:02 +02:00
Martin Roth 824255ea28 sconfig: Remove bootblock and Kconfig modes
The command line parameters for these modes haven't worked in two
years and nobody noticed.  They're obviously not getting used, so
remove them.

TEST=Generate static.c before and after the change, verify they're
identical.

Change-Id: I1d746fb53a2f232155f663f4debc447d53d4cf6b
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16079
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-08 19:15:41 +02:00
Martin Roth 25f8a4f6d4 sconfig: Update command line parameters
Instead of having directories and file names hardcoded, pass in the full
path and filename of both the input and output files.

In the makefile, create variables for these values, and use them in
places that previously had the names and paths written out.

Change-Id: Icb6f536547ce3193980ec5d60c786a29755c2813
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16078
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-08 19:15:13 +02:00
Martin Roth 3205170a2e sconfig: pass in devicetree filename
Instead of forcing the hardcoded 'devicetree.cb' filename under the
mainboard directory, this allows mainboards to select a filename for
the devicetree file.

This allows mainboard variants that need to use different devicetree
files to live under the same directory.

Change-Id: I761e676ba5d5f70d1fb86656b528f63db169fcef
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12529
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-08 19:14:33 +02:00
Furquan Shaikh 9844d56993 cbfstool/cbfs_image: Fix resource leak for tbuff
Change-Id: I1f4626e1bda92af38e7967d7e05a4c7143942cf6
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/16074
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-08 13:02:50 +02:00
Furquan Shaikh 58644a0e0f cbfstool/cbfs_image: Check for return value of buffer_create
Free any buffers if required.

Change-Id: Iccd435dba51275d875a5fdb5649cdcd0541fd84c
Signed-off-by: Furquan Shaikh <furquan@google.com>
Found-by: Coverity Scan # 1361254
Reviewed-on: https://review.coreboot.org/16073
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-08 13:02:27 +02:00
Furquan Shaikh 7b405178f4 cbfstool/cbfs_image: Fix resource leak for segs
Free segs whenever returning from cbfs_payload_make_elf()

Change-Id: I0dd722dd488723cecffe1f5621244bb0344056a6
Signed-off-by: Furquan Shaikh <furquan@google.com>
Found-by: Coverity Scan # 1361268
Reviewed-on: https://review.coreboot.org/16072
Tested-by: build bot (Jenkins)
Reviewed-by: Antonello Dettori <dev@dettori.io>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-08 13:02:07 +02:00
Furquan Shaikh b927bec09a cbfstool/elfheaders: Make elf_writer_destroy NULL-safe
This relieves caller from having to check if the parameter being passed
in is NULL.

Change-Id: I3ea935c12d46c6fb5534e0f2077232b9e25240f1
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/16076
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-08-08 13:01:34 +02:00
Furquan Shaikh f3bba44a04 cbfstool/cbfs_image: Initialze empty_sz to 0
Change-Id: I8b9cfe56b5893ba11047fcc1a6727e7e12a15772
Signed-off-by: Furquan Shaikh <furquan@google.com>
Found-by: Coverity Scan # 1361276
Reviewed-on: https://review.coreboot.org/16071
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-08-08 13:01:16 +02:00
Paul Kocialkowski 61486b506d Use VBOOT_SOURCE instead of hardcoding vboot path
This replaces all occurrences of a hardcoded vboot path to the
VBOOT_SOURCE variable, that may be overridden from the command line,
witch fallback to the source from 3rdparty.

Change-Id: Ia57d498d38719cc71e17060b76b0162c4ab363ed
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-on: https://review.coreboot.org/15825
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2016-08-08 12:17:00 +02:00
Lee Leahy 72fe7acbbb util/checklist: Place tables in proper boot order
during the boot, romstage occurs before postchar which is before
ramstage.  Place the tables in the proper boot order when generating
the final webpage.

TEST=Build and run on Galileo Gen2

Change-Id: I5df3ceb797aced58fe5ea3d10d78254a27341e47
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/16042
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-08-03 18:01:32 +02:00
Lee Leahy 3440db5827 util/checklist: Concatinate optional list to complete list
Don't require that the routines in the .optional file be listed in the
.complete data file.  Concatinate the two files when building the
complete symbol list.

TEST=Build and run on Galileo Gen2

Change-Id: I596134e1a19311d357aa0d93cfb33c7ca9801e2e
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/16037
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-08-03 18:00:57 +02:00
Lee Leahy 3741a0b225 util/checklist: Process .debug files before .elf files
Ensure that the output file is created by processing the .debug files
before the .elf files.

TEST=Build and run on Galileo Gen2

Change-Id: Ief8d774249c9d8eb313f3d10f04d7e4f2e3cf491
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/16041
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-08-03 18:00:29 +02:00
Lee Leahy ce8ff85fe5 util/checklist: Add usage instructions
Document how to use the checklist and how to generate the data files.

TEST=Build and run on Amenia

Change-Id: Idffc0683e916cbc5a984028886dc3d89a01d0595
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/16036
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-08-03 18:00:03 +02:00
Nico Huber 5407310e64 cbfstool: Check for excessive arguments
Change-Id: I66de6a33b43c284198c0a0a97c5c6a10f9b96e02
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/16019
Tested-by: build bot (Jenkins)
Reviewed-by: Omar Pakker
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-08-03 10:12:02 +02:00
Nico Huber 9ade717571 cbfstool: Check arguments to strtoul() where appropriate
The interface to strtoul() is a weird mess. It may or may not set errno
if no conversion is done. So check for empty strings and trailing
characters.

Change-Id: I82373d2a0102fc89144bd12376b5ea3b10c70153
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/16012
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-03 09:42:11 +02:00
Martin Roth ae39fc45a8 util/lint: Add a lint tool to find non-ascii & unprintable chars
This examines characters in coreboot's sourcecode to look for values
that are not TAB, or in the range of space (0x20) to ~ (0x7F).

It specifically excludes copyright lines so that names with high-
ASCII characters are not flagged.

Change-Id: I40f7e61fd403cbad19cf0746e2017c53e7379bf8
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15979
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-02 18:56:14 +02:00
Martin Roth 0cd338e6e4 Remove non-ascii & unprintable characters
These non-ascii & unprintable characters aren't needed.

Change-Id: I129f729f66d6a692de729d76971f7deb7a19c254
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15977
Tested-by: build bot (Jenkins)
Reviewed-by: Omar Pakker
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-08-01 21:44:45 +02:00
Martin Roth bb9722bd77 Add newlines at the end of all coreboot files
Change-Id: I7930d5cded290f2605d0c92a9c465a3f0c1291a2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15974
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2016-08-01 21:43:56 +02:00
Timothy Pearson c1dc9d725e util/cbfstool: Increase initrd offset to 64M
Newer Linux kernels fail to detect the initramfs using the old 16M
offset.  Increase the offset to the minimum working value, 64M.

Tested-on: qemu pc, 64-bit virtual CPU, linux 4.6 x86_64

Change-Id: I8678fc33eec23ca8f5e0d58723e04d434cd9d732
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Reviewed-on: https://review.coreboot.org/15999
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-01 18:20:35 +02:00
Patrick Georgi 1fcebe7fd9 intelvbttool: cope with errors in open()
Change-Id: I9fee87b7331ee05d4e984cb024f124abb2c97a69
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1347357
Reviewed-on: https://review.coreboot.org/15962
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-07-31 19:23:29 +02:00
Patrick Georgi 030c73031d util/inteltool: fix memory leak
A struct pci_dev was allocated but not freed.

Change-Id: I6a8bbef6a118fc1f0aa7037e72c4d0dda9208f4b
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1353037
Reviewed-on: https://review.coreboot.org/15971
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-07-31 19:16:45 +02:00
Patrick Georgi be8f0fa2bb util/cbmem: Initialize variable
There can be cases where "found" wasn't initialized, do so.

Change-Id: Ifef8d61daa70e27ec39b7a8f3481d2316dfaa36e
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1347334
Reviewed-on: https://review.coreboot.org/15969
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-07-31 19:15:34 +02:00
Patrick Georgi 8260650cde nvramtool: Don't consider reserved regions to be "out of range"
Reserved regions showed different behavior for debug and regular builds.
Debug output was unfriendly, regular was wrong.
Print a proper error message and exit instead.

Change-Id: I9842ff61f7d554800e2041e8c4c607f22b2df79f
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1287076
Reviewed-on: https://review.coreboot.org/15968
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-07-31 19:07:43 +02:00
Omar Pakker 312e9f586a superiotool: Add Nuvoton NCT6791D
This adds support for the Nuvoton NCT6791D Super I/O chip to the
superiotool.
The implementation is based on the Datasheet supplied by Nuvoton:
Datasheet Version: January 8th, 2016 Revision 1.11

Datasheet deviation:
- Defaults for control registers 0x20 and 0x21 are invalid.
  Datasheet: 0xc562. Actual: 0xc803.

Change-Id: I8ced9738cd41960cbab7b5ea38ff19192d210672
Signed-off-by: Omar Pakker <omarpakker+coreboot@gmail.com>
Reviewed-on: https://review.coreboot.org/15252
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-07-31 18:35:59 +02:00
Martin Roth 4c72d3612b Remove extra newlines from the end of all coreboot files.
This removes the newlines from all files found by the new
int-015-final-newlines script.

Change-Id: I65b6d5b403fe3fa30b7ac11958cc0f9880704ed7
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15975
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-07-31 18:19:33 +02:00
Nico Huber 4b48ed8f38 buildgcc: Apply patches with -p1
Turned out that there are versions of the patch command that use the
left hand side path for new files created by a patch. This behavior is
incompatible with some of our patches. Stripping the topmost dir from
the path with -p1 helps.

While touching that line, I couldn't resist to drop a command
substituion (the `echo $patch`). It really shouldn't be necessary as the
path to the patch file is already expanded in the head of the for loop.

Change-Id: I95398605db6dd54a8b08d8bc84c6602edbea6e10
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/15908
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Tested-by: build bot (Jenkins)
2016-07-31 17:37:41 +02:00
Stefan Reinauer 28434a9ca7 util/chromeos: Make scripts executable
crosfirmware.sh and extract_blobs.sh are not executable, change that.

Change-Id: Ib04df580a9acd4a422aedbdc15013b2ef505459a
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/15922
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Omar Pakker
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-07-30 19:34:20 +02:00
Paul Menzel aad4587c03 viatool/quirks: Add newline to end of file
Change-Id: If505021c6dd4bc1c98094dc6e4a3da1ea7753859
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/15916
Tested-by: build bot (Jenkins)
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2016-07-28 20:18:10 +02:00
Elyes HAOUAS e3e2bb0a89 util: Correct typo in MSR_EBC_SOFT_POWERON
Change-Id: Iba5fc92d8740d0bb7d41f8a83513ba7fb97be592
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/15900
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-07-28 01:09:37 +02:00
Elyes HAOUAS 7ab98fb790 util/msrtool: update register for Pentium4_later
Update MSR's registers regarding "Intel® 64 and IA-32
Architectures Software Developer’s Manual"- April 2015.
"64-ia-32-architectures-software-developer-manual-325462.pdf"

Change-Id: I71e399c4a6fef9de6a5581b64a6918660b2f8445
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/15798
Tested-by: build bot (Jenkins)
Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
2016-07-28 01:09:02 +02:00
Elyes HAOUAS e5a5084b70 msrtool/README: Remove trailing spaces
Change-Id: I8b7d2263591608e0ab9504262bb06eac4cb52850
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/15779
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-07-28 01:08:47 +02:00
Paul Kocialkowski 46114517d7 Rename VB_SOURCE to VBOOT_SOURCE for increased clarity
This renames the VB_SOURCE variable to VBOOT_SOURCE in the build system,
providing increased clarity about what it represents.

Since the submodule itself is called "vboot", it makes sense to use that
name in full instead of a very shortened (and confusing) version of it.

Change-Id: Ib343b6642363665ec1205134832498a59b7c4a26
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-on: https://review.coreboot.org/15824
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-07-27 17:26:05 +02:00
Paul Kocialkowski 7899db2355 buildgcc: Never set GMP CFLAGS manually in order to get the right flags
When no CFLAGS are explicitly provided to it, the GMP configure script
will figure out the best optimization flags to use on its own. In
particular, it will setup the march, mfpu and mtune flags based on
hardware detection.

However, when CFLAGS are provided, they are used as-is and such
detection doesn't happen. When the march, mfpu and mtune flags are not
provided (which happens when GMP wasn't built already), not only will
related optimizations be disabled, but some code might not build because
of missing support. This happens with NEON instructions on ARMv7 hosts.

Thus, it is better not to set CFLAGS and leave it up to the GMP
configure script to get them right and still reuse those later.

Change-Id: I6ffcbac1298523d1b8ddf29a8bca1b00298828a7
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-on: https://review.coreboot.org/15452
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-07-21 11:49:25 +02:00
Antonello Dettori 613702b5dc cbmem: share additional time stamps IDs
Split the additional time stamps concerning depthcharge from
the cbmem utility sourcecode and move them into
commonlib/timestamp_serialized.h header.

Change-Id: Ic23c3bc12eac246336b2ba7c7c39eb2673897d5a
Signed-off-by: Antonello Dettori <dev@dettori.io>
Reviewed-on: https://review.coreboot.org/15725
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-07-20 22:09:24 +02:00
Martin Roth 6101dfbaf3 buildgcc: Update the revision to 1.41
The binutils patch went in without updating the revision,
so we need to update it now. This was done in commit bcfa7ccb
(buildgcc: Update to binutils-2.26.1 & Fix aarch64 build issue)

Change-Id: Ifad4a2e3973f1f60d0ea840945e2bd097e1b4474
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15712
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-07-16 00:03:30 +02:00
Martin Roth bcfa7ccb28 buildgcc: Update to binutils-2.26.1 & Fix aarch64 build issue
- Update to the latest version of GNU binutils
- Add a patch to undo the changes to binutils done by commit c1baaddf
so that arm-trusted-firmware builds correctly again.

Test: Build arm-trusted-firmware (ATF) with this patch.  Build ATF
with binutils 2.26.1 changing the '.align x,0' to '.align x', which
changes the padding bytes to NOP instructions.  Verify that everything
except the padding bytes is the same.

See https://sourceware.org/bugzilla/show_bug.cgi?id=20364 for more
information about this issue.

Change-Id: I559c863c307b4146f8be8ab44b15c9c606555544
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15711
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-07-14 23:58:56 +02:00
Jonathan Neuschäfer 8660580567 util/riscvtools: Provide a tohost/fromhost symbols so Spike doesn't hang
See https://github.com/riscv/riscv-isa-sim/issues/54 for more
information.

Change-Id: I8cda8dc07866d395eb3ce5d94df8232840fa8b82
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/15288
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2016-07-14 18:23:05 +02:00
Martin Roth bfe6f6a72e kconfig: add olddefconfig target to help
olddefconfig is used to expand the miniconfig files with all the default
values removed by the 'savedefconfig' target.

Change-Id: Ic9c62f4c334919e8be478d30099819b90891670a
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15319
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-07-12 19:23:36 +02:00
Nico Huber 234d246535 buildgcc: Add option to bootstrap a host gcc
Bootstrapping gcc is the recommended way if your host gcc's version
doesn't match the gcc version you're going to build. While a build
with an outdated host gcc usually succeeds, an outdated gnat seems
to be a bigger issue.

v3: Some library controversy: gcc likes the libraries it ships with
    most but we don't want to install shared libraries. So we build
    them static --disable-shared) and install only the minimum
    (libgcc, libada, libstdc++). However, as the code of these
    libraries might be used to build a shared library we have to
    compile them with `-fPIC`.

v4: o Updated getopt strings.
    o The workaround for clang (-fbracket-depth=1024) isn't needed
      for bootstrapping and also breaks the build, as clang is only
      used for the first stage in that case and gcc doesn't know
      that option.

So far build tested with `make BUILDGCC_OPTIONS="-b -l c,ada"` on
  o Ubuntu 14.04 "Trusty Tahr" (i386)
  o Debian 8 "Jessie" (x86_64) (building python (-S) works too)
  o current Arch Linux (x86_64)
  o FreeBSD 10.3 (x86_64) (with gcc-aux package)

and with clang host compiler, thus C only: `make BUILDGCC_OPTIONS="-b"`
on
  o Debian 8 "Jessie" (x86_64)
  o FreeBSD 10.3 (x86_64)

v5: Rebased after toolchain updates to GCC 5.3.0 etc.

Build tested with `make BUILDGCC_OPTIONS="-b -l c,ada"` on
  o Debian 8 "Jessie" (x86_64)

Change-Id: Icb47d3e9dbafc55737fbc3ce62a084fb9d5f359a
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/13473
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-07-05 11:52:57 +02:00
Nico Huber 11ea2b378b buildgcc: Make package build() function more versatile
Refactor build() to make things more flexible:

Add a parameter that tells if we build a package for the host or for a
target architecture. This is just passed to the build_$package()
function and can be used later to take different steps in each case
(e.g. for bootstrapping a host gcc).

Move .success files into the destination directory. That way we can tell
that a package has been built even if the package build directory has
been removed.

Change-Id: I52a7245714a040d11f6e1ac8bdbff8057bb7f0a1
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/13471
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-07-05 11:52:40 +02:00
Patrick Georgi 2b80734811 fmaptool: Accept hex values with uppercase letters
Due to a newer flex version with which the scanner was recreated, we
also have to make the compiler less strict on the generated code.

Change-Id: I3758c0dcb2f5661d072b54a30d6a4ebe094854e6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/15482
Tested-by: build bot (Jenkins)
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-07-04 12:17:51 +02:00
Antonello Dettori 0b806285a7 cbfstool: Require "-m ARCH" to extract payloads and stages
Require the user to specify which architecture the payload/stage
was built for before extracting it.

Change-Id: I8ffe90a6af24e76739fd25456383a566edb0da7e
Signed-off-by: Antonello Dettori <dev@dettori.io>
Reviewed-on: https://review.coreboot.org/15438
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-02 03:27:33 +02:00
Jonathan Neuschäfer e1a022ade4 util/kconfig: Fix gconfig build
This linker error was the problem:

build/util/kconfig/zconf.tab.o: In function `conf_read_simple':
/home/jn/dev/coreboot/util/kconfig/confdata.c:413: undefined reference to `kconfig_warnings'
/home/jn/dev/coreboot/util/kconfig/confdata.c:413: undefined reference to `kconfig_warnings'
build/util/kconfig/zconf.tab.o: In function `sym_calc_value':
/home/jn/dev/coreboot/util/kconfig/symbol.c:388: undefined reference to `kconfig_warnings'
/home/jn/dev/coreboot/util/kconfig/symbol.c:388: undefined reference to `kconfig_warnings'
collect2: error: ld returned 1 exit status
/home/jn/dev/coreboot/util/kconfig/Makefile:339: recipe for target 'build/util/kconfig/gconf' failed
make: *** [build/util/kconfig/gconf] Error 1

Change-Id: I4a667c7c15b35618fb9ad536f2be5044b8031ab4
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/15505
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-07-01 19:29:53 +02:00
Martin Roth deed18627d rebase.sh: Update to current cros branch
Change-Id: I04add4e6fc957cb9a0cdefe79ec9e97e3cebdf8e
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15322
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-06-29 16:48:18 +02:00
Werner Zeh 310580ea13 ifwitool: Fix gcc error due to shadowed global declaration
The name 'bpdt_size' is used for a function as well as ia local variable.
As ifwitool is compiled using HOSTCC, there can be an older gcc version
used for the compilation. With gcc version 4.4.7 I get the following
error: declaration of 'bpdt_size' shadows a global declaration
To fix it, rename the function to get_bpdt_size so that names are
unique now.

Change-Id: I47791c705ac4ab28307c52b86940a7a14a5cfef8
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/15343
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-06-26 10:49:06 +02:00
Benjamin Barenblat 82ef8ada82 src/commonlib/lz4_wrapper: Correct inline asm for unaligned 64-bit copy
Rewrite inline assembly for ARMv7+ to correctly annotate inputs and
outputs.  On ARM GCC 6.1.1, this causes assembly output to change from
the incorrect

	@ r0 is allocated to hold dst and x0
	@ r1 is allocated to hold src and x1
	ldr r0, [r1]		@ clobbers dst!
	ldr r1, [r1, #4]
	str r0, [r0]
	str r1, [r0, #4]

to the correct

	@ r0 is allocated to hold dst
	@ r1 is allocated to hold src and x1
	@ r3 is allocated to hold x0
	ldr r3, [r1]
	ldr r1, [r1, #4]
	str r3, [r0]
	str r1, [r0, #4]

Also modify checkpatch.pl to ignore spaces before opening brackets when
used in inline assembly.

Change-Id: I255995f5e0a7b1a95375258755a93972c51d79b8
Signed-off-by: Benjamin Barenblat <bbaren@google.com>
Reviewed-on: https://review.coreboot.org/15216
Tested-by: build bot (Jenkins)
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-24 19:10:05 +02:00
Alexander Couzens 2c68b1c732 cbfstool: Change CONFIG_FMD_GENPARSER if not set to n
When doing make in util/cbfstool it contaminates the tree because it generates
the fmd_parser.

Change-Id: Ida855d1e57560c76d3fcfcc8e2f7f75bcdfdd5d4
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/15221
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-06-21 17:55:17 +02:00
Julius Werner 119dcee1dd fmaptool: Make base offsets absolute in fmap_config.h
fmaptool generates a header file used to hardcode certain values from
the FMAP in coreboot's binaries, to avoid having to find and parse the
FMAP manually for every access. For the offset of the FMAP itself this
has already been using the absolute offset from the base of the whole
ROM, but for individual CBFS sections it only used the offset from the
immediate parent FMAP region. Since the code using it intentionally has
no knowledge of the whole section tree, this causes problems as soon as
the CBFS is a child section of something not at absolute offset 0 (as is
the case for most x86 Chromebooks).

Change-Id: If0c516083949fe5ac8cdae85e00a4461dcbdf853
Reported-by: Rolf Evers-Fischer <embedded24@evers-fischer.de>
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/15273
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-21 17:14:27 +02:00
Jonathan Neuschäfer 2459f67731 util/riscvtools: Add script that turns coreboot.rom into an ELF
This is required because SPIKE doesn't support loading flat files yet.

Change-Id: If745d78712ca8108b5dcc21591201bc2d3f70b86
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14964
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-21 00:10:14 +02:00
Antonello Dettori fda691ef53 cbfstool: Extract payload in ELF
Implement function that automatically converts a SELF payload,
extracted from the CBFS, into an ELF file.

The code has been tested on the following payloads:
Working: GRUB, FILO, SeaBIOS, nvramcui, coreinfo and tint
Currently not working: none

Change-Id: I51599e65419bfa4ada8fe24b119acb20c9936227
Signed-off-by: Antonello Dettori <dettori.an@gmail.com>
Reviewed-on: https://review.coreboot.org/15139
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-17 20:44:28 +02:00
Antonello Dettori 3bded7db7e elfwriter: Fix multi-phdrs ELFs parsing
Allow to write multiple phdrs, one for each non-consecutive section
of the ELF.
Previously it only worked for ELFs contaning a single
program header.

Change-Id: If6f95e999373a0cab4414b811e8ced4c93c67c30
Signed-off-by: Antonello Dettori <dev@dettori.io>
Reviewed-on: https://review.coreboot.org/15215
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-17 20:04:27 +02:00
Furquan Shaikh e51c20bf2c ifwitool: Calculate checksum for subpart_dir
Checksum is calculated by using 2s complement method. 8-bit sum of the
entire subpart directory from first byte of header to last byte of last
partition directory entry.

BUG=chrome-os-partner:53508

Change-Id: I991d79dfdb5331ab732bf0d71cf8223d63426fa8
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15200
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-16 19:38:36 +02:00
Rolf Evers-Fischer eb8b7d6ef4 ifwitool: Fix calculation of dst_size
Change-Id: I07523252eacffb323e2bb54c306f5e9ac83e4cbd
Signed-off-by: Rolf Evers-Fischer <embedded24@evers-fischer.de>
Reviewed-on: https://review.coreboot.org/15162
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-15 17:37:17 +02:00
Furquan Shaikh e7f35cd292 ifwitool: Do not calculate checksum for subpart_dir
1. The checksum method that was documented is not correct. So, no use
filling in a value based on wrong calculations. This can be added back
once updated information is available.
2. Checksum does not seem to affect the booting up of SoC. So, fill in 0
for now.

Change-Id: I0e49ac8e0e04abb6d7c9be70323612bdef309975
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15145
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-12 12:45:25 +02:00
Furquan Shaikh fe42b11cdf ifwitool: Correct pack order and header order
Update pack and header order and mark the entries as mandatory and
recommended w.r.t. ordering (mandatory = essential for booting,
recommended = okay to change, but this config is tested and known to work).

Change-Id: Ia089bdaa0703de830bb9553130caf91a3665d2c4
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15144
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-12 12:44:23 +02:00
Chris Ching 5343b1fc27 autoport: Add prompt for enabling unsafe inteltool glx option
Change-Id: Ib674ab7ca8b6464de553a86536b1762fda98d94e
Signed-off-by: Chris Ching <chingcodes@google.com>
Reviewed-on: https://review.coreboot.org/14901
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-12 12:27:57 +02:00
Lee Leahy c9bf8bfabf util/checklist: Add bootblock support
Scan the boot block when building it with C_ENVIRONMENT_BOOTBLOCK
selected.

TEST=Build and run with Galileo Gen2

Change-Id: I922f761c31e95efde0975d8572c47084b91b2879
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15130
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-09 23:10:40 +02:00
Stefan Tauner 37fcd58ba6 inteltool: handle unsafe dumping of graphics registers
The current implementation from Vladimir simply dumps 1 MB of memory
contents starting at the base address of the second PCI device (which
most likely is the VGA controller on Intel systems). This locks up a
number of different systems, e.g. my Ibex Peak-based T410s.

This patch documents the issue and stops dumping the graphics registers
for the -a/--all parameter.

Change-Id: I581bdc63db60afaf4792bc11fbeed73aab57f63a
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/14627
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2016-06-08 22:35:57 +02:00
Antonello Dettori 75c37058b3 cbfstool: Allow to easily build the individual tools
Adds a label for each tool included in the cbfstool package
in order to build them more easily through Make.

Change-Id: Id1e5164240cd12d22cba18d7cc4571fbadad38af
Signed-off-by: Antonello Dettori <dettori.an@gmail.com>
Reviewed-on: https://review.coreboot.org/15075
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-08 18:47:49 +02:00
Omar Pakker a03609b496 intelmetool: Add the X99 ISA Bridge device id
This adds the ISA bridge device id for the Intel C160/X99 series
chipset to the intelmetool.

Change-Id: I2e7db0fe1692985ebb167b9a44ab412a45a9f3bd
Signed-off-by: Omar Pakker <omarpakker+coreboot@gmail.com>
Reviewed-on: https://review.coreboot.org/15053
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-04 23:41:22 +02:00
Lee Leahy fc3741f379 Add Board Checklist Support
Build the <board>_checklist.html file which contains a checklist table
for each stage of coreboot.  This processing builds a set of implemented
(done) routines which are marked green in the table.  The remaining
required routines (work-to-do) are marked red in the table and the
optional routines are marked yellow in the table.  The table heading
for each stage contains a completion percentage in terms of count of
routines (done .vs. required).

Add some Kconfig values:
*  CREATE_BOARD_CHECKLIST - When selected creates the checklist file
*  MAKE_CHECKLIST_PUBLIC - Copies the checklist file into the
   Documenation directory
*  CHECKLIST_DATA_FILE_LOCATION - Location of the checklist data files:
   *  <stage>_complete.dat - Lists all of the weak routines
   *  <stage>_optional.dat - Lists weak routines which may be optionally
      implemented

TEST=Build with Galileo Gen2.

Change-Id: Ie056f8bb6d45ff7f3bc6390b5630b5063f54c527
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15011
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-03 17:29:13 +02:00
Furquan Shaikh 55d2e5398b ifwitool: Fix syntax issues with ifwitool
Change-Id: Ie7a12a39116ee08f5e24c81c97695201169a63f7
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15022
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-01 21:16:45 +02:00
Furquan Shaikh 233f1b6a38 ifwitool: Add new tool for managing IFWI images
- Supports following operations:
 1. add raw/dir sub-partition
 2. extract raw/dir sub-partition
 3. print info
 4. delete raw sub-partition
 5. replace raw/dir sub-partition

Change-Id: I683a0ab13cc50eb60eecca34db4a8ffefc8dccbd
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14896
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-30 23:51:42 +02:00
Furquan Shaikh 161d2334e8 util/cbfstool: Include commonlib/helpers.h in common.h
This avoids re-declaring common macros like ARRAY_SIZE, MIN, MAX and
ALIGN. Also removes the issues around including both files in any
tool.

Also, fix comparison error in various files by replacing int with
size_t.

Change-Id: I06c763e5dd1bec97e8335499468bbdb016eb28e5
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14978
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-28 08:48:45 +02:00
Furquan Shaikh 1ac194e14a cbfstool: Move cbfs_file_get_header to fit.c
Since fit.c is the only caller of this function move it out of common.c
and into fit.c.

Change-Id: I64cc31a6d89ee425c5b07745ea5ca9437e2f3fcf
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14949
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-26 23:51:08 +02:00
Roberto Muñoz Gómez 15a53c6329 superiotool: Add support for chip NCT6102D / NCT6106D
Add support for chip NCT6102D / NCT6106D in superiotool

Change-Id: I689ff8e796f43a5aac144e9898df750407588b1f
Signed-off-by: Roberto Muñoz Gómez <munoz.roberto@gmail.com>
Reviewed-on: https://review.coreboot.org/14206
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
2016-05-26 01:05:25 +02:00
Aaron Durbin 493ec92eb3 util/cbfstool: allow option to honor FSP modules' linked address
If '-b' isn't passed when adding an FSP file type to CBFS allow
the currently linked address to be used. i.e. don't relocate the
FSP module and just add it to CBFS.

Change-Id: I61fefd962ca9cf8aff7a4ca2bea52341ab41d67b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14839
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-18 03:19:12 +02:00
Jonathan Neuschäfer 0e962eeb93 board_status: Abort early if the coreboot image doesn't exist
Change-Id: I274c990e69634ebcb9dd77470cbf1515281de312
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14683
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-18 00:17:18 +02:00
Duncan Laurie 4650f5baff sconfig: Add a new generic device type
Add support for a basic generic device in the devicetree to bind to a
device that does not have a specific bus, but may need to be described
in tables for the operating system.  For instance some chips may have
various GPIO connections that need described but do not fall under any
other device.

In order to support this export the basic 'scan_static_bus()' that can
be used in a device_operations->scan_bus() method to scan for the generic
devices.

It has been possible to get a semi-generic device by using a fake PNP
device, but that isn't really appropriate for many devices.

Also Re-generate the shipped files for sconfig.  Use flex 2.6.0 to avoid
everything being rewritten.  Clean up the local paths that leak into the
generated configs.

Change-Id: If45a5b18825bdb2cf1e4ba4297ee426cbd1678e3
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14789
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
2016-05-16 19:49:59 +02:00
Duncan Laurie b7ce5fe311 sconfig: Add 10bit addressing mode to i2c device type
Use the second token for an i2c device entry in devicetree.cb to
indicate if it should use 10-bit addressing or 7-bit.  The default if
not provided is to use 7-bit addressing, but it can be changed to
10-bit addressing with the ".1" suffix.  For example:

chip drivers/i2c/generic
  device i2c 3a.1 on end
end

Change-Id: I1d81a7e154fbc040def4d99ad07966fac242a472
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14788
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-16 19:49:46 +02:00
Duncan Laurie b1fb0152bf sconfig: Allow strings in devicetree.cb
Currently you cannot assign a string to a register in devicetree because
the quotes are removed when parsing and the literal is assigned directly.

Add a parse option for two double-quotation marks to indicate a string
and return a quoted literal that can be assigned to a register with a
'const char *' type.

Example:

chip drivers/i2c/generic
  register "hid" = ""INT343B""
  register "uid" = "1"
  device i2c 15 on end
end

Change-Id: I621cde1f7547494a8035fbbab771f29522da1687
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14787
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-16 19:49:37 +02:00
David Hendricks b2aa5283e6 board_status: Add longopt equivalents for older options
Long options can be useful when writing examples and documentation
as they are more expressive and obvious to the reader.

Change-Id: I39496765ba1f15ccc2ffe1ad730f0f95702f82b8
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://review.coreboot.org/14736
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
2016-05-16 19:19:54 +02:00
Jonathan Neuschäfer 4aef682819 board_status: Add an option to set the SSH port
If the option is not provided, ssh uses the default port for the host,
which is usually 22, but may be overridden in the user's SSH
configuration.

Change-Id: I303e9aeae16bd73a96c5e6d54f8e39482613db28
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14522
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2016-05-13 17:30:58 +02:00
Jonathan Neuschäfer 478c889847 board_status: Use explicit branch name in "git push"
In some configurations, "git push <remote>" (without a branch name)
refuses to do anything.

Change-Id: I23a401b39dd851e9723676586c7f29afa111b49d
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14539
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2016-05-13 17:29:35 +02:00
Stefan Tauner 572f074971 inteltool: update documentation
- manpage
 - usage message
 - new warning message if -S is used on an unsupported chipset

Change-Id: I1acaa5f4232b65244ec00fd22ec7460d9cc387f1
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/14624
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2016-05-13 16:58:56 +02:00
Furquan Shaikh b0c2fe0554 cbfstool/fsp: Rename fsp1_1_relocate
FSP 2.0 uses the same relocate logic as FSP 1.1. Thus, rename
fsp1_1_relocate to more generic fsp_component_relocate that can be
used by cbfstool to relocate either FSP 1.1 or FSP 2.0
components. Allow FSP1.1 driver to still call fsp1_1_relocate which
acts as a wrapper for fsp_component_relocate.

Change-Id: I14a6efde4d86a340663422aff5ee82175362d1b0
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14749
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2016-05-11 18:38:28 +02:00
Furquan Shaikh 61c1a05c07 util/cbfstool: Allow xip/non-xip relocation for FSP component
Currently, convert_fsp assumes that the component is always XIP. This
is no longer true with FSP 2.0 and Apollolake platform. Thus, add the
option -y|--xip for FSP which will allow the caller to mention whether
the FSP component being added is XIP or not. Add this option to
Makefiles of current FSP drivers (fsp1_0 and fsp1_1).

Change-Id: I1e41d0902bb32afaf116bb457dd9265a5bcd8779
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14748
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-05-11 18:38:13 +02:00
Pratik Prajapati de62e0f079 util/mma: changing BOOT_STUB to COREBOOT region and few more things
(1) Added following new function.

cbfs_locate_file_in_region - to locate (and mmap) a file in a flash
region
  This function is used to look for MMA blobs in "COREBOOT" cbfs region

(2) mma_setup_test.sh would write to "COREBOOT" region.

(3) changes in mma_automated_test.sh. Few MMA tests need system to
be COLD rebooted before test can start. mma_automated_test.sh would
do COLD reboot after each test, and so i would sync the filesystem
before doing COLD reboot.

BRANCH=none
BUG=chrome-os-partner:43731
TEST=Build and Boot kunimitsu (FAB4). Able to locate MMA files in CBFS
Not tested on Glados.

Change-Id: I8338a46d8591d16183e51917782f052fa78c4167
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 1e418dfffd8a7fe590f9db771d2f0b01a44afbb4
Original-Change-Id: I402f84f5c46720710704dfd32b9319c73c412e47
Original-Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/331682
Original-Commit-Ready: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com>
Original-Tested-by: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/14125
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-05-10 22:59:36 +02:00
Pratik Prajapati 0175fb1b4f util/mma: Add tools to support (semi) automation test of mma
mma_automated_test.sh takes a config file (/usr/local/mma/tests) as
input and executes all tests mentioned in the config file.

format of the config file is one or more lines mentioned below.

	<MMA test name> <MMA test param> <#count>

e.g. consider following config file.

	Margin1D.efi Margin1DRxVrefConfig.bin 4
	RMT.efi RMTConfig.bin 1
	MarginMapper.efi ScoreTxVref-TxDqDelayConfigCh1.bin 2
	Margin2D.efi Margin2D_Cmd_Ch0_D1_R0_Config.bin 3

This will execute Margin1D.efi MMA test 4 times with
Margin1DRxVrefConfig.bin param and results will be stored
in DUT under /usr/local/mma/results_<date-time-stamp>
with Margin1D_Margin1DRxVrefConfig_1.bin to
Margin1D_Margin1DRxVrefConfig_4.bin name.  Subsequently all tests
will be executed and results will be stored.

/etc/init/mma.conf invokes mma_automated_test.sh when DUT
starts. And if valid test config is preset at /usr/local/mma/tests,
mma_automated_test.sh will continue executing the tests.  Each time
DUT will be rebooted and next test in sequence will be executed.

Overall follow these steps to start MMA.
(1) create /usr/local/mma/tests file with the syntax mentioned above.
(2) either reboot the DUT (mma.conf will be called at each boot time,
which would run the mma_automated_test.sh) or execute "start mma"
command (to save a reboot cycle.)
(3) all test results can be found under
/usr/local/mma/results_<date-time-stamp> where <date-time-stamp> is
YY_MM_DD_HH_mm format (YEAR_MONTH_DAY_HOUR_MINUTE) when you started
the mma tests.

BRANCH=none
BUG=chrome-os-partner:43731
TEST=Build and Boot kunimitsu (FAB3). MMA automation tests executes
and results get saved.

Change-Id: I6805fdb95b7ff919f9c8e967b748e4893a3f9889
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 68c0a531ba3fc335b92b17002e75412195b778c4
Original-Change-Id: I92db7ca47e1e3e581c3fbb413f11e2c3e6d19b6b
Original-Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com>
Original-Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/313180
Original-Commit-Ready: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com>
Original-Tested-by: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/12928
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-05-10 22:59:15 +02:00
Varadarajan Narayanan 2dfbd93ed6 util: ipq40xx: Scripts to combine SBL and Coreboot ELFs
The IPQ40xx Primary Boot Loader (PBL, i.e. Boot-ROM) expects an
ELF in the boot medium to load and boot. These scripts combine
the Secondary Boot Loader (SBL) and Coreboot ELF to an image as
expected by the PBL.

BUG=chrome-os-partner:49249
TEST=Able to boot and reach depthcharge
BRANCH=none

Change-Id: I5d02b7f1f58bb23d81a3e19fb9b78f3a999b89f3
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 819c7f2a810ca2880718ba14f2451f06eef4d98b
Original-Change-Id: I017207b2d4108de150853f421aa7bcfd0e12e9a4
Original-Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/340181
Original-Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Original-Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://review.coreboot.org/14680
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-05-09 09:36:27 +02:00
Stefan Reinauer 2e78aa5a78 util/sconfig: Fix warnings
and re-generate _shipped files

Change-Id: I7a18824d64d3f6212e8566695376bf97e2196ee2
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14733
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-05-08 21:37:36 +02:00
David Hendricks 292be87205 board_status: Allow for parsing longopts
This converts the argument parsing to allow us to add longopts
using GNU getopt(1).

Shortopts should be reserved for general parameters. Longopts can be
used to tweak specific behaviors. For example, we might wish to add
options to set SSH port, timeout, and authentication parameters
with "--ssh-port", "--ssh-timeout", "--ssh-identity", etc.

Change-Id: Idee5579079dbbb7296ad98f5d6025b01aab55452
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://review.coreboot.org/14523
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
2016-05-07 03:15:12 +02:00
Aaron Durbin ab00d779ed util/cbfstool: fix x86 execute-in-place semantics for all fmd regions
A previous patch [1] to make top-aligned addresses work within per
fmap regions caused a significant regression in the semantics of
adding programs that need to be execute-in-place (XIP) on x86
systems. Correct the regression by providing new function,
convert_to_from_absolute_top_aligned(), which top aligns against
the entire boot media.

[1] 9731119b cbfstool: make top-aligned address work per-region

Change-Id: I3b685abadcfc76dab8846eec21e9114a23577578
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14608
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-06 16:49:01 +02:00
Stefan Reinauer 3dc5d079fe buildgcc: Update Python to 3.5.1
Change-Id: I57f935b94ab0db2e9ff9434fb496d470bb4ec987
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14463
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2016-05-04 20:40:57 +02:00
Stefan Reinauer 498f3d0cd5 buildgcc: Update gdb and expat
Update gdb to 7.11 and expat to 2.1.1
riscv64-elf is still broken.

Change-Id: Id7605f4274fcb15f9c3e366f5c492328f70f7956
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14461
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
2016-05-04 20:21:29 +02:00
Iru Cai ae8e3a0bbb crossgcc: Update toolchain
New tools:
* mpfr 3.1.4
* binutils 2.26
* gcc 5.3.0
* llvm/clang 3.8.0

Patch changes:
* binutils-2.25_fix-aarch64.patch: fixed in 2.26
* binutils-2.25_host-clang.patch: the positions of header file
  includes have been adjusted
* binutils-2.25_no-bfd-doc.patch: update to 2.26
* binutils-2.25_riscv.patch: update from riscv-gnu-toolchain
* gcc-5.2.0_elf_biarch.patch: update to 5.3.0
* gcc-5.2.0_gnat.patch: update to 5.3.0
* gcc-5.2.0_libgcc.patch: update to 5.3.0
* gcc-5.2.0_nds32.patch: update to 5.3.0
* gcc-5.2.0_riscv.patch: update from riscv-gnu-toolchain
* cfe-3.7.1.src_frontend.patch: update to 3.8.0

In the latest code of riscv-gnu-toolchain project, the patch for
{binutils,gcc}/config.sub has been removed, and the target is renamed
as riscv32 and riscv64. The `riscv' to `riscv64' change in xcompile is
in another commit.

Test results:
All GCC and LLVM/clang toolchain build successfully.

x86,arm: qemu boots
power8: firmware fails to boot
aarch64,mips: not tested
riscv: firmware fails to build with new binutils
clang: firmware fails to boot

Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Change-Id: I42ce89c29263d768d161c28199994f17d0389633
Reviewed-on: https://review.coreboot.org/14227
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-05-04 20:21:11 +02:00
Joseph Pillow d3fccfbc41 crosfirmware: Make script more silent
Remove debug output and parted messages.

Change-Id: I6416a88b5fdb4c92741439e9edb5f753f885cbe3
Signed-off-by: Joseph Pillow <joseph.a.pillow@gmail.com>
Reviewed-on: https://review.coreboot.org/14460
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-04 18:54:59 +02:00
Nico Huber 5f72f960df buildgcc: Always set HOSTCFLAGS
Always set HOSTCFLAGS to the flags GMP was built with, defaulting to
"-Os" if it isn't built yet. Previously, if GMP was already built or
not even in the list of packages to be built, this was silently skipped
and other packages were built with empty HOSTCFLAGS.

Change-Id: I29b2ea75283410a6cea60dc1c92b87573aebfb34
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/13550
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-05-04 13:39:14 +02:00
Stefan Reinauer d9d2102bec buildgcc: Use smaller xz archives
The xz archives are slightly smaller than the bz2 archives for gmp
and mpfr, so use them instead to speed up the download.

Change-Id: I3729455cdbc46e5a0cff119ecca97b0e00c3d402
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14462
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-04 07:20:49 +02:00
Stefan Reinauer a344b68936 buildgcc: Drop --target from python and expat
Both packages are not using the target architecture. Drop it,
and remove them from package_uses_targetarch

Change-Id: I58efde4cb7cc39e7e3c31527eb7682e318928100
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14464
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-04 07:20:17 +02:00
Patrick Georgi 919be612b8 fmaptool: Export some fmap knowledge to the build environment
By exporting base and offset of CBFS-formatted fmap regions, the code
can use these when it's not prudent to do a runtime lookup.

Change-Id: I20523b5cea68880af4cb1fcea4b37bb8ac2a23db
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/14571
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-03 11:42:45 +02:00
Stefan Tauner 98ab22711d xcompile: test if gcc is really available
Just because an 'as' with a certain prefix is available does not guarantee
that a 'gcc' with the same prefix is available as well.

Without a check detect_compiler_runtime() would try to execute an
unavailable binary and print something like this:
.../xcompile: line 218: arm-linux-gnueabi-gcc: command not found

Change-Id: Icbadfeb2860152f7cf7696a9122521d0d881f3aa
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/14563
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-05-03 04:16:24 +02:00
Jonathan Neuschäfer 2d67d12570 board_status/towiki: Link to CGit instead of Gitweb
Gitweb isn't online anymore, so fix a few broken links.

Change-Id: I7fdfcb60f83a718c9a5b6c7f7ef4df9206451d95
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14559
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-05-03 04:13:35 +02:00
Jonathan Neuschäfer 2a8adac7f5 romcc.1: Point bug reporters to the coreboot ML / bug tracker
Change-Id: Ic0866a5183c64070ef35b21ba00586bc65dfcde8
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14538
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-05-01 16:29:09 +02:00
Timothy Pearson c410b18337 board_status/to-wiki: Fix background color of very recent test results
Test results under 16 days old display with an incorrect background color
due to the leading zero not being preset in the associated HTML color code.

Add the leading zero where needed to generate a valid HTML color code.

Change-Id: I0dfe29ec1afc409a4908073922ac31a4091f0f1f
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: https://review.coreboot.org/14514
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-26 20:50:07 +02:00
Timothy Pearson 7501b6c285 board_status/to-wiki: Indicate age of test results by background color
A major issue with the board-status Wiki page is that it shows all
test results equally regardless of age.  As a test result ages it
becomes more likely that the board no longer works peroperly under
coreboot due to code churn.

Visually indicate board-test status "at a glance" by smoothly fading
the background color of the test result from green to yellow as the
test result ages.  This patch sets the full yellow transition to 255
days after test for programming convenience, however the number of
days required to fully "stale" a test result could be modified
relatively easily.

Change-Id: I5a076a6cc17d53fda8e4681e38074fc1f46c0e12
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: https://review.coreboot.org/14457
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
Tested-by: build bot (Jenkins)
2016-04-25 17:17:31 +02:00
Huimin Zhang 2fb2483d44 Reject duplicate results in board-status.
This is in response to issue #28: board-status should reject duplicate 
uploads. 

Change-Id: Iff99be154b35e8c0f9f05f9470d1c2dcff8510b8
Signed-off-by: Huimin Zhang <thehobn@gmail.com>
Reviewed-on: https://review.coreboot.org/14187
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-24 04:19:13 +02:00
Stefan Reinauer 477a0d69e5 fmaptool: Make sure strings are not destroyed on hdestroy()
On Mac OS X hdestroy seems to overwrite node->name. Hence
duplicate the string before stuffing it into the hash search
table.

Change-Id: Ieac2025f5c960cdb8d509dde7e92ba0dd32644b0
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14443
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-22 20:41:34 +02:00
Alexander Couzens ebef00faf6 lint/checkpatch.pl: escape \{ in perl regex to fix warnings
Fix warnings:
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/\#\s*define.*do\s{ <-- HERE / at util/lint/checkpatch.pl line 3261.
marked by <-- HERE in m/\(.*\){ <-- HERE / at util/lint/checkpatch.pl line 3750.
marked by <-- HERE in m/do{ <-- HERE / at util/lint/checkpatch.pl line 3751.
marked by <-- HERE in m/^\({ <-- HERE / at util/lint/checkpatch.pl line 4194.

Change-Id: If0c1f07a16df9e6cd1c1393a31af8b8ea6a66b01
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/14310
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-04-22 17:24:17 +02:00
Martin Roth f790672f2d util/lint: Find unsigned variables with no length specified
The coding guidelines say that all objects should have fully
qualified types (unsigned int instead of unsigned).

This script finds violations of that rule.

Steps for the filter:
1) Find all lines in the coreboot tree that have the word 'unsigned'
followed by a space.
2) Exclude directories that aren't in the include list or
are specifically excluded.
3) Exclude files that aren't specifically included.
4) Filter out legimitate uses 'unsigned int' or 'unsigned long' for
example.
5) Filter out lines that begin with '/*' or '*'

Change-Id: I46213c6a168e6aafa29a50af814bf7e0fcd32eb6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14269
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-04-21 23:13:09 +02:00
Martin Roth 3a6374c454 lint: Add check for amd & apple mainboard license headers
Change-Id: Idda4b7179e3e7b3f5b70be810b428b0651c1cd67
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14427
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-21 23:07:31 +02:00
Stefan Reinauer e0383d2ce8 xcompile: support being called from payloads/external/.../.../
Change-Id: Icc1361fdd3a8369c4b442ce5b8807c549519c93a
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14387
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-21 07:34:33 +02:00
Martin Roth a53958098e crossgcc/Makefile.inc: Update jenkins-build-toolchain
Because the builders have the coreboot cross-compilers in their path,
the XGCCPATH variable needs to be set after building the new toolchain
before it will be used.

- Add $DEST/bin to $PATH if $DEST is set, add the default location
for toolchain builds otherwise.  Because the jenkins build image puts
the tools in the path, we ca
- Add KEEP_SOURCES option to help speed up compilation (Slightly).
- Log .xcompile for verification that the right toolchain was used.
- Verify that test-toolchain passes.

Change-Id: I7c270dab94be7e8f801d527169767018a24986e4
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14231
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-20 00:24:47 +02:00
Stefan Reinauer 86ddd732bd kbuild: Allow drivers to fit src/drivers/[X]/[Y]/ scheme
Reorder drivers to fit src/drivers/[X]/[Y]/ scheme to make
them pluggable.

Also, fix up the following driver subdirectories by switching
to the src/drivers/[X]/[Y]/ scheme as these are hard requirements
for the main change:

* drivers/intel
* drivers/pc80
* drivers/dec

Change-Id: I455d3089a317181d5b99bf658df759ec728a5f6b
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14047
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-19 18:34:18 +02:00
Stefan Reinauer 88e83e580d crossgcc: Move temp file handling into cleanup function
Move code to handle leaving temp files around into cleanup.

Change-Id: Ief346d7973f693ec06c8bef6492cf1330858d9e1
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14346
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-04-19 01:38:06 +02:00
Stefan Reinauer 7844912f37 crossgcc: Fix out of bounds array access for nds32le
Patch from Segher Boessenkool <segher@kernel.crashing.org>

Change-Id: Ia91e0d6e50399da38afd8cdc0b92c82e4efa0a08
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14380
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-18 21:42:00 +02:00
Stefan Reinauer b194a43397 More compatible use of mktemp
This is taken from FILO and slightly enhanced.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Change-Id: Ieadd9db3f1013ec1cd9f5a1dc44e17587617f1d1
Original-Change-Id: I961a7ddcd39657c9463806d7b82757eff0a4ac57
Original-Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Original-Reviewed-on: http://review.coreboot.org/190
Reviewed-on: https://review.coreboot.org/14386
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-18 15:59:22 +02:00
Derek Waldner 3b42119237 util/superiotool: Add initial support for Exar XR28V384.
Datasheet
https://www.exar.com/content/document.ashx?id=21368

Add support for Exar chip used on a custom board
that was designed to connect to the Olive Hill Plus
development platform. The register dump was verified
on the Olive Hill Plus platform.

Change-Id: Ibd3e13eefb706bd99b6e5b38634f6855b39848ab
Signed-off-by: Derek Waldner <derek.waldner.os@gmail.com>
Reviewed-on: https://review.coreboot.org/14367
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-16 02:00:38 +02:00
Stefan Reinauer 88352d7365 crossgcc: Add version number to script name
Store both the version number and git hash in the file name
when copying the buildgcc script to the destination directory.

Also, fix the quoting in the lines touched anyways, and move the
script to $TARGETDIR/share/

Change-Id: Ib37dc2be57ee7f0ae18a0b954f537f8b4c2db9d0
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14347
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-15 22:38:20 +02:00
Paul Menzel 534c5e1133 util/xcompile/xcompile: Remove -Wno-unused-but-set-variable from CFLAGS
Do not disable warnings about unused but set variables to further
improve the code quality.

Change-Id: I25fa29ac42c9d09596d03f11fb01f31635a62a11
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/3981
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
2016-04-14 19:15:21 +02:00
Jonathan Neuschäfer 0a20c08d0f romcc: Remove old test infrastructure, rework Makefile
Changes in visible behaviour:
 - The default make target doesn't run the tests anymore
 - All generated files are stored under util/romcc/build/
   (or $BUILD_DIR)

Change-Id: If003240742eb1902a6e9b337cdee299d7d66ee06
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14341
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-14 19:13:07 +02:00
Martin Roth cd9aec6fb0 util/lint: Update lint-stable-000-license-headers
Add all currently clean directories.

Change-Id: Ibfb6432b485adb7fdc930f57ea0af4ff35921d37
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14332
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-14 17:46:48 +02:00
Martin Roth 84129b8c68 util/lint: update lint-000-license-headers
- Add some additional filters for files that do not require
license headers.
- Add an alternative wording for the BSD license that is used
in several files.
- Add string for dummy files
- Stop checking if there are no files left.
- Remove 'local' keyword which is not posix compliant.

Change-Id: I2ed1b0572b5fbe84ea86173b7ec2106454399547
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14324
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-13 17:37:53 +02:00
Jonathan Neuschäfer e69d6c2e7b romcc: Rewrite the test system
Differences:
 - The test logic is now only implemented in one place (pending the
   deletion of the old parts), whereas it previously was implemented
   both as make rules and as a pair of shell scripts.
 - Tests don't need to be registered anymore. Just adding a new file
   with the correct name is enough to have it tested.
 - The code is hopefully more readable and maintainable.
 - The new test script supports colors (if the standard output is a
   terminal and --nocolor was not passed on the command line).

Things to do in follow-up patches:
 - Remove the old test code
 - Test or remove fail_test*.c, hello_world*.c and raminit_test*.c
 - Fix regressions that have built up over the years, while making sure
   not to introduce new ones
 - Makefile integration
 - Jenkins integration

There are tests in the makefile that specify -fno-always-inline, but
this option doesn't exist anymore, so I didn't port them over.

Change-Id: Idd6b89368c1e36555cb880c37bbe07035c938cd7
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14291
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins)
2016-04-13 17:37:28 +02:00
Jonathan Neuschäfer 3cfbc4a608 romcc: Use UNIX line endings in linux tests
This makes it easier to check the output against a reference output.

Change-Id: I9c7ae538b708399a5cadd18e498618d7480d240f
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14276
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-13 17:37:03 +02:00
Jonathan Neuschäfer 9551cf4709 romcc: Increase base address in linux ld script
Newer versions of Linux implement a sysctl variable called vm.mmap_min_addr
that controls the minimum address a virtual memory mapping may have[1]. It is
usually set to 64KiB.

Map the start of the segment specified in util/romcc/tests/ldscript.ld to
128KiB, just to be sure.

[1]: https://www.kernel.org/doc/Documentation/sysctl/vm.txt

Change-Id: I72a5c65ca5e7d3a77d6ec897ae3287e3ea05cc2f
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14277
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-13 17:36:39 +02:00
Damien Zammit 711a478c05 intelmetool: Fix detection logic of no MEI device
Previously, on systems that are supposed to have ME but
are librebooted, there was no message printed to tell the user
that no MEI was detected.  Fixed this bug.

Change-Id: I59681c194ae5e76533dd777374e26d1aea727337
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/14334
Tested-by: build bot (Jenkins)
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-04-13 17:20:36 +02:00
Martin Roth e03305358f lint/lint-stable-004-style-labels: Update script
- Look at entire tree instead of just the current commit.  This was
causing the test to overlook some issues that were already in the tree.
- If git is on the system, and the code is in a git repo, use the
'git ls-files' command to find the files to examine.  If those
conditions aren't met, fall back to using the find command.
- Wrap the command so it's easier to read.

Change-Id: I3dce219a29ffb1ae56a31318b995e3ba8ea43e70
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14194
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-13 02:11:28 +02:00
Martin Roth 444ece2a38 crossgcc: skip TARGETARCH for tools that don't use it
Many of the tools and libraries don't use a target architecture, but
they were still getting put in one. This change separates out the
builds that need the target architecture from the ones that don't,
and sets the build directory accordingly.

This will help keep from rebuilding the libraries when building all
of the tools if you keep the temporary files around (-t option).

Change-Id: Id6c17719332f2244657f103f5f07ca7812d51af1
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14229
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-12 06:33:25 +02:00
Paul Menzel 7fbe6ae900 util/nvramtool/cli/nvramtool.c: Add newline to error message
"CMOS parameter touchpad not found" string needs '\n' termination.

Change-Id: Ied431dbc9f94d82e1f4716cfb89ea3d6cf513703
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/6553
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2016-04-11 16:26:58 +02:00
Aaron Durbin b2229dc199 util/crossgcc/buildgcc: correct clang test
On certain versions of /bin/sh the following sequence
causes problems.
'$CC --version | grep clang &>/dev/null && ...'

The above is a bashish for 2>&1 >/dev/null. However, buildgcc
is interpeted by /bin/sh which doesn't necessarily mean bash.
On dash it's effectively forking grep off into the background
and always evaluating an empty statement to /dev/null while
unconditionally running whatever follows the &&.

Change-Id: Ie3a2ebb12226434d50a7b2a7e254c8b80ae4c46b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14281
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-11 16:10:43 +02:00
Martin Roth ef5a238cb9 lint/check_lint_tests: Add script that will break all stable tests
Add a script to help us verify that our lint tests are working.

This isn't finished, because it should test all of the failure modes.
Some of the tests, 008-kconfig in particular have a lot of ways
that they can fail.

Currently the Kconfig test is triggered by removing the board
name file in test 006.  This removes the only place the config
option for that board name is located.

Change-Id: If01c6daf1c99d097a19995b4befae90a3b5db2d6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14198
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-10 18:13:01 +02:00
Stefan Reinauer ba3a69f9c7 crossgcc: Add workaround for libgcc's GNU sed dependency
libgcc fails to compile on a number of platforms when a
non-GNU sed is used.

This patch has been verified by building the MIPS reference
toolchain on OS X.

Change-Id: Ia1c18ea4359de7707ac2e2640f1b8f107c47cd8c
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14275
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
2016-04-09 03:41:15 +02:00
Aaron Durbin 0ac4e5a7f8 util/crossgcc/buildgcc: quote parameters that may have spaces
On certain versions of /bin/sh assigning variables with spaces
unquoted leads to failures. Therefore, quote variables that
are known to be passed in that have spaces.

Change-Id: I007c56c3bfb8183bb4b16cf0591f6aa508fd105d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14280
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-04-09 01:02:21 +02:00