Commit graph

13,574 commits

Author SHA1 Message Date
Yidi Lin
89c3bb4b08 soc/mediatek/common/dp: Use DP_WRITE2BYTE if possible
This patch prevents wrong mask passing to mtk_dp_mask.

TEST=emerge-rauru coreboot, check FW screen

Change-Id: If8c801173089761db55992279045d053c60dcd86
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85918
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-11 07:10:03 +00:00
Yidi Lin
1e56bc4851 src/soc/mediatek/common/dp: Fix mask data type in mtk_dp_write_byte
TEST=emerge-rauru coreboot

Change-Id: I2762d6ca024d60663f6dae0db62a959a191adc02
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85917
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2025-01-11 07:09:49 +00:00
Yidi Lin
57022e16a3 soc/mediatek/common/dp: Add read/write APIs for DP Phy register
MT8196's eDP architecture is different from previous SoCs. DP Phy needs
to be configured during the initialization. Add read/write APIs for DP
Phy register configuration. Add a mock definition EDP_PHY_BASE for the
SoC that do not support DP Phy configuration.

BUG=b:382363408
TEST=emerge-geralt coreboot && emerge-rauru coreboot
TEST=check FW screen on Navi

Change-Id: I5c00d0aa7e35f03cc3c3aef6a58eadd3d334d8ed
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85914
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-11 07:09:38 +00:00
Yidi Lin
45c4d70b74 soc/mediatek/common/dp: Move common functions to dptx_hal_common.c
Move the functions that can be shared with MT8196 to dptx_hal_common.c.

BUG=b:382363408
TEST=emerge-geralt coreboot && emerge-cherry coreboot
TEST=verify FW screen on Navi

Change-Id: I9e151bc766c312eaf81b4220782775ef1c9d2297
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85861
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2025-01-11 07:09:27 +00:00
Jarried Lin
9ff48e4b9e soc/mediatek/mt8196: Add modem power driver to disable unused power
Disable MT6363 unused power:
vbuck5, vcn15, vrf09, vrf12, vrf13, vrf18, vsram_digrf, vsram_mdfe.
Disable MT6373 unused power:
vant18, vsim1, vsim2.

BUG=b:315894234
TEST=Build pass, Check there are no check failed logs. And check logs:
Vmodem value: 0x78 (means SPMI_SLAVE_4_750MV)

Signed-off-by: Xavier Chang <xavier.chang@mediatek.corp-partner.google.com>
Change-Id: Ia8808e3500727753e4537017b46ac8ab39d59468
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85651
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-10 14:48:31 +00:00
Hope Wang
1920c0cca9 soc/mediatek/mt8196: Add mt6363_read8 API
Add mt6363_read8 API for common use.

BUG=b:317009620
TEST=Build pass.

Change-Id: I3cca4c2e5f6c2537c9661623260b21fb6088eff9
Signed-off-by: Hope Wang <hope.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85892
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-01-10 14:48:23 +00:00
Naresh Solanki
7cd7db6991 soc/amd/common/psp_gen2: Add config for PSP MBOX offset
Some SoC like Glinda use different PSP MBOX offset.
Add config to allow SoC Kconfig to override PSP MBOX offset.

Change-Id: Iefcc7d3b75689b43399a7a7b612417c155619211
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85626
Reviewed-by: Ana Carolina Cabral
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2025-01-10 13:03:31 +00:00
Anand Vaikar
a1269c4777 soc/amd/cezanne: add option to disable I2S master clock output of FCH
Add a devicetree option to disable the 48MHz clock output of the FCH
when an I2S audio codec uses a separate oscillator for its 48 MHz
master clock instead of the FCH clock output. This code was ported
from the Picasso code base.

Change-Id: I0c1bee121f528d28d591dace260507b345dfec26
Signed-off-by: Anand Vaikar <a.vaikar2021@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85865
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2025-01-10 12:48:52 +00:00
Nicolas Kochlowski
0341e027cd drivers/amd/opensil: Add openSIL timepoint calls
Place openSIL timepoints 1, 2 and 3 calls in the driver, which will
serve as the central point for invoking SoC-specific vendorcode
implementations. TP1 and TP2 will initialize silicon pre- and post-PCIe
enumeration, respectively. TP3 then performs late SoC IPs programming
and register locking closer to payload load prior to OS handoff. Add a
Kconfig option for selecting and including the openSIL driver source
code in the build.

