Commit Graph

55033 Commits

Author SHA1 Message Date
Kenneth Chan 961cb4f04f mb/google/dedede: Add HPD GPIOs on dexi variant
Some Type-C monitors do not immediately assert HPD. If we enter FSP-S
before HDP is asserted, display initialisation may fail. So wait for
HPD.

This is similar to commit b40c600914 ("mainboard/hatch: Fix puff DP
output on cold boots") on puff, except we don't use
google_chromeec_wait_for_displayport() since that EC command was removed
for TCPMv2 (https://crrev.com/c/4221975). Instead we use the HPD signals
only. By waiting for any HPD signal (Type-C or HDMI), we skip waiting if
HDMI is connected, which is the same behaviour as puff and fizz.

BUG=b:303533815
BRANCH=dedede
TEST=On dexi, connect a display via a Type-C to HDMI dongle and check
the dev and recovery screens are now displayed correctly. Also check the
logs in the following cases:

Cold reboot in dev mode, Type-C to HDMI dongle:
HPD ready after 800 ms

Warm reboot in dev mode, Type-C to HDMI dongle:
HPD ready after 0 ms

Cold/warm reboot in dev mode, direct Type-C:
HPD ready after 0 ms

Cold/warm reboot in dev mode, direct HDMI:
HPD ready after 0 ms

Cold/warm reboot in dev mode, no display:
HPD not ready after 3000 ms. Abort.

Change-Id: Ib4fc071cac98a542072ffbeb6943bff4c988554c
Signed-off-by: Kenneth Chan <kenneth.chan@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78450
Reviewed-by: Sheng-Liang Pan <sheng-liang.pan@quanta.corp-partner.google.com>
Reviewed-by: Ren Kuo <ren.kuo@quanta.corp-partner.google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-23 13:01:28 +00:00
Morris Hsu 0360aea500 mb/google/brya/var/dochi: Update overridetree for FingerPrint
Update overridetree to correct FP_MCU fw_config settings.

BUG=b:299284564, b:298328847, b:299570339
TEST=emerge-brya coreboot

Change-Id: If76dd8fa3567ed01b11a6d2ba796e8c39807816c
Signed-off-by: Morris Hsu <morris-hsu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78454
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Bob Moragues <moragues@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-23 13:01:01 +00:00
Morris Hsu a0efce412d mb/google/brya/var/dochi: Update overridetree for TouchPad
Update overridetree for TouchPad.

BUG=b:299284564, b:298328847, b:299570339
TEST=emerge-brya coreboot

Change-Id: I4f88fa8a34b65aaeb64746e7f02e82d9913ce21b
Signed-off-by: Morris Hsu <morris-hsu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78455
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Bob Moragues <moragues@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-23 13:00:32 +00:00
Yunlong Jia 8ce19f54c7 mb/google/nissa/var/gothrax: Supplement register settings for SX9324 P-sensor
Set the following register value to make SX9324 work normally
    "ph0_pin" = "{1, 3, 3}"
    "ph1_pin" = "{3, 2, 1}"
    "ph2_pin" = "{3, 3, 1}"
    "ph3_pin" = "{1, 3, 3}"
    "ph01_resolution" = "512"
    "ph23_resolution" = "1024"
    "startup_sensor" = "1"
    "ph01_proxraw_strength" = "2"
    "ph23_proxraw_strength" = "2"
    "avg_pos_strength" = "256"
    "cs_idle_sleep" = ""gnd""
    "int_comp_resistor" = ""lowest""
    "input_precharge_resistor_ohms" = "4000"
    "input_analog_gain" = "3"

BUG=b:295109511
BRANCH=None
TEST=emerge-nissa coreboot chromeos-bootimage & Check sar sensor data

Signed-off-by: Yunlong Jia <yunlong.jia@ecs.corp-partner.google.com>
Change-Id: Ib15f12d754fec8b379afd702b27d0701fac78072
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78463
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Derek Huang <derekhuang@google.com>
2023-10-23 12:59:05 +00:00
Bill XIE 29030d0f3d drivers/pc80/rtc/option.c: Stop resetting CMOS during s3 resume
After commit e12b313844 ("drivers/pc80/rtc/option.c: Allow CMOS
defaults to extend to bank 1"), Thinkpad X200 with
CONFIG(STATIC_OPTION_TABLE) can no longer resume from s3 (detected via
bisect).

Further inspection shows that DRAM training result of GM45 is stored
in CMOS above 128 bytes in raminit_read_write_training.c, for s3 resume
to restore, but it will be erased by sanitize_cmos(), which now clears
both bank 0 and bank 1, leaving only "untrained" result restored, so s3
resume will fail.

However, resetting CMOS seems unnecessary during s3 resume. Now,
cmos_need_reset will be negated when acpi_is_wakeup_s3() returns true.

Tested: Thinkpad X200 with CONFIG(STATIC_OPTION_TABLE) can resume from
	s3 again with these changes.

Change-Id: I533e83f3b95f327b0e24f4d750f8812325b7770b
Signed-off-by: Bill XIE <persmule@hardenedlinux.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78288
Reviewed-by: Jonathon Hall <jonathon.hall@puri.sm>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-23 12:58:40 +00:00
Ivy Jian 51eee89c78 mb/google/rex: Use upstream driver properties for SX9324
Use human readable properties as upstream driver support.

BUG=b:297977526
TEST=Able to get sensor values changed w/wo a hand covering the device.

before this CL , SSD.dsl of STH9324
Package (0x02)
{
"semtech,ph0-pin",
Package (0x03)
{
	Zero,
	Zero,
	Zero
},
...
Package (0x02)
{
	"semtech,ph23-resolution",
	Zero
	},
Package (0x02)
{
	"semtech,startup-sensor",
	Zero
},
....

after this CL , SSD.dsl of STH9324

Package (0x02)
{
"semtech,ph0-pin",
Package (0x03)
{
	One,
	0x02,
	0x02
},
...
Package (0x02)
{
"	semtech,ph23-resolution",
	0x0400
},
Package (0x02)
{
	"semtech,startup-sensor",
	One
},

Change-Id: Ie0d929228f4510f33b07d9c4cfdfcd2a9a437c27
Signed-off-by: Ivy Jian <ivy.jian@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78174
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
2023-10-23 12:57:57 +00:00
Tim Crawford 61374317b1 mb/system76: Enable BayHub driver for all TGL+
Clevo had apparently swapped the Realtek card reader for the O2 Micro
card reader for newer batches of all TGL models. Enable the BayHub
driver on everything (except bonw15, which doesn't have a card reader)
to fix LTR programming, as was done for other in commit 3d7a5bdf58
("mb/system76: Enable DRIVERS_GENERIC_BAYHUB_LV2 to fix LTR issue").

Tested on system76/galp5: CPU reaches C-states deeper than C2 when idle.

Change-Id: I3667e08acd23c12638159a2f7d2592737a34e63d
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78298
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-23 12:57:32 +00:00
Dtrain Hsu 69cb81d15c mb/google/dedede/var/cret: Modify Goodix touchpad HID
Update Goodix touchpad HID to GDIX0000 for GXTP7288 and GXTP7863.

BUG=b:305118852
BRANCH=firmware-dedede-13606.B
TEST=Build and touchpads are workable
# evtest for GXTP7863
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Lid Switch
/dev/input/event1:      Power Button
/dev/input/event2:      AT Translated Set 2 keyboard
/dev/input/event3:      cros_ec_buttons
/dev/input/event4:      Elan Touchscreen
/dev/input/event5:      GDIX0000:00 27C6:0D51 Mouse
/dev/input/event6:      GDIX0000:00 27C6:0D51 Touchpad

# evtest for GXTP7288
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Lid Switch
/dev/input/event1:      Power Button
/dev/input/event10:     GDIX0000:00 27C6:01F5 Touchpad
/dev/input/event11:     sof-da7219max98360a Headset Jack
/dev/input/event12:     sof-da7219max98360a HDMI/DP,pcm=2
/dev/input/event13:     sof-da7219max98360a HDMI/DP,pcm=3
/dev/input/event14:     sof-da7219max98360a HDMI/DP,pcm=4
/dev/input/event2:      AT Translated Set 2 keyboard
/dev/input/event3:      cros_ec_buttons
/dev/input/event4:      ELAN900C:00 04F3:2E5D
/dev/input/event5:      ELAN900C:00 04F3:2E5D UNKNOWN
/dev/input/event6:      ELAN900C:00 04F3:2E5D UNKNOWN
/dev/input/event7:      ELAN900C:00 04F3:2E5D Stylus
/dev/input/event8:      ELAN900C:00 04F3:2E5D Stylus
/dev/input/event9:      GDIX0000:00 27C6:01F5 Mouse

Change-Id: Id2a6223bdbb2f0693149136baa853ca2efb57815
Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78503
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-23 12:57:15 +00:00
Karthikeyan Ramasubramanian 3167fb70f8 soc/amd/*: Set AMD_FW_AB_POSITION to either 64 or 128 bytes
When CBFS verification is enabled, add amdfw_a/b.rom at offset 128 bytes
to account for CBFS file header with hash attribute. When CBFS
verification is disabled, add amdfw_a/b.rom at offset 64 bytes to
account for CBFS file header without hash attribute.

BUG=None
TEST=Build Skyrim, Myst BIOS images with and without CBFS verification
enabled.

Change-Id: Ic374ac41df0c8fb8ce59488881ce5846e9058915
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78425
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 19:32:43 +00:00
Karthikeyan Ramasubramanian 1394612116 soc/amd/phoenix/psp_verstage: Fix the hash file names
Fix the hash file names to be used to verify signed PSP binaries when
booting with VBOOT FW Slot B.

BUG=None
TEST=Build and boot to OS in Myst with PSP Verstage enabled using both
VBOOT slots A and B.

Change-Id: I89f02922bc901d8ac71d48bf5128fe6ecead43a0
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78236
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 19:32:27 +00:00
Karthikeyan Ramasubramanian 7ab6105aef mb/google/myst: Enable CBFS Verification
Enable RO verification by GSC and RO/RW CBFS verification.

BUG=b:277087492
TEST=Build and boot to OS in Myst with CBFS verification enabled using
PSP verstage.

Change-Id: I2dd3ce59f331f89660185309ccf60c53d50e4fad
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78235
Reviewed-by: Tim Van Patten <timvp@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-20 19:32:14 +00:00
Karthikeyan Ramasubramanian 637a21e27b soc/amd/phoenix: Disable CCP DMA in PSP Verstage
Some stalls are observed while using CCP DMA in PSP verstage -
especially with CBFS verification enabled. Also with RW CBFS
verification enabled, the entire firmware body is not loaded during
verstage for verification. Instead the files are verified as and when
they are loaded from CBFS. Hence the impact to boot time is reduced
since only few files are loaded during PSP verstage. Hence disable CCP
DMA in PSP verstage until the root cause is identified.

BUG=None
TEST=Build and boot to OS in Myst with CBFS verification enabled.

Change-Id: I22ac108b08abcfe432dfd175644393e384888e11
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78234
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 19:31:54 +00:00
Karthikeyan Ramasubramanian 244e3ffcbc soc/amd/phoenix: Add build rules to enable CBFS verification
Add SPI flash RO ranges to be verified by GSC in order to enable CBFS
verification. Also with CBFS verification enabled, CBFS metadata is
more than 64 bytes. So configure the offset of amdfw_a/b to 128 bytes -
next address aligned to 64 bytes.

BUG=b:277087492
TEST=Build and boot to OS in Myst with and without CBFS verification
enabled.

Change-Id: Ibfffd3d6fce8b80ec156a7b13b387e1df8c43347
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78233
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 19:31:13 +00:00
Jeremy Compostella 533efb2308 soc/intel/meteorlake: Set build time physical address reserved bits
Meteor Lake TME bits [42-45] are reserved regardless of if the part
supports TME or not.

On a device with TME fused off, we noticed some reboot hangs which
have been narrowed down to internal IP routing issues when the IA
accesses the Input Output Manager (IOM) which is mapped at
0x3fff0aa0000 (0x3ff upper 32 bits).

It turns out since TME is fused off, coreboot uses the full physical
address size reported by CPUID MAXPHYADDR (46 bits). Therefore, it
allocates thunderbolt memory range on 46 bits (0x3fff upper 32 bits).
Since 4 of these bits are actually reserved, it seems that this
address range is "stripped down" to 42 bits (=> 0x3ff upper 32 bits)
resulting in potential conflict with other devices such as IOM.

BUG=b:288978352
TEST=No reboot issue on rex with TME fused off

Change-Id: I96ba23ab304257003c0413243d3ac8129ce31743
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78452
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 17:51:52 +00:00
Jeremy Compostella 6dff1fd7d5 cpu/intel/common: Define build time physical address reserved bits
According the Intel Software Developer Manual,
CPUID.80000008H:EAX[15:8] reports the physical-address width supported
by the processor.  Unfortunately, it does not necessarily reflect the
physical-address space the system can actulally use as some of those
bits can be reserved for internal hardware use.

It is critical for coreboot to know the actual physical address size.
Overestimating this size can lead to device resource overlaps due to
the hardware ignoring upper reserved bits.  On rex for instance, it
creates some reboot hangs due to an overlap between thunderbolt and
Input Output Manager (IOM) address space.

As some SoCs, such as Meteor Lake, have physical address reserved bits
which cannot be probed at runtime, this commit introduces
`CPU_INTEL_COMMON_RESERVED_PHYS_ADDR_BITS' Kconfig to set the number
of physical address reserved bits at compilation time for those SoCs.

A runtime detection by hardware probing will be attempted if the value
is 0 (default).

BUG=b:288978352

Change-Id: I8748fa3e5bdfd339e973d562c5a201d5616f813e
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78451
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2023-10-20 17:51:46 +00:00
Matt DeVillier d947639a48 Revert "mb/google/rex: Enable sending EOP from payload"
This reverts commit 55b7dee278.

Reason for revert: accidentally submitted out of order / breaks tree

Change-Id: Ic15d0e3688cd54f7d678998341263e7bd30e75f2
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78525
Tested-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2023-10-20 17:13:27 +00:00
Matt DeVillier 8ea8940e39 Revert "ec/dell/mec5035: Hook up radio enables to option API"
This reverts commit bb5fa6419d.

Reason for revert: accidentally committed out of order; reverting to
unbreak tree

Change-Id: I36aa1fd3a0befe49b7e9e34198676f16fb08cf73
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78524
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: Martin L Roth <gaumless@gmail.com>
2023-10-20 17:11:45 +00:00
Nicholas Chin bb5fa6419d ec/dell/mec5035: Hook up radio enables to option API
Change-Id: I52de5ea3d24b400a93adee7a6207a4439eac61db
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77535
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2023-10-20 14:34:00 +00:00
Jeremy Compostella 226f51c765 x86: Add ramstage CBFS cache scratchpad support
Having a CBFS cache scratchpad offers a generic way to decompress CBFS
files through the cbfs_map() function without having to reserve a
per-file specific memory region.

This commit introduces the x86 `RAMSTAGE_CBFS_CACHE_SIZE' Kconfig to
set a ramstage CBFS cache size.  A cache size of zero disables the
CBFS cache feature.  The default size is 16 KB which seems a
reasonable minimal value large enough to satisfy basic needs such as
the decompression of a small configuration file.  This setting can be
adjusted depending on the platform needs and capabilities.

To support S3 suspend/resume use-case, the CBFS cache memory cannot be
released to the operating system. There are two options to meet this
requirement:

1. Define a static CBFS cache buffer (located in the .bss section)
2. Create a new CBMEM entry

Option #2 seems more powerful but considering that:

1. The CBFS cache is actually not a cache but just a scratch pad
   designed to be isolated between stages
2. postcar is a very short stage not really needing CBFS cache
3. The static initialization of the `cbfs_cache' global
   variable (cf. src/lib/cbfs.c) offers a simple and robust design

=> It is simpler to use a static buffer and limit the support to
ramstage.

Since some AMD SoCs (cf. `SOC_AMD_COMMON_BLOCK_NONCAR' Kconfig) define
a `_cbfs_cache' region, an extra `POSTRAM_CBFS_CACHE_IN_BSS' Kconfig
must be set to enable the use of a static buffer as the CBFS cache
scratchpad.

TEST=Decompression of vbt.bin in ramstage on rex using cbfs_map()

Change-Id: I7fbb1b51cda9f84842992e365b16c5ced1010b89
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77885
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:33:20 +00:00
Jeremy Compostella 052fb7c451 x86: Add pre-memory stages CBFS cache scratchpad support
Having a CBFS cache scratchpad offers a generic way to decompress CBFS
files through the cbfs_map() function without having to reserve a
per-file specific memory region.

This commit introduces the x86 `PRERAM_CBFS_CACHE_SIZE' Kconfig to set
the pre-memory stages CBFS cache size.  A cache size of zero disables
the CBFS cache feature.  The default value is 16 KB which seems a
reasonable minimal value enough to satisfy basic needs such as the
decompression of a small configuration file. This setting can be
adjusted depending on the platform needs and capabilities.

We have set this size to zero for all the platforms without enough
space in Cache-As-RAM to accommodate the default size.

TEST=Decompression of vbt.bin in romstage on rex using cbfs_map()

Change-Id: Iee493f9947fddcc57576f04c3d6a2d58c7368e09
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77290
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-10-20 14:32:44 +00:00
Jeremy Compostella 621ccf8a97 cbfstool: Skip relocation entries pointing to undefined symbol
The linker can make relocation entries of a symbol which has a value
of zero point to the undefined symbol entry.  It is permitted since
when the symbol value is zero as the documentation of the relocation
entry `r_info' field states:

"If the index is STN_UNDEF, the undefined symbol index, the relocation
 uses 0 as the symbol value."

The ELF binary does not really have any missing symbols.  It is an
optimization as the symbol points to the undefined symbol because its
value is zero.

A typical way to hit this cbfstool limitation is to define an empty
region using the REGION macro in the linker script.  Here is an
example if we assume `CONFIG_MY_REGION' is set to 0:

    .car.data {
            [...]
	    REGION(my_region, CONFIG_MY_REGION_SIZE)
	    [...]
    }

A region is defined as follow:

    #define REGION_SIZE(name) ((size_t)_##name##_size)

    #define DECLARE_REGION(name)	\
            extern u8 _##name[];	\
            extern u8 _e##name[];	\
            extern u8 _##name##_size[];

So the size of the region is actually the address of the
`_##name##_size' symbol.  Therefore, the `_my_region_size' symbol
address is zero and the linker can make the relocation entry of this
symbol point to the undefined symbol index.

In such a situation, cbfstool hits a segmentation fault when it
attempts to relocate the symbol in `parse_elf_to_xip_stage()'
function.  We resolves this issue by making cbfstool skips relocation
entries pointing to the undefined symbol similarly to the way it skips
relocation relative to absolute symbols.  A symbol which value is zero
can be considered an absolute symbol and therefore should not be
relocated.

Of course, we could argue that we could just prevent the declaration
of an empty region as illustrated in the following example:

    .car.data {
            [...]
	    #if CONFIG_MY_REGION_SIZE > 0
            REGION(my_region, CONFIG_MY_REGION_SIZE)
	    #endif
	    [...]
    }

However, this is not a satisfying solution because:

1. It requires to add unnecessary code in the linker script as an empty
   region is a valid declaration.  Such a workaround requires the code
   using it to mark the region symbols as weak symbols to handle the
   situation where the region is not defined.

2. There could be other situations which have yet to be uncovered which
   would lead the same cbfstool crash.

3. A binary with an empty region is a valid ELF file and cbfstool
   should not crash when it is asked to create an eXecute-In-Place stage
   out of it.

Change-Id: I2803fd3e96e7ff7a0b22d72d50bfbce7acaeb941
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77699
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-10-20 14:32:20 +00:00
Arthur Heymans 7f1f2973c5 soc/cavium/cn81xx/bootblock_custom.S: Specify arch
This fixes assembling with clang which complains about fpu instructions.

TEST: BUILD_TIMELESS=1 remains the same.

Change-Id: I175b8e749fafde5fb7ffb8101fc0dc892d9b4e0d
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74539
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:30:54 +00:00
Kapil Porwal 55b7dee278 mb/google/rex: Enable sending EOP from payload
Enable sending EOP from payload

BUG=b:279184514
TEST=Verify sending EOP from depthcharge on google/rex

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: I5eda0a5c6d4c34cfcc2de898adde0b005d6edc1e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74768
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:29:56 +00:00
Morris Hsu 9bf0dee146 mb/google/brya/var/dochi: Enable EC keyboard backlight
Enable EC keyboard backlight for dochi.

BUG=b:299284564
TEST=FW_NAME=dochi emerge-brya coreboot chromeos-bootimage

Change-Id: I1b640c576fcdd368110b88cba6f969f10dfc15f1
Signed-off-by: Morris Hsu <morris-hsu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78395
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Bob Moragues <moragues@google.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-20 14:29:37 +00:00
Varshit Pandya 9acc572caa soc/amd/genoa: Add Global NVS
Change-Id: I8d64236fc81e848503535db6f52e93328a60404c
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78391
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:29:17 +00:00
Arthur Heymans c5122f9f1c soc/amd/genoa: Hook up IOMMU ops
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I2419feed1a76ec1cb04cb9640689b8758fa1d3f8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76527
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:28:57 +00:00
Varshit Pandya 0a2d2a9744 soc/amd/genoa: Add SMU header file and SMU Kconfig
Change-Id: Ief56bff2a1b8825d6e65aeb5f7ed9e8f432e465b
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78390
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
2023-10-20 14:28:48 +00:00
Arthur Heymans 49bbe34829 soc/amd/genoa: Hook up LPC ops
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I068fcbbcb0641cddce8fa85e2a64ab44d91d6bcf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76526
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:28:13 +00:00
Varshit Pandya a775958938 soc/amd/genoa: Add MAX_CPUS
As per PPR, Genoa supports up to 96 core, that is 192 threads.
It also supports dual socket.

Change-Id: I817fea7c41477f476794e9e5c16451037d01f912
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78402
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:28:00 +00:00
Tyler Wang 6856f56be5 mb/google/rex/var/karis: Remove I2C2 "on" settings
GPP_H04/GPP_H05 doesn't use for I2C usage, remove I2C2 "on" settings.

BUG=b:294155897
TEST=Check ap firmware log, i2c2 is disabled

Change-Id: I0124fd108fbbd87507d252e9caab4dfc16aceddb
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78339
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eran Mitrani <mitrani@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:27:29 +00:00
Bora Guvendik cfec7a26c6 mb/google/rex: Set frequency and gears for SaGv points
Update SaGv gears and frequency values as per recommendation
from power and performance team. This change doesn't cause
negative impact on firmware boot time performance.

BUG=b:274137879
TEST=Verified the settings on google/rex using debug FSP logs.

Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Change-Id: Ie8a81c05f25b1cdab1008d09c606d1debea6e6e4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78268
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-10-20 14:27:04 +00:00
Karthikeyan Ramasubramanian 204a4e6d9f soc/amd/common/psp_verstage: Add PSP_VERSTACK_STACK_IS_MAPPED config
Crypto Engine in PSP prefers the buffer from Static RAM (SRAM). Hence if
a buffer comes from within SRAM address range, then it is passed
directly to Crypto Engine. Otherwise a bounce bufer from the stack is
used. But on SoCs like Picasso where PSP Verstage stack is mapped to a
virtual address space this check fails causing a bounce buffer to be
used and hence a stack overflow. Fix this issue by assuming that the
buffer comes from the SRAM always in such SoCs and pass the buffer
directly to crypto engine.

BUG=b:259649666
TEST=Build and boot to OS in Dalboz with unsigned PSP verstage.

Change-Id: I2161c8f0720c770efa5c05aece9584c3cbe7712a
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78426
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:26:25 +00:00
CoolStar 64ba070fd1 drivers/generic/bayhub: Add ACPI for BH720
The Bayhub BH720 eMMC bridge is a fixed internal device, and needs to
me marked as non-removable in order for Windows to properly recognize/
utilize the device. Add the necessary ACPI to be generated at runtime.

TEST=build/boot/install Win11 on google/kahlee (liara)

Change-Id: I0815abf1d2dc5cfe785dc04670ab91f2a6a1af23
Signed-off-by: CoolStar <coolstarorganization@gmail.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78403
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-20 14:26:11 +00:00
CoolStar f2e14fbb40 mb/google/kahlee: Hide Linux machine audio devices from Windows
Windows does not use these devices for audio. Hide these so they don't
clutter device manager.

Change-Id: Ic85eff7f7ff68e25cc005bbb822bf99374c96532
Signed-off-by: CoolStar <coolstarorganization@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78418
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:25:32 +00:00
Arthur Heymans 0b0113f243 device/device.h: Rename pci_domain_scan_bus
On all targets the domain works as a host bridge. Xeon-sp code intends
to feature multiple host bridges below a domain, hence rename the
function to pci_host_bridge_scan_bus.

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I4e65fdbaf0b42c5f4f62297a60d818d299d76f73
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78326
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
2023-10-20 14:24:57 +00:00
CoolStar ce84a347bf acpi: Reserve hardware ID for custom AMD ACP driver
AMD Audio CoProcessor handles I2S audio on AMD SoC's. Prior to AMD
Ryzen platforms (e.g. STONEY) it is located on the Integrated GFX
device. As the proprietary AMD driver does not support accessing this
easily, reserve a custom ACPI ID from the coreboot namespace so that
another driver can be attached in Windows device manager.

Change-Id: I855b81908ed9ad0587b6367b052c726c36350208
Signed-off-by: CoolStar <coolstarorganization@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78405
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:23:55 +00:00
Tyler Wang ef68e98ff4 mb/google/rex/var/karis: Use 2 gpio for stylus detect/wake
Use 2 gpio for stylus detect and wake function.
GPP_E04 is the IRQ source, and GPP_E09 is the wake source.

BUG=b:304680060
TEST=Build and test on karis, stylus detect function works

Change-Id: I7a83326f76932c8e501e6369bb845fc7236291b4
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78336
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:23:40 +00:00
Rex Chou 69892eedf6 mb/google/nissa/var/craaskov: Use runtime detection for touchscreens
Use runtime detection for touchscreens.

BUG=b:289962599
BRANCH=firmware-nissa-15217.B
TEST=emerge-nissa coreboot

Change-Id: Ia43ada8b3b6dbee95dbadacc353106e0f8f37549
Signed-off-by: Rex Chou <rex_chou@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78338
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-20 14:23:17 +00:00
Sean Rhodes 8d730224ac mb/starlabs: Set POWER_STATE_OFF_AFTER_FAILURE
This Kconfig option is used as a failback when `get_uint_option`
fails. It will fail after coreboot is flashed, as the cfr code has
not yet setup the options.

Change the default to OFF, so when it does fallback, it's the correct
behaviour.

Change-Id: I5d06047fe23322520e9c84ded8f1941f6d716a51
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78223
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:22:50 +00:00
Sean Rhodes 34b4a2efd3 mb/starlabs/starbook: Include ACPI for GNA scoring accelerator
Change-Id: Id42d07aabfd08c6c7a38515f9cf4b749750deecd
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78202
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:22:42 +00:00
Sean Rhodes 8ef072cf14 mb/starlabs/starbook/adl: Enable PchHdaSdiEnable
This is required for the HDA device to work.

Change-Id: I5fd3617c4cb1e69b7e0ecf6cddf4c143da99b927
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78201
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:22:23 +00:00
Jonathon Hall a86704aa10 mb/purism/librem_jsl: Add support for Librem 11
This adds support for the Librem 11 tablet, using the ME 13.50.15.1436
binary from the original BIOS (version 28.D8.E1.021) and FSP binaries
from a Jasper Lake Chromebook.

The following features were tested with PureOS:
* Audio (speakers, microphone, headset jack)
* Cameras
* Display
* Touchscreen and pen
* Keyboard cover, with tablet/laptop mode switch indicated via ACPI
* Power and volume buttons
* USB-C ports (USB 2/3, DP alt mode, PD charging)
* SD card reader
* WLAN
* Bluetooth
* NVMe SSD (socketed)
* Battery state information from EC
* Accelerometer

A UART is accessible with soldering via test points on the mainboard,
documented in the mainboard Kconfig with a toggle to enable it for
coreboot logging.

Change-Id: I545994889ddfb41f56de09b3a42840bccbd7c4aa
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78343
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:22:07 +00:00
Rex Chou 24502f4cb0 mb/google/nissa/var/craaskov: Remove TOF function
Based on schematics and confirm with EE to remove TOF function.

BUG=b:290891557
BRANCH=firmware-nissa-15217.B
TEST=emerge-nissa coreboot

Change-Id: I1ae6a6562d87f8da5f41691a7606a1aa10989443
Signed-off-by: Rex Chou <rex_chou@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78147
Reviewed-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:21:46 +00:00
Jonathon Hall 484b24234c mb/purism/librem_cnl: Add ALC269 and adjust GPIOs for Librem 14 v1-02
The next board revision of Librem 14 (v1-02) has replaced the ALC256
codec with ALC269.  Add verbs for it.

Two GPIOs were changed from SMBus native functions to NC for this
revision.  They are not used on either revision, change to NC.

Change-Id: I43b6265d2f502c05d5539ff3abf53ade0da6d706
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78347
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:20:30 +00:00
Jonathon Hall 960209e7ee mb/purism/librem_cnl: Support Comet Lake v1 and v2 for Librem 14
New Librem 14s have a newer CPU stepping, which changes them from CML
v1 to v2.  The product is not significantly different and remains v1,
specifically "v1-02".

Select SOC_INTEL_COMETLAKE_1_2 to support all CPU steppings.

Change-Id: Iab37208b81e973714a2c088d2346eda518bf1214
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78346
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:20:21 +00:00
Jonathon Hall 4dfa90613c soc/intel/cannonlake: Support Comet Lake v1 and v2 in one build
Define SOC_INTEL_COMETLAKE_1_2, which creates a build supporting both
Comet Lake v1 and v2 by including both sets of FSP binaries and
selecting one based on the CPUID.

A mainboard can select this instead of SOC_INTEL_COMETLAKE_1 or ..._2
to support all CML-U steppings in one build.

Change-Id: Ic8bf444560fd6b57064c47faf038643fabde010e
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78345
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
2023-10-20 14:20:08 +00:00
Jonathon Hall eb834d9d13 drivers/intel/fsp2_0: Support embedding a second FSP-M/FSP-S
Support embedding a second FSP-M/FSP-S binary for an SoC that can
select one at runtime.

Comet Lake v1 and v2 are different steppings of the same SKUs, but they
require different FSP binaries.  Supporting both in a single build
requires embedding both FSPs and selecting one at runtime based on the
CPUID.  This is desirable for a product that may have different CPU
steppings but is not otherwise differentiated enough for a separate
firmware build.

An SoC can select PLATFORM_USES_SECOND_FSP to indicate that two FSP-M/
FSP-S binaries are required.  Implement soc_select_fsp_m_cbfs() and
soc_select_fsp_s_cbfs() to choose one based on platform-specific
criteria.  For Comet Lake, the first FSP is CML v1 and the second is
CML v2, but in principle a platform could define any meaning for the
first and second FSP.

FSP-T is not affected, only one FSP-T can be embedded if FSP_CAR is
used.

Only one set of FSP headers is used, which is sufficient for Comet Lake
v1/v2; their headers are equivalent.

ADD_FSP_BINARIES, FSP_USE_REPO, and FSP_FULL_FD are supported for both
sets of FSP-S/FSP-M but cannot be configured separately, both use the
same configuration.

Change-Id: Ied4c6c49a6bdf278238272edd47a2006258be8e5
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78344
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2023-10-20 14:19:52 +00:00
Felix Singer 4ed3ea668c util/liveiso/nixos: Drop XFS package
XFS is barely used. In order to save some space, drop it from the
package list.

Change-Id: Ic1cc567eb3f555bdf5567f3d036c84ce58691128
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78400
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-19 21:01:56 +00:00
Felix Singer 2282ed7c71 util/liveiso/nixos: Bump to 23.05
Bump to 23.05 and also rename settings in order to compliant with newest
namespaces and names.

Change-Id: I4a23466bef5c45ebb82d92038ec2595103c984d3
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78399
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2023-10-19 21:01:50 +00:00
Ravi Sarawadi 180c702bb9 soc/intel/meteorlake: Update TBT PCIe Reg Map offsets for QS
Within TBT PCIe, following register offsets have been updated for
production silicon. Update ASL with new offsets.
1. MPC - Miscellaneous Port Configuration Register
2. RPPGEN - Root Port Power Gating Enable
3. SMSCS - SMI/SCI Status Register

BUG=306026121
TEST= Check TBT PCIe Tunnel creation and device enumration.
Change-Id: I0497f7108ef5046c2694aece232263582514a0c5
Signed-off-by: Ravi Sarawadi <ravishankar.sarawadi@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78163
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Jamie Ryu <jamie.m.ryu@intel.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-10-19 16:19:31 +00:00