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_ELKHARTLAKE_PCI_DEVS_H_
4 #define _SOC_ELKHARTLAKE_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_DPTF 0x04
30 #define SA_DEVFN_DPTF PCI_DEVFN(SA_DEV_SLOT_DPTF, 0)
31 #define SA_DEV_DPTF PCI_DEV(0, SA_DEV_SLOT_DPTF, 0)
32 
33 #define SA_DEV_SLOT_GNA 0x08
34 #define SA_DEVFN_GNA PCI_DEVFN(SA_DEV_SLOT_GNA, 0)
35 #define SA_DEV_GNA PCI_DEV(0, SA_DEV_SLOT_GNA, 0)
36 
37 #define SA_DEV_SLOT_TRACEHUB 0x09
38 #define SA_DEVFN_TRACEHUB PCI_DEVFN(SA_DEV_SLOT_TRACEHUB, 0)
39 #define SA_DEV_TRACEHUB PCI_DEV(0, SA_DEV_SLOT_TRACEHUB, 0)
40 
41 /* PCH Devices */
42 #define PCH_DEV_SLOT_IEH 0x10
43 #define PCH_DEVFN_I2C6 _PCH_DEVFN(IEH, 0)
44 #define PCH_DEVFN_I2C7 _PCH_DEVFN(IEH, 1)
45 #define PCH_DEVFN_IEH _PCH_DEVFN(IEH, 5)
46 #define PCH_DEV_I2C6 _PCH_DEV(IEH, 0)
47 #define PCH_DEV_I2C7 _PCH_DEV(IEH, 1)
48 #define PCH_DEV_IEH _PCH_DEV(IEH, 5)
49 
50 #define PCH_DEV_SLOT_PSE0 0x11
51 #define PCH_DEVFN_PSEUART0 _PCH_DEVFN(PSE0, 0)
52 #define PCH_DEVFN_PSEUART1 _PCH_DEVFN(PSE0, 1)
53 #define PCH_DEVFN_PSEUART2 _PCH_DEVFN(PSE0, 2)
54 #define PCH_DEVFN_PSEUART3 _PCH_DEVFN(PSE0, 3)
55 #define PCH_DEVFN_PSEUART4 _PCH_DEVFN(PSE0, 4)
56 #define PCH_DEVFN_PSEUART5 _PCH_DEVFN(PSE0, 5)
57 #define PCH_DEVFN_PSEIS20 _PCH_DEVFN(PSE0, 6)
58 #define PCH_DEVFN_PSEIS21 _PCH_DEVFN(PSE0, 7)
59 #define PCH_DEV_PSEUART0 _PCH_DEV(PSE0, 0)
60 #define PCH_DEV_PSEUART1 _PCH_DEV(PSE0, 1)
61 #define PCH_DEV_PSEUART2 _PCH_DEV(PSE0, 2)
62 #define PCH_DEV_PSEUART3 _PCH_DEV(PSE0, 3)
63 #define PCH_DEV_PSEUART4 _PCH_DEV(PSE0, 4)
64 #define PCH_DEV_PSEUART5 _PCH_DEV(PSE0, 5)
65 #define PCH_DEV_PSEIS20 _PCH_DEV(PSE0, 6)
66 #define PCH_DEV_PSEIS21 _PCH_DEV(PSE0, 7)
67 
68 #define PCH_DEV_SLOT_SIO0 0x12
69 #define PCH_DEVFN_GSPI2 _PCH_DEVFN(SIO0, 0)
70 #define PCH_DEVFN_CSE_UMA _PCH_DEVFN(SIO0, 3)
71 #define PCH_DEVFN_CSE_DMA _PCH_DEVFN(SIO0, 4)
72 #define PCH_DEVFN_UFS0 _PCH_DEVFN(SIO0, 5)
73 #define PCH_DEVFN_UFS1 _PCH_DEVFN(SIO0, 7)
74 #define PCH_DEV_GSPI2 _PCH_DEV(SIO0, 0)
75 #define PCH_DEV_CSE_UMA _PCH_DEV(SIO0, 3)
76 #define PCH_DEV_CSE_DMA _PCH_DEV(SIO0, 4)
77 #define PCH_DEV_UFS0 _PCH_DEV(SIO0, 5)
78 #define PCH_DEV_UFS1 _PCH_DEV(SIO0, 7)
79 
80 #define PCH_DEV_SLOT_PSE1 0x13
81 #define PCH_DEVFN_PSEGSPI0 _PCH_DEVFN(PSE1, 0)
82 #define PCH_DEVFN_PSEGSPI1 _PCH_DEVFN(PSE1, 1)
83 #define PCH_DEVFN_PSEGSPI2 _PCH_DEVFN(PSE1, 2)
84 #define PCH_DEVFN_PSEGSPI3 _PCH_DEVFN(PSE1, 3)
85 #define PCH_DEVFN_PSEGPIO0 _PCH_DEVFN(PSE1, 4)
86 #define PCH_DEVFN_PSEGPIO1 _PCH_DEVFN(PSE1, 5)
87 #define PCH_DEV_PSEGSPI0 _PCH_DEV(PSE1, 0)
88 #define PCH_DEV_PSEGSPI1 _PCH_DEV(PSE1, 1)
89 #define PCH_DEV_PSEGSPI2 _PCH_DEV(PSE1, 2)
90 #define PCH_DEV_PSEGSPI3 _PCH_DEV(PSE1, 3)
91 #define PCH_DEV_PSEGPIO0 _PCH_DEV(PSE1, 4)
92 #define PCH_DEV_PSEGPIO1 _PCH_DEV(PSE1, 5)
93 
94 #define PCH_DEV_SLOT_XHCI 0x14
95 #define PCH_DEVFN_XHCI _PCH_DEVFN(XHCI, 0)
96 #define PCH_DEVFN_USBOTG _PCH_DEVFN(XHCI, 1)
97 #define PCH_DEV_XHCI _PCH_DEV(XHCI, 0)
98 #define PCH_DEV_USBOTG _PCH_DEV(XHCI, 1)
99 
100 #define PCH_DEV_SLOT_SIO1 0x15
101 #define PCH_DEVFN_I2C0 _PCH_DEVFN(SIO1, 0)
102 #define PCH_DEVFN_I2C1 _PCH_DEVFN(SIO1, 1)
103 #define PCH_DEVFN_I2C2 _PCH_DEVFN(SIO1, 2)
104 #define PCH_DEVFN_I2C3 _PCH_DEVFN(SIO1, 3)
105 #define PCH_DEV_I2C0 _PCH_DEV(SIO1, 0)
106 #define PCH_DEV_I2C1 _PCH_DEV(SIO1, 1)
107 #define PCH_DEV_I2C2 _PCH_DEV(SIO1, 2)
108 #define PCH_DEV_I2C3 _PCH_DEV(SIO1, 3)
109 
110 #define PCH_DEV_SLOT_CSE 0x16
111 #define PCH_DEVFN_CSE _PCH_DEVFN(CSE, 0)
112 #define PCH_DEVFN_CSE_2 _PCH_DEVFN(CSE, 1)
113 #define PCH_DEVFN_CSE_3 _PCH_DEVFN(CSE, 4)
114 #define PCH_DEVFN_CSE_4 _PCH_DEVFN(CSE, 5)
115 #define PCH_DEV_CSE _PCH_DEV(CSE, 0)
116 #define PCH_DEV_CSE_2 _PCH_DEV(CSE, 1)
117 #define PCH_DEV_CSE_3 _PCH_DEV(CSE, 4)
118 #define PCH_DEV_CSE_4 _PCH_DEV(CSE, 5)
119 
120 #define PCH_DEV_SLOT_SATA 0x17
121 #define PCH_DEVFN_SATA _PCH_DEVFN(SATA, 0)
122 #define PCH_DEV_SATA _PCH_DEV(SATA, 0)
123 
124 #define PCH_DEV_SLOT_PSE2 0x18
125 #define PCH_DEVFN_PSEI2C7 _PCH_DEVFN(PSE2, 0)
126 #define PCH_DEVFN_PSECAN0 _PCH_DEVFN(PSE2, 1)
127 #define PCH_DEVFN_PSECAN1 _PCH_DEVFN(PSE2, 2)
128 #define PCH_DEVFN_PSEQEP0 _PCH_DEVFN(PSE2, 3)
129 #define PCH_DEVFN_PSEQEP1 _PCH_DEVFN(PSE2, 4)
130 #define PCH_DEVFN_PSEQEP2 _PCH_DEVFN(PSE2, 5)
131 #define PCH_DEVFN_PSEQEP3 _PCH_DEVFN(PSE2, 6)
132 #define PCH_DEV_PSEI2C7 _PCH_DEV(PSE2, 0)
133 #define PCH_DEV_PSECAN0 _PCH_DEV(PSE2, 1)
134 #define PCH_DEV_PSECAN1 _PCH_DEV(PSE2, 2)
135 #define PCH_DEV_PSEQEP0 _PCH_DEV(PSE2, 3)
136 #define PCH_DEV_PSEQEP1 _PCH_DEV(PSE2, 4)
137 #define PCH_DEV_PSEQEP2 _PCH_DEV(PSE2, 5)
138 #define PCH_DEV_PSEQEP3 _PCH_DEV(PSE2, 6)
139 
140 #define PCH_DEV_SLOT_SIO2 0x19
141 #define PCH_DEVFN_I2C4 _PCH_DEVFN(SIO2, 0)
142 #define PCH_DEVFN_I2C5 _PCH_DEVFN(SIO2, 1)
143 #define PCH_DEVFN_UART2 _PCH_DEVFN(SIO2, 2)
144 #define PCH_DEV_I2C4 _PCH_DEV(SIO2, 0)
145 #define PCH_DEV_I2C5 _PCH_DEV(SIO2, 1)
146 #define PCH_DEV_UART2 _PCH_DEV(SIO2, 2)
147 
148 #define PCH_DEV_SLOT_STORAGE 0x1a
149 #define PCH_DEVFN_EMMC _PCH_DEVFN(STORAGE, 0)
150 #define PCH_DEVFN_SDCARD _PCH_DEVFN(STORAGE, 1)
151 #define PCH_DEV_EMMC _PCH_DEV(STORAGE, 0)
152 #define PCH_DEV_SDCARD _PCH_DEV(STORAGE, 1)
153 
154 #define PCH_DEV_SLOT_PSE3 0x1b
155 #define PCH_DEVFN_PSEI2C0 _PCH_DEVFN(PSE3, 0)
156 #define PCH_DEVFN_PSEI2C1 _PCH_DEVFN(PSE3, 1)
157 #define PCH_DEVFN_PSEI2C2 _PCH_DEVFN(PSE3, 2)
158 #define PCH_DEVFN_PSEI2C3 _PCH_DEVFN(PSE3, 3)
159 #define PCH_DEVFN_PSEI2C4 _PCH_DEVFN(PSE3, 4)
160 #define PCH_DEVFN_PSEI2C5 _PCH_DEVFN(PSE3, 5)
161 #define PCH_DEVFN_PSEI2C6 _PCH_DEVFN(PSE3, 6)
162 #define PCH_DEV_PSEI2C0 _PCH_DEV(PSE3, 0)
163 #define PCH_DEV_PSEI2C1 _PCH_DEV(PSE3, 1)
164 #define PCH_DEV_PSEI2C2 _PCH_DEV(PSE3, 2)
165 #define PCH_DEV_PSEI2C3 _PCH_DEV(PSE3, 3)
166 #define PCH_DEV_PSEI2C4 _PCH_DEV(PSE3, 4)
167 #define PCH_DEV_PSEI2C5 _PCH_DEV(PSE3, 5)
168 #define PCH_DEV_PSEI2C6 _PCH_DEV(PSE3, 6)
169 
170 #define PCH_DEV_SLOT_PCIE 0x1c
171 #define PCH_DEVFN_PCIE1 _PCH_DEVFN(PCIE, 0)
172 #define PCH_DEVFN_PCIE2 _PCH_DEVFN(PCIE, 1)
173 #define PCH_DEVFN_PCIE3 _PCH_DEVFN(PCIE, 2)
174 #define PCH_DEVFN_PCIE4 _PCH_DEVFN(PCIE, 3)
175 #define PCH_DEVFN_PCIE5 _PCH_DEVFN(PCIE, 4)
176 #define PCH_DEVFN_PCIE6 _PCH_DEVFN(PCIE, 5)
177 #define PCH_DEVFN_PCIE7 _PCH_DEVFN(PCIE, 6)
178 #define PCH_DEV_PCIE1 _PCH_DEV(PCIE, 0)
179 #define PCH_DEV_PCIE2 _PCH_DEV(PCIE, 1)
180 #define PCH_DEV_PCIE3 _PCH_DEV(PCIE, 2)
181 #define PCH_DEV_PCIE4 _PCH_DEV(PCIE, 3)
182 #define PCH_DEV_PCIE5 _PCH_DEV(PCIE, 4)
183 #define PCH_DEV_PCIE6 _PCH_DEV(PCIE, 5)
184 #define PCH_DEV_PCIE7 _PCH_DEV(PCIE, 6)
185 
186 #define PCH_DEV_SLOT_PSE4 0x1d
187 #define PCH_DEVFN_PSEIPC _PCH_DEVFN(PSE4, 0)
188 #define PCH_DEVFN_PSEGBE0 _PCH_DEVFN(PSE4, 1)
189 #define PCH_DEVFN_PSEGBE1 _PCH_DEVFN(PSE4, 2)
190 #define PCH_DEVFN_PSEDMA0 _PCH_DEVFN(PSE4, 3)
191 #define PCH_DEVFN_PSEDMA1 _PCH_DEVFN(PSE4, 4)
192 #define PCH_DEVFN_PSEDMA2 _PCH_DEVFN(PSE4, 5)
193 #define PCH_DEVFN_PSEPWM _PCH_DEVFN(PSE4, 6)
194 #define PCH_DEVFN_PSEADC _PCH_DEVFN(PSE4, 7)
195 #define PCH_DEV_PSEIPC _PCH_DEV(PSE4, 0)
196 #define PCH_DEV_PSEGBE0 _PCH_DEV(PSE4, 1)
197 #define PCH_DEV_PSEGBE1 _PCH_DEV(PSE4, 2)
198 #define PCH_DEV_PSEDMA0 _PCH_DEV(PSE4, 3)
199 #define PCH_DEV_PSEDMA1 _PCH_DEV(PSE4, 4)
200 #define PCH_DEV_PSEDMA2 _PCH_DEV(PSE4, 5)
201 #define PCH_DEV_PSEPWM _PCH_DEV(PSE4, 6)
202 #define PCH_DEV_PSEADC _PCH_DEV(PSE4, 7)
203 
204 #define PCH_DEV_SLOT_SIO3 0x1e
205 #define PCH_DEVFN_UART0 _PCH_DEVFN(SIO3, 0)
206 #define PCH_DEVFN_UART1 _PCH_DEVFN(SIO3, 1)
207 #define PCH_DEVFN_GSPI0 _PCH_DEVFN(SIO3, 2)
208 #define PCH_DEVFN_GSPI1 _PCH_DEVFN(SIO3, 3)
209 #define PCH_DEVFN_GBE _PCH_DEVFN(SIO3, 4)
210 #define PCH_DEVFN_HPET _PCH_DEVFN(SIO3, 6)
211 #define PCH_DEVFN_IOAPIC _PCH_DEVFN(SIO3, 7)
212 #define PCH_DEV_UART0 _PCH_DEV(SIO3, 0)
213 #define PCH_DEV_UART1 _PCH_DEV(SIO3, 1)
214 #define PCH_DEV_GSPI0 _PCH_DEV(SIO3, 2)
215 #define PCH_DEV_GSPI1 _PCH_DEV(SIO3, 3)
216 #define PCH_DEV_GBE _PCH_DEV(SIO3, 4)
217 #define PCH_DEV_HPET _PCH_DEV(SIO3, 6)
218 #define PCH_DEV_IOAPIC _PCH_DEV(SIO3, 7)
219 
220 #define PCH_DEV_SLOT_ESPI 0x1f
221 #define PCH_DEV_SLOT_LPC PCH_DEV_SLOT_ESPI
222 #define PCH_DEVFN_ESPI _PCH_DEVFN(ESPI, 0)
223 #define PCH_DEVFN_P2SB _PCH_DEVFN(ESPI, 1)
224 #define PCH_DEVFN_PMC _PCH_DEVFN(ESPI, 2)
225 #define PCH_DEVFN_HDA _PCH_DEVFN(ESPI, 3)
226 #define PCH_DEVFN_SMBUS _PCH_DEVFN(ESPI, 4)
227 #define PCH_DEVFN_SPI _PCH_DEVFN(ESPI, 5)
228 #define PCH_DEVFN_TRACEHUB _PCH_DEVFN(ESPI, 7)
229 #define PCH_DEV_ESPI _PCH_DEV(ESPI, 0)
230 #define PCH_DEV_LPC PCH_DEV_ESPI
231 #define PCH_DEV_P2SB _PCH_DEV(ESPI, 1)
232 
233 #if !ENV_RAMSTAGE
234 /*
235  * PCH_DEV_PMC is intentionally not defined in RAMSTAGE since PMC device gets
236  * hidden from PCI bus after call to FSP-S. This leads to resource allocator
237  * dropping it from the root bus as unused device. All references to PCH_DEV_PMC
238  * would then return NULL and can go unnoticed if not handled properly. Since,
239  * this device does not have any special chip config associated with it, it is
240  * okay to not provide the definition for it in ramstage.
241  */
242 #define PCH_DEV_PMC _PCH_DEV(ESPI, 2)
243 #endif
244 
245 #define PCH_DEV_HDA _PCH_DEV(ESPI, 3)
246 #define PCH_DEV_SMBUS _PCH_DEV(ESPI, 4)
247 #define PCH_DEV_SPI _PCH_DEV(ESPI, 5)
248 #define PCH_DEV_TRACEHUB _PCH_DEV(ESPI, 7)
249 
250 #endif