summaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/data_fabric.c
blob: a25115886ef7da5de399e70c128382620892562f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* SPDX-License-Identifier: GPL-2.0-only */

#include <acpi/acpi_device.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>

static const char *data_fabric_acpi_name(const struct device *dev)
{
	switch (dev->device) {
	case PCI_DID_AMD_FAM17H_MODEL18H_DF0:
		return "DFD0";
	case PCI_DID_AMD_FAM17H_MODEL18H_DF1:
		return "DFD1";
	case PCI_DID_AMD_FAM17H_MODEL18H_DF2:
		return "DFD2";
	case PCI_DID_AMD_FAM17H_MODEL18H_DF3:
		return "DFD3";
	case PCI_DID_AMD_FAM17H_MODEL18H_DF4:
		return "DFD4";
	case PCI_DID_AMD_FAM17H_MODEL18H_DF5:
		return "DFD5";
	case PCI_DID_AMD_FAM17H_MODEL18H_DF6:
		return "DFD6";
	case PCI_DID_AMD_FAM17H_MODEL18H_DF7:
		return "DFD7";
	default:
		printk(BIOS_ERR, "%s: Unhandled device id 0x%x\n", __func__, dev->device);
	}

	return NULL;
}

struct device_operations picasso_data_fabric_ops = {
	.read_resources		= noop_read_resources,
	.set_resources		= noop_set_resources,
	.acpi_name		= data_fabric_acpi_name,
	.acpi_fill_ssdt		= acpi_device_write_pci_dev,
};