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

Go to the source code of this file.

Macros

#define NMI_OFF   0
 

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 pch_pirq_init (struct device *dev)
 
static void pch_gpi_routing (struct device *dev)
 
static void pch_power_options (struct device *dev)
 
static void pch_rtc_init (struct device *dev)
 
static void mobile5_pm_init (struct device *dev)
 
static void enable_hpet (void)
 
static void enable_clock_gating (struct device *dev)
 
static void pch_set_acpi_mode (void)
 
static void pch_fixups (struct device *dev)
 
static void lpc_init (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 *device)
 
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

◆ NMI_OFF

#define NMI_OFF   0

Definition at line 26 of file lpc.c.

Function Documentation

◆ enable_clock_gating()

static void enable_clock_gating ( struct device dev)
static

Definition at line 355 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 ( void  )
static

Definition at line 341 of file lpc.c.

References HPTC, RCBA32, read32(), and write32().

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 514 of file lpc.c.

◆ lpc_final()

static void lpc_final ( struct device dev)
static

Definition at line 528 of file lpc.c.

◆ lpc_init()

◆ mobile5_pm_init()

static void mobile5_pm_init ( struct device dev)
static

Definition at line 257 of file lpc.c.

References ARRAY_SIZE, BIOS_DEBUG, pci_write_config8(), printk, RCBA32, and void().

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 33 of file lpc.c.

References ioapic_lock_max_vectors(), setup_ioapic(), and VIO_APIC_VADDR.

Referenced by lpc_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 41 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_fixups()

static void pch_fixups ( struct device dev)
static

Definition at line 393 of file lpc.c.

References RCBA32_AND_OR, and RCBA32_OR.

Referenced by lpc_init().

Here is the caller graph for this function:

◆ pch_gpi_routing()

static void pch_gpi_routing ( struct device dev)
static

Definition at line 111 of file lpc.c.

References device::chip_info, 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_lpc_enable()

static void pch_lpc_enable ( struct device dev)
static

Definition at line 505 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

◆ pch_pirq_init()

static void pch_pirq_init ( struct device dev)
static

Definition at line 73 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().

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

Definition at line 140 of file lpc.c.

References ALT_GP_SMI_EN, BIOS_INFO, device::chip_info, config, CONFIG, GEN_PMCON_1, GEN_PMCON_3, get_uint_option(), GPE0_EN, inb(), inl(), MAINBOARD_POWER_KEEP, MAINBOARD_POWER_OFF, MAINBOARD_POWER_ON, NMI_OFF, outb(), outl(), outw(), pch_gpi_routing(), pci_read_config16(), pci_write_config16(), pmbase, printk, PRSTS, and RCBA32.

Referenced by lpc_init().

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

◆ pch_rtc_init()

static void pch_rtc_init ( struct device dev)
static

Definition at line 240 of file lpc.c.

References BIOS_DEBUG, cmos_init(), elog_add_event(), ELOG_TYPE_RTC_RESET, GEN_PMCON_3, pci_read_config8(), pci_write_config8(), printk, RTC_BATTERY_DEAD, and rtc_failed().

Referenced by lpc_init().

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

◆ pch_set_acpi_mode()

static void pch_set_acpi_mode ( void  )
static

Definition at line 386 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 device)
static

Definition at line 519 of file lpc.c.

References chip, device::chip_info, intel_acpi_gen_def_acpi_pirq(), intel_acpi_pcie_hotplug_generator(), and pcidev_on_root().

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:539
static const unsigned short pci_device_ids[]
Definition: lpc.c:553

Definition at line 553 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 = acpi_write_hpet,
.init = lpc_init,
.final = lpc_final,
.enable = pch_lpc_enable,
.scan_bus = scan_static_bus,
.ops_pci = &pci_dev_ops_pci,
}
unsigned long acpi_write_hpet(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
Definition: acpi.c:1141
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:528
static const char * lpc_acpi_name(const struct device *dev)
Definition: lpc.c:514
static void pch_lpc_read_resources(struct device *dev)
Definition: lpc.c:444
static void southbridge_fill_ssdt(const struct device *device)
Definition: lpc.c:519
static void lpc_init(struct device *dev)
Definition: lpc.c:403
static void pch_lpc_enable(struct device *dev)
Definition: lpc.c:505

Definition at line 528 of file lpc.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCI_DID_INTEL_IBEXPEAK_LPC_3400
Definition: pci_ids.h:2804
#define PCI_DID_INTEL_IBEXPEAK_LPC_H57
Definition: pci_ids.h:2799
#define PCI_DID_INTEL_IBEXPEAK_LPC_Q57
Definition: pci_ids.h:2801
#define PCI_DID_INTEL_IBEXPEAK_LPC_P55
Definition: pci_ids.h:2795
#define PCI_DID_INTEL_IBEXPEAK_LPC_HM55
Definition: pci_ids.h:2800
#define PCI_DID_INTEL_IBEXPEAK_LPC_HM57
Definition: pci_ids.h:2802
#define PCI_DID_INTEL_IBEXPEAK_LPC_PM55
Definition: pci_ids.h:2796
#define PCI_DID_INTEL_IBEXPEAK_LPC_QM57
Definition: pci_ids.h:2798
#define PCI_DID_INTEL_IBEXPEAK_LPC_3450
Definition: pci_ids.h:2806
#define PCI_DID_INTEL_IBEXPEAK_LPC_QS57
Definition: pci_ids.h:2803
#define PCI_DID_INTEL_IBEXPEAK_LPC_H55
Definition: pci_ids.h:2797
#define PCI_DID_INTEL_IBEXPEAK_LPC_3420
Definition: pci_ids.h:2805

Definition at line 553 of file lpc.c.