summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block/acpi/madt.c
blob: 14fab74b8492dc55b1194f5da85f74e47519c346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* SPDX-License-Identifier: GPL-2.0-only */

#include <acpi/acpi.h>
#include <amdblocks/data_fabric.h>
#include <device/device.h>

unsigned long acpi_fill_madt(unsigned long current)
{
	struct device *dev = NULL;
	while ((dev = dev_find_path(dev, DEVICE_PATH_DOMAIN)) != NULL) {
		struct resource *res = probe_resource(dev, IOMMU_IOAPIC_IDX);
		if (!res)
			continue;

		current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current,
						   res->base);
	}

	return current;
}