coreboot/src/soc
Kilian Krause 1fa24898e2 soc/intel/common/block/pcie: Move speed helper to pcie_helpers.c
The pcie_speed_control_to_upd() helper function was only available in
aspm.c for PCH root port configuration. However, CPU root ports in
romstage also need to convert PCIE_SPEED_control enum values to FSP
UPD indices.

Move pcie_speed_control_to_upd() from aspm.c to pcie_helpers.c to
make it available in both romstage and ramstage. This allows both
PCH and CPU root port code to use the same conversion logic without
code duplication.

The helper handles the mapping between devicetree enum values and FSP
UPD values using the UPD_INDEX() macro (which subtracts 1):
- SPEED_DEFAULT (0) -> SPEED_AUTO (1) -> UPD_INDEX = 0
- SPEED_AUTO (1) -> UPD_INDEX = 0
- SPEED_GEN1 (2) -> UPD_INDEX = 1
- SPEED_GEN2 (3) -> UPD_INDEX = 2
- SPEED_GEN3 (4) -> UPD_INDEX = 3
- SPEED_GEN4 (5) -> UPD_INDEX = 4

This accounts for the fact that FSP expects 0-based indexing where
0 = Auto, 1 = Gen1, 2 = Gen2, etc.

TEST=Configured PCIE_SPEED_GEN2 for root port on mc_rpl1, booted and
verified with lspci -vv that device is limited to Gen2 speed

Change-Id: I0f70ad4da6f9f9e73b1c05648f0b206d5d61e07d
Signed-off-by: Kilian Krause <kilian.krause@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89763
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2025-10-31 21:06:43 +00:00
..
amd soc/amd/turin_poc: Add Turin SoC structure as a copy of genoa_poc 2025-10-24 21:38:41 +00:00
cavium
example/min86
ibm/power9 soc/power9/rom_media.c: find CBFS in PNOR 2025-08-28 20:14:01 +00:00
intel soc/intel/common/block/pcie: Move speed helper to pcie_helpers.c 2025-10-31 21:06:43 +00:00
mediatek soc/mediatek/common: Fix MMU assertion for framebuffer region 2025-10-29 05:39:54 +00:00
nvidia
qualcomm soc/qualcomm/x1p42100: Add EUSB2 HS repeater support for USB Type-C 2025-10-22 18:49:51 +00:00
rockchip
samsung
sifive
ti
ucb/riscv soc/riscv/ucb: Switch to FDT parsing to get memory size 2025-02-26 17:11:09 +00:00
xilinx