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 <device/pci_def.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 <acpi/acpigen.h>
#include <cpu/x86/smm.h>
#include <string.h>
#include "chip.h"
#include "pch.h"
#include <northbridge/intel/sandybridge/sandybridge.h>
#include <southbridge/intel/common/pciehp.h>
#include <southbridge/intel/common/acpi_pirq_gen.h>
#include <southbridge/intel/common/pmutil.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
 

Typedefs

typedef struct southbridge_intel_bd82x6x_config config_t
 

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 cpt_pm_init (struct device *dev)
 
static void ppt_pm_init (struct device *dev)
 
static void enable_hpet (struct device *const dev)
 
static void enable_clock_gating (struct device *dev)
 
static void pch_set_acpi_mode (void)
 
static void pch_fixups (struct device *dev)
 
static void pch_spi_init (const struct device *const dev)
 
static void report_pch_info (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)
 
void intel_southbridge_override_spi (struct intel_swseq_spi_config *spi_config)
 

Variables

struct {
   u16   dev_id
 
   const char *   dev_name
 
pch_table []
 
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 29 of file lpc.c.

Typedef Documentation

◆ config_t

Definition at line 1 of file lpc.c.

Function Documentation

◆ cpt_pm_init()

static void cpt_pm_init ( struct device dev)
static

Definition at line 248 of file lpc.c.

References BIOS_DEBUG, CIR10, CIR11, CIR12, CIR13, CIR14, CIR15, CIR16, CIR17, CIR18, CIR19, CIR2, CIR20, CIR21, CIR22, CIR23, CIR24, CIR25, CIR26, CIR27, CIR28, CIR29, CIR3, CIR30, CIR5, CIR6, CIR7, CIR8, CIR9, DMC, pci_write_config8(), PM_CFG, PMSYNC_CFG, printk, RCBA16_AND_OR, RCBA32, and RCBA32_AND_OR.

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

References CG, DMIC, GEN_PMCON_1, get_platform_type(), pch_iobp_update(), pci_read_config16(), pci_write_config16(), PLATFORM_DESKTOP_SERVER, PLATFORM_MOBILE, 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 332 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:

◆ intel_southbridge_override_spi()

void intel_southbridge_override_spi ( struct intel_swseq_spi_config spi_config)

Definition at line 645 of file lpc.c.

◆ lpc_acpi_name()

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

Definition at line 620 of file lpc.c.

◆ lpc_final()

static void lpc_final ( struct device dev)
static

Definition at line 634 of file lpc.c.

References acpi_is_wakeup_s3(), APM_CNT_FINALIZE, apm_control(), CONFIG, and spi_finalize_ops().

Here is the call graph for this function:

◆ lpc_init()

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

References ioapic_lock_max_vectors(), LPC_IBDF, PCH_IOAPIC_PCI_BUS, PCH_IOAPIC_PCI_SLOT, pci_write_config16(), 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 50 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 397 of file lpc.c.

References DMC, GEN_PMCON_2, LCAP, LCTL, pci_or_config8(), 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:

◆ pch_gpi_routing()

static void pch_gpi_routing ( struct device dev)
static

Definition at line 119 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 611 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 82 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 148 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_set_acpi_mode()

static void pch_set_acpi_mode ( void  )
static

Definition at line 390 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:

◆ pch_spi_init()

static void pch_spi_init ( const struct device *const  dev)
static

Definition at line 410 of file lpc.c.

References BIOS_DEBUG, device::chip_info, config, printk, RCBA32, and RCBA32_OR.

Referenced by lpc_init().

Here is the caller graph for this function:

◆ ppt_pm_init()

static void ppt_pm_init ( struct device dev)
static

Definition at line 290 of file lpc.c.

References BIOS_DEBUG, CIR10, CIR11, CIR12, CIR13, CIR14, CIR15, CIR16, CIR17, CIR18, CIR19, CIR2, CIR20, CIR21, CIR22, CIR23, CIR24, CIR25, CIR26, CIR27, CIR28, CIR29, CIR3, CIR30, CIR5, CIR6, CIR7, CIR8, CIR9, DMC, pci_write_config8(), PM_CFG, PMSYNC_CFG, printk, RCBA16_AND_OR, RCBA32, and RCBA32_AND_OR.

Referenced by lpc_init().

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

◆ report_pch_info()

static void report_pch_info ( struct device dev)
static

Definition at line 476 of file lpc.c.

References ARRAY_SIZE, BIOS_INFO, dev_id, pch_table, pch_type(), PCI_CLASS_REVISION, PCI_DEVICE_ID, pci_read_config16(), pci_read_config8(), and printk.

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

Definition at line 680 of file lpc.c.

◆ dev_id

u16 dev_id

Definition at line 426 of file lpc.c.

Referenced by report_pch_info().

◆ dev_name

const char* dev_name

Definition at line 427 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,
.write_acpi_tables = acpi_write_hpet,
.acpi_fill_ssdt = southbridge_fill_ssdt,
.acpi_name = lpc_acpi_name,
.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:634
static const char * lpc_acpi_name(const struct device *dev)
Definition: lpc.c:620
static void pch_lpc_read_resources(struct device *dev)
Definition: lpc.c:547
static void southbridge_fill_ssdt(const struct device *device)
Definition: lpc.c:625
static void lpc_init(struct device *dev)
Definition: lpc.c:492
static void pch_lpc_enable(struct device *dev)
Definition: lpc.c:611

Definition at line 645 of file lpc.c.

◆ 

const { ... } pch_table[]

Referenced by report_pch_info().

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0x1c40, 0x1c41, 0x1c42, 0x1c43, 0x1c44, 0x1c45, 0x1c46, 0x1c47, 0x1c48,
0x1c49, 0x1c4a, 0x1c4b, 0x1c4c, 0x1c4d, 0x1c4e, 0x1c4f, 0x1c50, 0x1c51,
0x1c52, 0x1c53, 0x1c54, 0x1c55, 0x1c56, 0x1c57, 0x1c58, 0x1c59, 0x1c5a,
0x1c5b, 0x1c5c, 0x1c5d, 0x1c5e, 0x1c5f,
0x1e41, 0x1e42, 0x1e43, 0x1e44, 0x1e45, 0x1e46, 0x1e47, 0x1e48, 0x1e49,
0x1e4a, 0x1e4b, 0x1e4c, 0x1e4d, 0x1e4e, 0x1e4f, 0x1e50, 0x1e51, 0x1e52,
0x1e53, 0x1e54, 0x1e55, 0x1e56, 0x1e57, 0x1e58, 0x1e59, 0x1e5a, 0x1e5b,
0x1e5c, 0x1e5d, 0x1e5e, 0x1e5f,
0 }

Definition at line 680 of file lpc.c.