Commit Graph

534 Commits

Author SHA1 Message Date
Patrick Rudolph 9e877ec60d util/supermicro: Add and use new tool smcbiosinfo
The BMC and tools interacting with it depend on metadata placed inside
the ROM in order the flash the BIOS.

Add a new tool smcbiosinfo, integrate it into the build system, and
generate a 128byte metadata file called smcbiosinfo.bin on build.

You need to provide the BoardID for every SMC mainboard through a new
Kconfig symbol: SUPERMICRO_BOARDID

Some fields are unknown, but it's sufficient to flash it using SMC
vendor tools.

Tested on Supermicro X11SSH:
* Flashing using the WebUI works
* Flashing using SMCIPMITool works

No further validation is done on the firmware.

Change-Id: Id608c2ce78614b45a2fd0b26d97d666f02223998
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35484
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-01-06 10:56:09 +00:00
Elyes HAOUAS c2092569d5 Makefile: Remove romcc
Change-Id: I2fe7fa8b23da3b909adc2b8bce59304acfb5b807
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37788
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
2019-12-27 08:59:59 +00:00
Kyösti Mälkki 75396f67aa Makefiles: Remove -D__PRE_RAM__
All cases of testing for __PRE_RAM__ have been converted
to equivalent ENV_xxx definitions from <rules.h>.

Change-Id: Ib6cd598f17109cc1072818cebe4791f7410c3428
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37075
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-11-22 06:27:21 +00:00
Julius Werner 63c444a69b Remove imgtec/pistachio SoC
After removing urara no board still uses this SoC, and there are no
plans to add any in the future (I'm not sure if the chip really exists
tbh...).

Change-Id: Ic4628fdfacc9fb19b6210394d96431fdb5f8e8f1
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36491
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-20 10:10:44 +00:00
Patrick Georgi 4100c2a6e3 build system: Add various compiler flags that enable warnings on UB
Some types of Undefined Behavior can be determined statically at compile
time and gcc now has a set of flags that make it emit warnings in that
case instead of doing the __builtin_trap() / optimize / UD2-opcode dance
that silently breaks the resulting binary.

BUG=chromium:958270
BRANCH=none
TEST=abuild passes (probably not)

Change-Id: I3aa5ca00c9838cc7517160069310a1ef85372027
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32814
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-11-18 19:19:24 +00:00
Wim Vervoorn 556cc26337 src: Ignore Redundant offset remarks in ASL code
IASL reports unnecessary/redundant use of offset operator. These
messages are only masking usefull messages.
Add -vw 2158 so this message isn't reported.

BUG=N/A
TEST=build

Change-Id: Ie8507d3b3cb6f2e75cb87cd3e4bcc4280df27f77
Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36857
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-18 16:21:57 +00:00
Julius Werner cefe89ee79 lib/fmap: Add optional pre-RAM cache
This patch adds an optional pre-RAM cache for the FMAP which most
platforms should be able to use, complementing the recently added
post-RAM FMAP cache in CBMEM. vboot systems currently read the FMAP
about half a dozen times from flash in verstage, which will all be
coalesced into a single read with this patch. It will also help
future vboot improvements since when FMAP reads become "free" vboot
doesn't need to keep track of so much information separately.

In order to make sure we have a single, well-defined point where the new
cache is first initialized, eliminate the build-time hardcoding of the
CBFS section offsets, so that all CBFS accesses explicitly read the
FMAP.

Add FMAP_CACHEs to all platforms that can afford it (other than the
RISC-V things where I have no idea how they work), trying to take the
space from things that look like they were oversized anyway (pre-RAM
consoles and CBFS caches).

Change-Id: I2820436776ef620bdc4481b5cd4b6957764248ea
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36657
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Joel Kitching <kitching@google.com>
2019-11-14 03:30:11 +00:00
Patrick Rudolph b1ef725f39 cpu/qemu-x86: Add x86_64 bootblock support
Add support for x86_64 bootblock on qemu.

Introduce a new approach to long mode support. The previous patch set
generated page tables at runtime and placed them in heap. The new
approach places the page tables in memory mapped ROM.

Introduce a new tool called pgtblgen that creates x86 long mode compatible
page tables and writes those to a file. The file is included into the CBFS
and placed at a predefined offset.

Add assembly code to load the page tables, based on a Kconfig symbol and
enter long in bootblock.

The code can be easily ported to real hardware bootblock.

Tested on qemu q35.

Change-Id: Iec92c6cea464c97c18a0811e2e91bc22133ace42
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35680
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2019-11-04 11:58:58 +00:00
Marshall Dawson 20ce4007eb Makefile, Kconfig: Add AMD dependency for amd_blobs repo
Add a Kconfig option for indicating agreement to use the contents of
amd_blobs.  Users should only download the repo after implicitely
agreeing to AMD's License text.  No formal documented agreement
is required.

Update Makfile.inc, similar to other submodules, to initialize and
checkout the submodule once the Kconfig option is selected.

Change-Id: I4ae807659db16756453dc3db2c51848291c681b8
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36416
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-10-31 12:31:12 +00:00
Marshall Dawson 376357c107 Makefile.inc: Consolidate submodule comments
Reduce duplicated comments explaining that submodules' settings in
.gitmodules are update=none, and that --checkout is required.  This
prepares for another submodule, and makes adding a third set of
comments unnecessary.

Change-Id: I7721333a61122284ed9975ecd2adc3271a879728
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36440
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-10-30 21:42:53 +00:00
Arthur Heymans 5e5fd41fcf Makefile.inc: Add a class 'all' to link files in all stage except SMM
Change-Id: I955dd2dc22cb3cfc4fdf1198cfd32f56475f97c9
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33198
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-10-30 08:26:54 +00:00
Patrick Rudolph d9c799c529 build: Mark bootblock files on x86 as IBB
* Add cbfsoption --ibb to mark files as IBB
* Will be used by "Legacy FIT TXT" boot

Change-Id: I83313f035e7fb7e1eb484b323862522e28cb73d4
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31497
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
2019-10-18 15:38:19 +00:00
Nico Huber 17e9bcb9b8 util/sconfig: Issue header for exposed PCI and PNP names
Let `sconfig` output a C header file with the symbol names that we
generate since 5e2a2cd5e7 (util/sconfig: Expose usable PCI and PNP
device names).

We add another command line argument for the path to the header
file. As the file is similar in nature to our `config.h` we simply
put it in $(obj)/ too.

Change-Id: I8f87288c82f2844b61eba6534797a42b978b47bb
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35488
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-10-05 02:43:23 +00:00
Martin Roth ad84062b0d Makefile: Create the build directory before bootblock.bin
This was causing a failure when building platforms with no bootblock
when building with make -jXX

Change-Id: Ic4cd4fe8ac82bd1e9ce114dbd53763538d125af3
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35531
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2019-09-24 10:36:24 +00:00
Raul E Rangel 4007d7f8c7 Makefile: Pass .xcompile into genbuild_h
I'm moving the .xcompile file into the $(obj) directory so we can leave
the source pristine. We need to pass the location of .xcompile into
genbuild_h.sh.

BUG=b:112267918
TEST=Ran genbuild_h with and without an .xcompile and verified it was
passed.

Change-Id: I8b3a75b478fad92a0b09246f0a00b0580f8c4aef
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34240
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2019-08-28 18:29:15 +00:00
Patrick Georgi 3807ecdc54 build system: add kconfig/toada to tools list
Without this, we're lacking a serialization point in abuild when doing
parallel builds. This manifests in parallel attempts to write the toada
binary, which fails.

Change-Id: Id6ebbb3750284225670608e4927d80c4eea96afb
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35107
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-08-27 05:40:22 +00:00
Jacob Garber 9cd53c56ed Makefile.inc, payloads: Enable -Wvla
Variable length arrays are dangerous, so let's make sure they don't
sneak back into coreboot or any of the payloads.

Change-Id: Idf2488cf0efab51c9569a3789ae953368b61880c
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33846
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-08-20 20:57:01 +00:00
Kyösti Mälkki a3cb61a55d Makefile: Support HAVE_BOOTBLOCK=n case
With HAVE_BOOTBLOCK=n build of bootblock-class is skipped.

Inserts an empty 64-byte bootblock-region to coreboot.rom file,
cbfstool will fill in the CBFS master header relative location
at the end.

Change-Id: Iaee9200f72f31175aca597865e3c74fc68bec8a6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34477
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2019-08-07 21:22:12 +00:00
Jacob Garber 6e66b4e820 Makefile.inc: Enable -Wimplicit-fallthrough
Change-Id: Ic81ed9eb2ed5255a221082326b81c375456a6499
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34300
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-07-19 09:58:05 +00:00
Marshall Dawson 30cf155168 util/cbfstool: Add AMD BIOS compression tool for PSP
Add a utility to generate a compressed BIOS image for AMD Family 17h.

