Commit Graph

50815 Commits

Author SHA1 Message Date
Subrata Banik f251a6a439 soc/intel/meteorlake: Implement MultiPhase SI Init Index 2 callback
The details about how the CPU multiprocessor init (MP) has migrated
from coreboot to FSP can be found in
https://doc.coreboot.org/soc/intel/mp_init/mp_init.html.

The major reason behind this migration is to support the Intel
proprietary and restricted CPU feature programming which can't be
performed if coreboot sets the BIOS_DONE or BIOS Reset CPL as part
of coreboot MP Init flow (prior to calling FSP-S). Hence, the new
flow introduced with Tiger Lake platform forced having monolithic
MP Init peformed by FSP (using coreboot MP PPI wrapper code).

The last 3-4 years of FSP doing MP Init has demonstrated ample
issues during platform bringup which is specific to UEFI MP Service
implementation and not relevant to open source coreboot. This new
flow makes the debug and validation aspect complicated where
any FSP MP Init code changes should have been validated with coreboot
MP PPI wrapper else might cause some failure, unfortunately,
the validation commitment has never been met, hence, issue debugging
is the only solution that remains in practice.

Most importantly, the restricted feature programming which demanded
closed source MP Init (for features like SGX and C6DRAM) has never
been enabled in coreboot (starting with Alder Lake, the SGX feature
has been dropped).

This patch attempts to decouple FSP-S doing MP Init from the rest
of the FSP-S silicon init and introduces 2nd MultiPhase SI init
which allows bootloader to perform the mandatory SoC programming
before FSP-S has done with PM programming (a.k.a set the reset CPL).

The core/uncore BWG suggests the minimum SoC programming before
BIOS Reset CPL is set. coreboot uses the MultiPhaseSI Init Index 2
to perform the required CPU programming before enabling the BIOS
Reset CPL.

This implementation would allow us to get rid of FSP running CPU
feature programming and additionally make several EDK2 MP service
modules optional (those are packed to create FSP-S blob).

In summary, this change would allow coreboot to utilize open source
MP init without running into FSP-S related code blocks.

Note: At present, Intel Meteor Lake FSP doesn't have support for
MultiPhase SI Init, Index 2 (submitted a FSP code changes over
chrome-internal to enable this feature to decouple MP Init from
FSP-S init).

This patch is backported from
commit b6c3a0325b (soc/intel/alderlake:
Implement MultiPhase SI Init Index 2 callback).

BUG=b:233199592
TEST=Build and boot google/taeko to ChromeOS.
Perform several thousands cycles of suspend test and power cycle
without running into any issue.

Change-Id: I2ea1a8bb2b142e39c2bc9d248b7fd0041366c0db
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70558
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2022-12-19 14:13:26 +00:00
Subrata Banik b9d53a0c8c drivers/intel/fsp2_0: Implement `mps2_noop_get_number_of_processors()`
This patch implements mps2_noop_get_number_of_processors() API with
minimal information required for Intel MTL FSP to utilise the
`MP_SERVICES_PPI_V2_NOOP` config.

The major difference between Intel ADL and MTL FSP in terms of doing
CPU feature programming aka utilizing MP PPI wrapper code is that,
starting with MTL, FSP has dropped the `SkipMpInit` UPD.

It means now, coreboot doesn't have any way to skip FSP doing MP Init
operation. But during ADL, coreboot had introduced the
MP_SERVICES_PPI_V2_NOOP config that is used to skip FSP about
actually running any CPU feature programming on APs.

The idea is to use the same config even in MTL to provide only the
must have information (to bypass any assert in FSP during debug image)
to FSP.

Passing `FSP_UNSUPPORTED` from mps2_noop_get_number_of_processors()
results in `assert` while compiling FSP in debug mode hence,
implementing the function to pass only the information about BSP being
the active processor along with passing `FSP_SUCCESS` (eventually it
makes FSP happy and doesn't run into any issue in debug and/or release
mode).

TEST=Able to build and boot Google/Rex and Google/Kano while
coreboot skip calling into FSP for doing MP init.

