coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ish.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <acpi/acpi_device.h>
4 #include <acpi/acpigen.h>
5 #include <console/console.h>
6 #include <device/pci.h>
7 #include <device/pci_ids.h>
8 #include "chip.h"
9 
10 static void ish_fill_ssdt_generator(const struct device *dev)
11 {
13  struct device *root = dev->bus->dev;
14  struct acpi_dp *dsd;
15 
16  if (!config || !config->firmware_name)
17  return;
18 
20 
21  dsd = acpi_dp_new_table("_DSD");
22  acpi_dp_add_string(dsd, "firmware-name", config->firmware_name);
23  acpi_dp_write(dsd);
24 
25  acpigen_pop_len(); /* Scope */
26 
27  printk(BIOS_INFO, "%s: Set firmware-name: %s\n",
28  acpi_device_path(root), config->firmware_name);
29 }
30 
31 static struct device_operations intel_ish_ops = {
33  .set_resources = noop_set_resources,
34  .acpi_fill_ssdt = ish_fill_ssdt_generator,
35 };
36 
37 static void intel_ish_enable(struct device *dev)
38 {
39  /* This dev is a generic device that is a child to the ISH PCI device */
40  dev->ops = &intel_ish_ops;
41 }
42 
43 /* Copy of default_pci_ops_dev with scan_bus addition */
44 static const struct device_operations pci_ish_device_ops = {
46  .set_resources = pci_dev_set_resources,
47  .enable_resources = pci_dev_enable_resources,
48  .init = pci_dev_init,
49  .scan_bus = &scan_generic_bus, /* Non-default */
50  .ops_pci = &pci_dev_ops_pci,
51 };
52 
53 static const unsigned short pci_device_ids[] = {
59  0
60 };
61 
62 static const struct pci_driver ish_intel_driver __pci_driver = {
63  .ops = &pci_ish_device_ops,
64  .vendor = PCI_VID_INTEL,
65  .devices = pci_device_ids,
66 };
67 
69  CHIP_NAME("Intel ISH Chip")
70  .enable_dev = intel_ish_enable,
71 };
const char * acpi_device_path(const struct device *dev)
Definition: device.c:144
struct acpi_dp * acpi_dp_add_string(struct acpi_dp *dp, const char *name, const char *string)
Definition: device.c:991
void acpi_dp_write(struct acpi_dp *table)
Definition: device.c:898
struct acpi_dp * acpi_dp_new_table(const char *name)
Definition: device.c:930
void acpigen_pop_len(void)
Definition: acpigen.c:37
void acpigen_write_scope(const char *name)
Definition: acpigen.c:326
#define printk(level,...)
Definition: stdlib.h:16
#define CHIP_NAME(X)
Definition: device.h:32
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
Definition: device.h:73
static void noop_set_resources(struct device *dev)
Definition: device.h:74
static struct device_operations intel_ish_ops
Definition: ish.c:31
static void intel_ish_enable(struct device *dev)
Definition: ish.c:37
static void ish_fill_ssdt_generator(const struct device *dev)
Definition: ish.c:10
static const struct pci_driver ish_intel_driver __pci_driver
Definition: ish.c:62
static const struct device_operations pci_ish_device_ops
Definition: ish.c:44
static const unsigned short pci_device_ids[]
Definition: ish.c:53
struct chip_operations drivers_intel_ish_ops
Definition: ish.c:68
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
enum board_config config
Definition: memory.c:448
void pci_dev_init(struct device *dev)
Default handler: only runs the relevant PCI BIOS.
Definition: pci_device.c:873
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
#define PCI_DID_INTEL_MTL_ISHB
Definition: pci_ids.h:2184
#define PCI_DID_INTEL_TGL_H_ISHB
Definition: pci_ids.h:2183
#define PCI_DID_INTEL_CNL_ISHB
Definition: pci_ids.h:2180
#define PCI_DID_INTEL_TGL_ISHB
Definition: pci_ids.h:2182
#define PCI_DID_INTEL_CML_ISHB
Definition: pci_ids.h:2181
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
void scan_generic_bus(struct device *bus)
Definition: root_device.c:52
DEVTREE_CONST struct device * dev
Definition: device.h:78
void(* read_resources)(struct device *dev)
Definition: device.h:39
Definition: device.h:107
struct device_operations * ops
Definition: device.h:143
DEVTREE_CONST struct bus * bus
Definition: device.h:108
DEVTREE_CONST void * chip_info
Definition: device.h:164