Commit graph

62,395 commits

Author SHA1 Message Date
Subrata Banik
a6842184ab mb/google/fatcat/var/kinmen: Use ACPI for touchscreen power sequencing
This commit removes redundant touchscreen GPIO configurations from
romstage_gpio_table. These GPIOs are no longer required to be explicitly
set for the touchscreen while using ACPI for touchscreen power
sequencing.

When the generic.use_gpio_for_status flag is enabled, the touchscreen
driver's power resource method will perform a probe to determine the
device's operational status. This probe specifically verifies two
critical conditions:

- The Enable GPIO pin is enabled (HIGH).
- The Reset GPIO pin is not in reset (LOW).

If both of these conditions are met, the touchscreen is considered ready
and functional.

Conversely, if either of these conditions is not met, the _ON method
within the power resource will be invoked. The _ON method is then
responsible for executing the full touchscreen initialization sequence
to bring the device into an operational state.

BUG=b:430444353
TEST=Able to build and boot google/kinmen. Verified touchscreen is
working as expected with this patch.

Change-Id: I0bb2e1ddd4168ef1831b30817dbb3bc3f6e6a5d2
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88518
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-24 09:00:25 +00:00
Subrata Banik
712aac780f mb/google/rex/kanix: Use ACPI for touchscreen power sequencing
This commit transitions the touchscreen power sequencing for the Karis
variant from static coreboot GPIO configuration to ACPI-driven
management. This allows the kernel's touch driver to handle the power
sequencing, providing more flexible and dynamic control.

Redundant touchscreen GPIO configurations are removed from
early_gpio_table, and romstage_gpio_table. These GPIOs are no
longer required to be explicitly set in coreboot given the shift to ACPI
power sequencing.

The generic.use_gpio_for_status register is set to true in the
device's override tree to enable ACPI power sequencing for touchscreen
signaling.

When the generic.use_gpio_for_status flag is enabled, the touchscreen
driver's power resource method will perform a probe to determine the
device's operational status. This probe specifically verifies two
critical conditions:

- The Enable GPIO pin is enabled (HIGH).
- The Reset GPIO pin is not in reset (LOW).

If both of these conditions are met, the touchscreen is considered ready
and functional.

Conversely, if either of these conditions is not met, the _ON method
within the power resource will be invoked. The _ON method is then
responsible for executing the full touchscreen initialization sequence
to bring the device into an operational state.

BUG=b:430444353
TEST=Able to build and boot google/kanix. Verified touchscreen is
working as expected with this patch.

Change-Id: I5c049c76fed185a40c31a6e779119c953926e6c9
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88517
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-24 09:00:14 +00:00
Subrata Banik
26e6d0be00 mb/google/rex/var/karis: Use ACPI for touchscreen power sequencing
This commit transitions the touchscreen power sequencing for the Karis
variant from static coreboot GPIO configuration to ACPI-driven
management. This allows the kernel's touch driver to handle the power
sequencing, providing more flexible and dynamic control.

Redundant touchscreen GPIO configurations in bootblock and romstage are
removed from early_gpio_table, and romstage_gpio_table. These GPIOs are
no longer required to be explicitly set in coreboot given the shift to
ACPI power sequencing.

The generic.use_gpio_for_status register is set to true in the
device's override tree to enable ACPI power sequencing for touchscreen
signaling.

When the generic.use_gpio_for_status flag is enabled, the touchscreen
driver's power resource method will perform a probe to determine the
device's operational status. This probe specifically verifies two
critical conditions:

- The Enable GPIO pin is enabled (HIGH).
- The Reset GPIO pin is not in reset (LOW).

If both of these conditions are met, the touchscreen is considered ready
and functional.

Conversely, if either of these conditions is not met, the _ON method
within the power resource will be invoked. The _ON method is then
responsible for executing the full touchscreen initialization sequence
to bring the device into an operational state.

BUG=b:430444353
TEST=Able to build and boot google/karis. Verified touchscreen is
working as expected with this patch.

Change-Id: I967650290dda9ca3ca66a2f161fff0ae84b14f04
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88516
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-24 09:00:02 +00:00
Jian Tong
00d99a6e9b mb/google/brox/var/lotso: Configure Acoustic noise mitigation
- Enable Acoustic noise mitigation
- Set slow slew rate VCCIA and VCCGT to SLEW_FAST_4
- Set FastPkgCRampDisable VCCIA and VCCGT to 1

BUG=b:404416910
TEST=emerge-brox coreboot chromeos-bootimage
	USE=fw_debug confirm SlowSlewRate set to 1 at FSP

Change-Id: I0b8622472e4e851bb5d1d64367a402f7ad6dfabc
Signed-off-by: Jian Tong <tongjian@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88537
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Dengwu Yu <yudengwu@huaqin.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kun Liu <liukun11@huaqin.corp-partner.google.com>
2025-07-24 08:46:57 +00:00
LiLiang Chen
4b6ebbdd94 mb/google/skywalker: Initialize clkbuf and srclken in romstage
Initialize clkbuf and srclken drivers.