If the input is an elf file, the utility extracts the program portion
for compression.  Otherwise the file is compressed as-is.

In modern AMD systems, the PSP brings up DRAM then uncompresses the
BIOS image into memory prior to x86 beginning execution.  The PSP
supports a zlib engine, and interprets the first 256 bytes as a
header, where offset 0x14 containing the uncompressed size.  For
further details, see AMD Platform Security Processor BIOS Architecture
Design Guide for AMD Family 17h Processors (NDA only, #55758).

BUG=b:127766506
TEST=Use with WIP Picasso

Change-Id: Id1c54e0a6dae9e4a0362c6635fe8b8aa48a369d8
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33401
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2019-07-03 21:28:43 +00:00
Patrick Rudolph 5e3b92a924 Makefile: Use ifittool to update FIT
Depend on ifittool and use it to update FIT instead cbfstool FIT code.

Move the TOPSWAP / microcode handling out of cbfstool and implement it
in the Makefile.

The new FIT looks like the old one and has been tested on Broadwell-DE.

The TOPSWAP / microcode code path needs test on real hardware.

Change-Id: I687469d62557f81e9d88398cfc93182164fdac95
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31495
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
2019-06-24 09:42:52 +00:00
Nico Huber 6d7564cdfe Move -Wlogical-op into xcompile
Clang doesn't know `-Wlogical-op`, so let's move it into xcompile where
we can easily distinguish between the two. However, this requires us to
split out `GCC_ADAFLAGS*` from `GCC_CFLAGS*`.

Change-Id: I6a50de0bc5372f61337f237383d32645ba86b0fd
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33579
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-06-21 08:44:49 +00:00
Arthur Heymans 917420f7e8 Makefile.inc: Update 3rdparty/intel-microcode on USE_BLOBS
Change-Id: I0caeff3ff5613a594a79441e849440ebdc9a9b87
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33553
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-06-18 10:43:10 +00:00
Elyes HAOUAS 8c03542f92 Makefile.inc: Add -Wlogical-op warning option
Change-Id: Ie0491817a3a69c9f8e6f0f0d3cb755c642819df9
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33385
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-06-15 17:21:58 +00:00
Subrata Banik b5962a934a Rampayload: Able to build coreboot without ramstage
This patch removes all possible dependencies in order to build platform
with CONFIG_RAMPAYLOAD enable(without ramstage).

A. Create coreboot separate stage kconfigs

This patch creates seperate stage configs as below
1. HAVE_BOOTBLOCK
2. HAVE_VERSTAGE
3. HAVE_ROMSTAGE
4. HAVE_POSTCAR
5. HAVE_RAMSTAGE

B. Also ensures below kconfigs are aligned with correct stage configs

1. COMPRESS_RAMSTAGE and RELOCATABLE_RAMSTAGE are now enable if
CONFIG_HAVE_RAMSTAGE is selected.
2. COMPRESS_BOOTBLOCK will enable if CONFIG_HAVE_BOOTBLOCK is set
3. COMPRESS_PRERAM_STAGES will enable if CONFIG_HAVE_VERSTAGE
|| CONFIG_HAVE_ROMSTAGE is selected.

C. Also fix compilation issue with !CONFIG_HAVE_RAMSTAGE

On x86 platform:
Case 1: ramstage do exist: CONFIG_HAVE_RAMSTAGE=1
>> rmodules_$(ARCH-ramstage-y) will evaluate as rmodules_x86_32

Case 2: ramstage doesn't exist: CONFIG_HAVE_RAMSTAGE=0
>> rmodules_$(ARCH-ramstage-y) will evaluate as rmodules_

This patch fixes Case 2 usecase where platform doesn't select
CONFIG_HAVE_RAMSTAGE.

Also add option to create sipi_vector.manual based on $(TARGET_STAGE)
variable.

$(TARGET_STAGE)=ramstage if user selects CONFIG_HAVE_RAMSTAGE
$(TARGET_STAGE)=postcar if user selects CONFIG_RAMPAYLOAD

Change-Id: I0f7e4174619016c5a54c28bedd52699df417a5b7
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33142
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2019-06-11 15:49:25 +00:00
Nico Huber 342d3180d7 Makefile.inc: Extend version string for timeless builds
With the version string "TIMELESS", binaries are slightly smaller than
for a regular build. This may lead to false positive build tests if the
space is limited (e.g. bootblock). So let's make the string a little
longer.

Change-Id: I3bbf6f71d5bcd74728a3fe39734312690901d0ec
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32986
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-05-29 20:09:24 +00:00
Julius Werner 795fda0336 Reland "Makefile.inc: Enable -Wtype-limits""
This reverts commit 99e836c843.
This relands commit c4ab50cdde.

The issues with -Wtype-limits in the vboot submodule have been resolved
now, so we can enable this flag again.

Change-Id: I32e8cc88e69072e7ee66cf443b578a9a8ea0ebe2
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32749
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Joel Kitching <kitching@google.com>
2019-05-13 10:25:45 +00:00
Patrick Georgi 99e836c843 Revert "Makefile.inc: Enable -Wtype-limits"
This reverts commit c4ab50cdde.

Reason for revert:
vboot recently was changed so that -Wtype-limits fails, and that
was just brought upstream. Since vboot internals are more likely
to be used elsewhere while -Wtype-limits is less critical, revert
this until vboot is resolved, then bring -Wtype-limits back again.

Change-Id: I9cce10462b9e57189513fa49e11fd27ebe35ba51
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32670
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-05-07 15:53:54 +00:00
Julius Werner c4ab50cdde Makefile.inc: Enable -Wtype-limits
This patch enables -Wtype-limits for the whole repository, which
disallows checking for a condition that must be always true or always
false based on type width (e.g. checking whether an unsigned variable is
negative or whether a 32-bit integer is larger than 4G). This helps
avoid easy to make and hard to find (because they often only affect
error paths) mistakes like

 size_t size = fmap_read_area(...);
 if (size < 0)
   die("If only the compiler could've told me to use ssize_t instead");

Change-Id: I19edabfd092d09dad720e3fc47b44838163bfe25
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32536
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-05-06 10:32:24 +00:00
Matt DeVillier 8c99a4859e Makefile.inc: Update fsp submodule for all FSP platforms
Rather than selectively update the fsp submodule based on
FSP version or platform selection, update it when building
for any FSP-enabled platform, so all have latest version available.

Change-Id: If07d55828a1863623e04a4ecdd1514c3cb6d9c11
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32526
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-05-03 20:13:25 +00:00
Nico Huber 91ead42f4b Makefile: Check for errors in ACPI decompilation, too
We only grep'ed for "ACPI Warning" resulting in an actual more severe
"ACPI Error" being ignored.

Change-Id: I9cec8a388f5558b1ffc383cc2fc69405252cbb37
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32469
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-04-29 12:15:15 +00:00
Kyösti Mälkki 1368244d48 Makefile: Reduce scope of oprom include paths
Change-Id: Ibaa5428df1832d3f18946d456fb0b6d2fff65c32
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31694
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-03-05 16:18:38 +00:00
Nico Huber 2f7d0543ff Makefile.inc: Keep .asl intermediates
We used .aml as the file extension for preprocessed ASL code. That
file gets overwritten with the compilation results, fix that.

Change-Id: I11a03dfbcebb0fd762da7b27862a7bdb9a581b92
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/31523
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-02-21 16:05:14 +00:00
Arthur Heymans 12431d6eef Makefile.inc: Create a default SMMSTORE region
Change-Id: I7b7b75050e0139ea9a0a4f2ad3c0d69a482fb38b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/30421
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-02-06 18:15:59 +00:00
Arthur Heymans d37c2c2318 Makefile.inc: Make sure the BIOS region is 64K aligned
If a non aligned CONFIG_CBFS_SIZE is used the region RW_MRC_CACHE and
CONSOLE could end up non aligned. Currently this is only possible if
the user messes with CONFIG_CBFS_SIZE in menuconfig, but better be
safe than sorry.

Change-Id: Ieb7e3c7112bd4b3f9733c36af21b1d59b3836811
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/30420
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-02-06 18:15:35 +00:00
Arthur Heymans 0b75679cbb Makefile.inc: Optimize generating the default x86 fmap
Put the FMAP FMAP region right above the coreboot CBFS region.
The other regions like RW_MRC_CACHE and CONSOLE often have alignment
requirements so it makes sense to put those on top. This also
simplifies the code the generate the default fmap a little.

Change-Id: I24fa6c89ecf85fb9002c0357f14aa970ee51b1df
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/30419
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-02-06 18:15:27 +00:00
Nico Huber b567977075 Hook up Kconfig Ada spec file
We generate a $(obj)/cb-config.ads once and copy it per stage that uses
it to $(obj)/<stage>/cb-config.ads (to simplify the gnat-bind step). The
Ada package is called `CB.Config`. As there was no `CB` package yet, add
that too.

Change-Id: I963a6517ef4bcf84f2c8e9ae8d24a0d6b971d2b0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/30584
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-02-06 16:20:35 +00:00
Kyösti Mälkki 5c29daa150 buildsystem: Promote rules.h to default include
Does not fix 3rdparty/, *.S or *.ld or yet.

Change-Id: I66b48013dd89540b35ab219d2b64bc13f5f19cda
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/17656
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-01-16 11:51:07 +00:00
Patrick Rudolph e77d6dc852 vendorcode/intel/fsp1_0/broadwell_de: Use FSP from 3rdparty/fsp
Default to FSP binary and headers shiped in 3rdparty/fsp.

* Drop headers and code from vendorcode/intel/fsp1_0/broadwell_de
* Select HAVE_FSP_BIN to build test the platform
* Fetch FSP repo as submodule
* Make FSP_HEADER_PATH known from FSP2.0 useable on FSP1.0
* Introduce FSP_SRC_PATH for FSP source file
* Add sane defaults for FSP_FILE

Tested on wedge100s.

Change-Id: I46f201218d19cf34c43a04f57458f474d8c3340d
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/30742
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Jay Talbott <JayTalbott@sysproconsulting.com>
2019-01-15 07:45:41 +00:00
Nico Huber f5ca922c87 Untangle CBFS microcode updates
The option to specify a binary file name was added later for platforms
that do not provide microcode updates in our blobs repository. Alas,
it wasn't visible what platforms these are. And if you specified a file
for a platform that already had one, they were all included together.

Make it visible which platforms don't provide binaries with the new con-
figs MICROCODE_BLOB_NOT_IN_BLOB_REPO, MICROCODE_BLOB_NOT_HOOKED_UP and
MICROCODE_BLOB_UNDISCLOSED. Based on that we can decide if we want to
include binaries by default or explicitly show that no files are inclu-
ded (default to CPU_MICROCODE_CBFS_NONE).

Also split CPU_MICROCODE_CBFS_GENERATE into the more explicit
CPU_MICROCODE_CBFS_DEFAULT_BINS and CPU_MICROCODE_CBFS_EXTERNAL_BINS.
And clean up the visibility of options: Don't show CBFS related options
on platforms that don't support it and don't show external file options
if the platform uses special rules for multiple files (CPU_MICROCODE_
MULTIPLE_FILES).

Change-Id: Ib403402e240d3531640a62ce93b7a93b4ef6ca5e
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/29934
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-01-10 09:24:02 +00:00
Edward O'Callaghan 4139c15276 util/gitconfig/pre-commit: Use clang-format to sanitise commits
Use the `git-format' tool to sanitise coreboot commits such that
they conform to coreboot's coding style.

This fancy piece of machinary allows one to have LibFormat from
Clang to automatically check your commit conforms to coreboot's
coding style, fix any issues automatically and provides you a
diff you may review and apply at your convenience.

N.B. When the `clang-format' binary is not found we issue a warning
that the test was skipped and carry on as usual. Hence, this is
strictly non-enforcing at this current time. You may use it at your
leisure.

Change-Id: If49017ea82f0707efd47cae5978a286a9af8f3b7
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: https://review.coreboot.org/c/8037
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-01-04 10:37:10 +00:00
Jonathan Neuschäfer 45e6c82e68 Fix typos involving "the the"
Change-Id: I179264ee6681a7ba4488b9f1c6bce1a19b4e1772
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/c/30160
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2018-12-18 13:24:28 +00:00
Jonathan Neuschäfer d2c02420e2 Makefile.inc: Avoid race condition when using 'make -j<N>'
When building coreboot from scratch with 'make -j4', I sometimes see
this error:

    CREATE     build/mainboard/emulation/qemu-riscv/cbfs-file.wblRgZ.out (from /.../coreboot/.config)
    HOSTCC     cbfstool/cbfstool (link)
make[1]: execvp: build/util/kconfig/conf: Permission denied
make[1]: *** [/.../coreboot/util/kconfig/Makefile:92: savedefconfig] Error 127

It happens, I think, because the rule generated by
cbfs-files-processor-defconfig runs 'make savedefconfig', which builds
build/util/kconfig/conf, and something also builds it, at the same time.
Fix this case, by making this rule depend on $(objutil)/kconfig/conf.

The same fix is also precautiously applied to the rule for
$(KCONFIG_AUTOHEADER) in Makefile.

Change-Id: Ie93eda567f88ca08c97df7e70cdff5b07442747d
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/c/29984
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2018-12-11 16:19:15 +00:00
Philipp Deppenwiese aea00f496b broadcom: Remove SoC and board support
The reason for this code cleanup is the legacy
Google Purin board which isn't available anymore
and AFAIK never made it into the stores.

* Remove broadcom cygnus SoC support
* Remove /util/broadcom tool
* Remove Google Purin mainboard
* Remove MAINTAINERS entries

Change-Id: I148dd7eb0192d396cb69bc26c4062f88a764771a
Signed-off-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/29905
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-11-30 10:26:37 +00:00
Nico Huber 5a5f6a76ec build system: Fix FSP downloading
Check for PLATFORM_USES_FSP2_0 instead of MAINBOARD_USES_FSP2_0. The
latter is only valid for Skylake where we decide per mainboard if FSP2.0
is used. PLATFORM_USES_FSP2_0 is the one that actually enables the
FSP2.0 integration.

Change-Id: I3f16e5f4454c0bf02d51db5d1c267a921917f377
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/29291
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Lijian Zhao <lijian.zhao@intel.com>
Reviewed-by: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com>
2018-10-27 11:12:09 +00:00
Nico Huber d44221f9c8 Move compiler.h to commonlib
Its spreading copies got out of sync. And as it is not a standard header
but used in commonlib code, it belongs into commonlib. While we are at
it, always include it via GCC's `-include` switch.

Some Windows and BSD quirk handling went into the util copies. We always
guard from redefinitions now to prevent further issues.

Change-Id: I850414e6db1d799dce71ff2dc044e6a000ad2552
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/28927
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-10-08 16:57:27 +00:00
Nico Huber 3e51d53064 Makefile.inc: Fix dependency tracking of fmap{_config.h,.desc}
GNU make is too smart (or too stupid?) for empty recipes. In the case of
empty recipes, GNU make doesn't consider the target as updated even if
its prerequisites are. So if we told make to rebuild `build/romstage/
lib/cbfs.o` for instance, and the FMAP changed, it rerun the fmaptool
recipe (as a prerequisite) but only considered `cbfs.o` to be updated
by chance.

Just not leaving the recipes empty seems to help here. I seeemed to
remember that it wasn't that easy, but it fixes the issue for me...

Change-Id: Ic7ecb88cf7df7f2488defd47ea02255fc10a67e9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/28198
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-09-13 13:58:29 +00:00
Patrick Georgi 5cc9ef414f build system: Add automatic downloading of FSP mirror repo if requested
It only happens if both USE_BLOBS and MAINBOARD_USES_FSP2_0 are enabled.

Change-Id: I46843c61d3ddf398a3c058bb571d285b596bf5c1
Signed-off-by: Patrick Georgi <patrick@georgi.software>
Reviewed-on: https://review.coreboot.org/28304
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-09-02 03:07:59 +00:00
Angel Pons 240eaaad28 Kconfig, Makefile.inc: Remove all traces of ifdfake
Since ifdfake has been deprecated in favor of better alternatives, there
is no need to support it any further. Remove it from the build system.

Change-Id: Id62e95ba72004a1e15453e3eb75f09cb8194feb2
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/28233
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-08-23 18:31:32 +00:00
Nico Huber 5d790e3f52 Makefile.inc: Ensure update of build.h
There were so many pitfalls that I wrote my own version of this even-
tually. This version is inspired by the procedure of Alex Thiessen[1].
Instead of generating a `build.h` on demand, we always generate a tem-
porary version that, if it differs from the current one, is added as
a dependency.

As we use .SECONDEXPANSION on the prerequisites, special care is taken
that we won't generate the file twice. As it would be too late to add
the dependency if we'd run `genbuild_h.sh` inside a recipe, we have
to run it through the `$(shell)` function. But that brings us to the
next issue: The make variables used by `genbuild_h.sh` are not expor-
ted to this shell like they would be in a recipe. So we export them
manually. We could also make these variables explicit parameters of
`genbuild_h.sh` instead.

An alternative to always creating the temporary `build.h` would be
to add a phony target as dependency instead, and finally calling
`genbuild_h.sh` again in case we need an update. But, um, we create
so many files anyway...

[1] https://review.coreboot.org/25685

Change-Id: I311cf610eabae873c70f2985fc7a09acec8061f0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/28197
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2018-08-20 15:56:29 +00:00
Piotr Król bb95731dad payloads/external/SeaBIOS: add support for sercon port
Change-Id: Id2d2ed0fa97f2cef5818a8508bb8ee3ddba73647
Signed-off-by: Piotr Król <piotr.krol@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/26060
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2018-08-06 14:16:17 +00:00
Ronald G. Minnich ff22b6aca6 make: add clang-format prepare-commit-msg hook
To install this hook, run
make install-git-commit-clangfmt

This will install a pre-commit-msg hook that runs clang-format
on all .c and .h files that are staged.

It will add a clang-formatted-by: <git username>
line to the commit message to indicate that clang-format
was run on the files and that further processing of them
is not needed.

Change-Id: I1773f55b5b4677dad8f4bea017b6328fd93df20c
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-on: https://review.coreboot.org/27779
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-08-01 18:03:26 +00:00
Martin Roth 21e09b1c15 Build system: Add fixes for scanbuild
- Exclude build flags that generate warnings when scanbuild is running
- Add the SCANBUILD_ARGS variable to abuild so we can pass in arguments
to scanbuild.
- Set the default scanbuild argument to -k (--keep-going) so that even
if an error occurs it continues with the scan.  This is similar to what
we do with coverity runs.

Change-Id: I82e7c13d7fd7432b43c17a31834ec82fca158a07
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/27595
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-07-24 09:08:55 +00:00
Rizwan Qureshi 5348512451 Kconfig: Add config to insert ucode address in second FIT
This config is used to provide the name of a region where a microcode
is located. The address of this will be added as the first entry in
the FIT of the topswap bootblock.

This adds a capability to associate two microcodes for each
of the two bootblocks, this allows for the CPU to boot with different
microcodes with 2 separate bootblocks.

Change-Id: I4ee41d90bae34862aa68c9b8bd69288de1335585
Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com>
Reviewed-on: https://review.coreboot.org/27151
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2018-07-19 08:07:49 +00:00
Rizwan Qureshi b082670234 Kconfig: Add config for creating a second bootblock
Intel PCH/Southbridges have feature that it is possible
to have the southbridge/PCH look for the bootblock at a 64K or
128K/256K/512K/1MB (in case of newer SoCs) offset instead of
the usual top of flash.
Add configs to create a second bootblock and configure its size.

Change-Id: I4bbd19c35871891b762a0673f840858d972e129e
Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com>
Signed-off-by: Aamir Bohra <aamir.bohra@intel.com>
Reviewed-on: https://review.coreboot.org/22533
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-07-19 08:07:12 +00:00
Nico Huber afc74cab6e Makefile.inc: Rewrite $(files-in-dir)
The `files-in-dir` macro is supposed to return all files (out of a
given set) that reside directly (non-recursive) in a given directory.
While the current solution worked splendidly, we can achieve the same
without recursive macros that look at each parent dir individually.

Beside providing better readability, this also fixes a future make
error, as make doesn't like the variable name ` ` anymore ;)

Change-Id: Iac0eacdf91b8b5098592ad301c1f3fdb632454e9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/27324
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-07-04 08:57:40 +00:00
Paul Menzel 1619a38475 Makefile.inc: Use no-packed-not-aligned only with GCC
Clang doesn't know the warning `packed-not-aligned`, so only add it
when GCC is used.

    error: unknown warning option '-Wno-packed-not-aligned'; did you \
    mean '-Wno-over-aligned'? [-Werror,-Wunknown-warning-option]

Change-Id: I86ee12a12fc24a0b8b92c4a0e665103ee4c4003d
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/26879
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-07-02 16:22:32 +00:00
Furquan Shaikh f241998352 Kconfig: Add new config for OVERRIDE_DEVICETREE
This change adds a new config option OVERRIDE_DEVICETREE that allows
variants to provide an override devicetree file to override the
registers and/or add new devices on top of the ones provided by
baseboard devicetree using CONFIG_DEVICETREE.

BUG=b:80081934

Change-Id: Ica046b7e0d70d0f1e8d94da714d1e62032277916
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/26691
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-06-25 17:40:28 +00:00
Martin Roth 2819a40ed3 Makefile.inc: Skip -fconserve-stack flag if running scan-build
Scan-build refuses to run if the -fconserve-stack flag is added to
cflags.  It fails with the cryptic message "could not find clang line".

Change-Id: Ib1b56ef7d217138a1a195fe993d8e8dd965bd855
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/26878
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-06-07 16:38:08 +00:00
Julius Werner 99f4683adf Introduce bootblock self-decompression
Masked ROMs are the silent killers of boot speed on devices without
memory-mapped SPI flash. They often contain awfully slow SPI drivers
(presumably bit-banged) that take hundreds of milliseconds to load our
bootblock, and every extra kilobyte of bootblock size has a hugely
disproportionate impact on boot speed. The coreboot timestamps can never
show that component, but it impacts our users all the same.

This patch tries to alleviate that issue a bit by allowing us to
compress the bootblock with LZ4, which can cut its size down to nearly
half. Of course, masked ROMs usually don't come with decompression
algorithms built in, so we need to introduce a little decompression stub
that can decompress the rest of the bootblock. This is done by creating
a new "decompressor" stage which runs before the bootblock, but includes
the compressed bootblock code in its data section. It needs to be as
small as possible to get a real benefit from this approach, which means
no device drivers, no console output, no exception handling, etc.
Besides the decompression algorithm itself we only include the timer
driver so that we can measure the boot speed impact of decompression. On
ARM and ARM64 systems, we also need to give SoC code a chance to
initialize the MMU, since running decompression without MMU is
prohibitively slow on these architectures.

This feature is implemented for ARM and ARM64 architectures for now,
although most of it is architecture-independent and it should be
relatively simple to port to other platforms where a masked ROM loads
the bootblock into SRAM. It is also supposed to be a clean starting
point from which later optimizations can hopefully cut down the
decompression stub size (currently ~4K on RK3399) a bit more.

NOTE: Bootblock compression is not for everyone. Possible side effects
include trying to run LZ4 on CPUs that come out of reset extremely
underclocked or enabling this too early in SoC bring-up and getting
frustrated trying to find issues in an undebuggable environment. Ask
your SoC vendor if bootblock compression is right for you.

Change-Id: I0dc1cad9ae7508892e477739e743cd1afb5945e8
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/26340
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-05-22 02:44:14 +00:00
Julius Werner 9123449734 Makefile.inc: Export CCACHE_EXTRAFILES and add __BUILD_DIR__ definition
This patch adds the CCACHE_EXTRAFILES variable to the list of exported
environment variables, which can be useful as a target-specific variable
to make ccache aware of extra dependencies that it cannot figure out on
its own. It also adds a CPPFLAGS parameter to define the __BUILD_DIR__
constant for the preprocessor so that the current output build directory
can be referenced in C code if necessary.

Change-Id: I4fdd08842972cfed8ef5e5a61ebf859c0571bcfb
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/26451
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-05-22 02:39:23 +00:00
Julius Werner 1ca26664e6 Makefile.inc: Add separate bootblock.raw.elf with allocatable BSS
This patch moves the objcopy invocation that changes the bootblock's
section flags to make sure .data and .bss are preserved in the binary
image from the generation of bootblock.raw.bin into a separate
bootblock.raw.elf file. Some SoCs (like SDM845) like to have an ELF
rather than a raw binary as input to their masked ROM wrapper
generation script.

Also move those objcopy flags out into a variable because I'll need them
again in a later patch.

Change-Id: I9557b184df7f753a442c7e0ceb58e81c5e19f2c5
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/26338
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-05-22 02:38:57 +00:00
Patrick Georgi 035ee6a668 Makefile.inc: disable warnings on unaligned struct members
We use packed structs with unaligned members all the time, which is the
entire point of us using the packed attribute.

Change-Id: Ib26b422ba83257d1a7f26134ee20217fad5823cd
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/25996
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2018-05-20 12:11:28 +00:00
Martin Roth 3abdeb0af0 Makefile.inc: Ignore IASL empty resource template warnings
As I mention in the comment, this is valid ASL, which was added as
a warning with the comment "This would appear to be worthless in
real-world ASL code."  While code using empty resource templates
could probably be rewritten, this seems like an arbitrary choice
to generate this as a warning, since it's valid.

This gets rid of warnings such as this one:
dsdt.aml   2975:    Return (ResourceTemplate() {})
Warning  3150 - Empty Resource Template (END_TAG only)

Which is generated by this code in google/rambi/acpi/mainboard.asl:
Method (_CRS)
{
  /* Only return interrupt if I2C1 is PCI mode */
  If (LEqual (\S1EN, 0)) {
    Return (^RBUF)
  }
  /* Return empty resource template otherwise */
  Return (ResourceTemplate() {})
}

Change-Id: I9cfe9069c738a284aa85feada9d58e1aee97e433
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/26352
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-05-18 18:35:46 +00:00
Nico Huber ea83e3e9fe Makefile.inc: Drop spurious `-t` from `cbfstool add-payload`
The `-t` argument was never required for `add-payload` and results in
a warning now because the type was renamed.

TEST=Built with BUILD_TIMELESS=1 and compared binaries with and without
     this patch.

Change-Id: I6ccb70acc6e88a602b90c625040d4f05d8e3630a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/26323
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-05-18 12:16:53 +00:00
Subrata Banik 5f1da55b49 device: Include devicetree in SMM stage
Allow bootblock to get access to the entire static device tree
as other stages can access independently.

TEST=SMM code now can access devicetree.cb variables.

Change-Id: I59537c16f0a459e48d8b1efb5c1b196302f13381
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/23823
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2018-02-22 09:55:19 +00:00
Paul Menzel db9709d67d Makefile.inc: Also print layout at end of build
Currently, at the end of a build `CBFSPRINT` prints the content of all
CBFS regions. This is confusing, as they are identical. To avoid
confusion print the layout beforehand.

> layout [-w] – List mutable (or, with -w, readable) image regions

Change-Id: Ibf03b125ef6dae41c58b8ae867430047778cfff3
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/22143
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-02-15 21:40:31 +00:00
Arthur Heymans 47dd96db97 payloads: Add an option to compress secondary payloads
Both GRUB and SeaBIOS can chainload lzma compressed payloads.
Therefore it is beneficial to compress secondary payloads
like Memtest86+, coreinfo, nvramcui,... for both size reasons and
often also speed reasons since the limiting factor is generally the
IO of the boot device.

Tested with SeaBIOS and memtest86+ master on Thinkpad X220.

Change-Id: Iddfd6fcf4112d255cc7b2b49b99bf5ea4d6f8db4
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/23639
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2018-02-10 23:57:06 +00:00
Alex Thiessen 7bcd6ecea6 util/gitconfig: Use `make` in git hooks
As the code was moved from the Makefile.inc to a separate file in
commit 9ab8ae6a (util/gitconfig: Make gitconfig a bash script),`$(MAKE)`
was replaced by `remake`, introducing dependency on this tool which is
basically a `make` with debugging capabilities. Many developers don't
have `remake` installed, leading to pre-commit hooks being not executed
properly. Apparently this was an unintentional change.

Furthermore, special treatment of `make` tool via the `%MAKE%`
substitution performed during hooks' deployment is still desired. Use
case is calling `remake gitconfig` to set `remake` as the `make` tool in
the hooks. To accomplish this, add a parameter that is passed from the
Makefile.inc to gitconfig.sh.

Change-Id: Ia78e06567b904b342dc9b7778569201fe02e6897
Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com>
Reviewed-on: https://review.coreboot.org/23096
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2018-01-23 05:18:14 +00:00
Alex Thiessen a90e5ebde4 Makefile.inc: Improve git worktree check
`Makefile.inc` checks for `.git` to be present under $(top) to define
the value of $GIT. This check is rather weak and doesn't handle many
edge cases like that of a broken gitfile.

Add a proper `git rev-parse` call to check the condition.

Change-Id: Ifd6da19f13d9f2a9fddb6afd7cb5f16daba2401e
Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com>
Reviewed-on: https://review.coreboot.org/23254
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-22 12:32:00 +00:00
Arthur Heymans 82aa8338c7 drivers/mrc_cache: Always generate an FMAP region
This automatically generates an FMAP region for the MRC_CACHE driver
which is easier to handle than a cbfsfile.

Adds some spaces and more comments to Makefile.inc to improve
readability.

Tested on Thinkpad x200 with some proof of concept patches.

Change-Id: Iaaca36b1123b094ec1bbe5df4fb25660919173ca
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/23150
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-20 16:11:44 +00:00
Denis 'GNUtoo' Carikli 780e931eed util/blobtool: rename to bincfg
The name blobtool is confusing as 'blob' is also used to
describe nonfree software in binary form.

Since this utility deals with binary configurations it
makes more sense to call it bincfg.

Change-Id: I3339274f1c42df4bb4a6b30b9538d91c3c03d7d0
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: https://review.coreboot.org/23239
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-18 13:47:20 +00:00
Antonello Dettori fbcfdaf785 payloads: add support lz4 compression
Add the option to use the lz4 compression method
to compress payloads.
Also sets LZ4 as the default compression method.

Change-Id: Ic712f984f791d268440c8463eaea0d246aa31d99
Signed-off-by: Antonello Dettori <dev@dettori.io>
Reviewed-on: https://review.coreboot.org/15817
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2018-01-15 01:27:48 +00:00
Marc Jones 9ab8ae6a55 util/gitconfig: Make gitconfig a bash script
The gitconfig target has a few bashisms and would fail
silently on systems that use a POSIX standard sh (like Ubuntu dash).

Remove the code from the makefile and put it in a bash script that
is called by the gitconfig target.

Change-Id: I3bc8cf688a3ad211b57c8ca0e6b1e86c82dc6a37
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/22857
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-12-15 23:02:11 +00:00
Julius Werner ec477346bf Kconfig: Remove BOARD_ID_MANUAL option
The BOARD_ID_MANUAL and BOARD_ID_STRING options were introduced for the
Urara board which is now long dead, and have never been used anywhere
else. They were trying to do something that we usually handle with a
separate SKU ID these days, whereas BOARD_ID is supposed to be reserved
for different revisions of the same board/SKU. Get rid of it to make
further refactoring of other options easier.

Also shove some stuff back into the Urara mainboard that should've never
crept into generic headers.

Change-Id: I4e7018066eadb38bced96d8eca2ffd4f0dd17110
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/22694
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-12-06 23:27:03 +00:00
Patrick Georgi db7b8afc91 build system: drop duplicate rule for $(objutil)/blobtool/blobtool
There's already one in util/blobtool/Makefile.inc

BUG=chromium:787042
TEST=no more warning about duplicate rules

Change-Id: I8bc17d3b182369cf5b67bdcf392db7932e5389bf
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/22555
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-11-22 18:25:26 +00:00
Denis 'GNUtoo' Carikli 76e387319b Makefile.inc: Cosmetics: Format blobtool commands similar to other tools
Change-Id: Iddb09d0838da119bfccd5443652ca7a6baa95c7b
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Reviewed-on: https://review.coreboot.org/22126
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-11-07 04:45:14 +00:00
Philipp Deppenwiese fea2429e25 security/vboot: Move vboot2 to security kconfig section
This commit just moves the vboot sources into
the security directory and fixes kconfig/makefile paths.

Fix vboot2 headers

Change-Id: Icd87f95640186f7a625242a3937e1dd13347eb60
Signed-off-by: Philipp Deppenwiese <zaolin@das-labor.org>
Reviewed-on: https://review.coreboot.org/22074
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-10-22 02:14:46 +00:00
Chris Ching 782b9a7b75 Makefile.inc: remove '--global' flag from config check for gitconfig rule
As long as user.name and user.email are set, gitconfig should pass. This
handles if values are only set for the local repo, or if values are
stored in ~/.config/git/config

BUG=none
TEST=make gitconfig

Change-Id: Ie01e7a155f9e6db35d5991e4303aad85fb277a06
Signed-off-by: Chris Ching <chingcodes@google.com>
Reviewed-on: https://review.coreboot.org/22109
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-10-19 20:13:06 +00:00
Nico Huber 5218533ae7 Makefile.inc: Remove -gnatg from ADAFLAGS_common
It was only set by accident. `-gnatg` is a special mode for GNAT
internals and libgnat (we already set it explicitly for the latter).

TEST=Gave libgfxinit a shot on lenovo/t420.

Change-Id: Ie56a95da2dafd014bd6152cb419a2d315e7c78c4
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21365
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-09-23 10:50:45 +00:00
Martin Roth 229e021110 Makefile.inc: Add left shift macro
Add a macro to shift a value to the left by a specified number of bits.

Change-Id: Ib3fb43b620f31fee2a41f00ddf7294edc81a60f6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/21601
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
2017-09-21 17:30:18 +00:00
Nico Huber 7a1fbdb1e6 Makefile: Keep list of exported variables
This can be useful to unexport them later.

Change-Id: I2ce9eff32d817ec190441550116376843abd1c11
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21162
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-09-06 04:36:56 +00:00
Arthur Heymans 1db500c101 Fix build with CLANG, avoid GCC only CFLAGS
Commit 7c8d331fbb "Fine-tune compiler flags" added CFLAGS that are not
existing on CLANG hence breaking building coreboot with clang.

Fixes: https://ticket.coreboot.org/issues/134

Change-Id: Ie0250e285b0c5a9f8ee2eb99401aeca875d2789a
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/21202
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: Damien Zammit <damien@zamaudio.com>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-09-02 15:23:05 +00:00
Stefan Reinauer 7c8d331fbb Fine-tune compiler flags
Per default, GCC enables -fdelete-null-pointer-checks, which is
harmful and hence we should disable it:
  "Assume that programs cannot safely dereference null pointers, and
   that no code or data element resides there."

We want to be careful with our stack usage, hence enable
-fconserve-stack:
  "Attempt to minimize stack usage. The compiler will attempt to use
   less stack space, even if that makes the program slower."

Change-Id: I74eac2b07c986553f79898a2f2e57bbead4223f8
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/20883
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-08-11 15:56:12 +00:00
Martin Roth 6c9c196f1c copy & update test routines from what-jenkins-does
Currently the only testing we had was 'what-jenkins-does' and
'make lint'. While the lint testing is suitable for developers,
the 'what-jenkins-does' target really isn't, as it was designed
specifically for testing on jenkins.

This adds the infrastructure for basic tests that are more suitable
for the developer. Extended tests and improvements will follow.

Add the coreboot-builds directories to .gitignore.

TODO:
- Save/restore .config
- Update test-abuild to use existing COREBOOT_BUILD_DIR variable

Change-Id: I19e1256d79531112ff84e47a307f55791533806f
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20874
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Chris Ching <chingcodes@google.com>
2017-08-11 15:24:56 +00:00
Martin Roth e624e270e6 Make: Move testing into a subdirectory
In preparation for expanding the testing, move the test targets
out of the top level Makefile.inc and into a separate
subdirectory.

Change-Id: Ie252c7555223f9ce76b54e6f7b66d03f3cf60500
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20873
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Chris Ching <chingcodes@google.com>
2017-08-11 15:24:49 +00:00
Nico Huber a81f321924 drivers/pc80/rtc: Build for bootblock and postcar stages too
Fixes builds with BOOTBLOCK_CONSOLE && USE_OPTION_TABLE.

Change-Id: I1c7e9baa60f33c2c3651e2def0335454f7e20451
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20767
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-07-26 19:14:16 +00: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
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
Aaron Durbin 5e88c3b18a device: allow devicetree accesses in postcar stage
Change-Id: Ib6f8ee937c4f3d8e2c0ff3851a819077fa499ccc
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/19334
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2017-04-25 18:15:14 +02:00
Aaron Durbin 42bcd13c75 Makefile.inc: ensure cbfs-files-processor-struct has correct ccopts
The ramstage-c-ccopts variable needs to be double dereferenced
for the cbfs-files-processor-struct handler so all the ccopts
are included since the ramstage-c-ccopts is fully constructed
later by another function. Without this not all the flags
are present on the command line.

Change-Id: I5425b3c1f23d767c61f654dd287584403f85d719
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/19380
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins)
2017-04-25 18:13:09 +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
Martin Roth ee762fa42b Makefile.inc: Fix jenkins build of nvramcui & coreinfo
With COREBOOT_BUILD_DIR set, nvramcui & coreinfo were getting built
in the wrong location, causing those builds to fail.

