coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lpc.c File Reference
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <arch/ioapic.h>
#include <acpi/acpi.h>
#include <cpu/x86/smm.h>
#include <bootstate.h>
#include <soc/lpc.h>
#include <soc/pci_devs.h>
#include <soc/ramstage.h>
#include <soc/iomap.h>
#include <soc/pcr.h>
#include <soc/p2sb.h>
#include <soc/acpi.h>
#include "chip.h"
Include dependency graph for lpc.c:

Go to the source code of this file.

Data Structures

struct  dnv_ir_lut
 

Macros

#define PCH_REDIR_ETR   120
 
#define DEVFN(dev, fn)   ((dev << 3) | (fn))
 

Functions

static void pch_enable_ioapic (struct device *dev)
 Set miscellaneous static southbridge features. More...
 
static int is_dnv_swizzled_rp (uint16_t bdf)
 
static int dnv_get_swizzled_pin (config_t *config, u8 devfn, u8 pin)
 
static int dnv_get_ir (config_t *config, u8 devfn, u8 pin)
 
static u8 dnv_get_int_line (struct device *irq_dev)
 
static void pch_pirq_init (struct device *dev)
 
static void pci_p2sb_read_resources (struct device *dev)
 
static void pch_enable_serial_irqs (struct device *dev)
 
static void lpc_init (struct device *dev)
 
static void pch_lpc_add_mmio_resources (struct device *dev)
 
static void pch_lpc_add_io_resources (struct device *dev)
 
static void lpc_read_resources (struct device *dev)
 
static void pch_decode_init (struct device *dev)
 
static void lpc_enable_resources (struct device *dev)
 
static void pch_hide_devfn (uint32_t devfn)
 
void southcluster_enable_dev (struct device *dev)
 
static void finalize_chipset (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_OS_RESUME, BS_ON_ENTRY, finalize_chipset, NULL)
 
 BOOT_STATE_INIT_ENTRY (BS_PAYLOAD_LOAD, BS_ON_EXIT, finalize_chipset, NULL)
 

Variables

static const struct dnv_ir_lut dnv_ir_lut []
 
static struct device_operations device_ops
 
static const struct pci_driver lpc_driver __pci_driver
 

Macro Definition Documentation

◆ DEVFN

#define DEVFN (   dev,
  fn 
)    ((dev << 3) | (fn))

Definition at line 47 of file lpc.c.

◆ PCH_REDIR_ETR

#define PCH_REDIR_ETR   120

Definition at line 25 of file lpc.c.

Function Documentation

◆ BOOT_STATE_INIT_ENTRY() [1/2]