BUG=b:379008996,b:422503190,b:403478729
BRANCH=none
TEST=1. Check register is configured  correctly:
clkbuf:
[clk_buf_init_pmic_clkbuf] XO_WCN_VOTER(0x7c0)
[clk_buf_init_pmic_clkbuf] XO_NFC_VOTER(0x1)
[clk_buf_init_pmic_clkbuf] XO_CEL_VOTER(0x7c0)
[clk_buf_init_pmic_clkbuf] XO_EXT_VOTER(0x1)
srclken:
RG_CENTRAL_CFG1: 0x104014e5
RG_CENTRAL_CFG2: 0x1010
RG_CENTRAL_CFG3: 0x400f
RG_CENTRAL_CFG4: 0x2020800
RG_CENTRAL_CFG5: 0x1bfc1761
RG_CENTRAL_CFG6: 0x0
2. Pass Y1_PMIC MT6365-26MHz cystal test.

Signed-off-by: LiLiang Chen <liliang.chen@mediatek.corp-partner.google.com>
Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Change-Id: I9fe79a9f457f3e2efd2e810b87ea91c92ddd69b5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88526
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2025-07-24 06:38:47 +00:00
LiLiang Chen
f131f0e336 soc/mediatek/mt8189: Add clk_buf and srclken_rc drivers
MT8189 uses MT6359 clk_buf, and will use new RC mode with srclken_rc.
The clk_buf will provide several 26M clocks, and these clocks can be
independently turned on.

BUG=b:379008996,b:422503190,b:403478729
BRANCH=none
TEST=show driver init log:
RG_CENTRAL_CFG1: 0x104014e5
RG_CENTRAL_CFG2: 0x1010
RG_CENTRAL_CFG3: 0x400f

Signed-off-by: LiLiang Chen <liliang.chen@mediatek.corp-partner.google.com>
Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Change-Id: Ia04526d55191c695caf3ef40002e1ec99f299966
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88525
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-24 06:38:40 +00:00
Jeremy Compostella
2de0158eec soc/intel/pantherlake: Add asynchronous CBFS file loading support
This commit introduces support for asynchronous coreboot File
System (CBFS) file loading from SPINOR, specifically targeting the
fsps.bin file, in the Intel Panther Lake (PTL) System on a Chip (SoC)
platform. The primary motivation for this change is to improve boot time
performance by utilizing SPI Direct Memory Access (DMA) to preload files
while the Central Processing Unit (CPU) continues executing other tasks.

This feature uses cooperative multithreading. Because the scheduling is
cooperative, the boot process stays mostly predictable, which minimizes
debugging difficulties while still enhancing boot performance.

The preload operations are strategically modified according to the
chipset lockdown settings. This guarantees that payload preloading is
finalized prior to SPI DMA locking when the chipset lockdown is managed
by FSP or otherwise maximizes the pre-loading feature.

Note: As there is no UPD to control the Fast DMI DMA interface lockdown,
a special FSP binary, built without the Fast SPI DMA driver
(PcdSpiDmaEnable), is required when chipset lockdown setting is set to
CHIPSET_LOCKDOWN_COREBOOT.

TEST=On a Fatcat device, with CHIPSET_LOCKDOWN_COREBOOT, the boot time
     has improved by around 17-18 ms.

Change-Id: I4106058d382b99eac5f988c134cc02f024f7d473
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88300
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-23 22:07:55 +00:00
Jeremy Compostella
eb1b5ee116 soc/intel/cmn/block/fast_spi: Introduce a DMA transfer queue
This commit implements a token-based queuing system to reduce delays
between consecutive DMA operations. The queuing mechanism aims to
improve overall throughput.

A Kconfig option FAST_SPI_DMA_QUEUE_SIZE defines the maximum number of
concurrent DMA transfers that can be queued and processed.

When DMA transfers are queued, a new thread is initiated to run
fast_spi_dma_main_thread(). This function consistently monitors for
available transfer tokens and performs DMA operations when tokens are in
the DMA_REQUESTED state. If there are no tokens in the desired state,
the thread_running flag is set to false, and the thread terminates
smoothly.

While it provides a barely perceptible boot time improvement with the
Panther Lake configuration, it makes the boot flow more consistent and
predictable.

TEST=On a Fatcat device with CBFS_PRELOAD enabled and set up, we observe
     consecutive logs as follows, proving a new DMA transfer is issued
     as soon as the previous one's completion is detected.
     [DEBUG]  Fast-SPI: transfer completed in 2574 us
     [DEBUG]  Fast-SPI: Reading 240 blocks via DMA

Change-Id: Ic5249362041cfa028885874b43893e1d7942ed94
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88474
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
2025-07-23 22:07:39 +00:00
Sowmya Aralguppe
182ba52792 soc/intel/pantherlake: Remove mailbox interface offset
In PTL Crashlog Watcher interface is used instead of Mailbox since it
is based on the Intel Platform Monitoring Technology (PMT) standard.
The Watcher interface provides a more flexible and efficient way to
control and monitor crashlog collection. Hence the functionalities like
rearm and clear are implemented using watcher interface instead of BIOS
mailbox to PUNIT.