Also, because they were built in the wrong location, the build failures
were not detected by jenkins which was looking for the junit.xml files
under the payloads directory.

Change-Id: I9d81ebabebe5d8b5f79ae63f8a5f388430e06754
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/19069
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-04-03 04:52:22 +02:00
Julius Werner e91d170d21 Remove libverstage as separate library and source file class
In builds without CONFIG_VBOOT_SEPARATE_VERSTAGE, verstage files are
linked directly into the bootblock or the romstage. However, they're
still compiled with a separate "libverstage" source file class, linked
into an intermediate library and then linked into the final destination
stage.

There is no obvious benefit to doing it this way and it's unclear why it
was chosen in the first place... there are, however, obvious
disadvantages: it can result in code that is used by both libverstage
and the host stage to occur twice in the output binary. It also means
that libverstage files have their separate compiler flags that are not
necessarily aligned with the host stage, which can lead to weird effects
like <rules.h> macros not being set the way you would expect. In fact,
VBOOT_STARTS_IN_ROMSTAGE configurations are currently broken on x86
because their libverstage code that gets compiled into the romstage sets
ENV_VERSTAGE, but CAR migration code expects all ENV_VERSTAGE code to
run pre-migration.

This patch resolves these problems by removing the separate library.
There is no more difference between the 'verstage' and 'libverstage'
classes, and the source files added to them are just treated the same
way a bootblock or romstage source files in configurations where the
verstage is linked into either of these respective stages (allowing for
the normal object code deduplication and causing those files to be
compiled with the same flags as the host stage's files).

Tested this whole series by booting a Kevin, an Elm (both with and
without SEPARATE_VERSTAGE) and a Falco in normal and recovery mode.

Change-Id: I6bb84a9bf1cd54f2e02ca1f665740a9c88d88df4
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/18302
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-03-28 22:18:53 +02:00
Patrick Georgi 78a5f22994 build system: mark sub-make invocations as parallelizable
We rely on gnu make, so we can expect the jobserver to be around in
parallel builds, too. Avoids some make warnings and slightly speeds up
the build if those sub-makes are executed (eg for arm-trusted-firmware
and vboot).

Change-Id: I0e6a77f2813f7453d53e88e0214ad8c1b8689042
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/18263
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-31 18:51:55 +01:00
Arthur Heymans 7218a1e754 Only add etc/ps2-keyboard-spinup when not updating an image
Without this motherboards that requires a non zero timeout for ps2
keyboards on SeaBIOS don't build when CONFIG_UPDATE_IMAGE is set.

An alternative way to achieve this file would be to include a cbfsfile
instead of calling cbfstool. That way the file gets updated/added both
both image update and regular build. A difficulty of that approach is
that it needs to convert a decimal to a binary in little endian
representation, which is not a trivial thing to do in a Makefile.

Change-Id: Icafba8d3e279a2e70e607abba81e3dbebfb55e4b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/18231
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-27 02:09:38 +01:00
Patrick Georgi 0ffef882d8 build system: don't run xcompile or git for %clean/%config targets
It takes a long time for no gain: We don't need to update the
submodules, we don't need to fetch the revision, we don't need to find
the compilers, when all we want to do is to manipulate the .config file
or clean the build directory.

Change-Id: Ie1bd446a0d49a81e3cccdb56fe2c43ffd83b6c98
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18182
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-24 23:22:56 +01:00
Patrick Georgi 847bbb8b1b cbfs-compression-tool: add to "make tools" target
Change-Id: I7bd0a17f9b20e46aee836fef1ff0b39de8670a15
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/18202
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-01-24 18:19:28 +01:00
Paul Menzel acbb70b810 Makefile.inc: Explicitly set GNU11 as C language standard
Different compiler versions use a different C language standard by
default.

GCC 4.9 uses GNU89 by default [1], while GCC 5.x uses GNU11 [2].

The discussion on the mailing list in thread *[RFC] Setting C99 by
default* [3] resulted in the preference of C11, which results in build
errors.

So explicitly set it to GNU11, which is also what the current coreboot
toolchain with GCC 5.3 is using.

[1] https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/C-Dialect-Options.html
[2] https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc/Standards.html
[3] https://www.coreboot.org/pipermail/coreboot/2016-November/082541.html

Change-Id: If1569618f8044925ff72dcf3543480b34d4f90d6
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/17636
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins)
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
2017-01-22 19:26:26 +01:00
Martin Roth 8d49d52ae9 Makefile.inc: Update what-jenkins-does target
- Update the junit.xml target to make it less util specific
- Add builds of coreboot internal payloads: nvramcui and coreinfo