Change-Id: If0559fc0ff0ec55e9ef131e5ed20dfb5baa651da
Signed-off-by: Nicolas Kochlowski <nickkochlowski@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85631
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-09 14:45:28 +00:00
Yidi Lin
8a62f239bd soc/mediatek/common: Get storage type from mainboard
Add common definitions and `mainboard_get_storage_type` API for
determining the storage type from mainboard.

TEST=emerge-rauru coreboot

Change-Id: I5dba2b54b29a701b825fb9bfcac74eb45a563d71
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85878
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-08 14:12:30 +00:00
Yidi Lin
c63f91f4dc soc/mediatek/common/dp: Initialize dptx_misc
Initialize dptx_misc to prevent unexpected value set to
REG_3034_DP_ENCODER0_P0.

TEST=emerge-geralt coreboot && emerge-rauru coreboot

Change-Id: I80e0f83f238d9b4c1ed0e1d1b219f4fb89a6cd22
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85877
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2025-01-08 09:55:09 +00:00
Yidi Lin
10be8c5ace soc/mediatek/common/dp: Move common functions to dptx_common.c
Move the functions that can be shared with MT8196 to dptx_common.c.

BUG=b:382363408
TEST=emerge-geralt coreboot && emerge-cherry coreboot

Change-Id: Ic5074feee9efa62f27c118eaf7adb25875ba4c16
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85860
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-08 09:54:58 +00:00
Yidi Lin
3f362cced5 soc/mediatek: Rename DP related header files
Add `_common` postfix to the header files located in
common/dp/include/soc/. The patch helps MT8196 managing its own DP
register difition and macros in its include/soc folder.

BUG=b:382363408
TEST=emerge-geralt coreboot && emerge-cherry coreboot

Change-Id: I4ebfa2aa0dde759275c9826c605f3285c777f58d
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85859
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2025-01-08 09:54:50 +00:00
Patrick Rudolph
87e3b9d192 soc/intel/xeon_sp/acpi: Convert spaces to tabs
Cosmetic change only: Convert spaces to tabs.

Change-Id: I0361b93bea44bb85477a3323198da612234397e8
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85558
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-08 08:28:45 +00:00
Hope Wang
f7a977d39a soc/mediatek/mt8196: Correct the argument type of MT6363
Correct the argument type of the mt6363_sdmadc_read API and the return
value type of the mt6363_read16 API.

TEST=Build pass
BUG=b:317009620

Change-Id: I0f768e23473fa924245d90ab1e4fa383ec437db3
Signed-off-by: Hope Wang <hope.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85839
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-01-08 02:53:46 +00:00
Hope Wang
2ad6b19037 soc/mediatek/mt8196: Fix MT6363 buck5 enablement
The MT6363 buck5 API's mask and shift settings are incorrect, preventing
the buck from being disabled. Resolve the issue by correcting these two
values.

BUG=b:365445188
TEST=build pass, check buck5 is power off after calling the
mt6363_enable_buck5 API.

Change-Id: I0af1e0582ae8fc1e219f3cce536aed9985108be5
Signed-off-by: Hope Wang <hope.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85838
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
2025-01-08 02:53:37 +00:00
Hope Wang
c476c4d5b9 soc/mediatek/mt8196: Delay 0.5ms after enabling PMIF SPMI SW interface
The initialization process of SPMI requires a certain amount of time
(0.5ms) to ensure all components are correctly configured and
synchronized. Otherwise, if the SPMI calibration fails, it will result
in the non-serial firmware failing to boot.

TEST=Build pass, non-serial firmware boot ok.
BUG=b:341054056

Change-Id: I63df384061e4ed2629238f1843decd18d1ad1ac4
Signed-off-by: Hope Wang <hope.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85799
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
2025-01-08 02:52:22 +00:00
Jeremy Compostella
4b18c0f514 soc/intel/pantherlake: Add core scaling factors read support
This commit adds support for reading core scaling factors via the
PCODE mailbox interface.

Starting with Lunar Lake, the scaling factor information is
centralized in the power control unit (PCU) firmware. In order to keep
all firmware in sync, it is recommended to read the scaling factors
from the PCU firmware instead of using hard-coded values.

The following changes were made:

- Updated the Kconfig file to select
  SOC_INTEL_COMMON_BLOCK_RUNTIME_CORE_SCALING_FACTORS option

- Modified the acpi.h header file to export the cpu_perf_eff_type
  enumeration for CPU performance/efficiency types.

