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/pci_ops.h>
#include <arch/ioapic.h>
#include <acpi/acpi.h>
#include <cpu/x86/smm.h>
#include <acpi/acpigen.h>
#include <arch/smp/mpspec.h>
#include <southbridge/intel/common/acpi_pirq_gen.h>
#include <southbridge/intel/common/rcba_pirq.h>
#include <southbridge/intel/common/hpet.h>
#include <southbridge/intel/common/pmbase.h>
#include <southbridge/intel/common/spi.h>
#include "chip.h"
#include "i82801gx.h"
Include dependency graph for lpc.c:

Go to the source code of this file.

Macros

#define NMI_OFF   0
 
#define SPIBASE   0x3020
 
#define SPIBAR16(x)   RCBA16(0x3020 + x)
 
#define SPIBAR32(x)   RCBA32(0x3020 + x)
 

Functions

static void i82801gx_enable_ioapic (struct device *dev)
 Set miscellaneous static southbridge features. More...
 
static void i82801gx_enable_serial_irqs (struct device *dev)
 
static void i82801gx_pirq_init (struct device *dev)
 
static void i82801gx_gpi_routing (struct device *dev)
 
static void i82801gx_power_options (struct device *dev)
 
static void i82801gx_configure_cstates (struct device *dev)
 
static void i82801gx_rtc_init (struct device *dev)
 
static void enable_clock_gating (void)
 
static void i82801gx_set_acpi_mode (struct device *dev)
 
static void i82801gx_spi_init (void)
 
static void i82801gx_fixups (struct device *dev)
 
static void lpc_init (struct device *dev)
 
unsigned long acpi_fill_madt (unsigned long current)
 
static void i82801gx_lpc_read_resources (struct device *dev)
 
static void lpc_final (struct device *dev)
 
static const char * lpc_acpi_name (const struct device *dev)
 
static void southbridge_fill_ssdt (const struct device *device)
 

Variables

static struct device_operations device_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver ich7_lpc __pci_driver
 

Macro Definition Documentation

◆ NMI_OFF

#define NMI_OFF   0

Definition at line 27 of file lpc.c.

◆ SPIBAR16

#define SPIBAR16 (   x)    RCBA16(0x3020 + x)

Definition at line 420 of file lpc.c.

◆ SPIBAR32

#define SPIBAR32 (   x)    RCBA32(0x3020 + x)

Definition at line 421 of file lpc.c.

◆ SPIBASE

#define SPIBASE   0x3020

Definition at line 287 of file lpc.c.

Function Documentation

◆ acpi_fill_madt()

unsigned long acpi_fill_madt ( unsigned long  current)

◆ enable_clock_gating()

static void enable_clock_gating ( void  )
static

Definition at line 259 of file lpc.c.

References CG, and RCBA32.

Referenced by lpc_init().

Here is the caller graph for this function:

◆ i82801gx_configure_cstates()

static void i82801gx_configure_cstates ( struct device dev)
static

Definition at line 232 of file lpc.c.

References pci_or_config8(), and pci_update_config8().

Referenced by lpc_init().

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

◆ i82801gx_enable_ioapic()

static void i82801gx_enable_ioapic ( struct device dev)
static

Set miscellaneous static southbridge features.

Parameters
devPCI device with I/O APIC control registers

Definition at line 34 of file lpc.c.

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

◆ i82801gx_enable_serial_irqs()

static void i82801gx_enable_serial_irqs ( struct device dev)
static

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

◆ i82801gx_fixups()

static void i82801gx_fixups ( struct device dev)
static

Definition at line 297 of file lpc.c.

References pci_write_config8(), and RCBA32.

Referenced by lpc_init().

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

◆ i82801gx_gpi_routing()

static void i82801gx_gpi_routing ( struct device dev)
static

Definition at line 112 of file lpc.c.

References device::chip_info, config, GPIO_ROUT, and pci_write_config32().

Referenced by i82801gx_power_options().

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

◆ i82801gx_lpc_read_resources()

static void i82801gx_lpc_read_resources ( struct device dev)
static

◆ i82801gx_pirq_init()

static void i82801gx_pirq_init ( struct device dev)
static

Definition at line 66 of file lpc.c.

References all_devices, device::chip_info, config, 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:

◆ i82801gx_power_options()

static void i82801gx_power_options ( struct device dev)
static

◆ i82801gx_rtc_init()

static void i82801gx_rtc_init ( struct device dev)
static

Definition at line 243 of file lpc.c.

References BIOS_DEBUG, cmos_init(), 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:

◆ i82801gx_set_acpi_mode()

static void i82801gx_set_acpi_mode ( struct device dev)
static

Definition at line 278 of file lpc.c.

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

Referenced by lpc_init().

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

◆ i82801gx_spi_init()

static void i82801gx_spi_init ( void  )
static

Definition at line 288 of file lpc.c.

References RCBA16, and SPIBASE.

Referenced by lpc_init().

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

◆ lpc_final()

static void lpc_final ( struct device dev)
static

Definition at line 423 of file lpc.c.

References CONFIG, DEFAULT_PMBASE, GEN_PMCON_1, inw(), outb(), outw(), pci_or_config16(), POST_OS_BOOT, RCBA32, spi_finalize_ops(), SPIBAR16, and TCO1_CNT.

Here is the call graph for this function:

◆ lpc_init()

◆ southbridge_fill_ssdt()

static void southbridge_fill_ssdt ( const struct device device)
static

Definition at line 456 of file lpc.c.

Variable Documentation

◆ __pci_driver

const struct pci_driver ich7_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:461
static const unsigned short pci_device_ids[]
Definition: lpc.c:475

Definition at line 475 of file lpc.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = i82801gx_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,
.scan_bus = scan_static_bus,
.enable = i82801gx_enable,
.ops_pci = &pci_dev_ops_pci,
.final = lpc_final,
}
unsigned long acpi_write_hpet(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
Definition: acpi.c:1141
void i82801gx_enable(struct device *dev)
Definition: i82801gx.c:54
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:423
static const char * lpc_acpi_name(const struct device *dev)
Definition: lpc.c:451
static void southbridge_fill_ssdt(const struct device *device)
Definition: lpc.c:456
static void i82801gx_lpc_read_resources(struct device *dev)
Definition: lpc.c:378
static void lpc_init(struct device *dev)
Definition: lpc.c:309

Definition at line 456 of file lpc.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0x27b0,
0x27b8,
0x27b9,
0x27bc,
0x27bd,
0
}

Definition at line 475 of file lpc.c.