Change-Id: I97fda909065659ab7fa4c8ee00d936d97b255bf7
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17014
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-12-12 17:45:41 +01:00
Matt DeVillier 91480cc64c Makefile.inc: export VARIANT_DIR as top-level variable
export VARIANT_DIR at the top level, rather than doing so multiple
times at the SoC / board level

Change-Id: If825701450c78289cb8cca731d589e12aafced11
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/17451
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-11-18 20:28:37 +01:00
Martin Roth d61b5404dc southbridge/amd: update for amdfwtool size on command line
amdfwtool was getting the ROM size as a #define when it was built.
It has been updated to pass it in as a command line parameter, so
now it can be built just once for abuild as a shared tool.

Update the calls to amdfwtool to pass the ROM size.

All platforms using amdfwtool had the output verified using
a binary compare.

This reverts commit 0529236ed2
(Makefile.inc: Don't share amdfwtool between platforms)

Change-Id: I188b34e08249f2d00bd48957ced750b21f1ec348
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/17327
Tested-by: build bot (Jenkins)
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2016-11-10 00:27:52 +01:00
Nico Huber ef405a2c04 Set up 3rdparty/libgfxinit
`libgfxinit` is a SPARK library for graphics modesetting. It supports
Intel integrated graphics only, strictly speaking, the Core i processor
line.

Change-Id: Idf4b0e5fbf37a5d974075b2e44d1fa16dc428da3
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16949
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-10-29 01:35:03 +02:00
Nico Huber e09f8acdad Set up 3rdparty/libhwbase
`libhwbase` is a SPARK library that contains some basic support for i/o
access, debugging, timers. Just what I put around `libgfxinit`, to make
it build standalone.

Change-Id: I1918680c14696215522e1c5dae072235bb4e71a3
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16948
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-10-29 01:34:45 +02:00
Nico Huber e84e625483 Add option to build Ada debugging code
Ada knows a pragma `Debug` that is used to exclude procedure calls from
a release build. The new option `DEBUG_ADA_CODE` enables those procedure
calls.

Change-Id: Id5298e5819606c3d1cf2a2a1cd4f1d5d1227aa4f
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16943
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-29 01:28:13 +02:00
Paul Menzel a3a6746495 Makefile.inc: Explicitly disable PIE
Some distribution compilers enable Position Independent Executable (PIE)
by default, causing a build failure.

So explicitly disable PIE by passing the flag `-fno-pie`, to fix the
build error.

Change-Id: I1b7d7168e34c5c93c25bc03ffa49b2eeac0e76f8
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/17097
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-28 20:16:33 +02:00
Martin Roth 0529236ed2 Makefile.inc: Don't share amdfwtool between platforms
amdfwtool currently gets built for a specific size of ROM chip.  This
should be updated to be passed in on the amdfwtool command line, but
until that's done, stop sharing the tool between builds.

This caused a problem for abuild when we tried changing the default
rom to one that used a 256KB rom chip.  That wasn't large enough for
all of the files included by amdfwtool on several platforms, causing
build failures.

Change-Id: Ib08f3283e5be956f995a4a416a70b12a32462882
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/17070
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-10-21 19:38:39 +02:00
Daisuke Nojiri 165af1c5c2 gitconfig: Allow user name and email to be in includes
This patch adds '--includes' option to 'git config --global' command
to allow user name and email to be defined in a file included from
the global gitconfig (~/.gitconfig) file.

BUG=none
BRANCH=none
TEST=make gitconfig with ~/.gitconfig including another file which
defines user.name and email.

Change-Id: I4fe61078b143c3a2e26b0be69c3ca8e6f069d8b0
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://review.coreboot.org/16912
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-10-13 18:21:17 +02:00
Nico Huber 6dfffdc297 Makefile.inc: Fix make gitconfig for blobs repo
It's `.git/modules/3rdparty/blobs` now.

Change-Id: Ief12bb934332375a20f150afb568aef266924c9f
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16946
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2016-10-10 13:46:02 +02:00
Martin Roth 0f671f6ee9 Build system: Remove IASL_WARNINGS_ARE_ERRORS option
All systems are building with IASL warnings as errors enabled.
Remove the option to disable it.

Remove the notification at the end of the build.

Change-Id: I5c6218c182fdf173b4026fd010d939a5fa36040e
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16606
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-22 22:33:55 +02:00
Martin Roth 03b9ecb2cf Makefile.inc: Add aliases for submodule updates to gitconfig target
Updating submodules seem to give people headaches, so this adds a pair
of git aliases to update them.

'git sup' updates the submodules to the latest versions, but leaves any
locally modified files.

'git sup-destroy' will remove the current submodules and re-initialize
them.  This deletes any local changes.

Change-Id: Id62a30d88b3b6d285b3f00555d7609509aa1561f
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16573
Tested-by: build bot (Jenkins)
Reviewed-by: Omar Pakker
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-09-20 22:20:30 +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
Nico Huber 2e09d2b239 Make Ada a first class citizen
Some remarks on the make process:
  o We usually leave Ada specs (.ads files which are like c headers)
    together with the bodies (implementations in .adb files) in one
    directory. So we have to know, where they live.
  o If there is no matching .adb an .ads is a valid source file and
    we'll generate an object file from it.
  o Object files need to have the same basename as their source files :-/
    That's why we put them in build/<class>/ dirs now.
  o We track dependencies by looking at the compiler output (.ali files
    which accompany every .o). This way we don't need any gnatmake
    magic, or even more complex, less portable tools.

For ADAFLAGS_common, I simply copied the CFLAGS_common whilst dropping
everything unsupported and adding sane warning options.

The set of language features is highly restricted (see gnat.adc). This
should suit the embedded nature of coreboot and helps proving absence
of runtime errors with SPARK.

Change-Id: I70df9adbd467ecd2dc7c5c1cf418b7765aca4e93
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/13044
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
2016-09-19 11:14:18 +02:00
Alexander Couzens c7702536ed Makefile.inc: build ifdtool using its own makefile
Change-Id: I67c73c101b928d104e231064e05d367bf9584730
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/16571
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-12 20:04:33 +02:00
Iru Cai 2128d625ca Makefile.inc: Use $(MAINBOARDDIR)
Commit 93ef3ff makes the following only print the part number when
the ROM is built. In Makefile.inc, $(MAINBOARDDIR) is the variable
that has the quotes stripped off from $(CONFIG_MAINBOARD_DIR), so
use it instead of $(MAINBOARD_DIR).

build_complete:: coreboot
        printf "\nBuilt %s (%s)\n" $(MAINBOARD_DIR) \
                $(CONFIG_MAINBOARD_PART_NUMBER)

Change-Id: I729a583182937db7a926eb75aa28dfb53360046c
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/16410
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-09-04 05:33:25 +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
Patrick Georgi 21c54d26cb build system: Print the content of all regions we add files to
That's more useful than just COREBOOT for more complex scenarios

Change-Id: I93cd686d698799a3331ca2ea487cd6efb304caa0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16143
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-08-11 20:32:28 +02:00
Patrick Georgi e206ab7a78 build system: drop -cbfstool-opts variable support
It was a band-aid that isn't required any more.

Change-Id: Ib1793ae8fe25eecf9bd5ab8e5feef0d9380b43c2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16142
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-11 20:32:18 +02:00
Patrick Georgi f3656d8238 build system: allow overriding file position and alignment per region
To override fallback/foo's position or alignment in region BAR, use
fallback/foo-BAR-{position,align} = 0x1234

Like for the global settings, specifying both isn't allowed
because that's rather pointless.

Change-Id: I94f41ebc9f35108267265df4164f23b70e3d0bf6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16140
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-11 20:31:59 +02:00
Patrick Georgi 5986d2972a build system: remove early stage cbfs-file sorting
They're now sorted later in the process after the per-region file lists
are determined.

Change-Id: I0bba381d09dc4b99e2fe5cae16ff7ffcb5b3aa82
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16138
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-11 20:31:48 +02:00
Patrick Georgi 513693ca3a build system: order per-region files to optimize placement success
Make sure that files with a fixed position are placed first (whose order
doesn't matter: either they collide or they don't), then all aligned
files (where we just hope that the right thing happens) and finally the
files with no further requirements (again, hope).
It's still a pretty good heuristic given a typical coreboot image.

The global sorting that happens earlier in the build flow will be
removed in the future to make room for per-region requirements.

Change-Id: I269c00b2ece262c95d310b76a6651c9574badb58
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16137
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-11 20:31:36 +02:00
Patrick Georgi a8b86b3a9f build system: change addition order of files to go by region
Instead of adding each file in all requested regions, sort by region,
then by file.

This is in preparation of per-region file options
(eg. position, alignment)

Change-Id: Ide09a1c8840279380294a059bbd5d2f9f0cba780
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/16130
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-08-10 21:13:27 +02:00
Martin Roth 93ef3ffdf0 Makefiles: Use $(MAINBOARD_DIR) instead of $(CONFIG_MAINBOARD_DIR)
The variable MAINBOARD_DIR already has the quotes stripped off.

Change-Id: Ib434ce92bdbc49180fb3f713b26d65ba4cf8c441
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/16117
Tested-by: build bot (Jenkins)
Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-10 21:12:03 +02:00
Martin Roth fc46583807 Makefile.inc: Strip CONFIG_DEVICETREE quotes at top of makefile
Minor change - Instead of stripping the quotes from CONFIG_DEVICETREE
inline, add it to the location where we normalize all the other Kconfig
variables.

Change-Id: Idbc58179c7b45160afef7d7e44f9b3b334f8c4a7
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/16116
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-08-10 21:11:49 +02:00
Patrick Georgi 16559c3447 build system: drop commented out code
Change-Id: I7f36a317f0a7cf4634246a255be79e6bcb2b2442
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://review.coreboot.org/16067
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2016-08-09 08:39:16 +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 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
Aaron Durbin bcbb205454 build system: add easier targetting of cbfstool options per region
The first attempt of providing a options-for-region function to call
to determining a file's cbfstool options would work, but it means there
can only be one instance which has to handle all of the files that may
need an override. That logic can be problematic in impelementation.

Instead, provide a mechanism to target cbfstool options for a given
CBFS region where the implementation is tightly coupled in the build
system to where the file as requested to be added to cbfs. This allows
there to be a base set of cbfstool options while more easily extending
arguments on specific regions.

Example which adds '-b 0x10000' only for the COREBOOT CBFS region:
cbfs-files-y += file.bin
file.bin-COREBOOT-cbfstool-opts := -b 0x10000

Change-Id: Idfafb0205be42768adb04bb0a30fe46a9ca1bd57
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14640
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-08-05 07:59:54 +02:00
Nico Huber f641a27b63 Makefile.inc: Strip output of `wc`
Apparently BSD's wc indents its output.

Change-Id: I77f50a4b7d6012782f1c1b42ba20a64721c186c8
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/16013
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-08-03 09:40:36 +02:00
Furquan Shaikh 0325dc6f7c bootmode: Get rid of CONFIG_BOOTMODE_STRAPS
With VBOOT_VERIFY_FIRMWARE separated from CHROMEOS, move recovery and
developer mode check functions to vboot. Thus, get rid of the
BOOTMODE_STRAPS option which controlled these functions under src/lib.

BUG=chrome-os-partner:55639

Change-Id: Ia2571026ce8976856add01095cc6be415d2be22e
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15868
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-28 00:36:22 +02:00
Furquan Shaikh 2a12e2e8da vboot: Separate vboot from chromeos
VBOOT_VERIFY_FIRMWARE should be independent of CHROMEOS. This allows use
of verified boot library without having to stick to CHROMEOS.

BUG=chrome-os-partner:55639

Change-Id: Ia2c328712caedd230ab295b8a613e3c1ed1532d9
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15867
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-07-28 00:36:00 +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
Aaron Durbin 40d93494c3 device: include devicetree in bootblock stage
Allow bootblock to get access to the static device tree like
other early stages. device_romstage.c was renamed to
device_simple.c to better articulate the usage since it's not
just being used in romstage.

BUG=chrome-os-partner:55357

Change-Id: I3d63d2754c737cc738c09a3e3b3b468362fb78d1
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/15837
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Tested-by: build bot (Jenkins)
2016-07-27 00:40:05 +02:00
Subrata Banik 168eb6ad6f Makefile: Add uCode binary to FIT
Currently, on Intel Skylake the uCode binary is added to
CBFS based on the config option CBFS_EXTERNAL_HEADER. But
the entry is missing into the Firmware Interface Table, so
add it there.

BRANCH=none
BUG=chrome-os-partner:55403, chrome-os-partner:53077
TEST=built and verified FIT table has ucode entry.

Change-Id: I7dd7459ff7d2468f0aff66eb3ee9c2e3d7eda501
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/15783
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-07-24 00:09:14 +02:00
Werner Zeh 95f6022cb1 flashmap: Use CONFIG_ROM_SIZE as flash size in flashmap
Currently there are two sources for the final size of the
flash image. One is defined as a Kconfig variable
(ROM_SIZE) and the other can be provided in a user defined
flashmap.fmd. This patch will enable the usage of CONFIG_ROM_SIZE
in flashmap.fmd to define the flash size. In this way, the
Kconfig variable is the only source of information for the
flash image size. This way is optional.

Change-Id: Id5298e06d360aaa6d94f2b5a2ffa65e45919853e
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/15219
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-21 17:51:54 +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 3ac9d4cbb0 Makefile: Add ifwitool to list of tools to be built
Add ifwitool to list of tools to be built so that it can be used by the
build system.

Change-Id: Ifcfbfd87ad9b7ba3ea11cfbcf40894f3e0dae694
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15013
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-01 21:16:58 +02:00
zbao c16918ac11 splash: Put the suffix of splash file to CBFS name
The previous code harded the suffix of splash file as
"jpg". Actually, SeaBIOS supports both jpg and bmp.

Change-Id: I06c4b14aae7f75be3406652a94612b5f30ce91c2
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/14932
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-05-26 23:48:02 +02:00
Jonathan Neuschäfer d4d3ecb551 jenkins: Run the romcc test suite
Change-Id: I467c56ffc632f58338cb3dbafade15acab5ee016
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14540
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-19 00:14:15 +02:00
Furquan Shaikh 94b18a1757 xip: Do not pass --xip for early stages if CAR supports code execution
On modern x86 platforms like apollolake, pre-RAM stages verstage and
romstage run within the cache-as-ram region. Thus, we do not need to
pass in the --xip parameter to cbfstool while adding these
stages. Introduce a new Kconfig variable NO_XIP_EARLY_STAGES which is
default false for all x86 platforms. Apollolake selects this option
since it supports code execution with CAR.

Change-Id: I2848046472f40f09ce7fc230c258b0389851b2ea
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14623
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-09 05:01:58 +02:00
Aaron Durbin ef10529187 cpu/x86: don't treat all chipsets the same regarding XIP_ROM_SIZE
Previously, the XIP_ROM_SIZE Kconfig variable is used globally on
x86 platforms with the assumption that all chipsets utilize this
value.  For the chipsets which do not use the variable it can lead
to unnecessary alignment constraints in cbfs for romstage.  Therefore,
allow those chipsets a path to not be burdened by not passing
'-P $(XIP_ROM_SIZE)' to cbfstool when adding romstage.

Change-Id: Id8692df5ecec116a72b8e5886d86648ca959c78b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14625
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-06 16:49:37 +02:00
Patrick Georgi d264b46c49 build system: create fmap for UPDATE_IMAGE configurations, too
This fixes UPDATE_IMAGE builds, assuming that the fmap configuration in
the tree didn't change, at least as far as the CBFS regions are
concerned.

Another option would be to synthesize the fmap related files from the
existing image, but that comes with other issues (eg. what about
updating images old enough that there is no fmap?) and is more complex,
so keep it simple, stupid for now.

Change-Id: I036dab9f81f524f7d70bc0029b1ef835e6180a53
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/14601
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
2016-05-05 23:16:29 +02:00
Werner Zeh bc2d151b00 payload: Fix broken Linux kernel as payload
Commit 785a31d67e
(Makefile.inc: Move payload code to payloads/) breaks the usage of
Linux kernel as payload. The reason for it is that cbfs-files-y is
evaluated before payloads/external/Makefile.inc is sourced and as a
consequence ADDITIONAL_PAYLOAD_CONFIG is empty when it is used for
payload options. That leads to missing command line and initrd for
the kernel which in turn leads to kernel panic when it boots.
To avoid it, move the code which adds payload to cbfs completely to
payloads/extranal/Makefile.inc. This way, ADDITIONAL_PAYLOAD_CONFIG is
set right before the payload itself is added to cbfs-files-y.

I have tested this patch with a Linux kernel as well as with SeaBIOS as
payload on mc_tcu3 and it works. If someone sees impact to other
payloads just let me know.

Change-Id: I7aad352f8b3fc1fdba1875b12648b07eba14e282
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/14579
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-04 12:23:57 +02:00
Patrick Georgi 849635d4ef build system: rename fmap.h to fmap_config.h
There's an in-tree fmap.h, and the file generated by fmaptool is likely
used in tandem with it. To avoid problems, rename the generated file
(which so far isn't used).

Change-Id: I95dfde513a7f78677cf18ecd7ce8745e40af316b
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/14570
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-03 11:42:20 +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
Martin Roth 3812597c66 Makefile.inc: Stop running git repeatedly for each build
Currently, the coreboot makefiles repeatedly run git to try to set
the KERNELVERSION variable and to fetch the submodules.  This happens
three times for every build.  By exporting a variable, we can catch
this on recursive makes and not run each of these steps again.

Change-Id: I85ab867b40e80c36bd94d48510ffe3252c6cf93f
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14392
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
2016-04-19 18:24:10 +02:00
Stefan Reinauer 785a31d67e Makefile.inc: Move payload code to payloads/
Change-Id: I91d9537e8c78560c944c552255e703fc0e6f1f78
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14349
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-04-15 16:25:28 +02:00
Martin Roth a29bc9786d Makefile.inc: Disassemble the ACPI AML to detect errors
This should help catch cases where the AML is not correct.

Change-Id: I48efb9ed0b62b3e17dcf3045ef9c32d813a412bc
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14340
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-04-14 20:20:41 +02:00
Martin Roth 888a98b872 payloads: add iPXE 'payload' build
We already have the ability to add a pxe rom to cbfs, but it needs to be
configured and built separately.

This moves the existing Kconfig options for PXE from device/Kconfig and
the top level Makefile.inc to payloads, and adds the option to download
and build iPXE as part of the coreboot build process.

This configures the serial output of iPXE to match coreboot's serial
port configuration by editing the .h files. iPXE doesn't give any
real build-time method of setting these configuration options.

Change-Id: I3d77b2c6845b7f5f644440f6910c3b4533a0d415
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14085
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-04-13 17:45:37 +02:00