Change-Id: I24c5c9753a577b255a7129d20ab83f93001a0485
Signed-off-by: Sowmya Aralguppe <sowmya.aralguppe@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88500
Reviewed-by: <srinivas.kulkarni@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
2025-07-23 17:11:54 +00:00
Sowmya Aralguppe
2ee78458be soc/intel/pantherlake: Use CONSUMED_BIOS bit
After the BIOS reads and processes the crashLog record, it sets the
CONSUMED_BIOS bit to indicate that the reading and storing of crashlog
record is complete. This is read only bit. When this bit is set ,
crashlog discovery and data collection are skipped. This bit helps in
preventing the same crashLog from being extracted multiple times after
a reset.

BUG= b:None
TEST= The header value during warm boot after crash
      cpu_cl_disc_tab.header.data dw0=88420003, dw1=0x0

Change-Id: I4b9e6900218f28b6beb71b7667bc1c57f0134a84
Signed-off-by: Sowmya Aralguppe <sowmya.aralguppe@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88499
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Reviewed-by: <srinivas.kulkarni@intel.com>
2025-07-23 17:11:37 +00:00
Kapil Porwal
9a8ba5b39a {lib, drivers/intel}: Move BMP rendering logic out of SoC code
This patch refactors the BMP rendering logic, moving it from
drivers/intel/fsp2_0 to src/lib. This centralizes the code
responsible for rendering BMP images to the framebuffer.

Key changes:
- Move BMP rendering functions (e.g., calculate_logo_coordinates,
  copy_logo_to_framebuffer) and their dependencies to
  src/lib/render_bmp.c and src/lib/render_bmp.h.
- Decouple BMP definitions from UEFI headers by introducing new
  coreboot-specific structures for BMP images and BLT pixels.
- Consolidate bootsplash-related declarations into bootsplash.h,
  including new `fw_splash_vertical_alignment`,
  `fw_splash_horizontal_alignment`, and `struct logo_config`.
- Update `soc_load_logo_by_coreboot` to use the new common
  `load_and_render_logo_to_framebuffer` function and `struct
  logo_config` for rendering.
- Relocate `release_logo` to `src/lib/render_bmp.c` for better
  module structure.
- Update `src/lib/Makefile.mk` to include the new render_bmp.c.

This refactoring improves code organization and reusability, making
BMP rendering accessible without tight coupling to Intel-specific
driver code.

BUG=b:427387842
TEST=Verify firmware splash screen on google/fatcat.

Change-Id: I0e20ea7e44b4b3ccdb2d4aa9b6aa10ed3447ccfc
Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88361
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-23 17:11:10 +00:00
Ivy Jian
a617317775 mb/google/fatcat/var/kinmen: Support SAR table selection via FW_CONFIG
Add wifi SAR table support for kinmen. Bit 2 in the CBI/FW_CONFIG
field is used to determine which SAR table file to load at runtime.

BUG=b:424628935
TEST= check coreboot log:
before:

[WARN ] CBFS: 'wifi_sar_defaults.hex' not found.
[ERROR] Failed to get the wifi_sar_defaults.hex file size!
[ERROR] failed getting SAR limits!

after:

[INFO ] Use wifi_sar_0.hex.
[INFO ] CBFS: Found 'wifi_sar_0.hex' @0x7072c0 size 0x116 in mcache @0x73abdd28

Change-Id: I63e44ba0a4094264165cc9bd7e41c4bd2094c242
Signed-off-by: Ivy Jian <ivy.jian@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88458
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2025-07-23 17:10:44 +00:00
David Wu
92dd8cea59 mb/google/nissa/var/riven: Add parade touchscreen support
This change adds the necessary configuration for the parade
touchscreen (PRT3406) device, connected to I2C bus 24.

It includes settings for:
* HID descriptor
* Device description
* IRQ configuration
* Detection
* Reset, stop and enable GPIOs with their respective delays
* Power resource handling
* HID descriptor register offset

BUG=b:431658711
TEST=emerge-nissa coreboot and parade touchscreen can work well

Change-Id: I5ca4853c4105d422b907c29fd0b3a4f2a1ce6d9f
Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88483
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-23 17:10:27 +00:00
Ian Feng
b98f786375 mb/google/fatcat/var/francka: Increase reset delay to 100ms for ILTK0001
Fix resume failure on i2c-ILTK0001:00 where acpi_subsys_resume
returns -121. Increase reset_delay_ms from 10ms to 100ms to
ensure the device is ready after reset.

BUG=b:411164455
TEST=Build and boot and verified resume time across 5 cycles.
All within 500 ms limit.
Suspend-resume time w/ and w/o:

w/o: Average=433.6 ms
1. Resume time 430 ms within limit of 500 ms
2. Resume time 435 ms within limit of 500 ms
3. Resume time 440 ms within limit of 500 ms
4. Resume time 430 ms within limit of 500 ms
5. Resume time 433 ms within limit of 500 ms

w/: Average=449.4 ms
1. Resume time 440 ms within limit of 500 ms
2. Resume time 439 ms within limit of 500 ms
3. Resume time 451 ms within limit of 500 ms
4. Resume time 482 ms within limit of 500 ms
5. Resume time 435 ms within limit of 500 ms