- Added a new function to the pantherlake systemagent.c file,
  soc_read_core_scaling_factors(), which reads the core scaling
  factors from the PCODE mailbox interface. The pcode
  READ_CORE_SCALING_FACTOR is presented in document 829201 Panther
  Lake Processor Mailbox Command.

The performance impact on boot time is minimal. It took 12 us to read
the scaling factors on a fatcat device.

TEST=Successfully read performance and efficient scaling factors on a
     fatcat board.

Change-Id: I7a8e1e66a02e4bf6b1a41277e83c6dec786fe169
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85554
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Zhixing Ma <zhixing.ma@intel.com>
2025-01-07 21:19:20 +00:00
Jeremy Compostella
1669573edd soc/intel/common: Read core scaling factors at runtime support
Starting with Lunar Lake, the scaling factor information is
centralized in the power control unit (PCU) firmware. In order to keep
all firmware in sync, it is recommended to read the scaling factors
from the PCU firmware instead of using hard-coded values.

This commit adds a new Kconfig option,
CONFIG_SOC_INTEL_COMMON_BLOCK_RUNTIME_CORE_SCALING_FACTORS, to allow
SoC specific code to specify its own function to read the core scaling
factors.

When this option is enabled, the soc_read_core_scaling_factors()
function from the SoC specific code is used to read the core scaling
factors instead of using the statically defined values
CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR and
CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR.

Change-Id: Icdf47e17cc5a6d042f3c5f90cf811fccd6c1ed9b
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85553
Reviewed-by: Pranava Y N <pranavayn@google.com>
Reviewed-by: Cliff Huang <cliff.huang@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-07 21:10:35 +00:00
Jarried Lin
7c5816f175 soc/mediatek/mt8196: Add GPUEB support
GPUEB is a micro-processor used for GPU power management. It is also
responsible for controlling GPU DVFS and GPU thermal throttling. This
gpueb load flow adds 47ms to the boot time.

coreboot log:
CBFS: Found 'gpueb_fw.img' @0x84740 size 0x29736 in mcache @0xfffdd374
Loaded (and reset) gpueb_fw.img in 47 msecs.

TEST=Boot ok
BUG=b:317009620

Signed-off-by: Andy.Hsu <andy.hsu@mediatek.corp-partner.google.com>
Change-Id: I0f10dfc753f73df97ea08a4c23e97de416832be2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85654
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-01-07 10:04:41 +00:00
Johannes Hahn
67ba09b6c5 soc/intel/common/block/power_limit: Disable RAPL via MSR completely
Disabling RAPL via Kconfig switch SOC_INTEL_DISABLE_POWER_LIMITS does
not turn off RAPL completely (i.d. MMIO & MSR).
In the past it was assumed disabling RAPL via MCHBAR is sufficient and
the corresponding changes are also reflected in the related
MSR (0x610-PACKAGE_POWER_LIMIT). This is not the case for
Power Limit 2 (PL2) because Bit[47]-PKG_PWR_LIM_2_EN is still set
although PL1 and PL2 were disabled through MCHBAR.

Thus Bit[10]-POWER_LIMITATION_STATUS flag can be set in
MSR 0x19C (THERM_STATUS) when the power limit of the SKU exceeds.
This may lead to a throttling of the domain level frequency.
Moreover related parameters within the same
MSR (0x610-PACKAGE_POWER_LIMIT) like PKG_PWR_LIM_TIME, PKG_CLMP_LIM,
PKG_PWR_LIM have to be cleared as well for both Power Limits
(PL1 & PL2). This is due to the fact that these parameters stray in to
the system and may effect different system settings.

With this commit the PACKAGE_POWER_LIMIT MSR is cleared additionally to
the MCHBAR setting when build for ElkhartLake.