BOOT_STATE_INIT_ENTRY ( BS_OS_RESUME  ,
BS_ON_ENTRY  ,
finalize_chipset  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [2/2]

BOOT_STATE_INIT_ENTRY ( BS_PAYLOAD_LOAD  ,
BS_ON_EXIT  ,
finalize_chipset  ,
NULL   
)

◆ dnv_get_int_line()

static u8 dnv_get_int_line ( struct device irq_dev)
static

◆ dnv_get_ir()

static int dnv_get_ir ( config_t config,
u8  devfn,
u8  pin 
)
static

Definition at line 137 of file lpc.c.

References ARRAY_SIZE, BIOS_ERR, BIOS_WARNING, config, dnv_ir_lut::devfn, dnv_ir_lut::ir, and printk.

Referenced by dnv_get_int_line().

Here is the caller graph for this function:

◆ dnv_get_swizzled_pin()

static int dnv_get_swizzled_pin ( config_t config,
u8  devfn,
u8  pin 
)
static

Definition at line 114 of file lpc.c.

References dnv_ir_lut::devfn.

Referenced by dnv_get_int_line().

Here is the caller graph for this function:

◆ finalize_chipset()

static void finalize_chipset ( void unused)
static

Definition at line 541 of file lpc.c.

References APM_CNT_FINALIZE, and apm_control().

Here is the call graph for this function:

◆ is_dnv_swizzled_rp()

static int is_dnv_swizzled_rp ( uint16_t  bdf)
static

Definition at line 90 of file lpc.c.

References DEVFN.

Referenced by dnv_get_int_line().

Here is the caller graph for this function:

◆ lpc_enable_resources()

static void lpc_enable_resources ( struct device dev)
static

Definition at line 492 of file lpc.c.

References pch_decode_init(), and pci_dev_enable_resources().

Here is the call graph for this function:

◆ lpc_init()

static void lpc_init ( struct device dev)
static

◆ lpc_read_resources()

static void lpc_read_resources ( struct device dev)
static

Definition at line 475 of file lpc.c.

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

Here is the call graph for this function:

◆ pch_decode_init()

static void pch_decode_init ( struct device dev)
static

Definition at line 490 of file lpc.c.

Referenced by lpc_enable_resources().

Here is the caller graph for this function:

◆ pch_enable_ioapic()

static void pch_enable_ioapic ( struct device dev)
static

Set miscellaneous static southbridge features.

Parameters
devPCI device with I/O APIC control registers

Definition at line 32 of file lpc.c.

Referenced by lpc_init().

Here is the caller graph for this function:

◆ pch_enable_serial_irqs()

static void pch_enable_serial_irqs ( struct device dev)
static

Definition at line 422 of file lpc.c.

References pci_write_config8(), and SERIRQ_CNTL.

Referenced by lpc_init().

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

◆ pch_hide_devfn()

static void pch_hide_devfn ( uint32_t  devfn)
static

Definition at line 499 of file lpc.c.

◆ pch_lpc_add_io_resources()

static void pch_lpc_add_io_resources ( struct device dev)
static

Definition at line 456 of file lpc.c.

References resource::base, resource::flags, IOINDEX_SUBTRACTIVE, IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_IO, IORESOURCE_MEM, IORESOURCE_SUBTRACTIVE, new_resource(), and resource::size.

Referenced by 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 454 of file lpc.c.

Referenced by lpc_read_resources().

Here is the caller graph for this function:

◆ pch_pirq_init()

◆ pci_p2sb_read_resources()

static void pci_p2sb_read_resources ( struct device dev)
static

Definition at line 396 of file lpc.c.

References resource::base, BIOS_DEBUG, DEFAULT_PCR_BASE, resource::flags, IO_APIC_ADDR, IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_MEM, IORESOURCE_STORED, new_resource(), printk, and resource::size.

Referenced by lpc_read_resources().

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

◆ southcluster_enable_dev()

void southcluster_enable_dev ( struct device dev)

Definition at line 501 of file lpc.c.

Referenced by byt_pcie_enable(), check_device_present(), enable_dev(), and sata_enable().

Here is the caller graph for this function:

Variable Documentation

◆ __pci_driver

const struct pci_driver lpc_driver __pci_driver
static
Initial value:
= {
.ops = &device_ops,
.vendor = PCI_VID_INTEL,
}
#define PCI_DID_INTEL_DNV_LPC
Definition: pci_ids.h:2787
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static struct device_operations device_ops
Definition: lpc.c:522

Definition at line 501 of file lpc.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = lpc_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = lpc_enable_resources,
.init = lpc_init,
.scan_bus = scan_static_bus,
.ops_pci = &soc_pci_ops,
}
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
struct pci_operations soc_pci_ops
Definition: chip.c:51
static void lpc_read_resources(struct device *dev)
Definition: lpc.c:475
static void lpc_enable_resources(struct device *dev)
Definition: lpc.c:492
void southcluster_enable_dev(struct device *dev)
Definition: lpc.c:501
static void lpc_init(struct device *dev)
Definition: lpc.c:433

Definition at line 501 of file lpc.c.

◆ dnv_ir_lut

const struct dnv_ir_lut dnv_ir_lut[]
static

Definition at line 32 of file lpc.c.