blob: bebabfba2978470312b29611f1211d1925cc117f [file] [log] [blame]
Marc Jones97321db2020-09-28 23:35:08 -06001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <acpi/acpigen.h>
Felix Held4b2464f2022-02-23 17:54:20 +01004#include <arch/hpet.h>
Marc Jones97321db2020-09-28 23:35:08 -06005#include <assert.h>
6#include <cbmem.h>
7#include <device/mmio.h>
8#include <device/pci.h>
Marc Jones97321db2020-09-28 23:35:08 -06009#include <soc/acpi.h>
10#include <soc/cpu.h>
Rocky Phagurad4db36e2021-04-03 08:49:32 -070011#include <soc/hest.h>
Marc Jones97321db2020-09-28 23:35:08 -060012#include <soc/iomap.h>
13#include <soc/pci_devs.h>
14#include <soc/soc_util.h>
Marc Jones18960ce2020-11-02 12:41:12 -070015#include <soc/util.h>
Arthur Heymans695dd292020-11-12 21:05:09 +010016#include <intelblocks/p2sb.h>
Marc Jones97321db2020-09-28 23:35:08 -060017
18#include "chip.h"
19
20/* Northbridge(NUMA) ACPI table generation. SRAT, SLIT, etc */
21
22unsigned long acpi_create_srat_lapics(unsigned long current)
23{
24 struct device *cpu;
25 unsigned int cpu_index = 0;
26
27 for (cpu = all_devices; cpu; cpu = cpu->next) {
Fabio Aiuto45aae7f2022-09-23 16:51:34 +020028 if (!is_enabled_cpu(cpu))
Marc Jones97321db2020-09-28 23:35:08 -060029 continue;
30 printk(BIOS_DEBUG, "SRAT: lapic cpu_index=%02x, node_id=%02x, apic_id=%02x\n",
31 cpu_index, cpu->path.apic.node_id, cpu->path.apic.apic_id);
32 current += acpi_create_srat_lapic((acpi_srat_lapic_t *)current,
33 cpu->path.apic.node_id, cpu->path.apic.apic_id);
34 cpu_index++;
35 }
36 return current;
37}
38
39static unsigned int get_srat_memory_entries(acpi_srat_mem_t *srat_mem)
40{
41 const struct SystemMemoryMapHob *memory_map;
42 unsigned int mmap_index;
43
44 memory_map = get_system_memory_map();
Elyes Haouasf1ba7d62022-09-13 10:03:44 +020045 assert(memory_map);
Marc Jones97321db2020-09-28 23:35:08 -060046 printk(BIOS_DEBUG, "memory_map: %p\n", memory_map);
47
48 mmap_index = 0;
49 for (int e = 0; e < memory_map->numberEntries; ++e) {
50 const struct SystemMemoryMapElement *mem_element = &memory_map->Element[e];
51 uint64_t addr =
Elyes Haouas9018dee2022-11-18 15:07:33 +010052 (uint64_t)((uint64_t)mem_element->BaseAddress <<
Marc Jones97321db2020-09-28 23:35:08 -060053 MEM_ADDR_64MB_SHIFT_BITS);
54 uint64_t size =
Elyes Haouas9018dee2022-11-18 15:07:33 +010055 (uint64_t)((uint64_t)mem_element->ElementSize <<
Marc Jones97321db2020-09-28 23:35:08 -060056 MEM_ADDR_64MB_SHIFT_BITS);
57
58 printk(BIOS_DEBUG, "memory_map %d addr: 0x%llx, BaseAddress: 0x%x, size: 0x%llx, "
59 "ElementSize: 0x%x, reserved: %d\n",
60 e, addr, mem_element->BaseAddress, size,
61 mem_element->ElementSize, (mem_element->Type & MEM_TYPE_RESERVED));
62
63 assert(mmap_index < MAX_ACPI_MEMORY_AFFINITY_COUNT);
64
65 /* skip reserved memory region */
66 if (mem_element->Type & MEM_TYPE_RESERVED)
67 continue;
68
69 /* skip if this address is already added */
70 bool skip = false;
71 for (int idx = 0; idx < mmap_index; ++idx) {
72 uint64_t base_addr = ((uint64_t)srat_mem[idx].base_address_high << 32) +
73 srat_mem[idx].base_address_low;
74 if (addr == base_addr) {
75 skip = true;
76 break;
77 }
78 }
79 if (skip)
80 continue;
81
82 srat_mem[mmap_index].type = 1; /* Memory affinity structure */
83 srat_mem[mmap_index].length = sizeof(acpi_srat_mem_t);
Elyes Haouas9018dee2022-11-18 15:07:33 +010084 srat_mem[mmap_index].base_address_low = (uint32_t)(addr & 0xffffffff);
85 srat_mem[mmap_index].base_address_high = (uint32_t)(addr >> 32);
86 srat_mem[mmap_index].length_low = (uint32_t)(size & 0xffffffff);
87 srat_mem[mmap_index].length_high = (uint32_t)(size >> 32);
Marc Jones97321db2020-09-28 23:35:08 -060088 srat_mem[mmap_index].proximity_domain = mem_element->SocketId;
89 srat_mem[mmap_index].flags = SRAT_ACPI_MEMORY_ENABLED;
90 if ((mem_element->Type & MEMTYPE_VOLATILE_MASK) == 0)
91 srat_mem[mmap_index].flags |= SRAT_ACPI_MEMORY_NONVOLATILE;
92 ++mmap_index;
93 }
94
95 return mmap_index;
96}
97
98static unsigned long acpi_fill_srat(unsigned long current)
99{
100 acpi_srat_mem_t srat_mem[MAX_ACPI_MEMORY_AFFINITY_COUNT];
101 unsigned int mem_count;
102
103 /* create all subtables for processors */
104 current = acpi_create_srat_lapics(current);
105
106 mem_count = get_srat_memory_entries(srat_mem);
107 for (int i = 0; i < mem_count; ++i) {
108 printk(BIOS_DEBUG, "adding srat memory %d entry length: %d, addr: 0x%x%x, "
109 "length: 0x%x%x, proximity_domain: %d, flags: %x\n",
110 i, srat_mem[i].length,
111 srat_mem[i].base_address_high, srat_mem[i].base_address_low,
112 srat_mem[i].length_high, srat_mem[i].length_low,
113 srat_mem[i].proximity_domain, srat_mem[i].flags);
114 memcpy((acpi_srat_mem_t *)current, &srat_mem[i], sizeof(srat_mem[i]));
115 current += srat_mem[i].length;
116 }
117
118 return current;
119}
120
121static unsigned long acpi_fill_slit(unsigned long current)
122{
Marc Jones70907b02020-10-28 17:00:31 -0600123 unsigned int nodes = soc_get_num_cpus();
Marc Jones97321db2020-09-28 23:35:08 -0600124
125 uint8_t *p = (uint8_t *)current;
126 memset(p, 0, 8 + nodes * nodes);
127 *p = (uint8_t)nodes;
128 p += 8;
129
130 /* this assumes fully connected socket topology */
131 for (int i = 0; i < nodes; i++) {
132 for (int j = 0; j < nodes; j++) {
133 if (i == j)
134 p[i*nodes+j] = 10;
135 else
136 p[i*nodes+j] = 16;
137 }
138 }
139
140 current += 8 + nodes * nodes;
141 return current;
142}
143
144/*
Marc Jones97321db2020-09-28 23:35:08 -0600145 * This function adds PCIe bridge device entry in DMAR table. If it is called
146 * in the context of ATSR subtable, it adds ATSR subtable when it is first called.
147 */
148static unsigned long acpi_create_dmar_ds_pci_br_for_port(unsigned long current,
Jacob Garber6df38702020-10-24 16:23:45 -0600149 int port, int stack, const IIO_RESOURCE_INSTANCE *iio_resource, uint32_t pcie_seg,
Marc Jones97321db2020-09-28 23:35:08 -0600150 bool is_atsr, bool *first)
151{
152
Marc Jones995a7e22020-10-28 17:08:54 -0600153 if (soc_get_stack_for_port(port) != stack)
Marc Jones97321db2020-09-28 23:35:08 -0600154 return 0;
155
Jacob Garber6df38702020-10-24 16:23:45 -0600156 const uint32_t bus = iio_resource->StackRes[stack].BusBase;
157 const uint32_t dev = iio_resource->PcieInfo.PortInfo[port].Device;
158 const uint32_t func = iio_resource->PcieInfo.PortInfo[port].Function;
Marc Jones97321db2020-09-28 23:35:08 -0600159
Nico Huberf4f365f2021-10-14 18:16:39 +0200160 const uint32_t id = pci_s_read_config32(PCI_DEV(bus, dev, func),
Marc Jones97321db2020-09-28 23:35:08 -0600161 PCI_VENDOR_ID);
162 if (id == 0xffffffff)
163 return 0;
164
165 unsigned long atsr_size = 0;
166 unsigned long pci_br_size = 0;
Elyes HAOUASfa999822022-01-27 14:27:05 +0100167 if (is_atsr && first && *first) {
Marc Jones97321db2020-09-28 23:35:08 -0600168 printk(BIOS_DEBUG, "[Root Port ATS Capability] Flags: 0x%x, "
169 "PCI Segment Number: 0x%x\n", 0, pcie_seg);
170 atsr_size = acpi_create_dmar_atsr(current, 0, pcie_seg);
171 *first = false;
172 }
173
174 printk(BIOS_DEBUG, " [PCI Bridge Device] Enumeration ID: 0x%x, "
175 "PCI Bus Number: 0x%x, PCI Path: 0x%x, 0x%x\n",
176 0, bus, dev, func);
177 pci_br_size = acpi_create_dmar_ds_pci_br(current + atsr_size, bus, dev, func);
178
179 return (atsr_size + pci_br_size);
180}
181
182static unsigned long acpi_create_drhd(unsigned long current, int socket,
183 int stack, const IIO_UDS *hob)
184{
Marc Jones97321db2020-09-28 23:35:08 -0600185 uint32_t enum_id;
186 unsigned long tmp = current;
187
188 uint32_t bus = hob->PlatformData.IIO_resource[socket].StackRes[stack].BusBase;
189 uint32_t pcie_seg = hob->PlatformData.CpuQpiInfo[socket].PcieSegment;
190 uint32_t reg_base =
191 hob->PlatformData.IIO_resource[socket].StackRes[stack].VtdBarAddress;
192 printk(BIOS_SPEW, "%s socket: %d, stack: %d, bus: 0x%x, pcie_seg: 0x%x, reg_base: 0x%x\n",
193 __func__, socket, stack, bus, pcie_seg, reg_base);
194
195 /* Do not generate DRHD for non-PCIe stack */
196 if (!reg_base)
197 return current;
198
Arthur Heymansa1c4ad32021-05-04 18:40:28 +0200199 // Add DRHD Hardware Unit
200 if (socket == 0 && stack == CSTACK) {
201 printk(BIOS_DEBUG, "[Hardware Unit Definition] Flags: 0x%x, PCI Segment Number: 0x%x, "
202 "Register Base Address: 0x%x\n",
203 DRHD_INCLUDE_PCI_ALL, pcie_seg, reg_base);
204 current += acpi_create_dmar_drhd(current, DRHD_INCLUDE_PCI_ALL,
205 pcie_seg, reg_base);
206 } else {
207 printk(BIOS_DEBUG, "[Hardware Unit Definition] Flags: 0x%x, PCI Segment Number: 0x%x, "
208 "Register Base Address: 0x%x\n", 0, pcie_seg, reg_base);
209 current += acpi_create_dmar_drhd(current, 0, pcie_seg, reg_base);
210 }
211
Marc Jones97321db2020-09-28 23:35:08 -0600212 // Add PCH IOAPIC
213 if (socket == 0 && stack == CSTACK) {
Arthur Heymans6e425e12020-11-12 21:12:05 +0100214 union p2sb_bdf ioapic_bdf = p2sb_get_ioapic_bdf();
Marc Jones97321db2020-09-28 23:35:08 -0600215 printk(BIOS_DEBUG, " [IOAPIC Device] Enumeration ID: 0x%x, PCI Bus Number: 0x%x, "
216 "PCI Path: 0x%x, 0x%x\n",
Arthur Heymans6e425e12020-11-12 21:12:05 +0100217 PCH_IOAPIC_ID, ioapic_bdf.bus, ioapic_bdf.dev, ioapic_bdf.fn);
Marc Jones97321db2020-09-28 23:35:08 -0600218 current += acpi_create_dmar_ds_ioapic(current, PCH_IOAPIC_ID,
Arthur Heymans6e425e12020-11-12 21:12:05 +0100219 ioapic_bdf.bus, ioapic_bdf.dev, ioapic_bdf.fn);
Marc Jones97321db2020-09-28 23:35:08 -0600220 }
221
222 // Add IOAPIC entry
Arthur Heymansa1cc5572020-11-06 12:53:33 +0100223 enum_id = soc_get_iio_ioapicid(socket, stack);
Marc Jones97321db2020-09-28 23:35:08 -0600224 printk(BIOS_DEBUG, " [IOAPIC Device] Enumeration ID: 0x%x, PCI Bus Number: 0x%x, "
225 "PCI Path: 0x%x, 0x%x\n", enum_id, bus, APIC_DEV_NUM, APIC_FUNC_NUM);
226 current += acpi_create_dmar_ds_ioapic(current, enum_id, bus,
227 APIC_DEV_NUM, APIC_FUNC_NUM);
228
229 // Add CBDMA devices for CSTACK
230 if (socket != 0 && stack == CSTACK) {
231 for (int cbdma_func_id = 0; cbdma_func_id < 8; ++cbdma_func_id) {
232 printk(BIOS_DEBUG, " [PCI Endpoint Device] Enumeration ID: 0x%x, "
233 "PCI Bus Number: 0x%x, PCI Path: 0x%x, 0x%x\n",
234 0, bus, CBDMA_DEV_NUM, cbdma_func_id);
235 current += acpi_create_dmar_ds_pci(current,
236 bus, CBDMA_DEV_NUM, cbdma_func_id);
237 }
238 }
239
240 // Add PCIe Ports
241 if (socket != 0 || stack != CSTACK) {
242 IIO_RESOURCE_INSTANCE iio_resource =
243 hob->PlatformData.IIO_resource[socket];
244 for (int p = PORT_0; p < MAX_PORTS; ++p)
245 current += acpi_create_dmar_ds_pci_br_for_port(current, p, stack,
Jacob Garber6df38702020-10-24 16:23:45 -0600246 &iio_resource, pcie_seg, false, NULL);
Marc Jones97321db2020-09-28 23:35:08 -0600247
248 // Add VMD
249 if (hob->PlatformData.VMDStackEnable[socket][stack] &&
250 stack >= PSTACK0 && stack <= PSTACK2) {
251 printk(BIOS_DEBUG, " [PCI Endpoint Device] Enumeration ID: 0x%x, "
252 "PCI Bus Number: 0x%x, PCI Path: 0x%x, 0x%x\n",
253 0, bus, VMD_DEV_NUM, VMD_FUNC_NUM);
254 current += acpi_create_dmar_ds_pci(current,
255 bus, VMD_DEV_NUM, VMD_FUNC_NUM);
256 }
257 }
258
259 // Add HPET
260 if (socket == 0 && stack == CSTACK) {
Elyes Haouas167b7fcd2022-12-11 10:38:35 +0100261 uint16_t hpet_capid = read16p(HPET_BASE_ADDRESS);
Marc Jones97321db2020-09-28 23:35:08 -0600262 uint16_t num_hpets = (hpet_capid >> 0x08) & 0x1F; // Bits [8:12] has hpet count
263 printk(BIOS_SPEW, "%s hpet_capid: 0x%x, num_hpets: 0x%x\n",
264 __func__, hpet_capid, num_hpets);
265 //BIT 15
266 if (num_hpets && (num_hpets != 0x1f) &&
Elyes Haouas167b7fcd2022-12-11 10:38:35 +0100267 (read32p(HPET_BASE_ADDRESS + 0x100) & (0x00008000))) {
Arthur Heymans695dd292020-11-12 21:05:09 +0100268 union p2sb_bdf hpet_bdf = p2sb_get_hpet_bdf();
Marc Jones97321db2020-09-28 23:35:08 -0600269 printk(BIOS_DEBUG, " [Message-capable HPET Device] Enumeration ID: 0x%x, "
270 "PCI Bus Number: 0x%x, PCI Path: 0x%x, 0x%x\n",
Arthur Heymans695dd292020-11-12 21:05:09 +0100271 0, hpet_bdf.bus, hpet_bdf.dev, hpet_bdf.fn);
272 current += acpi_create_dmar_ds_msi_hpet(current, 0, hpet_bdf.bus,
273 hpet_bdf.dev, hpet_bdf.fn);
Marc Jones97321db2020-09-28 23:35:08 -0600274 }
275 }
276
277 acpi_dmar_drhd_fixup(tmp, current);
278
279 return current;
280}
281
282static unsigned long acpi_create_atsr(unsigned long current, const IIO_UDS *hob)
283{
284 for (int socket = 0; socket < hob->PlatformData.numofIIO; ++socket) {
285 uint32_t pcie_seg = hob->PlatformData.CpuQpiInfo[socket].PcieSegment;
286 unsigned long tmp = current;
287 bool first = true;
288 IIO_RESOURCE_INSTANCE iio_resource =
289 hob->PlatformData.IIO_resource[socket];
290
291 for (int stack = 0; stack <= PSTACK2; ++stack) {
292 uint32_t bus = iio_resource.StackRes[stack].BusBase;
293 uint32_t vtd_base = iio_resource.StackRes[stack].VtdBarAddress;
294 if (!vtd_base)
295 continue;
Elyes Haouas167b7fcd2022-12-11 10:38:35 +0100296 uint64_t vtd_mmio_cap = read64p(vtd_base + VTD_EXT_CAP_LOW);
Marc Jones97321db2020-09-28 23:35:08 -0600297 printk(BIOS_SPEW, "%s socket: %d, stack: %d, bus: 0x%x, vtd_base: 0x%x, "
298 "vtd_mmio_cap: 0x%llx\n",
299 __func__, socket, stack, bus, vtd_base, vtd_mmio_cap);
300
301 // ATSR is applicable only for platform supporting device IOTLBs
302 // through the VT-d extended capability register
303 assert(vtd_mmio_cap != 0xffffffffffffffff);
304 if ((vtd_mmio_cap & 0x4) == 0) // BIT 2
305 continue;
306
307 for (int p = PORT_0; p < MAX_PORTS; ++p) {
308 if (socket == 0 && p == PORT_0)
309 continue;
310 current += acpi_create_dmar_ds_pci_br_for_port(current, p,
Jacob Garber6df38702020-10-24 16:23:45 -0600311 stack, &iio_resource, pcie_seg, true, &first);
Marc Jones97321db2020-09-28 23:35:08 -0600312 }
313 }
314 if (tmp != current)
315 acpi_dmar_atsr_fixup(tmp, current);
316 }
317
318 return current;
319}
320
321static unsigned long acpi_create_rmrr(unsigned long current)
322{
323 uint32_t size = ALIGN_UP(MEM_BLK_COUNT * sizeof(MEM_BLK), 0x1000);
324
325 uint32_t *ptr;
326
327 // reserve memory
328 ptr = cbmem_find(CBMEM_ID_STORAGE_DATA);
329 if (!ptr) {
330 ptr = cbmem_add(CBMEM_ID_STORAGE_DATA, size);
Elyes Haouasf1ba7d62022-09-13 10:03:44 +0200331 assert(ptr);
Marc Jones97321db2020-09-28 23:35:08 -0600332 memset(ptr, 0, size);
333 }
334
335 unsigned long tmp = current;
336 printk(BIOS_DEBUG, "[Reserved Memory Region] PCI Segment Number: 0x%x, Base Address: 0x%x, "
337 "End Address (limit): 0x%x\n",
Elyes Haouas9018dee2022-11-18 15:07:33 +0100338 0, (uint32_t)ptr, (uint32_t)((uint32_t)ptr + size - 1));
339 current += acpi_create_dmar_rmrr(current, 0, (uint32_t)ptr,
340 (uint32_t)((uint32_t)ptr + size - 1));
Marc Jones97321db2020-09-28 23:35:08 -0600341
342 printk(BIOS_DEBUG, " [PCI Endpoint Device] Enumeration ID: 0x%x, PCI Bus Number: 0x%x, "
343 "PCI Path: 0x%x, 0x%x\n",
344 0, XHCI_BUS_NUMBER, PCH_DEV_SLOT_XHCI, XHCI_FUNC_NUM);
345 current += acpi_create_dmar_ds_pci(current, XHCI_BUS_NUMBER,
346 PCH_DEV_SLOT_XHCI, XHCI_FUNC_NUM);
347
348 acpi_dmar_rmrr_fixup(tmp, current);
349
350 return current;
351}
352
353static unsigned long acpi_create_rhsa(unsigned long current)
354{
Arthur Heymans83b26222020-11-06 11:50:55 +0100355 const IIO_UDS *hob = get_iio_uds();
Marc Jones97321db2020-09-28 23:35:08 -0600356
357 for (int socket = 0; socket < hob->PlatformData.numofIIO; ++socket) {
358 IIO_RESOURCE_INSTANCE iio_resource =
359 hob->PlatformData.IIO_resource[socket];
360 for (int stack = 0; stack <= PSTACK2; ++stack) {
361 uint32_t vtd_base = iio_resource.StackRes[stack].VtdBarAddress;
362 if (!vtd_base)
363 continue;
364
365 printk(BIOS_DEBUG, "[Remapping Hardware Static Affinity] Base Address: 0x%x, "
366 "Proximity Domain: 0x%x\n", vtd_base, socket);
367 current += acpi_create_dmar_rhsa(current, vtd_base, socket);
368 }
369 }
370
371 return current;
372}
373
374static unsigned long acpi_fill_dmar(unsigned long current)
375{
Arthur Heymans83b26222020-11-06 11:50:55 +0100376 const IIO_UDS *hob = get_iio_uds();
Marc Jones97321db2020-09-28 23:35:08 -0600377
378 // DRHD
379 for (int iio = 1; iio <= hob->PlatformData.numofIIO; ++iio) {
380 int socket = iio;
381 if (socket == hob->PlatformData.numofIIO) // socket 0 should be last DRHD entry
382 socket = 0;
383
384 if (socket == 0) {
385 for (int stack = 1; stack <= PSTACK2; ++stack)
386 current = acpi_create_drhd(current, socket, stack, hob);
387 current = acpi_create_drhd(current, socket, CSTACK, hob);
388 } else {
389 for (int stack = 0; stack <= PSTACK2; ++stack)
390 current = acpi_create_drhd(current, socket, stack, hob);
391 }
392 }
393
394 // RMRR
395 current = acpi_create_rmrr(current);
396
397 // Root Port ATS Capability
398 current = acpi_create_atsr(current, hob);
399
400 // RHSA
401 current = acpi_create_rhsa(current);
402
403 return current;
404}
405
406unsigned long northbridge_write_acpi_tables(const struct device *device,
407 unsigned long current,
408 struct acpi_rsdp *rsdp)
409{
410 acpi_srat_t *srat;
411 acpi_slit_t *slit;
412 acpi_dmar_t *dmar;
413
414 const config_t *const config = config_of(device);
415
416 /* SRAT */
Elyes Haouasd6b6b222022-10-10 12:34:21 +0200417 current = ALIGN_UP(current, 8);
Marc Jones97321db2020-09-28 23:35:08 -0600418 printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
Elyes Haouas9018dee2022-11-18 15:07:33 +0100419 srat = (acpi_srat_t *)current;
Marc Jones97321db2020-09-28 23:35:08 -0600420 acpi_create_srat(srat, acpi_fill_srat);
421 current += srat->header.length;
422 acpi_add_table(rsdp, srat);
423
424 /* SLIT */
Elyes Haouasd6b6b222022-10-10 12:34:21 +0200425 current = ALIGN_UP(current, 8);
Marc Jones97321db2020-09-28 23:35:08 -0600426 printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
Elyes Haouas9018dee2022-11-18 15:07:33 +0100427 slit = (acpi_slit_t *)current;
Marc Jones97321db2020-09-28 23:35:08 -0600428 acpi_create_slit(slit, acpi_fill_slit);
429 current += slit->header.length;
430 acpi_add_table(rsdp, slit);
431
432 /* DMAR */
433 if (config->vtd_support) {
Elyes Haouasd6b6b222022-10-10 12:34:21 +0200434 current = ALIGN_UP(current, 8);
Marc Jones97321db2020-09-28 23:35:08 -0600435 dmar = (acpi_dmar_t *)current;
Marc Jonesb7e591e2020-11-13 15:55:31 -0700436 enum dmar_flags flags = DMAR_INTR_REMAP;
437
438 /* SKX FSP doesn't support X2APIC, but CPX FSP does */
439 if (CONFIG(SOC_INTEL_SKYLAKE_SP))
440 flags |= DMAR_X2APIC_OPT_OUT;
441
Marc Jones97321db2020-09-28 23:35:08 -0600442 printk(BIOS_DEBUG, "ACPI: * DMAR\n");
Marc Jonesb7e591e2020-11-13 15:55:31 -0700443 printk(BIOS_DEBUG, "[DMA Remapping table] Flags: 0x%x\n", flags);
444 acpi_create_dmar(dmar, flags, acpi_fill_dmar);
Marc Jones97321db2020-09-28 23:35:08 -0600445 current += dmar->header.length;
446 current = acpi_align_current(current);
447 acpi_add_table(rsdp, dmar);
448 }
449
Rocky Phagurad4db36e2021-04-03 08:49:32 -0700450 if (CONFIG(SOC_ACPI_HEST))
451 current = hest_create(current, rsdp);
452
Marc Jones97321db2020-09-28 23:35:08 -0600453 return current;
454}