Change-Id: I67ea9aa5ca8ba6f30f772c2decd464d889865347
Signed-off-by: Ian Feng <ian_feng@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88527
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-23 17:10:17 +00:00
Luca Lai
5f0177ac5d mb/google/trulo/var/pujjolo: Update Stylus IRQ wakeup group
Because when stylus bringing into the garage will resume
from suspend using powerd_dbus_suspend command, so
update the stylus setting which wake_gpe from DW0 to DW2
to fix the funtion.

BUG=b:430712526
BRANCH=none
TEST= Build and boot to OS and check when stylus bringing into
garage and the system will not resume from suspend.

Change-Id: I526b608b03631f365bb33fc44904c87b00a47436
Signed-off-by: Luca Lai <luca.lai@lcfc.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88479
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-23 17:10:07 +00:00
Felix Held
5b1a8b53b6 soc/amd/common/i23c_pad_ctrl: add I3C pad config options
Before, the I2C/I3C pads could only be configured to I2C mode. To be
able to use the I3C controller, add the corresponding options and
implementation for the I3C pad mode with all possible voltages.

Change-Id: I1cc2e830019101cfef96b9474477717a8a75111c
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87435
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
2025-07-23 17:09:55 +00:00
Patrick Rudolph
4b58ec5ac2 soc/amd/common/block/psp: Add fTPM specific bits
Add helper functions for PSP fTPM support.

Signed-off-by: Patrick Rudolph <patrick.rudolph@amd.com>
Change-Id: I5c111bbdda52859381693cb0a15d49f3284a2291
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88355
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2025-07-23 17:09:31 +00:00
Jincheng Li
15bf25de78 Documentation/soc/intel: Update the referenced linuxboot_defconfig
Changes mainly include:
- Switch kernel compression from LZ4 to LZMA for better compression
  efficiency.
- Support loopback block device.
- Enable SCSI and ATA support.

Change-Id: I1a46a239eead27efa709ee07bf1b85a10cd631b4
Signed-off-by: Jincheng Li <jincheng.li@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88501
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
2025-07-23 17:09:15 +00:00
Sowmya Aralguppe
debfac6352 mb/google/ocelot/var/ocelot: Add wake support for touchpad
This patch supports wake on touch for touchpad when LPSS I2C interface
is used by overriding GPE DW0 with group GPP_F.

Schematic version: schematic_1433518
Platform Mapping Document : Rev0p86

BUG=b:394208231
TEST= Build Ocelot and verify it compiles without any error.

Change-Id: Id2cc248aacebc0e85d06ad5c63c0605dd72cd05c
Signed-off-by: Sowmya Aralguppe <sowmya.aralguppe@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88534
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Pranava Y N <pranavayn@google.com>
Reviewed-by: Avi Uday <aviuday@google.com>
2025-07-23 17:09:00 +00:00
Patrick Rudolph
b6425a9a78 soc/amd/common: Add comments about bootblock
Since the boot flow is different on AMD compared to other x86
platforms document what is done and where.

Explain that AMDCOMPRESS does more than compressing the input.
It also parses the input as an ELF and extracts the first PT_LOAD marked
area from it and discards all other information from the ELF.

Explain bootblock.bin generation and that it has not much to do
with bootblock.elf, unlike on other platforms.
While on it also fix a whitespace in the following line.

Change-Id: Ida763f879c133be54ea1ca2abd3059db0d2c1ef7
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87316
Reviewed-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2025-07-23 17:01:19 +00:00
Patrick Rudolph
69888bc7fc util/cbfstool/amdcompress: Bail out on invalid ELF
Ensure that only one PT_LOAD segment is inside the input ELF as
the tool only expects and support one PT_LOAD segment. Instead of silently
discarding all other PT_LOAD segments than the first throw an error.

Change-Id: I90cfc8b9dd0b5e8060880790e5ff0ce73843943b
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87315
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-23 17:00:41 +00:00
Bincai Liu
3b008bde8c soc/mediatek/mt8196: Fix intermittent black screen issue
Currently we set DP_PHY_DIG_TX_CTL_0 during the PHYD reset flow.
However, that would cause the training to fail and result in
intermittent black screen issues.

As suggested by the eDP PHYD designer, the reset procedure should be
refined by setting bit 0 of DP_PHY_DIG_SW_RST from 0 to 1 to reset the
eDP PHYD status before training. DP_PHY_DIG_TX_CTL_0 controls the eDP
PHYD lane count: setting BIT0 enables lane0, and setting BIT1 enables
lane1. The eDP PHYD designer also recommends that when resetting PHYD,
it is sufficient to set DP_GLB_SW_RST_PHYD and leave DP_PHY_DIG_TX_CTL_0
unchanged.

After this change, this function is identical to the mt8189
implementation. Move dptx_hal_phyd_reset code to common for reuse.

BUG=b:427119942
BRANCH:rauru
TEST=Check the display function on Navi

Change-Id: I07bd6203a2b957eea79d1431953b043820c00338
Signed-off-by: Jarried Lin <jarried.lin@mediatek.corp-partner.google.com>
Signed-off-by: Bincai Liu <bincai.liu@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88450
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-23 16:04:48 +00:00
Raymond Sun
da33feeb51 soc/mediatek/mt8189: Correct thermal SRAM base address and length
A recent code review reveals incorrect SRAM base address and length
settings from the thermal driver refactor. This causes incorrect initial
values in SRAM and leads to CPU DVFS not working properly. After
correction, the CPU DVFS voltage and clock operate normally.

