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/pci_ops.h>
#include <option.h>
#include <pc80/isa-dma.h>
#include <pc80/i8259.h>
#include <arch/io.h>
#include <arch/ioapic.h>
#include <acpi/acpi.h>
#include <cpu/x86/smm.h>
#include "chip.h"
#include "iobp.h"
#include "pch.h"
#include <acpi/acpigen.h>
#include <southbridge/intel/common/acpi_pirq_gen.h>
#include <southbridge/intel/common/rcba_pirq.h>
#include <southbridge/intel/common/rtc.h>
#include <southbridge/intel/common/spi.h>
#include <types.h>
Include dependency graph for lpc.c:

Go to the source code of this file.

Macros

#define NMI_OFF   0
 
#define LPC_DEFAULT_IO_RANGE_LOWER   0
 
#define LPC_DEFAULT_IO_RANGE_UPPER   0x1000
 

Functions

static void pch_enable_ioapic (struct device *dev)
 Set miscellaneous static southbridge features. More...
 
static void pch_enable_serial_irqs (struct device *dev)
 
static void enable_hpet (struct device *const dev)
 
static void pch_pirq_init (struct device *dev)
 
static void pch_gpi_routing (struct device *dev, struct southbridge_intel_lynxpoint_config *config)
 
static void pch_power_options (struct device *dev)
 
static void configure_dmi_pm (struct device *dev)
 
static void lpt_pm_init (struct device *dev)
 
static void lpt_lp_pm_init (struct device *dev)
 
static void enable_clock_gating (struct device *dev)
 
static void enable_lp_clock_gating (struct device *dev)
 
static void pch_set_acpi_mode (void)
 
static void lpc_init (struct device *dev)
 
static void pch_lpc_add_mmio_resources (struct device *dev)
 
static int pch_io_range_in_default (int base, int size)
 
static void pch_lpc_add_io_resource (struct device *dev, u16 base, u16 size, int index)
 
static void pch_lpc_add_gen_io_resources (struct device *dev, int reg_value, int index)
 
static void pch_lpc_add_io_resources (struct device *dev)
 
static void pch_lpc_read_resources (struct device *dev)
 
static void pch_lpc_enable (struct device *dev)
 
static const char * lpc_acpi_name (const struct device *dev)
 
static void southbridge_fill_ssdt (const struct device *dev)
 
static unsigned long southbridge_write_acpi_tables (const struct device *device, unsigned long start, struct acpi_rsdp *rsdp)
 