Change-Id: I75d7e151699782210e86be564b0055d572cacc3f
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70555
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2022-12-19 14:12:59 +00:00
Sean Rhodes 836881935f ec/starlabs/merlin: Add EC related files for Cezanne laptops
Add EC memory layout and Q events for AMD Cezanne based boards,
the "StarBook Mk VI" and "StarFighter Mk I", which both use the ITE
5570E.

Change-Id: I87806b830b3d58a6ce3b89f45b5a07f4502a87f3
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68333
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-19 14:12:11 +00:00
Matt DeVillier 6dc05a369e mb/google/octopus: Add NHLT endpoints for Cirrus Logic codec
Add NHLT endpoints for octopus boards using CS42L42 codec.
Reuse method to add da7219 endpoint as the routing is identical.

TEST=boot Windows, verify audio working with coolstar's audio drivers.

Change-Id: Id68997073752f5d90b6fe21f666a6140e22d65eb
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70371
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-19 03:47:47 +00:00
Matt DeVillier f8fdd7a8de mb/google/octopus: update variant VBTs
Remove flag in VBTs for 'Use fixed resolution at boot' to allow FSP/GOP
display init to use native panel resolution instead.

TEST=build/boot multiple google/octopus variants with edk2 payload,
verify boot logo not distorted/stretched.

Change-Id: Ia31ff28379282619dfa22a955bee1a768bb54bb8
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70373
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-19 03:47:08 +00:00
Matt DeVillier 3a59fef511 mb/google/hatch/kohaku: set VBT boot resolution to 1080p
Boot menus are too small at native 4K res on some panels, so
set fixed display resolution to 1920x1090p

TEST=build/boot KOHAKU with 4K display, verify boot menu text legible.

Change-Id: I82563c83de7ab302151f60d86b8a6824330d03ea
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70370
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-19 03:46:40 +00:00
Frank Chu f99f308826 mb/google/brya/var/marasov: Configure I2C high and low time
Adjust I2C speed for codec, TPM, touchpad, touchscreen.

BUG=b:260565911
TEST=Built and verified adjusted I2C speed

Signed-off-by: Frank Chu <Frank_Chu@pegatron.corp-partner.google.com>
Change-Id: Idcec6e401992d30dff01940c50473cba48cffc19
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70232
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Frank Chu <frank_chu@pegatron.corp-partner.google.com>
2022-12-19 02:21:32 +00:00
Martin Roth 3b32af950d util/crossgcc: Add option to get packages from coreboot's mirror
coreboot has been keeping a mirror of all the toolchain packages used
for releases for quite a while now.  This adds an option to fetch the
packages from the coreboot mirror directly to buildgcc.

This can help with both our releases and when one of the various
servers experiences interruptions or changes a path.

To do this, the URL and filename needed to be split apart, which led to
quite a few changes in the buildgcc script.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I7df58dca152e7bfe9fde34d290e05b52515b20d9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70053
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-12-18 00:43:32 +00:00
Jeremy Compostella 50139d00bd lib: Hook up libhwbase in romstage
It's hidden behind the configuration option `CONFIG_ROMSTAGE_LIBHWBASE'.

This also adds some glue code to use the coreboot console for debug
output and our monotonic timer framework as timer backend.

Running Ada code in romstage and more particular libhwbase brings a few
challenges as global initialized variables are not supported in
Cache-As-Ram mode.

