mb/system76/cml-u/dt: Make use of chipset devicetree
[coreboot.git] / src / soc / intel / common / block / sata / sata.c
blob96b7390791cd6bf3ca0fef36d546f577bacef715
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpigen.h>
4 #include <acpi/acpigen_pci.h>
5 #include <device/device.h>
6 #include <device/pci.h>
7 #include <device/pci_ids.h>
8 #include <intelblocks/acpi.h>
10 static void sata_acpi_fill_ssdt(const struct device *dev)
12 const char *scope = acpi_device_scope(dev);
14 if (!scope)
15 return;
17 acpigen_write_scope(scope);
18 acpigen_write_device(soc_acpi_name(dev));
19 acpigen_write_ADR_pci_device(dev);
20 acpigen_write_STA(acpi_device_status(dev));
21 acpigen_pop_len(); /* Device */
22 acpigen_pop_len(); /* Scope */
25 struct device_operations sata_ops = {
26 .read_resources = pci_dev_read_resources,
27 .set_resources = pci_dev_set_resources,
28 .enable_resources = pci_dev_enable_resources,
29 .final = pci_dev_request_bus_master,
30 .ops_pci = &pci_dev_ops_pci,
31 #if CONFIG(HAVE_ACPI_TABLES)
32 .acpi_fill_ssdt = sata_acpi_fill_ssdt,
33 #endif
36 static const unsigned short pci_device_ids[] = {
37 PCI_DID_INTEL_MTL_SATA,
38 PCI_DID_INTEL_RPP_P_SATA_1,
39 PCI_DID_INTEL_RPP_P_SATA_2,
40 PCI_DID_INTEL_RPP_S_SATA,
41 PCI_DID_INTEL_LWB_SATA_AHCI,
42 PCI_DID_INTEL_LWB_SSATA_AHCI,
43 PCI_DID_INTEL_LWB_SATA_RAID,
44 PCI_DID_INTEL_LWB_SSATA_RAID,
45 PCI_DID_INTEL_LWB_SATA_AHCI_SUPER,
46 PCI_DID_INTEL_LWB_SSATA_AHCI_SUPER,
47 PCI_DID_INTEL_LWB_SATA_RAID_SUPER,
48 PCI_DID_INTEL_LWB_SSATA_RAID_SUPER,
49 PCI_DID_INTEL_LWB_SATA_ALT,
50 PCI_DID_INTEL_LWB_SATA_ALT_RST,
51 PCI_DID_INTEL_LWB_SSATA_ALT,
52 PCI_DID_INTEL_LWB_SSATA_ALT_RST,
53 PCI_DID_INTEL_CNL_SATA,
54 PCI_DID_INTEL_CNL_PREMIUM_SATA,
55 PCI_DID_INTEL_CNP_CMP_COMPAT_SATA,
56 PCI_DID_INTEL_CNP_H_SATA,
57 PCI_DID_INTEL_CNP_H_HALO_SATA,
58 PCI_DID_INTEL_CNP_LP_SATA,
59 PCI_DID_INTEL_ICP_U_SATA,
60 PCI_DID_INTEL_CMP_SATA,
61 PCI_DID_INTEL_CMP_PREMIUM_SATA,
62 PCI_DID_INTEL_CMP_LP_SATA,
63 PCI_DID_INTEL_CMP_H_SATA,
64 PCI_DID_INTEL_CMP_H_HALO_SATA,
65 PCI_DID_INTEL_CMP_H_PREMIUM_SATA,
66 PCI_DID_INTEL_TGP_LP_SATA,
67 PCI_DID_INTEL_TGP_SATA,
68 PCI_DID_INTEL_TGP_PREMIUM_SATA,
69 PCI_DID_INTEL_TGP_COMPAT_SATA,
70 PCI_DID_INTEL_TGP_H_SATA,
71 PCI_DID_INTEL_MCC_AHCI_SATA,
72 PCI_DID_INTEL_JSP_SATA_1,
73 PCI_DID_INTEL_JSP_SATA_2,
74 PCI_DID_INTEL_ADP_P_SATA_1,
75 PCI_DID_INTEL_ADP_P_SATA_2,
76 PCI_DID_INTEL_ADP_P_SATA_3,
77 PCI_DID_INTEL_ADP_P_SATA_4,
78 PCI_DID_INTEL_ADP_P_SATA_5,
79 PCI_DID_INTEL_ADP_P_SATA_6,
80 PCI_DID_INTEL_ADP_S_SATA_1,
81 PCI_DID_INTEL_ADP_S_SATA_2,
82 PCI_DID_INTEL_ADP_S_SATA_3,
83 PCI_DID_INTEL_ADP_S_SATA_4,
84 PCI_DID_INTEL_ADP_S_SATA_5,
85 PCI_DID_INTEL_ADP_S_SATA_6,
86 PCI_DID_INTEL_ADP_M_SATA_1,
87 PCI_DID_INTEL_ADP_M_SATA_2,
88 PCI_DID_INTEL_ADP_M_SATA_3,
89 PCI_DID_INTEL_APL_SATA,
90 PCI_DID_INTEL_GLK_SATA,
94 static const struct pci_driver pch_sata __pci_driver = {
95 .ops = &sata_ops,
96 .vendor = PCI_VID_INTEL,
97 .devices = pci_device_ids,