static void lpc_final (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
 

Macro Definition Documentation

◆ LPC_DEFAULT_IO_RANGE_LOWER

#define LPC_DEFAULT_IO_RANGE_LOWER   0

Definition at line 654 of file lpc.c.

◆ LPC_DEFAULT_IO_RANGE_UPPER

#define LPC_DEFAULT_IO_RANGE_UPPER   0x1000

Definition at line 655 of file lpc.c.

◆ NMI_OFF

#define NMI_OFF   0

Definition at line 25 of file lpc.c.

Function Documentation

◆ configure_dmi_pm()

static void configure_dmi_pm ( struct device dev)
static

Definition at line 278 of file lpc.c.

References pci_read_config8(), pcidev_on_root(), RCBA16, RCBA32_AND_OR, and RCBA32_OR.

Referenced by lpt_pm_init().

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

◆ enable_clock_gating()

static void enable_clock_gating ( struct device dev)
static

Definition at line 484 of file lpc.c.

References CG, GEN_PMCON_1, pci_read_config16(), pci_write_config16(), RCBA32, RCBA32_AND_OR, and RCBA32_OR.

Referenced by lpc_init().

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

◆ enable_hpet()

static void enable_hpet ( struct device *const  dev)
static

Definition at line 60 of file lpc.c.

References HPTC, LPC_HnBDF, PCH_HPET_PCI_BUS, PCH_HPET_PCI_SLOT, pci_write_config16(), and RCBA32.

Referenced by lpc_init().

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

◆ enable_lp_clock_gating()

static void enable_lp_clock_gating ( struct device dev)
static

Definition at line 509 of file lpc.c.

References BUC, CG, GEN_PMCON_1, PCH_DISABLE_GBE, pch_iobp_update(), pci_or_config32(), pci_read_config16(), pci_read_config8(), pci_write_config16(), pcidev_on_root(), RCBA32, RCBA32_AND_OR, and RCBA32_OR.

Referenced by lpc_init().

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

◆ lpc_acpi_name()

static const char* lpc_acpi_name ( const struct device dev)
static

Definition at line 751 of file lpc.c.

◆ lpc_final()

static void lpc_final ( struct device dev)
static

Definition at line 792 of file lpc.c.

◆ lpc_init()

◆ lpt_lp_pm_init()

static void lpt_lp_pm_init ( struct device dev)
static

Definition at line 393 of file lpc.c.

References BIOS_DEBUG, device::chip_info, config, FD, PCH_DISABLE_ADSPD, pch_iobp_update(), pci_or_config32(), pci_write_config8(), printk, RCBA32, RCBA32_AND_OR, and RCBA32_OR.

Referenced by lpc_init().

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

◆ lpt_pm_init()

static void lpt_pm_init ( struct device dev)
static

Definition at line 309 of file lpc.c.

References BIOS_DEBUG, device::chip_info, config, configure_dmi_pm(), pci_or_config32(), pci_update_config8(), pci_write_config8(), pcidev_on_root(), PMIR, PMIR_CF9LOCK, printk, RCBA32, and RCBA32_OR.

Referenced by lpc_init().

Here is the call graph for this function:
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.

References ioapic_lock_max_vectors(), ioapic_set_max_vectors(), LPC_IBDF, PCH_IOAPIC_PCI_BUS, PCH_IOAPIC_PCI_SLOT, pch_is_lp(), pci_write_config16(), setup_ioapic(), and VIO_APIC_VADDR.

Referenced by lpc_init(), and lpc_soc_init().

Here is the call graph for this function:
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 49 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_gpi_routing()

static void pch_gpi_routing ( struct device dev,
struct southbridge_intel_lynxpoint_config config 
)
static

Definition at line 144 of file lpc.c.

References config, GPIO_ROUT, and pci_write_config32().

Referenced by pch_power_options().

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

◆ pch_io_range_in_default()

static int pch_io_range_in_default ( int  base,
int  size 
)
inlinestatic

Definition at line 657 of file lpc.c.

References base, LPC_DEFAULT_IO_RANGE_LOWER, LPC_DEFAULT_IO_RANGE_UPPER, and resource::size.

Referenced by pch_lpc_add_io_resource().

Here is the caller graph for this function:

◆ pch_lpc_add_gen_io_resources()

static void pch_lpc_add_gen_io_resources ( struct device dev,
int  reg_value,
int  index 
)
static

Definition at line 690 of file lpc.c.

References base, resource::index, pch_lpc_add_io_resource(), and resource::size.

Referenced by pch_lpc_add_io_resources().

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

◆ pch_lpc_add_io_resource()

static void pch_lpc_add_io_resource ( struct device dev,
u16  base,
u16  size,
int  index 
)
static

Definition at line 676 of file lpc.c.

References resource::base, base, resource::flags, resource::index, IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_IO, new_resource(), pch_io_range_in_default(), and resource::size.

Referenced by pch_lpc_add_gen_io_resources(), and pch_lpc_add_io_resources().

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

◆ pch_lpc_add_io_resources()

◆ pch_lpc_add_mmio_resources()

static void pch_lpc_add_mmio_resources ( struct device dev)
static

Definition at line 614 of file lpc.c.

References resource::base, resource::flags, IO_APIC_ADDR, IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_MEM, IORESOURCE_RESERVE, LGMR, new_resource(), OIC, pci_read_config32(), RCBA, 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_enable()

static void pch_lpc_enable ( struct device dev)
static

Definition at line 742 of file lpc.c.

References DISPBDF, FD2, pch_enable(), PCH_ENABLE_DBDF, RCBA16, and RCBA32_OR.

Here is the call graph for this function:

◆ pch_lpc_read_resources()

static void pch_lpc_read_resources ( struct device dev)
static

Definition at line 730 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_pirq_init()

static void pch_pirq_init ( struct device dev)
static

Definition at line 100 of file lpc.c.

References all_devices, DEVICE_PATH_PCI, device::enabled, device::next, device::path, PCI_INTERRUPT_LINE, PCI_INTERRUPT_PIN, pci_read_config8(), pci_write_config8(), PIRQA_ROUT, PIRQB_ROUT, PIRQC_ROUT, PIRQD_ROUT, PIRQE_ROUT, PIRQF_ROUT, PIRQG_ROUT, PIRQH_ROUT, and device_path::type.

Referenced by lpc_init(), and lpc_soc_init().

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

◆ pch_power_options()

static void pch_power_options ( struct device dev)
static

◆ pch_set_acpi_mode()

static void pch_set_acpi_mode ( void  )
static

Definition at line 564 of file lpc.c.

References acpi_is_wakeup_s3(), APM_CNT_ACPI_DISABLE, and apm_control().

Referenced by lpc_init().

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

◆ southbridge_fill_ssdt()

static void southbridge_fill_ssdt ( const struct device dev)
static

Definition at line 756 of file lpc.c.

References intel_acpi_gen_def_acpi_pirq().

Here is the call graph for this function:

◆ southbridge_write_acpi_tables()

static unsigned long southbridge_write_acpi_tables ( const struct device device,
unsigned long  start,
struct acpi_rsdp rsdp 
)
static

Definition at line 761 of file lpc.c.

References acpi_add_table(), acpi_align_current(), acpi_create_serialio_ssdt(), acpi_write_hpet(), BIOS_DEBUG, acpi_table_header::length, pch_is_lp(), and printk.

Here is the call 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:803
static const unsigned short pci_device_ids[]
Definition: lpc.c:818

Definition at line 818 of file lpc.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = pch_lpc_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.acpi_fill_ssdt = southbridge_fill_ssdt,
.acpi_name = lpc_acpi_name,
.write_acpi_tables = southbridge_write_acpi_tables,
.init = lpc_init,
.final = lpc_final,
.enable = pch_lpc_enable,
.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 pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
void scan_static_bus(struct device *bus)
Definition: root_device.c:89
static void lpc_final(struct device *dev)
Definition: lpc.c:792
static const char * lpc_acpi_name(const struct device *dev)
Definition: lpc.c:751
static void pch_lpc_read_resources(struct device *dev)
Definition: lpc.c:730
static void southbridge_fill_ssdt(const struct device *dev)
Definition: lpc.c:756
static void lpc_init(struct device *dev)
Definition: lpc.c:570
static void pch_lpc_enable(struct device *dev)
Definition: lpc.c:742
static unsigned long southbridge_write_acpi_tables(const struct device *device, unsigned long start, struct acpi_rsdp *rsdp)
Definition: lpc.c:761

Definition at line 792 of file lpc.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCI_DID_INTEL_LPT_Q87
Definition: pci_ids.h:2829
#define PCI_DID_INTEL_LPT_MOBILE_SAMPLE
Definition: pci_ids.h:2821
#define PCI_DID_INTEL_LPT_H81
Definition: pci_ids.h:2835
#define PCI_DID_INTEL_LPT_LP_PREMIUM
Definition: pci_ids.h:2837
#define PCI_DID_INTEL_LPT_C226
Definition: pci_ids.h:2834
#define PCI_DID_INTEL_LPT_DESKTOP_SAMPLE
Definition: pci_ids.h:2822
#define PCI_DID_INTEL_LPT_Q85
Definition: pci_ids.h:2828
#define PCI_DID_INTEL_LPT_C224
Definition: pci_ids.h:2833
#define PCI_DID_INTEL_LPT_C222
Definition: pci_ids.h:2832
#define PCI_DID_INTEL_LPT_LP_SAMPLE
Definition: pci_ids.h:2836
#define PCI_DID_INTEL_LPT_HM87
Definition: pci_ids.h:2827
#define PCI_DID_INTEL_LPT_QM87
Definition: pci_ids.h:2830
#define PCI_DID_INTEL_LPT_B85
Definition: pci_ids.h:2831
#define PCI_DID_INTEL_LPT_Z85
Definition: pci_ids.h:2824
#define PCI_DID_INTEL_LPT_LP_VALUE
Definition: pci_ids.h:2839
#define PCI_DID_INTEL_LPT_LP_MAINSTREAM
Definition: pci_ids.h:2838
#define PCI_DID_INTEL_LPT_Z87
Definition: pci_ids.h:2823
#define PCI_DID_INTEL_LPT_H87
Definition: pci_ids.h:2826
#define PCI_DID_INTEL_LPT_HM86
Definition: pci_ids.h:2825

Definition at line 818 of file lpc.c.