Commit graph

2808 commits

Author SHA1 Message Date
Arthur Heymans
cc393085fb UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I9ff16e060aca66e3cb11c8315a6843ccecd1d3c2
Reviewed-on: https://chromium-review.googlesource.com/425277
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:01:06 -08:00
Arthur Heymans
dff619441a UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I7691bce619089b15805114047bcb1fd121a5722b
Reviewed-on: https://chromium-review.googlesource.com/425276
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:01:04 -08:00
Arthur Heymans
8e5d02d266 UPSTREAM: superiotool: Add support for HWM registers on W83627EHG
Based on datasheet: "W83627EHF/EF W83627EHG/EG WINBOND LPC I/O,
Revision : 1.0"

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Ia2e5ab8bc454a34a89fe2cf06bfba55261109785
Reviewed-on: https://chromium-review.googlesource.com/425273
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:00:56 -08:00
Arthur Heymans
a27b4f24cc UPSTREAM: superiotool: Add support for HWM registers on W83627DHG
Based on datasheet: "W83627DHG WINBOND LPC I/O, Version: 1.4"

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Id20dff7539d926ef6f68265efbfc7420539d9bca
Reviewed-on: https://chromium-review.googlesource.com/425272
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:00:54 -08:00
Patrick Georgi
04f16d5a2e UPSTREAM: util/cbfstool: Don't print region information on stderr by default
It's usually not too interesting, so hide it behind -v.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Icffb5ea4d70300ab06dfa0c9134d265433260368
Reviewed-on: https://chromium-review.googlesource.com/425268
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:00:44 -08:00
Paul Menzel
82651df8e2 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I4ede26127efcbd5668b978e6880a0535607e373d
Reviewed-on: https://chromium-review.googlesource.com/425262
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:00:30 -08:00
Nico Huber
e4adc5c60e UPSTREAM: buildgcc: Indicate CXXFLAGS for binutils
CXXFLAGS seems to be used a lot and have to be specified independently
from CFLAGS.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Iff4c76e54a46e908299b532fd848165a3dc04d43
Reviewed-on: https://chromium-review.googlesource.com/425261
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:00:28 -08:00
Nico Huber
f5a0ee7a42 UPSTREAM: buildgcc: Fix string comparison operator
BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I8ff8d51507dcf12cd554c8b4713074a99e47c11e
Reviewed-on: https://chromium-review.googlesource.com/425260
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:00:25 -08:00
Nico Huber
5e43c61461 UPSTREAM: 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.

BUG=None
BRANCH=None

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 Neuschfer <j.neuschaefer@gmx.net>

Change-Id: I5f3185af9c8d599379a628e18724b217b88be974
Reviewed-on: https://chromium-review.googlesource.com/425258
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-01-05 11:00:21 -08:00
Patrick Georgi
fcb772c2f2 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I818c233d797d82fa819243c4626dd9c4b7de3ac6
Reviewed-on: https://chromium-review.googlesource.com/422219
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-19 09:54:37 -08:00
Patrick Georgi
9597841a3b UPSTREAM: 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>
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421284
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-19 09:54:20 -08:00
Patrick Georgi
bd3c7e71f8 UPSTREAM: util/romcc: remove self-assignment
Change-Id: I0f78b55b28011cdefc90665bca2a7ea17647e955
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1129127
Original-Reviewed-on: https://review.coreboot.org/17885
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421219
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:42:09 -08:00
Patrick Georgi
7cd937c15c UPSTREAM: util/romcc: Move access after NULL-check
Change-Id: I7f9c38fd6e75b32fe1ed8a60c7054f4dd1fcd5c0
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1129104
Original-Reviewed-on: https://review.coreboot.org/17884
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421218
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:42:06 -08:00
Patrick Georgi
7c655b3316 UPSTREAM: util/romcc: Fix resource leak
Change-Id: I0d260254bab714ec939fc199b3a133b0fc05b10d
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1129112
Original-Reviewed-on: https://review.coreboot.org/17883
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421217
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:42:04 -08:00
Patrick Georgi
02ba75a7c6 UPSTREAM: util/broadcom: Add two more NULL checks
Change-Id: I088730fd87dd39fa2c36a06c5770fad05a5808b0
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1323511, #1323512
Original-Reviewed-on: https://review.coreboot.org/17882
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421216
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:42:01 -08:00
Patrick Georgi
07f561c2cb UPSTREAM: util/broadcom: Check return value of stat()
Change-Id: Ib53408e8b186c07aa8e42c67131d39c4add05983
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1323515
Original-Reviewed-on: https://review.coreboot.org/17881
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421215
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:41:59 -08:00
Patrick Georgi
33b86a139c UPSTREAM: util/broadcom: Initialize variable
It's later tested for NULL, but never initialized to make that test work
reliably.

