Commit Graph

2675 Commits

Author SHA1 Message Date
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