coreboot/src
Patrick Rudolph 91c38146a4 sb/intel/bd82x6x: Disable unused PCIe root ports
Follow the PCH BIOS spec more closely by porting the broadwell
and braswell PCIe downstream device detection. To safe power
disable PCIe root ports that have no downstream device connected.

By setting the FLAGS_SLOT bit in register PCI_EXP_FLAGS the
PCI_EXP_SLTSTA_PDS bit will be updated with in band device
detection from the PCIe PHY. While this is primarly used for PCIe
hot-plug detection, it is more reliable than probing for downstream
devices by reading DID/VID PCI registers.

The FLAGS_SLOT bit should stay cleared for integrated devices,
as those are known to be present, but to simplify the code all
PCIe ports will have the FLAGS_SLOT bit set. There currently
used devicetrees might also be lacking integrated devices on
the PCH root ports...

The SLOTCAP field must be updated by BIOS when the FLAGS_SLOT
is set, but it shouldn't be filled for integrated devices. Until
now the SLOTCAP field has always been populated and it never
was a problem.

- Set FLAGS_SLOT "Slot Implemented" bit early.
- Read bit PCI_EXP_SLTSTA_PDS to detect connected downstream
  devices as done on braswell.
- Disable unused PCIe slots that are not hotplugable.
- Set BIT26 in register 0x338 and wait for bits in register 0x328
  to clear as done on broadwell.

Test: Tested on Lenovo X220. Unused root ports are disabled and port
      that are in used or marked hot-plug are kept enabled.

Change-Id: I8ccfcab2e0e4faba8322755a4f8c2108d9b007ac
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78226
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-09 14:07:14 +00:00
..
acpi acpi/acpigen_ps2_keybd: Reduce minimum keys, optional alpha/num/punct 2023-10-02 16:24:54 +00:00
arch arch/x86/cpu_common: Add cpu_get_c_substate_support 2023-10-06 12:15:34 +00:00
commonlib cbfs: Restore 32-bit padding in cbfs_header 2023-10-06 10:11:31 +00:00
console commonlib,console,nb,sb,security: Add SPDX licenses to Makefiles 2023-08-14 15:14:45 +00:00
cpu cpu/intel/model_206ax: Only use supported C-states 2023-10-06 12:28:51 +00:00
device arch to drivers/intel: Fix misspellings & capitalization issues 2023-09-08 00:53:57 +00:00
drivers spi/winbond: Use spi_flash_bpbits in winbond_bpbits_to_region 2023-10-05 12:57:51 +00:00
ec ec/starlabs/merlin: Update the Q Events 2023-10-04 09:35:53 +00:00
include device/pci_def.h: Add more bits 2023-10-06 12:37:21 +00:00
lib cbfs: Remove x86 .data section limitation comment 2023-09-18 13:19:51 +00:00
mainboard mb/google/dedede: Create dexi variant 2023-10-09 13:55:07 +00:00
northbridge nb/intel: Remove space between function name and '(' 2023-09-11 15:52:56 +00:00
sbom payloads/Yabits: Remove deprecated Yabits Payload 2023-02-17 01:21:43 +00:00
security security/tpm: Enable Hibernate on setup failure 2023-10-02 17:06:32 +00:00
soc soc/mediatek: PCI: Fix translation window 2023-10-09 13:59:16 +00:00
southbridge sb/intel/bd82x6x: Disable unused PCIe root ports 2023-10-09 14:07:14 +00:00
superio superio/smsc/sch5147/acpi/superio: use IO instead of FixedIO resource 2023-08-11 23:11:57 +00:00
vendorcode treewide: convert to tpm_result_t 2023-09-28 16:54:37 +00:00
Kconfig Kconfig: Add option to make clang the default compiler 2023-08-24 22:08:59 +00:00