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/isa-dma.h>
#include <pc80/i8259.h>
#include <device/pci_ops.h>
#include <arch/ioapic.h>
#include <acpi/acpi.h>
#include <cpu/x86/smm.h>
#include <soc/iomap.h>
#include <soc/lpc.h>
#include <soc/pch.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/rcba.h>
#include <soc/intel/broadwell/pch/chip.h>
#include <acpi/acpigen.h>
#include <southbridge/intel/common/rtc.h>
#include <southbridge/intel/lynxpoint/iobp.h>
#include <southbridge/intel/lynxpoint/lp_gpio.h>
Include dependency graph for lpc.c:

Go to the source code of this file.

Macros

#define LPC_DEFAULT_IO_RANGE_LOWER   0
 
#define LPC_DEFAULT_IO_RANGE_UPPER   0x1000
 

Functions

static void pch_enable_ioapic (struct device *dev)
 
static void enable_hpet (struct device *dev)
 
static void pch_pirq_init (struct device *dev)
 
static void pch_power_options (struct device *dev)
 
static void pch_misc_init (struct device *dev)
 
static void pch_pm_init_magic (struct device *dev)
 
static void pch_enable_mphy (void)
 
static void pch_init_deep_sx (struct device *dev)
 
static void pch_pm_init (struct device *dev)
 
static void pch_cg_init (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 unsigned long broadwell_write_acpi_tables (const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
 

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

◆ LPC_DEFAULT_IO_RANGE_UPPER

#define LPC_DEFAULT_IO_RANGE_UPPER   0x1000

Definition at line 501 of file lpc.c.

Function Documentation

◆ broadwell_write_acpi_tables()

static unsigned long broadwell_write_acpi_tables ( const struct device device,
unsigned long  current,
struct acpi_rsdp rsdp 
)
static

Definition at line 589 of file lpc.c.

References ACPI_ACCESS_SIZE_DWORD_ACCESS, acpi_write_dbg2_pci_uart(), acpi_write_hpet(), CONFIG, PCH_DEV_UART0, and PCH_DEV_UART1.

Here is the call graph for this function:

◆ enable_hpet()

static void enable_hpet ( struct device dev)
static

Definition at line 39 of file lpc.c.

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

Referenced by lpc_init(), and sdram_initialize().

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

◆ lpc_init()

static void lpc_init ( struct device dev)
static

◆ pch_cg_init()

static void pch_cg_init ( struct device dev)
static

Definition at line 365 of file lpc.c.

References BUC, CG, FD, GEN_PMCON_1, PCH_DISABLE_GBE, PCH_DISABLE_HD_AUDIO, pch_iobp_update(), pch_is_wpt(), pci_read_config16(), pci_read_config8(), pci_write_config16(), pcidev_path_on_root(), RCBA32, RCBA32_AND_OR, RCBA32_OR, and SA_DEVFN_IGD.

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

Definition at line 26 of file lpc.c.

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

Referenced by chip_init(), and lpc_init().

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

◆ pch_enable_mphy()

static void pch_enable_mphy ( void  )
static

Definition at line 280 of file lpc.c.

References BIOS_DEBUG, gpio_is_native(), pch_iobp_update(), pch_is_wpt(), pch_is_wpt_ulx(), pch_read_soft_strap(), and printk.

Referenced by pch_pm_init().

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

◆ pch_init_deep_sx()

static void pch_init_deep_sx ( struct device dev)
static

Definition at line 317 of file lpc.c.

References device::chip_info, config, DEEP_S3_EN_AC, DEEP_S3_EN_DC, DEEP_S3_POL, DEEP_S5_EN_AC, DEEP_S5_EN_DC, DEEP_S5_POL, DEEP_SX_CONFIG, DEEP_SX_GP27_PIN_EN, DEEP_SX_WAKE_PIN_EN, and RCBA32_OR.

Referenced by pch_pm_init().

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 503 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 536 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 522 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 460 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_read_resources()

static void pch_lpc_read_resources ( struct device dev)
static

Definition at line 577 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_misc_init()

static void pch_misc_init ( struct device dev)
static

Definition at line 166 of file lpc.c.

References ACPI_BASE_ADDRESS, BIOS_CNTL, CONFIG, GEN_PMCON_2, inb(), inl(), outb(), outl(), pci_and_config8(), pci_or_config8(), pci_read_config8(), pci_write_config8(), PM1_CNT, RCBA32_AND_OR, RCBA32_OR, SCI_EN, SERIRQ_CNTL, and SLP_TYP.

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_pirq_init()

static void pch_pirq_init ( struct device dev)
static

Definition at line 70 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_pm_init()

static void pch_pm_init ( struct device dev)
static

Definition at line 340 of file lpc.c.

References BIOS_DEBUG, FD, PCH_DISABLE_ADSPD, pch_enable_mphy(), pch_init_deep_sx(), pch_iobp_update(), pch_is_wpt(), pch_pm_init_magic(), 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_pm_init_magic()

static void pch_pm_init_magic ( struct device dev)
static

Definition at line 214 of file lpc.c.

References pci_update_config32(), pci_write_config8(), RCBA32, RCBA32_AND_OR, and RCBA32_OR.

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

References BIOS_INFO, device::chip_info, config, enable_all_gpe(), enable_alt_smi(), GEN_PMCON_3, get_uint_option(), MAINBOARD_POWER_KEEP, MAINBOARD_POWER_OFF, MAINBOARD_POWER_ON, pci_read_config16(), pci_write_config16(), and printk.

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 431 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:

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

Definition at line 612 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 = broadwell_write_acpi_tables,
.init = &lpc_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 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 pch_lpc_read_resources(struct device *dev)
Definition: lpc.c:577
static unsigned long broadwell_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
Definition: lpc.c:589
static void lpc_init(struct device *dev)
Definition: lpc.c:438

Definition at line 589 of file lpc.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCH_LPT_LP_SAMPLE
Definition: pch.h:7
#define PCH_WPT_BDW_Y_SAMPLE
Definition: pch.h:17
#define PCH_LPT_LP_VALUE
Definition: pch.h:10
#define PCH_WPT_BDW_H
Definition: pch.h:20
#define PCH_LPT_LP_MAINSTREAM
Definition: pch.h:9
#define PCH_WPT_BDW_U_SAMPLE
Definition: pch.h:14
#define PCH_WPT_HSW_U_SAMPLE
Definition: pch.h:13
#define PCH_WPT_BDW_Y_BASE
Definition: pch.h:19
#define PCH_LPT_LP_PREMIUM
Definition: pch.h:8
#define PCH_WPT_BDW_Y_PREMIUM
Definition: pch.h:18
#define PCH_WPT_BDW_U_BASE
Definition: pch.h:16
#define PCH_WPT_BDW_U_PREMIUM
Definition: pch.h:15

Definition at line 612 of file lpc.c.