Debian Codegraph @

src/soc/intel/pantherlake/pcie_rp.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <intelblocks/pcie_rp.h>
4 #include <soc/pci_devs.h>
5 #include <soc/pcie.h>
6
7 /*
8 * Document #815002 Panther Lake H Processor - 2.3 Device IDs - Table 8 "Other Device ID"
9 * specifies that the first Thunderbolt PCIe root port number is 21. TBT's LCAP registers return
10 * port index which starts from 21 (usually for other PCIe root ports index starts from
11 * 1). Thus, keeping lcap_port_base 21 for TBT, so that coreboot's PCIe remapping logic can
12 * return a correct index (0-based).
13 */
14
15 static const struct pcie_rp_group tbt_rp_groups[] = {
16 { .slot = PCI_DEV_SLOT_TBT, .count = CONFIG_MAX_TBT_ROOT_PORTS, .lcap_port_base = 21 },
17 { 0 }
18 };
19
20 static const struct pcie_rp_group ptl_rp_groups[] = {
21 #if CONFIG(SOC_INTEL_WILDCATLAKE)
22 { .slot = PCI_DEV_SLOT_PCIE_1, .count = 4, .lcap_port_base = 1 },
23 #else
24 { .slot = PCI_DEV_SLOT_PCIE_1, .count = 8, .lcap_port_base = 1 },
25 #endif
26 #if CONFIG(SOC_INTEL_PANTHERLAKE_U_H)
27 { .slot = PCI_DEV_SLOT_PCIE_2, .count = 4, .lcap_port_base = 1 },
28 #elif CONFIG(SOC_INTEL_WILDCATLAKE)
29 { .slot = PCI_DEV_SLOT_PCIE_2, .count = 2, .lcap_port_base = 5 },
30 #else
31 { .slot = PCI_DEV_SLOT_PCIE_2, .count = 2, .lcap_port_base = 1 },
32 #endif
33 { 0 }
34 };
35
36 const struct pcie_rp_group *get_pcie_rp_table(void)
37 {
38 return ptl_rp_groups;
39 }
40
41 const struct pcie_rp_group *get_tbt_pcie_rp_table(void)
42 {
43 return tbt_rp_groups;
44 }
45
46 enum pcie_rp_type soc_get_pcie_rp_type(const struct device *dev)
47 {
48 return PCIE_RP_PCH;
49 }
50
51 int soc_get_cpu_rp_vw_idx(const struct device *dev)
52 {
53 return -1;
54 }