TEST=Verify MSR(0x610-PACKAGE_POWER_LIMIT) is set to zero during OS
runtime except Bit[15]-PKG_PWR_LIM_1_EN (it is known as a bug that this
bit will be set to 1 anyway).
Moreover using a system stress test tool (e.g. Passmark's BurnInTest)
and stressing the system hard should not lead to
Bit[10]-POWER_LIMITATION_STATUS flag being set. This is the case when
MSR (0x610-PACKAGE_POWER_LIMIT) is not cleared completely and the
system is stressed intensively.

Change-Id: I8272339a991667d5ba177f4755ec40e1961d729e
Signed-off-by: Johannes Hahn <johannes-hahn@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85606
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-07 06:57:03 +00:00
Subrata Banik
add685507b soc/intel/pantherlake: Refactor FSP-M params for debug message control
The fsp_params.c file is refactored to move the debug message
control logic to a separate function, fsp_control_log_level().
This function takes an FSPM_UPD pointer and a boolean value
indicating whether debug messages should be enabled or disabled.

The fill_fsp_event_handler() function is updated to call
fsp_control_log_level() with the appropriate boolean value based on
the CONFIG(CONSOLE_SERIAL) and CONFIG(FSP_ENABLE_SERIAL_DEBUG)
Kconfig options.

BUG=b:227151510
TEST=Able to build and boot google/fatcat.

Change-Id: Ie2916ce82133058464d20eed327de7c7288e78a4
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85827
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-04 01:36:43 +00:00
Sean Rhodes
71f57081fd soc/intel/jasperlake: Remove Cnvi Audio Offload bool
This isn't used anywhere, so remove it.

Change-Id: Ieb5980929ef35ae129f9e548da7ab71efa2ae7f3
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84594
Reviewed-by: coreboot org <coreboot.org@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-02 14:59:08 +00:00
Sean Rhodes
4d708beba6 soc/inte/{adl,mtl}: Move ASPM helper functions to common
The ASPM helper functions are the same for all Intel SOCs
since Skylake, so move them to common code.

Change-Id: Ic6876e920d75abbbbb27d4ce3a4f2c08a8db9410
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83679
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-02 14:58:33 +00:00
Sean Rhodes
b8093f4fa6 soc/intel/alderlake: Remove ADL-M Entries
Support for `-M` was removed, so remove these.

Change-Id: Ic2e58b951b5017e1642f6beecc8353ad9de7ce1e
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84651
Reviewed-by: Jayvik Desai <jayvik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2025-01-01 19:44:03 +00:00
Sean Rhodes
c8237371ce soc/intel/mtl: Enable all bits for IO decode register
Based on discussions on various patches (CB:57140), the idea was to
enable all bits to avoid incomplete ports.

Therefore, enable all bits - the same as ADL.

Change-Id: I5ace878faa09b959384338efcdbdfce390145002
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85707
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-01-01 19:43:54 +00:00
Hope Wang
a1f97b93c6 soc/mediatek/mt8196: Set SPMI-P SCL/SDA pins to pull-down
The current Pull-Down capabilities of the SPMI are insufficient and
require optimization. Configure the SCL and SDA of the SPMI-P to
Pull-Down mode on MT8196 SoC side. It is done only once during the SPMI
read check to fix SPMI clock calibration failure.

TEST=Build pass
BUG=b:361174333

Change-Id: Idbf8ed8e31850ca81c823db1b25bde4a83a48c4f
Signed-off-by: Hope Wang <hope.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85751
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-01 13:58:32 +00:00
Jeremy Compostella
736941b6a4 soc/intel/meteorlake: Add doc reference for thunderbolt port number
Document #640228 Meteor Lake - U/H and U Type4 Processor - 2.3 Device
IDs - Table 8 "Other Device ID" IDs - Table 8 "Other Device ID"
specifies that the first Thunderbolt PCIe root port number is 16.

Change-Id: Ic394aa6795105ff613f30e8aa0ffa45500c6332a
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85820
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-01 07:09:07 +00:00
Jeremy Compostella
00c3255214 soc/intel/pantherlake: Update the Thunderbolt lcap_port_base to 21
Document #815002 Panther Lake H Processor - 2.3 Device IDs - Table 8
"Other Device ID" specifies that the first Thunderbolt PCIe root port
number is 21.

The previous offset of 0x10, inherited from Meteor Lake code, caused
an issue that resulted in:

- Temporary deactivation of Thunderbolt PCI devices during ramstage

- Failure to generate critical ACPI SSDT power management data for the
  port

This error led to instability in PCIe tunneling during power state
transitions.

Change-Id: I44f91f954a4ec06c56dcc90d97e7da2193e9acf2
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85781
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-01-01 07:09:01 +00:00
Jarried Lin
6ca2c3c415 soc/mediatek/mt8196: Fix indentation in Makefile.mk
TEST=Build pass
BUG=b:317009620

Change-Id: Id70988da2505ed8940f4c55f3483c6bc2c33ff1c
Signed-off-by: Jarried Lin <jarried.lin@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85801
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
2024-12-30 22:23:57 +00:00
Jarried Lin
94c1307fdb soc/mediatek/mt8196: Add dynamic power-saving for peripheral clocks
In MT8196, CKSYS achieves power efficiency by dynamically turning the
clocks on or off based on the status provided by PERI.

TEST=Build pass, boot log:
mtk_cksys_init = 0x1
BUG=b:317009620

Change-Id: I70f710f068d7d882037691930a90c83adaab15d2
Signed-off-by: Jarried Lin <jarried.lin@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85774
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2024-12-30 22:23:44 +00:00
Kapil Porwal
3153432b83 soc/intel/alderlake: Add function to force disable memory channels
Add a function `mem_init_override_channel_mask` to disable memory
channels based on given bitmap where each bit represents a memory
channel. A set bit will disable corresponding memory channel. Variants
can override this bitmap by selecting `ENFORCE_MEM_CHANNEL_DISABLE` and
implementing `mb_get_channel_disable_mask` to return the bitmap.

BUG=b:379311559
TEST=Make sure that channel mask is applied correctly.

Lotso without any channel mask:
```
lotso-rev0 ~ # dmidecode -t 17 | grep -E "(Locator: C|Size)"
        Size: 2 GB
        Locator: Channel-0-DIMM-0
        Size: 2 GB
        Locator: Channel-1-DIMM-0
        Size: 2 GB
        Locator: Channel-2-DIMM-0
        Size: 2 GB
        Locator: Channel-3-DIMM-0
        Size: 2 GB
        Locator: Channel-0-DIMM-0
        Size: 2 GB
        Locator: Channel-1-DIMM-0
        Size: 2 GB
        Locator: Channel-2-DIMM-0
        Size: 2 GB
        Locator: Channel-3-DIMM-0

lotso-rev0 ~ # dmidecode -t 17 | grep Size | wc -l
8
```

Lotso with channel 2 & 3 masked:
```
lotso-rev0 ~ # dmidecode -t 17 | grep -E "(Locator: C|Size)"
        Size: 2 GB
        Locator: Channel-0-DIMM-0
        Size: 2 GB
        Locator: Channel-1-DIMM-0
        Size: 2 GB
        Locator: Channel-0-DIMM-0
        Size: 2 GB
        Locator: Channel-1-DIMM-0

lotso-rev0 ~ # dmidecode -t 17 | grep Size | wc -l
4
```

Change-Id: Ibfeca4509cb3d88bc1bac2ac2d480e665d895bc5
Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85529
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Jayvik Desai <jayvik@google.com>
2024-12-30 06:35:33 +00:00
Lu Tang
001e7a0b45 soc/mediatek/mt8196: Add MT6685 Clock IC driver
Add MT6685 initial settings and ADC init settings to support Thermal
Information Acquisition (TIA). TIA will read thermal info in HW.

TEST=Build pass
BUG=b:317009620

Change-Id: I26ae4f416202f04a8030259c49e009b19a60712e
Signed-off-by: Hope Wang <hope.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85734
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2024-12-29 01:38:41 +00:00
Sean Rhodes
5852841ca7 soc/intel/meteorlake: Use ASPM helpers from Alder Lake
Use the helper functions added to Alder Lake which will configure
ASPM and L1 Subsstate control based on Kconfig, but retain the
capability to override the specific levels from devicetree.

Change-Id: Ia5cc11188b245a93c303117589bd9d3c18c2877e
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83678
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-27 19:20:57 +00:00
Yidi Lin
825e9173b4 soc/mediatek: Distinguish pmic_init_setting function name
Rename pmic_init_setting to ${PMIC model}_init_setting accordingly.

Change-Id: Id591bf3089aaa2148d34c77d021c17403494a776
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85764
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2024-12-26 12:29:11 +00:00
Patrick Rudolph
d65ff8492c soc/intel/xeon_sp/spr/acpi: Fix regression
Fix regression introduced in commit 177bb5e9b9
("soc/intel/xeon_sp: Revise IIO domain ACPI name encoding").

Ensure domain ACPI names in the DSDT are in sync with SSDT ACPI names.
Fixes PCI devices not discovered on socket 1-3.

TEST: Booted in ibm/sbp1 and found all PCI devices working, no errors
      in dmesg are shown.

Change-Id: Ice168bdebc46dc0cfb9c63c78c46a5d9ff2b7658
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85562
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
2024-12-26 10:45:33 +00:00
Hope Wang
3cb7db4075 soc/mediatek/mt8196: Add PMIC MT6316 driver
Add MT6316 driver in SoC folder.

TEST=Build pass
BUG=b:317009620

Change-Id: I39e91d64e77cff03281845dfbea565e6ddf748f6
Signed-off-by: Hope Wang <hope.wang@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85630
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
2024-12-25 08:06:07 +00:00
Ke Zheng
d4c80054a4 soc/mediatek/mt8189: Enable timer compensation v2.5
Enable timer compensation v2.5 for MT8189 systimer.

BUG=b:379008996
BRANCH=none
TEST=Check SYSTIMER_BASE register is configurated correctly.

Change-Id: I28c051c2e51481464f5dacb4c93f41e4f7e62501
Signed-off-by: Ke Zheng <ot_ke.zheng@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85689
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-24 11:22:38 +00:00
Yu-Ping Wu
403846f177 soc/mediatek/mt8196: Define MFGPLL_*_BASE using MFGSYS_BASE
The MFGPLL_*_BASE addresses are based on MFGSYS_BASE (0x40000000)
instead of IO_PHYS (0x10000000). Rewrite the address calculation for
readability.

Also rename these macros to MFG_PLL_* to make them consistent with other
macros to be added in CB:85654.

Change-Id: Ifd5d77b95c698cb6030c58ba259f2cdf2a29d87b
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85740
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-24 11:22:17 +00:00
Vince Liu
620d2fab06 soc/mediatek/mt8189: Replace SPDX identifiers to GPL-2.0-only OR MIT
These files were originally from MediaTek and follow coreboot's main
license: "GPL-2.0-only". Now MediaTek replaces this file to
"GPL-2.0-only OR MIT" license for better code re-use in other open
source software stack.

BUG=b:379008996
BRANCH=none
TEST=build pass

Change-Id: I2821a8c097b8d22e1aa91b316ae0fdce80f342de
Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85723
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2024-12-23 07:37:18 +00:00
Dinesh Gehlot
d90b1322ab commonlib: Refactor CSE sync eventLog
This patch enhances the readability of the CSE sync event
ELOG_TYPE_FW_CSE_SYNC by updating the event naming from "early and late
bootstage" to "pre and post memory."

BUG=b:379585294
TEST=boot verified on google/rex0 and google/rex64
without change:
```
rex-rev3 ~ # elogtool list
rex64-rev3 ~ # /media/usb/elogtool list
3 | 2024-01-01 22:25:59-0800 | Firmware CSE sync | Late CSE Sync
```
with change:
```
rex64-rev3 ~ # elogtool list
3 | 2024-12-17 02:22:36-0800 | Firmware CSE sync | Post RAM CSE Sync
```

Change-Id: Ia5db3ffb43b2ceac821de72ef9e88ed62e617d41
Signed-off-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85622
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2024-12-23 01:57:13 +00:00
Cathy Xu
aa562d2881 soc/mediatek/mt8189: Add GPIO driver
Add GPIO driver for other modules to control GPIO pins.

BUG=b:379008996
BRANCH=none
TEST=build pass

Change-Id: Ia87fe0975add95fcfad16d55586559c7f912a624
Signed-off-by: Cathy Xu <ot_cathy.xu@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85667
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2024-12-21 16:10:18 +00:00
Vince Liu
40a863cd60 soc/mediatek/mt8189: Initialize watchdog
Add watchdog support for MT8189.

BUG=b:379008996
BRANCH=none
TEST=build pass and WDT makes DUT reboot when MTK_WDT_MODE_ENABLE is
set.

Change-Id: I496fce91e52393db31fd1fb5a1c68d91b2ed073e
Signed-off-by: Vince Liu <vince-wl.liu@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85678
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-21 16:10:05 +00:00
Yidi Lin
1380ed0cd2 soc/mediatek: Add support for MediaTek firmware support package
Starting from MT8196, MediaTek platform introudces a new blob named
MediaTek firmware support package (mtk-fsp). The features of mtk-fsp
include but not limit to,
- Security settings, e.g: Device Access Proctection Control, Security
  Memory Protection Unit.
- Initialization for advanced CPU frequency control.

This patch implements APIs for
1) Exchanging data between coreboot and mtk-fsp.
2) Loading and running the mtk-fsp blob at a specific bootstage.