1. The libhwbase dynamic mmio driver implementation makes the Gnat
   compiler generate some global initialized variables.

   For this reason, when compiled for romstage or for romstage and
   ramstage the static mmio driver is enforced (`HWBASE_STATIC_MMIO').

2. The Gnat compiler generates elaboration functions to initialize
   program data at runtime. These elaboration functions are called by
   the romstage_adainit() function.

   The data references symbols suffixed by `_E'. Even though these
   symbols, at compilation time, do not contain any data and are
   filled with zeros, the Gnat compiler installs them in the .data
   section.

   Since these symbols are actually filled with zeros, it is safe to
   install them in the .bss section.

   cf. https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/elaboration_order_handling_in_gnat.html#elaboration-code

This patch requires the libhwbase
https://review.coreboot.org/c/libhwbase/+/69854 CL.

BUG=b:252792591
BRANCH=firmware-brya-14505.B
TEST=libhwbae compiles for romstage and loads successfully

Change-Id: I670249d33506e886a683e55d1589cb2bf9b16aa3
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70275
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Zhixing Ma <zhixing.ma@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:51:38 +00:00
Jeremy Compostella fa83887e48 Add option to use Ada code in romstage
If selected, libgnat is linked into romstage. In addition, a call to
romstage_adainit() is added to support Ada program data
initialization.

BUG=b:252792591
BRANCH=firmware-brya-14505.B
TEST=Ada code compiles for romstage and loads successfully

Change-Id: I74f0460f6b14fde2b4bd6391e1782b2e5b217707
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70274
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:48:06 +00:00
Michał Żygowski e6b96dceab util/chromeos/gen_test_hwid.sh: Replace usage of hexdump
Hexdump command is not available in coreboot-sdk. Replace it with
equivalent implementation using commands that are present in the
container.

TEST=Passed "VP46XX" as prefix variable and it produced the same
crc32 result before and after the change.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: Icad93933335b8c5ebd8fee74cc9aaed36bb56482
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68133
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-12-17 20:45:42 +00:00
Johnny Lin a3e68c9f95 soc/intel/cmn: Clear interrupt status after HECI-1 has been received
According to Intel doc#630774, BIOS should clear Host Interrupt Status
if it has read all the slots of the message from the ME circular buffer.
Since this is not found in client ME document, add a Kconfig
SOC_INTEL_CSE_SERVER_SKU that only clears interrupt status for Server
ME SKU.

On SPR-SP, if mainboard calls get_me_fw_version via HECI-1, with the
change can avoid seeing below Linux warning during boot with Linux
v5.12:
[   17.868929] irq 16: nobody cared (try booting with the "irqpoll" option)
[   17.883819] CPU: 10 PID: 0 Comm: swapper/10 Not tainted 5.12.0
[   17.902412] Hardware name: Wiwynn Crater Lake EVT2/Crater Lake-Class1
[   17.922327] Call Trace:
[   17.927780]  <IRQ>
[   17.932253]  dump_stack+0x64/0x7c
[   17.939640]  __report_bad_irq+0x37/0xb1
[   17.948206]  note_interrupt.cold.11+0xa/0x63
[   17.957713]  handle_irq_event_percpu+0x6a/0x80
[   17.967626]  handle_irq_event+0x2a/0x50
[   17.976163]  handle_fasteoi_irq+0x9e/0x140
[   17.985305]  __common_interrupt+0x38/0x90
[   17.994255]  common_interrupt+0x7a/0xa0
[   18.002821]  </IRQ>
[   18.007514]  asm_common_interrupt+0x1e/0x40

Change-Id: I1cf21112870e53a11134d43e461b735ead239717
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66579
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
2022-12-17 20:44:10 +00:00
Eric Lai 5b89bf4666 lib: Introduce fw_config_get_field
In some cases, fw_config is used for ids like sar_id, sku_id etc.
To avoid calling fw_config_probe over and over, hence provide the
method to return the value then caller can use the switch case
instead of if else statement.

TEST=get fw_config field value on nivviks.
[INFO ]  fw_config get field name=DB_USB, mask=0x3, shift=0, value =0x1

Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Change-Id: Iae89668e8fe7322d5a4dcbf88a97d7ed36619af5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70745
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
2022-12-17 20:43:16 +00:00
Reka Norman f49fcc6bf5 util/cbfstool: Change %lu to %zu for size_t argument
With commit 34a7e66faa ("util/cbfstool: Add a new mechanism to
provide a memory map"), builds are failing on 32-bit platforms with:

../cbfstool/cbfstool.c:397:30: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
                printf("Image SIZE %lu\n", image_size);
                                   ~~~     ^~~~~~~~~~
                                   %zu

Change the format specifier from %lu to %zu.

TEST=`emerge-cherry coreboot-utils` now succeeds

Change-Id: I3602f57cf91c330122019bfa921faef6deb2b4ce
Signed-off-by: Reka Norman <rekanorman@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70848
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2022-12-17 20:41:14 +00:00
Jan Samek a1a8f58a07 mb/siemens/mc_ehl3/devicetree.cb: Adapt PCIe root port settings
Based upon hardware differences from mc_ehl2, disable RP7
and enable RP3 and RP5.

Change-Id: Iecaa3098c3e4c9ce15254bb8bd1fe6da86d6e706
Signed-off-by: Jan Samek <jan.samek@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70689
Reviewed-by: Uwe Poeche <uwe.poeche@siemens.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:39:44 +00:00
Jan Samek a2035cc4d0 mb/siemens/mc_ehl3: Add board variant based on mc_ehl2
Add a new mc_ehl variant, which is based on mc_ehl2 implementation.

This patch uses a copy of mc_ehl2 with changes only in naming
as a starting point for the new mc_ehl3 variant.

Follow-up patches will introduce the functional changes against
mc_ehl3.

Change-Id: Ie8c18b4f16d88b175ce576c2ef4c2e6ee0b4c306
Signed-off-by: Jan Samek <jan.samek@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70688
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2022-12-17 20:39:02 +00:00
Reka Norman 5e78090306 util/genbuild_h: Only use version tags in expected format
With commit 0110e1abe0 ("util/genbuild_h: Update printf %d to %s for
sh compatability"), the ChromeOS coreboot build is failing with:

In file included from src/lib/version.c:4:
/build/nissa/tmp/portage/sys-boot/coreboot-0.0.1-r5473/work/build/nivviks/build.h:10:32: error: 'v1' undeclared here (not in a function)
   10 | #define COREBOOT_MAJOR_VERSION v1
      |                                ^~
src/lib/version.c:35:46: note: in expansion of macro 'COREBOOT_MAJOR_VERSION'
   35 | const unsigned int coreboot_major_revision = COREBOOT_MAJOR_VERSION;
      |                                              ^~~~~~~~~~~~~~~~~~~~~~
/build/nissa/tmp/portage/sys-boot/coreboot-0.0.1-r5473/work/build/nivviks/build.h:11:32: error: 'v9308' undeclared here (not in a function)
   11 | #define COREBOOT_MINOR_VERSION v9308
      |                                ^~~~~
src/lib/version.c:36:46: note: in expansion of macro 'COREBOOT_MINOR_VERSION'
   36 | const unsigned int coreboot_minor_revision = COREBOOT_MINOR_VERSION;
      |                                              ^~~~~~~~~~~~~~~~~~~~~~

This is because the ChromeOS coreboot repo has a tag which is not in the
expected <major>.<minor> format:
$ git tag
v1.9308_26_0.0.22

Change genbuild_h.sh to only use the version from `git describe` if it's
in the expected <major>.<minor> format.

TEST=ChromeOS coreboot build now succeeds, with versions set to 0:
 #define COREBOOT_MAJOR_VERSION 0
 #define COREBOOT_MINOR_VERSION 0

Building upstream coreboot, the versions are still set correctly:
 #define COREBOOT_MAJOR_VERSION 4
 #define COREBOOT_MINOR_VERSION 18

Change-Id: I81b2317a83cdec4cc2aad60af2990e5e3f4ad694
Signed-off-by: Reka Norman <rekanorman@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70770
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Usha P <usha.p@intel.com>
2022-12-17 20:37:22 +00:00
Reka Norman f7bb72333a soc/intel/alderlake: Select SOC_INTEL_CSE_SEND_EOP_LATE for ADL-N
On nissa, sending EOP late improves boot time by about 57ms.

Before (SOC_INTEL_CSE_SEND_EOP_EARLY):
943:after sending EOP to ME                           931,206 (58,431)
943:after sending EOP to ME                           932,911 (58,427)
943:after sending EOP to ME                           930,908 (58,429)
943:after sending EOP to ME                           941,357 (61,748)
943:after sending EOP to ME                           933,289 (62,050)
943:after sending EOP to ME                           939,578 (62,453)
943:after sending EOP to ME                           932,491 (62,050)
943:after sending EOP to ME                           929,693 (62,655)
943:after sending EOP to ME                           942,247 (62,654)
943:after sending EOP to ME                           936,984 (61,751)

After (SOC_INTEL_CSE_SEND_EOP_LATE):
943:after sending EOP to ME                           1,107,816 (3,498)
943:after sending EOP to ME                           1,053,286 (25,212)
943:after sending EOP to ME                           1,124,095 (3,511)
943:after sending EOP to ME                           1,098,591 (3,498)
943:after sending EOP to ME                           1,107,772 (3,499)
943:after sending EOP to ME                           1,080,008 (45,969)
943:after sending EOP to ME                           1,081,754 (8,024)
943:after sending EOP to ME                           1,109,193 (4,102)
943:after sending EOP to ME                           1,088,866 (4,201)
943:after sending EOP to ME                           1,081,684 (4,203)

BUG=b:247902068
TEST=EOP time is improved on nissa (measurements above).

Change-Id: I2389831b4ab62f247193b5b0c5ec201e12eaa3db
Signed-off-by: Reka Norman <rekanorman@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70849
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:33:52 +00:00
Jakub Czapiga e8bef613df tests/Makefile.inc: Build utilities in separate directory
Utilities like kconfig/conf now will be built inside tests build tree.
It will eliminate possible colisions of target names when using test
framework in more than one place (see CB:70110)

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I4c1eb901c921f4ec6ee8985b154362153c5fd0e7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70359
Reviewed-by: Jan Dabros <jsd@semihalf.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:32:53 +00:00
Jakub Czapiga d190e0fa96 tests/Makefile.common: Remove unnecessary dependency to kconfig/conf
Utility will be built while executing kconfig targets so it is not
necessary to keep hard dependency on kconfig here.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I578f3e1d9de63e91ded44746539265bcd55bf579
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70298
Reviewed-by: Jan Dabros <jsd@semihalf.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:32:12 +00:00
Jakub Czapiga ab0686109e tests/Makefile.common: Allow to override tests defconfig
Some tools based on test framework might require defconfig other
than one set in tests framework.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: If53b9a54ef7389dd979dfe772e6946439f7d6a62
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70109
Reviewed-by: Jan Dabros <jsd@semihalf.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:31:38 +00:00
Jakub Czapiga 3088e43a5a tests/Makefile.common: Describe available test attributes
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I8ce702b4be254e206e2018deabde985b56cc6cd3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70475
Reviewed-by: Jan Dabros <jsd@semihalf.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 20:30:45 +00:00
Jakub Czapiga e744ba643d tests: Support linking with system libc
This patch allows for linking selected files with system libc. This
allows for creating libraries interacting with filesystem, standard I/O
and other parts of system. Until now it was only possible using CMocka
proxy functions or functions not masked by code under test.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I652362ba61a25e974d706357fc36479ccee763e4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70108
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jan Dabros <jsd@semihalf.com>
2022-12-17 20:30:12 +00:00
David Lin 69a6dd6aae drivers/generic/nau8315: Change method for HID assignment
This patch is to change method of HID assignment with compatible id
style in nau8315_config and allow mainboards to set it.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Change-Id: Ia6f02e495eeb06290947edc9e44fa25a4ce18956
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69965
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2022-12-17 20:29:15 +00:00
Wisley Chen 964a60360a mb/google/nissa/var/yaviks: Enable wifi SAR
Enable wifi sar function for yaviks.
Use the fw_config to separate SAR setting for different wifi card.

BUG=259199095
TEST=build, enabled iwlwifi debug, and check dmesg

Signed-off-by: Wisley Chen <wisley.chen@quanta.corp-partner.google.com>
Change-Id: I3ced65368ee66e084e58d66cff8f75147f665d71
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70750
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
2022-12-17 20:26:49 +00:00
Stanley Wu 3228b266b2 mb/google/nissa/var/pujjo: Tunning RegProxCtrl0 register for SX9324
Update SX9324 RegProxCtrl0 register settings based on tunning value
from P-sensor vendor.

BUG=b:242662878
TEST=i2cdump -y -f 13 0x28 on Pujjo

Signed-off-by: Stanley Wu <stanley1.wu@lcfc.corp-partner.google.com>
Change-Id: If471a6fee5a3daeac1958709415b2d5e1329b81b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70824
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
2022-12-17 20:24:44 +00:00
Sean Rhodes e56a812a6a soc/intel/common: Remove read-only from chip_get_common_soc_structure
Remove the `const` property from chip_get_common_soc_structure so that
the returned values can be overwritten as required.

Cc: th3fanbus@gmail.com
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I7d3db0bc119cd9b9b276abd68754e750e06a788c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70774
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-17 20:23:55 +00:00
Matt DeVillier d14461f403 device/Kconfig: bump desktop framebuffer max height/width to support 4K
Increase the default linear framebuffer max height/width for desktops
so that native display resolution works properly on 2160p and 1440p
ultrawide displays.

TEST=build/boot google/fizz, verify libgfxinit display init works
properly on 3440x1440p and 3840x2160p displays.

Change-Id: I95a1f1275a4faea195b73997c648023119807958
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70369
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-12-17 18:11:04 +00:00
Felix Held 719f7bebb0 device/oprom/yabel/io: use __fallthrough instead of comment
Unlike gcc, a clang build will fail when only a comment is used to
indicate that the fallthough is intended. To fix the clang build, use
__fallthrough instead. This will fix the build errors introduced by
commit f45c7671d9 ("Set x86_64 as supported architecture for clang")
that enabled clang builds for a case that uses yabel to run the VBIOS.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I4ed337025adeb833f352d198fc0f13b5e1c209c4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70889
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-12-17 16:45:44 +00:00
Angel Pons 816919b3c8 soc/intel/skylake/irq.c: Fix undefined `memcpy()`
The original value of the `DevIntConfigPtr` is unknown, and there's no
way to be absolutely certain that it actually points to usable memory.
Instead of copying the data, update the pointer's address to reference
the global variable directly. It is assumed that FSP does not write to
the memory pointed by `DevIntConfigPtr`. Confirming this assumption is
pointless; one might as well reimplement FSP instead.

Change-Id: I90594cc09e3fa2aef98658441c323a44a869635b
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65217
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
2022-12-17 12:36:33 +00:00
Sean Rhodes fd618f3325 Documentation/mb/starlabs: De-duplicate the building instructions
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I20301b3041a62eb416ed61a84544ec4e5cc66c1e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68585
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 01:20:58 +00:00
Ben-StarLabs b2db3659a9 mb/starlabs/starbook: Add Alder Lake StarBook Mk VI variant
Tested using `edk2` from
`github.com/starlabsltd/edk2/tree/uefipayload_202209`:
* Windows 10
* Ubuntu 20.04
* MX Linux 19.4
* Manjaro 21

No known issues.

https://starlabs.systems/pages/starbook-specification

Signed-off-by: Ben-StarLabs <ben@starlabs.systems>
Change-Id: Idc0c265a88b19cf9e89cc8ab3e8db9abd8cf8409
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65785
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
2022-12-17 01:20:26 +00:00
Karthikeyan Ramasubramanian 1c3da3f236 mb/google/skyrim: Configure RO and RW SPL files
This will help to integrate RO SPL table in RO partitions such that it
is used before PSP verstage is loaded. After PSP verstage, SPL table in
RW partition gets used.

BUG=b:243470283
TEST=Build Skyrim BIOS image and boot to OS.

Change-Id: Ic2061f66381d7e9a8018e6f28aa0bc2ca6010f6f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70777
Reviewed-by: Jon Murphy <jpmurphy@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 01:18:59 +00:00
Karthikeyan Ramasubramanian c57a0663ab Update 3rdparty/blobs submodule
Updating from commit id f8e84db3:
    mainboard/starlabs/cezanne/starbook: Add EC binary 1.02

to commit id 01ba1566:
    mb/google/skyrim: Add RO SPL table

This brings in 3 new commits:
01ba1566: mb/google/skyrim: Add RO SPL table
ce5566fd: soc/mediatek/mt8186: Update SSPM firmware from v1.0.0 to
			       v2.0.0
55d92ce7: soc/mediatek/mt8188: Update SSPM firmware from v1.88.00 to
			       v1.88.01

Change-Id: Ie8e78f61556da268f74caaba211b30e70f984f13
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70776
Reviewed-by: Jon Murphy <jpmurphy@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-17 01:18:49 +00:00
Kevin Chiu 3cbae049dc mb/google/brya/var/lisbon: Use RPL FSP headers
To support an RPL SKU on lisbon, lisbon must use the FSP for RPL.

Select SOC_INTEL_RAPTORLAKE for lisbon so that it will use the RPL
FSP headers for lisbon.

BUG=b:246657849
BRANCH=firmware-brya-14505.B
TEST=FW_NAME=lisbon emerge-brask intel-rplfsp
coreboot-private-files-baseboard-brya coreboot chromeos-bootimage
flash and boot lisbon to kernel.

Signed-off-by: Kevin Chiu <kevin.chiu.17802@gmail.com>
Change-Id: Ie60c357ef0a2af2fec90df4a54e56f51ceb927d3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70438
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2022-12-16 21:56:06 +00:00
Felix Held ca432d1fd9 drivers/i2c/designware: translate return type in dw_i2c_dev_transfer
dw_i2c_transfer returns an enum cb_err type, but dw_i2c_dev_transfer
returns an int, so explicitly translate between the types. Since
dw_i2c_transfer only returns either CB_SUCCESS or CB_ERR which are
defined as 0 and -1, this won't change behavior of dw_i2c_dev_transfer.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Iaf2cbcf6564035d5c0fc13f5d5e7ac0d0425e85d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70831
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2022-12-16 19:41:50 +00:00
Arthur Heymans b12caef23b configs: Add 64bit buildtest for prodrive/hermes
This configuration also boots on real hardware.

Change-Id: Ic62a33f8d8c3fdaa8182e797b2bf6fbed6b55731
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69236
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-16 17:22:13 +00:00
Arthur Heymans f45c7671d9 Set x86_64 as supported architecture for clang
This boots on both qemu and real hardware now.

Change-Id: Ibd320059cff575847bbf1844b5bb100312f77916
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69235
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-16 17:21:17 +00:00
Arthur Heymans 2834d98f52 cpu/intel: Fix clearing MTRR for clang 64bit
Clang generates R_X86_64_32S symbols that get truncated.

TESTED:
- prodrive/hermes boots with GCC and clang
- MTRR are properly cleared (tested by filling in both
MTRR_FIX_64K_00000 and MTRR_FIX_4K_F8000 before clearing)

Change-Id: I6a5139f7029b6f35b44377f105dded06f6d9cbf9
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69388
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-16 17:20:32 +00:00
Angel Pons 1c9a8d8083 nb/intel/haswell: Add native raminit scaffolding
Implement some scaffolding for Haswell native raminit, like bootmode
selection, handling of MRC cache and CPU detection.

Change-Id: Icd96649fa045ea7f0f32ae9bfe1e60498d93975b
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64182
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-12-16 17:19:07 +00:00
Angel Pons 49509189dc sb/intel/lynxpoint: Add native PCH init
Implement native PCH initialisation for Lynx Point. This is only needed
when MRC.bin is not used.

Change-Id: I36867bdc8b20000e44ff9d0d7b2c0d63952bd561
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64181
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-12-16 17:15:53 +00:00
Angel Pons 9c8c858e68 sb/intel/lynxpoint: Add native thermal init
Implement native thermal initialisation for Lynx Point. This is only
needed when MRC.bin is not used.

Change-Id: I4a67a3092d0c2e56bfdacb513a899ef838193cbd
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64180
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-16 17:13:18 +00:00
Angel Pons 70c6185476 sb/intel/lynxpoint: Add native USB init
Implement native USB initialisation for Lynx Point. This is only needed
when MRC.bin is not used.

TO DO: Figure out how to deal with the FIXME's and TODO's lying around.

Change-Id: Ie0fbeeca7b1ca1557173772d733fd2fa27703373
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64179
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-12-16 17:12:43 +00:00
Angel Pons 322b1c3d90 haswell/lynxpoint: Add native early ME init
Implement native early ME init for Lynx Point. This is only needed when
MRC.bin is not used.

Change-Id: If416e2078f139f26b4742c564b70e018725bf003
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64178
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-12-16 17:08:55 +00:00
Angel Pons 567ece44ea haswell/lynxpoint: Add native DMI init
Implement native DMI init for Haswell and Lynx Point. This is only
needed on non-ULT platforms, and only when MRC.bin is not used.

TEST=Verify DMI initialises correctly on Asrock B85M Pro4.

Change-Id: I5fb1a2adc4ffbf0ebbf0d2d3a444055c53765faa
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64177
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-12-16 17:08:00 +00:00
Sridhar Siricilla b739fd287d soc/intel/common: Drop unreferenced DP related macros
The patch drops the unreferenced DP related timeout macros.

TEST=Build code for Rex

Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Change-Id: I3f4c7733a92d1b7cb107410fedaca20ede040050
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70663
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-16 17:06:52 +00:00
Frank Chu 0cb7e614d0 mb/google/brya/var/marasov: Update gpio table for EVT
BUG=b:260565911
BRANCH=firmware-brya-14505.B
TEST=emerge-brya coreboot chromeos-bootimage

Signed-off-by: Frank Chu <Frank_Chu@pegatron.corp-partner.google.com>
Change-Id: Id5a73126737a3abbe6f0ef37276ce20f687b47fc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70236
Reviewed-by: Frank Chu <frank_chu@pegatron.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
2022-12-16 17:05:53 +00:00
Frank Chu 93197d20b6 mb/google/brya/var/marasov: Disable unused PCIE8 for s0ix
Disable unused PCIE8 for fix system can not enter S0ix completely.

BUG=b:261915226
BRANCH=firmware-brya-14505.B
TEST=emerge-brya coreboot chromeos-bootimage

Signed-off-by: Frank Chu <Frank_Chu@pegatron.corp-partner.google.com>
Change-Id: I06f8bd06e1fe92c03bd5625a41469830ce37a11c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70660
Reviewed-by: Frank Chu <frank_chu@pegatron.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2022-12-16 17:05:22 +00:00
Liju-Clr Chen 26a8dea551 mb/google/geralt: Revise the naming of MIPI PWM control GPIO
Rename the MIPI PWM control GPIO to be consistent with the schematic.

BUG=b:244208960
TEST=test firmware display pass for eDP and MIPI panels on MT8188 EVB

Change-Id: I6a3368d438cb50b257992260d1388f0b7e0f5ace
Signed-off-by: Liju-Clr Chen <liju-clr.chen@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70822
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2022-12-16 17:05:05 +00:00
Bo-Chen Chen f57155bca4 mb/google/geralt: Pass GPIOs to allow backlight control in payloads
There are two ways to control backlight in geralt:
1. MIPI/eDP panel => control backlight via the GPIOs.
   (`backlight chip enable` and `PWM dimming control`)
2. eDP OLED panel => enable backlight via `backlight chip enable` and
   control dimming over AUX.

For MIPI/eDP panels(#1), both "backlight enable" and "PWM control" GPIOs
will be passed from coreboot. For eDP OLED panel(#2), only the
"backlight enable" GPIO will be passed. If depthcharge successfully gets
the GPIOs, it will use them to control backlight.

BUG=b:244208960
TEST=test firmware display pass for eDP and MIPI panels on MT8188 EVB

Change-Id: I866fa219722241008e2b0d566b29edf2f6d9321f
Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70744
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-12-16 17:04:35 +00:00