BUG=b:428613901
BRANCH=none
TEST=Clocks fm_armpll_ll_ck (LITTLE) and fm_armpll_bl_ck (big) are
correct. Voltages: vbuck1 (big) <1100mV, vmodem (LITTLE) <1050mV.
echo 2000000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 2000000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 2600000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_min_freq
echo 2600000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_max_freq
clkdbg() { echo $@ > /proc/clkdbg ; cat /proc/clkdbg ; }
clkdbg fmeter | grep armpll
cat /sys/kernel/debug/regulator/regulator_summary | grep buck1
cat /sys/kernel/debug/regulator/regulator_summary | grep modem
 6: fm_armpll_bl_ck              : 2600000
 8: fm_armpll_ll_ck              : 1999968
 vbuck1                           1    0      0  normal  1037mV     0mA     0mV     0mV
 vmodem                           1    0      0  normal  1043mV     0mA   400mV  1100mV

Signed-off-by: Raymond Sun <raymond.sun@mediatek.corp-partner.google.com>
Change-Id: I5caebb27a47d7b19330ec8ac23e20a6efe23e940
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88530
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2025-07-23 09:59:16 +00:00
Jeremy Compostella
9e41c7cec7 soc/intel/cmn/block/fast_spi: Lock DMA before exiting coreboot
Introduce a DMA lock mechanism to secure the Fast SPI DMA operations
during the payload boot phase. A new `fast_spi_dma_lock` function is
added to lock the DMA control register when the system enters the
payload boot state. This ensures that DMA operations are appropriately
secured, preventing any unintended data transfers post-boot.

TEST=On a Fatcat device with an FSP not locking down Fast SPI DMA,
     coreboot logs show "Fast-SPI: DMA has been locked." and
     /sys/devices/pci0000:00/0000:00:1f.5/config shows that bit 15 of
     register FAST_SPI_DMA_CONTROL (0xbc) has been is set.

Change-Id: Ie4abbcfc798480319a32b0049e3559d623ef78ef
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88488
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-22 22:22:00 +00:00
peng.eren
c1d45ef93b mb/google/trulo/var/kaladin: Update touchpad settings
Update touchpad settings

BUG=b:431870030
TEST=Flash and boot on DUT, touchpad works normally

Change-Id: If3eefd5041e06b25dd1945a40fd2aa95186efc4a
Signed-off-by: peng.eren <peng.eren@inventec.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88431
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-22 16:31:06 +00:00
peng.eren
f13f980e03 mb/google/trulo/var/kaladin: Add fw_config probe for storage
Add FW Config probe for storage

BUG=b:430725546
TEST=Flash and boot on NVMe,eMMC,UFS

Change-Id: I7a200124930d0191f9c6f488444c052d803dfa70
Signed-off-by: peng.eren <peng.eren@inventec.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88430
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-22 16:30:58 +00:00
peng.eren
50c39b3a22 mb/google/trulo/var/kaladin: Fix Type C function
Fix Type C USB and display function

BUG=b:429267772
TEST=Build and flash to DUT, verify Type C USB and display function works

Change-Id: I37af5f4608b2756f0918a6b544b53818d1e45d63
Signed-off-by: Eren Peng <peng.eren@inventec.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88374
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-22 16:30:52 +00:00
Patrick Rudolph
f0d50aa404 commonlib/include/commonlib: Add volatile qualifier
With the introduction of the stack canary breakpoint QEMU uncovered
a different bug within coreboot. Currently the compiler optimizes
over aggressively inline functions and memory stores.

That also affects write_at_ble8(), which is supposed to store a
single byte at time. The compiler however optimizes multiple byte
stores into a single wider (and possibly unaligned) store operation.

This can be seen in the emited assembly code of write_le16(), as used
to install the EBDA:
 401348a:       66 c7 04 25 13 04 00    movw   $0x400,0x413
 4013491:       00 00 04

Make sure that the compiler does not optimize multiple calls to
write_at_ble8() by adding the volatile qualifier.

The emitted assembly code of the same function changes to:
 401394c:       c6 04 25 13 04 00 00    movb   $0x0,0x413
 4013953:       00
 4013954:       c6 04 25 14 04 00 00    movb   $0x4,0x414
 401395b:       04

Fixes a strange bug in QEMU where it triggers the DEBUG breakpoint
handler on unaligned 16-bit stores in the first 4KiB of memory.
Aligned stores and store outside of the first 4KiB do not dispatch
the DEBUG breakpoint handler.

Change-Id: Ibbc661235a38c7f7540b656a67f067c3e51105d1
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85855
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2025-07-22 16:30:38 +00:00
Jincheng Li
3828153ea5 soc/intel/xeon_sp/gnr: Use official microcodes
Use microcode updates from intel-microcode submodule by default.
Downstream users can still decide to use their own files.

TEST=Build and boot on intel/avenuecity CRB
TEST=Build and boot on intel/beechnutcity CRB

