coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lpc.c File Reference
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <intelblocks/lpc_lib.h>
#include <soc/pm.h>
#include "lpc_def.h"
Include dependency graph for lpc.c:

Go to the source code of this file.

Functions

__weak void lpc_soc_init (struct device *dev)
 
__weak void pch_lpc_soc_fill_io_resources (struct device *dev)
 
void pch_lpc_add_new_resource (struct device *dev, uint8_t offset, uintptr_t base, size_t size, unsigned long flags)
 
static void pch_lpc_add_io_resources (struct device *dev)
 
static void pch_lpc_add_mmio_resources (struct device *dev)
 
static void pch_lpc_read_resources (struct device *dev)
 
static void pch_lpc_set_child_resources (struct device *dev)
 
static void pch_lpc_loop_resources (struct device *dev)
 
static void pch_lpc_set_resources (struct device *dev)
 

Variables

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

Function Documentation

◆ lpc_soc_init()

__weak void lpc_soc_init ( struct device dev)

Definition at line 14 of file lpc.c.

◆ pch_lpc_add_io_resources()

static void pch_lpc_add_io_resources ( struct device dev)
static

Definition at line 35 of file lpc.c.

References base, IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_IO, LPC_GENERIC_IO_RANGE, LPC_LGIR_ADDR_MASK, LPC_LGIR_EN, LPC_NUM_GENERIC_IO_RANGES, pch_lpc_add_new_resource(), pch_lpc_soc_fill_io_resources(), pci_read_config32(), and resource::size.

Referenced by pch_lpc_read_resources().

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

◆ pch_lpc_add_mmio_resources()

static void pch_lpc_add_mmio_resources ( struct device dev)
static

Definition at line 60 of file lpc.c.

References IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_MEM, IORESOURCE_RESERVE, LPC_GENERIC_MEM_RANGE, LPC_LGMR_ADDR_MASK, LPC_LGMR_EN, LPC_LGMR_WINDOW_SIZE, pch_lpc_add_new_resource(), and pci_read_config32().

Referenced by pch_lpc_read_resources().

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

◆ pch_lpc_add_new_resource()

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

Definition at line 25 of file lpc.c.

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

Referenced by pch_lpc_add_io_resources(), and pch_lpc_add_mmio_resources().

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

◆ pch_lpc_loop_resources()

static void pch_lpc_loop_resources ( struct device dev)
static

Definition at line 86 of file lpc.c.

References resource::base, resource::flags, IORESOURCE_IO, lpc_open_pmio_window(), resource::next, pch_lpc_set_child_resources(), device::resource_list, and resource::size.

Referenced by pch_lpc_set_child_resources().

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

◆ pch_lpc_read_resources()

static void pch_lpc_read_resources ( struct device dev)
static

Definition at line 72 of file lpc.c.

References pch_lpc_add_io_resources(), pch_lpc_add_mmio_resources(), and pci_dev_read_resources().

Here is the call graph for this function:

◆ pch_lpc_set_child_resources()

static void pch_lpc_set_child_resources ( struct device dev)
static

Definition at line 101 of file lpc.c.

References bus::children, device::link_list, bus::next, pch_lpc_loop_resources(), and device::sibling.

Referenced by pch_lpc_loop_resources().

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

◆ pch_lpc_set_resources()

static void pch_lpc_set_resources ( struct device dev)
static

Definition at line 112 of file lpc.c.

◆ pch_lpc_soc_fill_io_resources()

__weak void pch_lpc_soc_fill_io_resources ( struct device dev)

Definition at line 20 of file lpc.c.

Referenced by pch_lpc_add_io_resources().

Here is the caller graph for this function:

Variable Documentation

◆ __pci_driver

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

Definition at line 140 of file lpc.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = pch_lpc_read_resources,
.set_resources = pch_lpc_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = lpc_soc_init,
.scan_bus = scan_static_bus,
.ops_pci = &pci_dev_ops_pci,
}
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 scan_static_bus(struct device *bus)
Definition: root_device.c:89
void lpc_soc_init(struct device *dev)
Definition: lpc.c:10
static void pch_lpc_read_resources(struct device *dev)
Definition: lpc.c:72
static void pch_lpc_set_resources(struct device *dev)
Definition: lpc.c:112

Definition at line 112 of file lpc.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static

Definition at line 140 of file lpc.c.