Change-Id: Iadee1af224507a6dd39956306f3eafa687895176
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1323515
Original-Reviewed-on: https://review.coreboot.org/17880
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421214
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:41:57 -08:00
Patrick Georgi
066676b4da UPSTREAM: util/broadcom: Close file after use
Change-Id: Ieea7ac7fbc618cd12f843f1606f9ebab37cae67e
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1323508
Original-Reviewed-on: https://review.coreboot.org/17879
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421213
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:41:54 -08:00
Patrick Georgi
bcefbf84ce UPSTREAM: util/broadcom: Terminate string
filebuffer is treated like a string, so it should be zero-terminated
like a string.

Change-Id: I078aa39906394be64023424731fe0c7ae2019899
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1323473
Original-Reviewed-on: https://review.coreboot.org/17878
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421212
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:41:52 -08:00
Patrick Georgi
c35186c9aa UPSTREAM: util/broadcom: close file on error
Change-Id: I5193c6a9f08398b881c971c7175654ba5775b34a
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Found-by: Coverity Scan #1323509
Original-Reviewed-on: https://review.coreboot.org/17876
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/421211
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-12-16 15:41:49 -08:00
Nico Huber
972b500cd8 UPSTREAM: util/ifdfake: Add number of regions
To make the generated descriptor compatible with latest libflashrom.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I005159dd24e72da9cc43119103c96c5dd5b90a55
Reviewed-on: https://chromium-review.googlesource.com/421170
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-12-16 07:51:49 -08:00
Patrick Georgi
4e42a37159 UPSTREAM: util/cbfstool: Handle error condition more carefully
BUG=None
BRANCH=None
TEST=None

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)

Change-Id: I72a7776d530d1cf0b8fa39e558990df3dc7f7805
Reviewed-on: https://chromium-review.googlesource.com/420522
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-12-16 07:51:28 -08:00
Patrick Georgi
f1a1abee6d UPSTREAM: util/cbfstool: check that buffer_create worked
We might not care much about this buffer, but we really use it later
on...

BUG=None
BRANCH=None
TEST=None

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)

Change-Id: Ia16270f836d05d8b454e77de7b5babeb6bb05d6d
Reviewed-on: https://chromium-review.googlesource.com/420521
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-12-16 07:51:26 -08:00
Patrick Georgi
90b1aa14f8 UPSTREAM: util/cbfstool: Fix memory leak
BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I66cb1c88155ef58610bacfb899e0132e4143c7ac
Reviewed-on: https://chromium-review.googlesource.com/420520
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-12-16 07:51:24 -08:00
Patrick Georgi
06b470b633 UPSTREAM: util/cbfstool: Add NULL-ptr check
BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I8b5caf5423135fe683a24db6700b895a2685cb98
Reviewed-on: https://chromium-review.googlesource.com/420519
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-12-16 07:51:21 -08:00
Martin Roth
dc2140664d UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I4966a3bb2541b452eeb4ca73ac3cd727f8525636
Reviewed-on: https://chromium-review.googlesource.com/420841
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-12-16 04:51:05 -08:00
Patrick Georgi
794f8b2290 UPSTREAM: util/cbfstool: require -i argument for cbfstool add-int
We never specified what value add-int should write by default.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I240be4842fc374690c4a718fc4d8f0a03d63003c
Reviewed-on: https://chromium-review.googlesource.com/419637
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:57 -08:00
Martin Roth
2a7983e545 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I28711a77962e16f6fc89789400363edd0fdd0931
Reviewed-on: https://chromium-review.googlesource.com/419632
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:45 -08:00
Martin Roth
b24ce01809 UPSTREAM: util/lint: add check for auto-included headers
Since we've removed them from the tree, add a check to keep them out.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I2995da765fee8796a297963d54a1c34f56376efe
Reviewed-on: https://chromium-review.googlesource.com/419631
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:43 -08:00
Martin Roth
40de871bbd UPSTREAM: 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
BRANCH=None

TEST=copy a disabled kconfig option to the end and set it to y.
See notice text instead of warning.

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>