Change-Id: I5a37423426b19dc9ec76984df5ad9c6d2a28f83b
Signed-off-by: Jincheng Li <jincheng.li@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88283
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
2025-07-22 16:30:02 +00:00
Jincheng Li
a87cbcd3c9 soc/intel/xeon_sp/ibl: Config ACPI base using PMC device
IBL shall use PMC device to program ABASE instead of PCR.

TESTED=Build and boot on intel/avenuecity CRB with below log:
[INFO ]  soc_config_acpibase : pmbase = 501

Change-Id: I3497c287a5370deed02b269405bc45d5d41e7f33
Signed-off-by: Jincheng Li <jincheng.li@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88144
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-22 16:29:45 +00:00
Martin Roth
480ac15044 util/cbfstool: Prevent overflow when sorting fit table entries
If fit_table_entries() fails, it returns zero, but the sort loop
subtracts 1 from that value before comparing for the loop termination.
Since the value is unsigned, this results in wraparound overflow,
effectively causing an infinite loop. To mitigate this, store the
number of FIT entries as an int, and use that for the loop exit
condition check. Use int type for the loop counters as well to
avoid the compiler complaining about an signed/unsigned comparison.

BUG=CID 1612099

Change-Id: Id0a16bdb86d075ec6c322b44fd782f81d15ca6a7
Signed-off-by: Martin Roth <gaumless@gmail.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88324
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-22 16:29:34 +00:00
Walter Sonius
bf4f08f3b6 mb/hp/snb_ivb_desktops/variants/compaq_8300_elite_sff: early VGA output
Recent development of the "pro_6300" variant fixed VGA output in EDK2
(MrChromebox/2502) and SeaBIOS 1.16.3 using libgfxinit by removing the
following line from Kconfig "select GFX_GMA_ANALOG_I2C_HDMI_B" hinted by
Keith Hui. This fix also applies to the "compaq_8300_elite_sff" variant.

The VGA output without this change only works after loading the OS!

Change-Id: Ifaf3df12fdde996d2842650be411a6d844f949a4
Signed-off-by: Walter Sonius <walterav1984@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88305
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2025-07-22 16:28:57 +00:00
Jakub Czapiga
dd19f6bc5a util/cbmem: Extract devmem and common code to separate files
Extract devmem-specific code to a separate file providing unified API.
Move hexdump() and cbmem_print_entry() to common.c.
Create common function for getting coreboot table entries. This can be
adjusted later to use higher-level API that selects appropriate backend.

BUG=b:391874512
TEST=cbmem -l; cbmem -x; cbmem -r 434f4e53; cbmem -t

Change-Id: Ic11f0659833e03324f6909fa3c1d62c36988b7b7
Signed-off-by: Jakub Czapiga <czapiga@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86557
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2025-07-22 16:28:04 +00:00
Sean Rhodes
def945f3ba soc/intel/apollolake: Measure the IBBL, IBB and OBB from the bootblock
Get information about the current Boot Guard implementation, such as
whether it's enabled, the profile and if Measured Boot or Verified
Boot are required.

Then, measure the three individual components of the BIOS.

Tested on the StarLite Mk III where all three components were measured
successfully:
    [DEBUG]  Boot Guard 2.0: Verified Boot: Enforced
    [DEBUG]  Boot Guard 2.0: Measured Boot: Enforced
    [DEBUG]  TXE Hash:
    [DEBUG]  0xfef08f5e: ...
    [DEBUG]  0xfef08f6e: ...
    [DEBUG]  IBBL Hash:
    [DEBUG]  0xfef08f7e: ...
    [DEBUG]  0xfef08f8e: ...
    [DEBUG]  IBB Pointer: Present
    ...
    [DEBUG]  IBB Hash:
    [DEBUG]  0xfef08f9e: ...
    [DEBUG]  0xfef08fae: ...

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ia962ae40b411671e82540b19f3b8680529783711
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65444
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2025-07-22 16:27:49 +00:00
Jian Tong
fbb0738272 mb/google/brox/var/lotso: Decrease cpu power limits
Based on RPL 15W baseline, PL4 should set to 87W.
Ref: 686872_RPL_UPH_RPL_UH_R_Power_Map_Rev2p4p1.xlsm

BUG=b:404416910
TEST=emerge-brox coreboot chromeos-bootimage
     cbmem -c | grep PL shows PL4=87

Change-Id: Ief8c4e5b119dc334f3b469a046946f95a070b866
Signed-off-by: Jian Tong <tongjian@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88498
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2025-07-22 11:12:44 +00:00
Pranava Y N
ce88b12420 mb/google/ocelot: Set correct TPM I2C bus for all ocelot model variants
Set `DRIVER_TPM_I2C_BUS` to 0x01 for all ocelot variants selecting
`BOARD_GOOGLE_MODEL_OCELOT` instead of `BOARD_GOOGLE_OCELOT`. This
ensures that the right I2C Bus is selected for all the variants.

BUG=b:433177132
TEST=Ensure that TPM I2C probing is successful.

```
[INFO ]  Probing TPM I2C: I2C bus 1 version 0x3230322a
[INFO ]  DW I2C bus 1 at 0xfe022000 (400 KHz)
[INFO ]  done! DID_VID 0x504a6666
[INFO ]  TPM ready after 0 ms
```