BUG=b:373797027
TEST=emerge-rauru coreboot; Run mock blob and return from mock blob.

Change-Id: Idef3518f9763fe5f74adb459c137db164563e483
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85665
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-21 16:09:36 +00:00
Ke Zheng
4f92943c89 soc/mediatek/common: Rename GPT_MHZ to TIMER_MHZ for readability
Update timer macro name for common.

The new ICs (e.g. mt8196, mt8189) will no longer use GPT. In order
to improve code readability, replace GPT_MHZ with TIMER_MHZ for
existing SoCs.

BUG=b:379008996
BRANCH=none
TEST=Build pass, Macro name is correct.

Change-Id: I02f18bfa5b5912f28e322d40cd46823a0095bbf4
Signed-off-by: Ke Zheng <ot_ke.zheng@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85681
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-21 16:09:23 +00:00
Wenzhen Yu
5a73692e0c soc/mediatek/mt8196: Add SPM loader
This patch adds support for loading SPM firmware from CBFS to SPM SRAM
and fix the SPM register definitions. SPM needs its own firmware to
enable SPM suspend/resume function which turns off several resources
such as DRAM/mainpll/26M clk when linux system suspends.

coreboot log:
CBFS: Found 'spm_firmware.pm' @0xadf00 size 0x5a60 in mcache @0xfffdd3c
mtk_init_mcu: Loaded (and reset) spm_firmware.pm in 3 msecs (30080 byt)