Change-Id: I9f575b2275233f638e42676263348c807e6515bd
Reviewed-on: https://chromium-review.googlesource.com/419630
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:40 -08:00
Martin Roth
f8e28dd9e4 UPSTREAM: 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

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I3a75b0615747d32f593948f53eab076f303271bf
Reviewed-on: https://chromium-review.googlesource.com/419629
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:38 -08:00
Martin Roth
97a6776ac0 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Ie8948361f1c51e89a99bdb13df8c554747cd521d
Reviewed-on: https://chromium-review.googlesource.com/419626
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:31 -08:00
Martin Roth
7f66f08b3e UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I1d6fd8f51765d0d8b29be8af1e8105e06dd44cc8
Reviewed-on: https://chromium-review.googlesource.com/419625
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:28 -08:00
Martin Roth
f006346951 UPSTREAM: 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

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Id5bd4db8d7e3705cbbb93895a46a3608cd1b09e2
Reviewed-on: https://chromium-review.googlesource.com/419624
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:26 -08:00
Martin Roth
f9e482254e UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I9c77e122435ba87ce3a4aee76b5022f7265f9ef2
Reviewed-on: https://chromium-review.googlesource.com/419623
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-13 17:49:24 -08:00
Patrick Georgi
baf378c5f2 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: I3752f731f8e6592b1a390ab565aa56e6b7de6765
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/417319
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2016-12-09 10:49:44 -08:00
Martin Roth
01ff9e24f6 UPSTREAM: 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()

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I1a276d3e507b178f7dcd9dc125fa9c59f1ab47bd
Reviewed-on: https://chromium-review.googlesource.com/418445
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-09 03:30:13 -08:00
Martin Roth
90ee62e947 UPSTREAM: util/kconfig/conf.c: Fix newline in error printf
For some reason the \n in the defconfig save error was not escaped.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I6a76b258f461a194fe17aae2b4fa04326b46d8d6
Reviewed-on: https://chromium-review.googlesource.com/418444
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-09 03:30:11 -08:00
Martin Roth
7550586ec8 UPSTREAM: util/lint: Add check to verify saved configs are miniconfigs
BUG=None
BRANCH=None
TEST=None

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)

Change-Id: Ifc5ec645dd27663c1b1fde9ff16d48534606a554
Reviewed-on: https://chromium-review.googlesource.com/418443
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-09 03:30:09 -08:00
Kyösti Mälkki
19710f8322 UPSTREAM: autoport: Fix romstage generator
Prototype changed here:
   e258b9a intel sandy/ivy: Improve DIMM replacement detection

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Kysti Mlkki <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>

Change-Id: Id79238db2e497b9163f3bd1b1d5d4bc11fe4da9e
Reviewed-on: https://chromium-review.googlesource.com/418366
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-08 22:46:38 -08:00
Nico Huber
d3434e7964 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Ie7189e8bcadeee56cf5c2172e8c0ae7cd534685a
Reviewed-on: https://chromium-review.googlesource.com/417951
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-08 12:31:34 -08:00
Nico Huber
effdc84b1f UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Ia927036ccd725550f1191890515578bc80c74f80
Reviewed-on: https://chromium-review.googlesource.com/417950
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-08 12:31:31 -08:00
Furquan Shaikh
2199d415a7 UPSTREAM: cbfstool: Fix off-by-one error in checking hash_type
BUG=None
BRANCH=None
TEST=None

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>

Change-Id: Iaf208705d0cd450288af721d53053b2d3407a336
Reviewed-on: https://chromium-review.googlesource.com/416261
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-04 01:20:11 -08:00
Martin Roth
4df1b157a7 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I4cf9d95a437626cb52e3032a5e6cba83320a334b
Reviewed-on: https://chromium-review.googlesource.com/415631
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-01 00:50:49 -08:00
Naresh G Solanki
5f8c322745 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>
Reviewed-on: https://chromium-review.googlesource.com/415628
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-12-01 00:50:42 -08:00
Martin Roth
ba5a128340 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I1134c08b417a731859e6b25fe38aecf01a85927b
Reviewed-on: https://chromium-review.googlesource.com/415098
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-30 02:53:58 -08:00
Martin Roth
caeb840847 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I0ff56d0a0916338a8b94f5210b8e0b3be5194f41
Reviewed-on: https://chromium-review.googlesource.com/415088
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-30 02:53:35 -08:00
Martin Roth
88f22b049d UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I6f28dc7dee040b8061fa5644066f3613367b6d84
Reviewed-on: https://chromium-review.googlesource.com/415087
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-30 02:53:33 -08:00
Patrick Georgi
010c769d40 UPSTREAM: 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.

BUG=None
BRANCH=None
TEST=None

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>

Change-Id: I4f24c93a25b7d567d3ce14a0415d20fd0778c9c8
Reviewed-on: https://chromium-review.googlesource.com/415083
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-30 02:53:23 -08:00
Marshall Dawson
4fc81cadfd UPSTREAM: 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.

BUG=None
BRANCH=None

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>

Change-Id: Ib4b50aaf9817ac94f46c28925081540676226d84
Reviewed-on: https://chromium-review.googlesource.com/414561
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-29 17:38:14 -08:00