Change-Id: Ib728eb410fcf2000e5d421d186a321a79b3894b0
Signed-off-by: Pranava Y N <pranavayn@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88513
Reviewed-by: Avi Uday <aviuday@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2025-07-22 05:00:19 +00:00
Sowmya Aralguppe
e050e2fbfc mb/google/ocelot/var/ocelot: Remove irrelevant comment
This patch removes comments that are not applicable when aligned to
fw_config.c

Platform Mapping Document : Rev0p86

BUG=b:394208231
TEST=Build Ocelot and verify it compiles without any error.

Change-Id: Id258b4e89c522ec438a74a9a149388bcfde125d1
Signed-off-by: Sowmya Aralguppe <sowmya.aralguppe@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88462
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Pranava Y N <pranavayn@google.com>
2025-07-21 19:05:05 +00:00
Sowmya Aralguppe
b66c8ea3d3 mb/google/ocelot/var/ocelot: Remove Bluetooth Audio offload
Remove Bluetooth Audio offload to align to fw_config.c

Platform Mapping Document : Rev0p86

BUG=b:394208231
TEST=Build Ocelot and verify it compiles without any error.

Change-Id: I30edbc0a5622e8893469384b853cad323c6ac544
Signed-off-by: Sowmya Aralguppe <sowmya.aralguppe@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88460
Reviewed-by: Pranava Y N <pranavayn@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-21 19:05:00 +00:00
Sowmya Aralguppe
d5d633f607 mb/google/ocelot/var/ocelot: Update variant.c
Modify variant configuration to support THC-based touchscreen and
touchpad configurations.

Platform Mapping Document : Rev0p86

BUG=b:394208231
TEST=Build Ocelot and verify it compiles without any error.

Change-Id: I7af8195f76312aa362a6be504b3fec7a81acec06
Signed-off-by: Sowmya Aralguppe <sowmya.aralguppe@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88418
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Pranava Y N <pranavayn@google.com>
2025-07-21 19:04:55 +00:00
Jeremy Compostella
3b069d320c cbfs: Add a function to wait for all CBFS preload operations to complete
Introduce cbfs_preload_wait_for_all() to guarantee that all CBFS preload
contexts complete their tasks before moving forward. This function goes
through each preload context and waits for the corresponding thread to
finish by using thread_join(). If any preload thread runs into an issue,
it records an error message along with the context name.

This addition provides a synchronization point during the boot process
which platform code can leverage, typically when the storage backend
supporting asynchronous file transfer is about to be deactivated.

Change-Id: I3ee27ef2fbfdc19bd75532713966f333ad975861
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88457
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-21 13:45:12 +00:00
Paul Menzel
a7710ed8fd Documentation: coding_style: Add *long* to long multi-line comment example
Update the example, after the short multi-line comment alternative was
added several years ago, when the Wiki was still used.

Change-Id: I401180a9ac7c7cdc45fb8e9ba364823092cea6da
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88492
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2025-07-21 13:44:54 +00:00
Paul Menzel
19d7104d85 drivers/intel/touch: Use recommended short multi-line comment style
The current style is not part of the coding style [1]. The comment has
five lines, so it’s unclear if the short or long multi-line comment
style should be used. Use the short one, to keep it concise.

[1]: Documentation/contributing/coding_style.md

Change-Id: I500340fd02a54c69db4ca5d753fcb690fae1c520
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88491
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-21 13:44:30 +00:00
Luca Lai
451988d015 mb/google/trulo/var/pujjolo: Fix Goodix touchscreen function
Change level from low to high to fix goodix touchscreen issue.

BUG=b:430156965
BRANCH=none
TEST= Build and boot to OS to test touch function work fine.

Change-Id: I9bd16b2a9ebb5699ad4bf04b018aefc6b86b4199
Signed-off-by: Luca Lai <luca.lai@lcfc.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88432
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-07-21 05:39:23 +00:00
Sasirekaa Madhesu
542e52c126 soc/qualcomm/x1p42100: Optimize memory layout for X1P42100
Refactor memory layout on x1p42100 to reuse a single reserved region
for all QC image metadata passed from coreboot to QcLib for TME
authentication. Also, reposition the PRERAM_CBMEM_CONSOLE reservation
after the QcLib region to allow for future expansion.

TEST=Successfully booted google/bluey.

Change-Id: I6eea99241c233935c5d99d48093c42bb1424143f
Signed-off-by: Sasirekaa Madhesu <smadhesu@qualcomm.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88485
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-20 03:42:32 +00:00
lizheng
2e47bd50f2 mb/google/trulo/var/pujjocento: Add 6W and 15W DPTF parameters
The DPTF parameters were defined by the thermal team.
Based on thermal table in 432114256 comment#1

BUG=b:432114256
TEST=emerge-nissa coreboot chromeos-bootimage
Signed-off-by: lizheng <lizheng@huaqin.corp-partner.google.com>

Change-Id: I969f93f384bb2a59f1300478794f48e30997736d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88463
Reviewed-by: Kun Liu <liukun11@huaqin.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2025-07-19 14:23:43 +00:00
Sean Rhodes
6e4f4538bb soc/intel/{tgl,adl,mtl,ptl}: Default to Software Connection Manager
Commit 060df17f1d ("soc/intel/alderlake/acpi: Add Kconfig options for SCM and FCM")
set the default to Firmware Connection Manager, as linux commit
c6da62a219d028de10f2e22e93a34c7ee2b88d03 did not work correctly with
Software Connection Manager.

