coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pmc.c File Reference
#include <device/pci_ops.h>
#include <console/console.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <intelblocks/acpi.h>
#include <intelblocks/pmc.h>
#include <intelblocks/pmclib.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
Include dependency graph for pmc.c:

Go to the source code of this file.

Functions

static void pch_pmc_add_new_resource (struct device *dev, uint8_t offset, uintptr_t base, size_t size, unsigned long flags)
 
static void pch_pmc_add_mmio_resources (struct device *dev, const struct pmc_resource_config *cfg)
 
static void pch_pmc_add_io_resources (struct device *dev, const struct pmc_resource_config *cfg)
 
static void pch_pmc_read_resources (struct device *dev)
 
static void pmc_fill_ssdt (const struct device *dev)
 
static void pmc_final (struct device *dev)
 

Variables

static struct device_operations device_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver pch_pmc __pci_driver
 

Function Documentation

◆ pch_pmc_add_io_resources()

static void pch_pmc_add_io_resources ( struct device dev,
const struct pmc_resource_config cfg 
)
static

Definition at line 33 of file pmc.c.

References pmc_resource_config::abase_addr, pmc_resource_config::abase_offset, pmc_resource_config::abase_size, device::command, CONFIG, IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_IO, pch_pmc_add_new_resource(), PCI_COMMAND_IO, and pci_write_config16().

Referenced by pch_pmc_read_resources().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pch_pmc_add_mmio_resources()

static void pch_pmc_add_mmio_resources ( struct device dev,
const struct pmc_resource_config cfg 
)
static

Definition at line 24 of file pmc.c.

References IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_MEM, IORESOURCE_RESERVE, pch_pmc_add_new_resource(), pmc_resource_config::pwrmbase_addr, pmc_resource_config::pwrmbase_offset, and pmc_resource_config::pwrmbase_size.

Referenced by pch_pmc_read_resources().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pch_pmc_add_new_resource()

static void pch_pmc_add_new_resource ( struct device dev,
uint8_t  offset,
uintptr_t  base,
size_t  size,
unsigned long  flags 
)
static

Definition at line 13 of file pmc.c.

References resource::base, base, resource::flags, new_resource(), offset, and resource::size.

Referenced by pch_pmc_add_io_resources(), and pch_pmc_add_mmio_resources().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pch_pmc_read_resources()

static void pch_pmc_read_resources ( struct device dev)
static

Definition at line 59 of file pmc.c.

References config, die_with_post_code, pch_pmc_add_io_resources(), pch_pmc_add_mmio_resources(), pci_dev_read_resources(), pmc_soc_get_resources(), and POST_HW_INIT_FAILURE.

Here is the call graph for this function:

◆ pmc_fill_ssdt()

static void pmc_fill_ssdt ( const struct device dev)
static

Definition at line 78 of file pmc.c.

References CONFIG, and generate_acpi_power_engine().

Here is the call graph for this function:

◆ pmc_final()

static void pmc_final ( struct device dev)
static

Definition at line 95 of file pmc.c.

Variable Documentation

◆ __pci_driver

const struct pci_driver pch_pmc __pci_driver
static
Initial value:
= {
.ops = &device_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids,
}
static struct device_operations device_ops
Definition: pmc.c:100
static const unsigned short pci_device_ids[]
Definition: pmc.c:113
#define PCI_VID_INTEL
Definition: pci_ids.h:2157

Definition at line 113 of file pmc.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = pch_pmc_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = pmc_soc_init,
.ops_pci = &pci_dev_ops_pci,
.scan_bus = scan_static_bus,
.final = pmc_final,
}
void pmc_soc_init(struct device *dev)
Definition: pmc.c:80
static void pmc_final(struct device *dev)
Definition: pmc.c:95
static void pch_pmc_read_resources(struct device *dev)
Definition: pmc.c:59
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
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
void scan_static_bus(struct device *bus)
Definition: root_device.c:89

Definition at line 95 of file pmc.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCI_DID_INTEL_CMP_H_PMC
Definition: pci_ids.h:3522
#define PCI_DID_INTEL_TGP_H_PMC
Definition: pci_ids.h:3524
#define PCI_DID_INTEL_ICP_PMC
Definition: pci_ids.h:3520
#define PCI_DID_INTEL_LWB_PMC_SUPER
Definition: pci_ids.h:3514
#define PCI_DID_INTEL_MTL_IOE_M_PMC
Definition: pci_ids.h:3531
#define PCI_DID_INTEL_CMP_PMC
Definition: pci_ids.h:3521
#define PCI_DID_INTEL_SPT_H_PMC
Definition: pci_ids.h:3512
#define PCI_DID_INTEL_SPT_LP_PMC
Definition: pci_ids.h:3511
#define PCI_DID_INTEL_CNP_H_PMC
Definition: pci_ids.h:3519
#define PCI_DID_INTEL_ADP_P_PMC
Definition: pci_ids.h:3527
#define PCI_DID_INTEL_MTL_SOC_PMC
Definition: pci_ids.h:3530
#define PCI_DID_INTEL_TGP_PMC
Definition: pci_ids.h:3523
#define PCI_DID_INTEL_LWB_PMC
Definition: pci_ids.h:3513
#define PCI_DID_INTEL_MTL_IOE_P_PMC
Definition: pci_ids.h:3532
#define PCI_DID_INTEL_APL_PMC
Definition: pci_ids.h:3516
#define PCI_DID_INTEL_GLK_PMC
Definition: pci_ids.h:3517
#define PCI_DID_INTEL_ADP_S_PMC
Definition: pci_ids.h:3528
#define PCI_DID_INTEL_JSP_PMC
Definition: pci_ids.h:3526
#define PCI_DID_INTEL_UPT_H_PMC
Definition: pci_ids.h:3515
#define PCI_DID_INTEL_MCC_PMC
Definition: pci_ids.h:3525
#define PCI_DID_INTEL_DNV_PMC
Definition: pci_ids.h:2789
#define PCI_DID_INTEL_ADP_M_N_PMC
Definition: pci_ids.h:3529

Definition at line 113 of file pmc.c.