coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pci_devs.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _SOC_ICELAKE_PCI_DEVS_H_
4 #define _SOC_ICELAKE_PCI_DEVS_H_
5 
6 #include <device/pci_def.h>
7 
8 #define _PCH_DEVFN(slot, func) PCI_DEVFN(PCH_DEV_SLOT_ ## slot, func)
9 
10 #if !defined(__SIMPLE_DEVICE__)
11 #include <device/device.h>
12 #define _PCH_DEV(slot, func) pcidev_path_on_root_debug(_PCH_DEVFN(slot, func), __func__)
13 #else
14 #define _PCH_DEV(slot, func) PCI_DEV(0, PCH_DEV_SLOT_ ## slot, func)
15 #endif
16 
17 /* System Agent Devices */
18 
19 #define SA_DEV_SLOT_ROOT 0x00
20 #define SA_DEVFN_ROOT PCI_DEVFN(SA_DEV_SLOT_ROOT, 0)
21 #if defined(__SIMPLE_DEVICE__)
22 #define SA_DEV_ROOT PCI_DEV(0, SA_DEV_SLOT_ROOT, 0)
23 #endif
24 
25 #define SA_DEV_SLOT_IGD 0x02
26 #define SA_DEVFN_IGD PCI_DEVFN(SA_DEV_SLOT_IGD, 0)
27 #define SA_DEV_IGD PCI_DEV(0, SA_DEV_SLOT_IGD, 0)
28 
29 #define SA_DEV_SLOT_DSP 0x04
30 #define SA_DEVFN_DSP PCI_DEVFN(SA_DEV_SLOT_DSP, 0)
31 #define SA_DEV_DSP PCI_DEV(0, SA_DEV_SLOT_DSP, 0)
32 
33 /* PCH Devices */
34 #define PCH_DEV_SLOT_THERMAL 0x12
35 #define PCH_DEVFN_THERMAL _PCH_DEVFN(THERMAL, 0)
36 #define PCH_DEVFN_UFS _PCH_DEVFN(THERMAL, 5)
37 #define PCH_DEVFN_GSPI2 _PCH_DEVFN(THERMAL, 6)
38 #define PCH_DEV_THERMAL _PCH_DEV(THERMAL, 0)
39 #define PCH_DEV_UFS _PCH_DEV(THERMAL, 5)
40 #define PCH_DEV_GSPI2 _PCH_DEV(THERMAL, 6)
41 
42 #define PCH_DEV_SLOT_ISH 0x13
43 #define PCH_DEVFN_ISH _PCH_DEVFN(ISH, 0)
44 #define PCH_DEV_ISH _PCH_DEV(ISH, 0)
45 
46 #define PCH_DEV_SLOT_XHCI 0x14
47 #define PCH_DEVFN_XHCI _PCH_DEVFN(XHCI, 0)
48 #define PCH_DEVFN_USBOTG _PCH_DEVFN(XHCI, 1)
49 #define PCH_DEVFN_CNViWIFI _PCH_DEVFN(XHCI, 3)
50 #define PCH_DEVFN_SDCARD _PCH_DEVFN(XHCI, 5)
51 #define PCH_DEV_XHCI _PCH_DEV(XHCI, 0)
52 #define PCH_DEV_USBOTG _PCH_DEV(XHCI, 1)
53 #define PCH_DEV_CNViWIFI _PCH_DEV(XHCI, 3)
54 #define PCH_DEV_SDCARD _PCH_DEV(XHCI, 5)
55 
56 #define PCH_DEV_SLOT_SIO1 0x15
57 #define PCH_DEVFN_I2C0 _PCH_DEVFN(SIO1, 0)
58 #define PCH_DEVFN_I2C1 _PCH_DEVFN(SIO1, 1)
59 #define PCH_DEVFN_I2C2 _PCH_DEVFN(SIO1, 2)
60 #define PCH_DEVFN_I2C3 _PCH_DEVFN(SIO1, 3)
61 #define PCH_DEV_I2C0 _PCH_DEV(SIO1, 0)
62 #define PCH_DEV_I2C1 _PCH_DEV(SIO1, 1)
63 #define PCH_DEV_I2C2 _PCH_DEV(SIO1, 2)
64 #define PCH_DEV_I2C3 _PCH_DEV(SIO1, 3)
65 
66 #define PCH_DEV_SLOT_CSE 0x16
67 #define PCH_DEVFN_CSE _PCH_DEVFN(CSE, 0)
68 #define PCH_DEVFN_CSE_2 _PCH_DEVFN(CSE, 1)
69 #define PCH_DEVFN_CSE_IDER _PCH_DEVFN(CSE, 2)
70 #define PCH_DEVFN_CSE_KT _PCH_DEVFN(CSE, 3)
71 #define PCH_DEVFN_CSE_3 _PCH_DEVFN(CSE, 4)
72 #define PCH_DEVFN_CSE_4 _PCH_DEVFN(CSE, 5)
73 #define PCH_DEV_CSE _PCH_DEV(CSE, 0)
74 #define PCH_DEV_CSE_2 _PCH_DEV(CSE, 1)
75 #define PCH_DEV_CSE_IDER _PCH_DEV(CSE, 2)
76 #define PCH_DEV_CSE_KT _PCH_DEV(CSE, 3)
77 #define PCH_DEV_CSE_3 _PCH_DEV(CSE, 4)
78 #define PCH_DEV_CSE_4 _PCH_DEV(CSE, 5)
79 
80 #define PCH_DEV_SLOT_SATA 0x17
81 #define PCH_DEVFN_SATA _PCH_DEVFN(SATA, 0)
82 #define PCH_DEV_SATA _PCH_DEV(SATA, 0)
83 
84 #define PCH_DEV_SLOT_SIO2 0x19
85 #define PCH_DEVFN_I2C4 _PCH_DEVFN(SIO2, 0)
86 #define PCH_DEVFN_I2C5 _PCH_DEVFN(SIO2, 1)
87 #define PCH_DEVFN_UART2 _PCH_DEVFN(SIO2, 2)
88 #define PCH_DEV_I2C4 _PCH_DEV(SIO2, 0)
89 #define PCH_DEV_I2C5 _PCH_DEV(SIO2, 1)
90 #define PCH_DEV_UART2 _PCH_DEV(SIO2, 2)
91 
92 #define PCH_DEV_SLOT_STORAGE 0x1A
93 #define PCH_DEVFN_EMMC _PCH_DEVFN(STORAGE, 0)
94 #define PCH_DEV_EMMC _PCH_DEV(STORAGE, 0)
95 
96 #define PCH_DEV_SLOT_PCIE 0x1c
97 #define PCH_DEVFN_PCIE1 _PCH_DEVFN(PCIE, 0)
98 #define PCH_DEVFN_PCIE2 _PCH_DEVFN(PCIE, 1)
99 #define PCH_DEVFN_PCIE3 _PCH_DEVFN(PCIE, 2)
100 #define PCH_DEVFN_PCIE4 _PCH_DEVFN(PCIE, 3)
101 #define PCH_DEVFN_PCIE5 _PCH_DEVFN(PCIE, 4)
102 #define PCH_DEVFN_PCIE6 _PCH_DEVFN(PCIE, 5)
103 #define PCH_DEVFN_PCIE7 _PCH_DEVFN(PCIE, 6)
104 #define PCH_DEVFN_PCIE8 _PCH_DEVFN(PCIE, 7)
105 #define PCH_DEV_PCIE1 _PCH_DEV(PCIE, 0)
106 #define PCH_DEV_PCIE2 _PCH_DEV(PCIE, 1)
107 #define PCH_DEV_PCIE3 _PCH_DEV(PCIE, 2)
108 #define PCH_DEV_PCIE4 _PCH_DEV(PCIE, 3)
109 #define PCH_DEV_PCIE5 _PCH_DEV(PCIE, 4)
110 #define PCH_DEV_PCIE6 _PCH_DEV(PCIE, 5)
111 #define PCH_DEV_PCIE7 _PCH_DEV(PCIE, 6)
112 #define PCH_DEV_PCIE8 _PCH_DEV(PCIE, 7)
113 
114 #define PCH_DEV_SLOT_PCIE_1 0x1d
115 #define PCH_DEVFN_PCIE9 _PCH_DEVFN(PCIE_1, 0)
116 #define PCH_DEVFN_PCIE10 _PCH_DEVFN(PCIE_1, 1)
117 #define PCH_DEVFN_PCIE11 _PCH_DEVFN(PCIE_1, 2)
118 #define PCH_DEVFN_PCIE12 _PCH_DEVFN(PCIE_1, 3)
119 #define PCH_DEVFN_PCIE13 _PCH_DEVFN(PCIE_1, 4)
120 #define PCH_DEVFN_PCIE14 _PCH_DEVFN(PCIE_1, 5)
121 #define PCH_DEVFN_PCIE15 _PCH_DEVFN(PCIE_1, 6)
122 #define PCH_DEVFN_PCIE16 _PCH_DEVFN(PCIE_1, 7)
123 #define PCH_DEV_PCIE9 _PCH_DEV(PCIE_1, 0)
124 #define PCH_DEV_PCIE10 _PCH_DEV(PCIE_1, 1)
125 #define PCH_DEV_PCIE11 _PCH_DEV(PCIE_1, 2)
126 #define PCH_DEV_PCIE12 _PCH_DEV(PCIE_1, 3)
127 #define PCH_DEV_PCIE13 _PCH_DEV(PCIE_1, 4)
128 #define PCH_DEV_PCIE14 _PCH_DEV(PCIE_1, 5)
129 #define PCH_DEV_PCIE15 _PCH_DEV(PCIE_1, 6)
130 #define PCH_DEV_PCIE16 _PCH_DEV(PCIE_1, 7)
131 
132 #define PCH_DEV_SLOT_PCIE_2 0x1b
133 #define PCH_DEVFN_PCIE17 _PCH_DEVFN(PCIE_2, 0)
134 #define PCH_DEVFN_PCIE18 _PCH_DEVFN(PCIE_2, 1)
135 #define PCH_DEVFN_PCIE19 _PCH_DEVFN(PCIE_2, 2)
136 #define PCH_DEVFN_PCIE20 _PCH_DEVFN(PCIE_2, 3)
137 #define PCH_DEVFN_PCIE21 _PCH_DEVFN(PCIE_2, 4)
138 #define PCH_DEVFN_PCIE22 _PCH_DEVFN(PCIE_2, 5)
139 #define PCH_DEVFN_PCIE23 _PCH_DEVFN(PCIE_2, 6)
140 #define PCH_DEVFN_PCIE24 _PCH_DEVFN(PCIE_2, 7)
141 #define PCH_DEV_PCIE17 _PCH_DEV(PCIE_2, 0)
142 #define PCH_DEV_PCIE18 _PCH_DEV(PCIE_2, 1)
143 #define PCH_DEV_PCIE19 _PCH_DEV(PCIE_2, 2)
144 #define PCH_DEV_PCIE20 _PCH_DEV(PCIE_2, 3)
145 #define PCH_DEV_PCIE21 _PCH_DEV(PCIE_2, 4)
146 #define PCH_DEV_PCIE22 _PCH_DEV(PCIE_2, 5)
147 #define PCH_DEV_PCIE23 _PCH_DEV(PCIE_2, 6)
148 #define PCH_DEV_PCIE24 _PCH_DEV(PCIE_2, 7)
149 
150 #define PCH_DEV_SLOT_SIO3 0x1e
151 #define PCH_DEVFN_UART0 _PCH_DEVFN(SIO3, 0)
152 #define PCH_DEVFN_UART1 _PCH_DEVFN(SIO3, 1)
153 #define PCH_DEVFN_GSPI0 _PCH_DEVFN(SIO3, 2)
154 #define PCH_DEVFN_GSPI1 _PCH_DEVFN(SIO3, 3)
155 #define PCH_DEV_UART0 _PCH_DEV(SIO3, 0)
156 #define PCH_DEV_UART1 _PCH_DEV(SIO3, 1)
157 #define PCH_DEV_GSPI0 _PCH_DEV(SIO3, 2)
158 #define PCH_DEV_GSPI1 _PCH_DEV(SIO3, 3)
159 
160 #define PCH_DEV_SLOT_ESPI 0x1f
161 #define PCH_DEV_SLOT_LPC PCH_DEV_SLOT_ESPI
162 #define PCH_DEVFN_ESPI _PCH_DEVFN(ESPI, 0)
163 #define PCH_DEVFN_P2SB _PCH_DEVFN(ESPI, 1)
164 #define PCH_DEVFN_PMC _PCH_DEVFN(ESPI, 2)
165 #define PCH_DEVFN_HDA _PCH_DEVFN(ESPI, 3)
166 #define PCH_DEVFN_SMBUS _PCH_DEVFN(ESPI, 4)
167 #define PCH_DEVFN_SPI _PCH_DEVFN(ESPI, 5)
168 #define PCH_DEVFN_GBE _PCH_DEVFN(ESPI, 6)
169 #define PCH_DEVFN_TRACEHUB _PCH_DEVFN(ESPI, 7)
170 #define PCH_DEV_ESPI _PCH_DEV(ESPI, 0)
171 #define PCH_DEV_LPC PCH_DEV_ESPI
172 #define PCH_DEV_P2SB _PCH_DEV(ESPI, 1)
173 
174 #if !ENV_RAMSTAGE
175 /*
176  * PCH_DEV_PMC is intentionally not defined in RAMSTAGE since PMC device gets
177  * hidden from PCI bus after call to FSP-S. This leads to resource allocator
178  * dropping it from the root bus as unused device. All references to PCH_DEV_PMC
179  * would then return NULL and can go unnoticed if not handled properly. Since,
180  * this device does not have any special chip config associated with it, it is
181  * okay to not provide the definition for it in ramstage.
182  */
183 #define PCH_DEV_PMC _PCH_DEV(ESPI, 2)
184 #endif
185 
186 #define PCH_DEV_HDA _PCH_DEV(ESPI, 3)
187 #define PCH_DEV_SMBUS _PCH_DEV(ESPI, 4)
188 #define PCH_DEV_SPI _PCH_DEV(ESPI, 5)
189 #define PCH_DEV_GBE _PCH_DEV(ESPI, 6)
190 #define PCH_DEV_TRACEHUB _PCH_DEV(ESPI, 7)
191 
192 #endif