This issue was fixed with linux commit
719e1f561afbe020ed175825a9bd25ed62ed1697, so now that Software
Connection Manager works, default to it for normal builds as well as
ChromeOS ones.

Change-Id: I4393fc4992d602b7214929592f542270002d84ec
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88484
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2025-07-19 14:23:31 +00:00
haril
1b8dd662a9 soc/qualcomm/x1p42100: Add PCIE Clock support for x1p42100
Add support to enable PCIE NOC, Controller and PHY clocks.
The register details are part of HRD-X1P42100-S1 document.
https://docs.qualcomm.com/bundle/resource/topics/HRD-X1P42100-S1/

TEST=Create an image.serial.bin, ensure it boots on X1P42100 and
check clock status

Change-Id: I6007a8315343a2d56d51c8472ace831a10146768
Signed-off-by: Hari L <haril@qualcomm.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88481
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2025-07-19 14:23:22 +00:00
Vince Liu
4d3def7514 soc/mediatek/mt8189: Fix timer reset in BL31 by using time_prepare_v2
After reboot, the system does not need to serve pending IRQ from
systimer. Therefore, clear systimer IRQ pending bits in init_timer().
For that to work, the systimer compensation version 2.5 needs to be
enabled. Otherwise, inaccurate timestamps may occur after BL31, for
example in depthcharge. As the solution has already been implemented
in time_prepare_v2, mt8189 can adopt this version to fix the issue.

Also remove unnecessary headers in timer.c.

BUG=b:430211678
BRANCH=none
TEST=check the depthcharge timstamp in `cbmem` is correct.
 554:finished TPM enable update                        399,533 (12,059)
  90:starting to load payload                          399,541 (8)
  15:starting LZMA decompress (ignore for x86)         410,775 (11,234)
  16:finished LZMA decompress (ignore for x86)         465,472 (54,697)
  99:selfboot jump                                     487,643 (22,171)
  15:starting LZMA decompress (ignore for x86)         490,591 (2,948)
  16:finished LZMA decompress (ignore for x86)         502,153 (11,562)
  15:starting LZMA decompress (ignore for x86)         502,210 (57)
  16:finished LZMA decompress (ignore for x86)         504,510 (2,300)
1000:depthcharge start                                 534,769 (30,259)
1002:RO vboot init                                     534,813 (44)
1020:vboot select&load kernel                          534,815 (2)
1030:finished EC verification                          554,600 (19,785)
1060:finished AuxFW Sync                               560,740 (6,140)
1040:finished storage device initialization            612,960 (52,220)
1050:finished reading kernel from disk                 639,711 (26,751)
1100:finished vboot kernel verification                710,596 (70,885)
1102:starting kernel decompression/relocation          731,729 (21,133)
1101:jumping to kernel                                 945,034 (213,305)

Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Signed-off-by: Zhanzhan Ge <zhanzhan.ge@mediatek.corp-partner.google.com>
Change-Id: Ic79003b5a5b747a3761fd4612cad6a96ada216b6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88468
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2025-07-19 12:11:45 +00:00
Vince Liu
d898653b0e soc/meidatek/mt8196: Extract common timer code for reuse
To promote code reuse and maintainability, move mt8196/timer_prepare.c
to timer_prepare_v2.c. The original timer_prepare.c is renamed to
timer_prepare_v1.c. Also use `mtk_systimer->cntcr` instead of
`SYSTIMER_BASE` for consistency.

BUG=b:379008996
BRANCH=none
TEST=build passed.

Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Change-Id: Iab617e7a8bfedb81bcf673edd94d24870df7f751
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88467
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2025-07-19 12:10:57 +00:00
Vince Liu
d1c096a5b9 src/soc/mt8196: Correct systimer register offset
A recent datasheet review finds that the previously used offset for
the `cnttval` register is incorrect. Since the relevant bits used by
`clear_timer()` have default values of 0, the functionality is not
affected before this fix.

BUG=b:430211678
BRANCH=rauru
TEST=check the timestamp order of depthcharge is correct in `cbmem`
  16:finished LZMA decompress (ignore for x86)         895,082 (526)
1000:depthcharge start                                 941,621 (46,539)
1002:RO vboot init                                     942,644 (1,023)
1020:vboot select&load kernel                          942,645 (1)
1030:finished EC verification                          980,005 (37,360)
1060:finished AuxFW Sync                               997,302 (17,297)
1040:finished storage device initialization            1,025,910 (28,608)
1050:finished reading kernel from disk                 2,174,931 (1,149,021)
1100:finished vboot kernel verification                2,229,874 (54,943)
1102:starting kernel decompression/relocation          2,249,121 (19,247)
1101:jumping to kernel                                 2,284,317 (35,196)

Total Time: 2,020,762

Change-Id: I018d81de79d6896a31972f925d5a26f41cf942a0
Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Signed-off-by: Zhanzhan Ge <zhanzhan.ge@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88480
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-07-19 11:14:23 +00:00