TEST=build pass
BUG=348147674

Change-Id: Ie09346f46cb734c74776b760485e7f35d4357e5e
Signed-off-by: Wenzhen Yu <wenzhen.yu@mediatek.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85599
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-21 16:09:01 +00:00
Subrata Banik
809e704101 soc/intel/pantherlake: Rename GSPI2 to GSPI0A
Rename GSPI2 to GSPI0A to align with the latest Intel documentation
and platform specifications (doc: 815002)

BUG=b:377595986
TEST=Able to see 0x12.6 device is visible using `lspci`.

Change-Id: I9b87d38e44c07a053104b53df38ee1ce14a86c7f
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85685
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Pranava Y N <pranavayn@google.com>
Reviewed-by: YH Lin <yueherngl@google.com>
2024-12-21 07:42:37 +00:00
Subrata Banik
222ef676f9 soc/intel/pantherlake: Add ACPI name for GSPI2
This change adds the ACPI name "SPI2" for the GSPI2 device
in the Panther Lake SOC.

Replace space with tab for PCI_DEVFN_GSPI2 macro.

w/o this patch:

[ERROR]  Missing ACPI Name for PCI: 00:12.6
[ERROR]  Missing ACPI Name for PCI: 00:12.6

w/ this patch:

No error

Change-Id: I404ddb893b82836e06d0f52a6d6f2aff2273d8c6
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85712
Reviewed-by: YH Lin <yueherngl@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-12-21 07:42:31 +00:00
Dinesh Gehlot
0797c40d52 src/soc/intel/cmn/blk/cse: Log cse sync information
This patch adds an event log entry for successful CSE synchronization,
along with the boot stage where the synchronization occurred, either
early or late.

BUG=b:379585294
TEST=elog verified on rex0 and rex64

Rex0:
```
rex-rev3 ~ # /media/usb/elogtool list
3 | 2024-01-01 22:25:59-0800 | Firmware CSE sync | Late CSE Sync
```
Rex64:
```
rex64-rev3 ~ # /media/usb/elogtool list
8 | 2024-01-01 22:51:00-0800 | Firmware CSE sync | CSE Sync at Payload
```

Change-Id: Idece841c2b069d7688afc258470667ed2851a282
Signed-off-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85219
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2024-12-19 14:29:16 +00:00
Karthikeyan Ramasubramanian
9a15a1ed21 soc/intel: Log CSE Sync Early Sign of Life event from a better place
CSE Sync Early Sign of Life (ESOL) event is logged as soon as the CSE FW
update is complete. This happens irrespective of whether Early Sign of
Life screen is enabled or not. Move CSE Sync ESOL event right before
displaying the ESOL screen.

BUG=b:378458829, b:379585294
TEST=Build Brox BIOS image and boot to OS. Ensure that the ESOL event
for CSE Sync is logged.

Change-Id: Iaa0dbb87ddde69dc3f4a9e058fc6bed8711b29e7
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85111
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2024-12-19 14:28:36 +00:00