coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lpc_lib.h File Reference
#include <device/device.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for lpc_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LPC_IOE_EC_4E_4F   (1 << 13)
 
#define LPC_IOE_SUPERIO_2E_2F   (1 << 12)
 
#define LPC_IOE_EC_62_66   (1 << 11)
 
#define LPC_IOE_KBC_60_64   (1 << 10)
 
#define LPC_IOE_HGE_208   (1 << 9)
 
#define LPC_IOE_LGE_200   (1 << 8)
 
#define LPC_IOE_FDD_EN   (1 << 3)
 
#define LPC_IOE_LPT_EN   (1 << 2)
 
#define LPC_IOE_COMB_EN   (1 << 1)
 
#define LPC_IOE_COMA_EN   (1 << 0)
 
#define LPC_NUM_GENERIC_IO_RANGES   4
 
#define PCR_LPC_PRC   0x341c
 
#define PCR_LPC_CCE_EN   0xf
 
#define PCR_LPC_PCE_EN   (9 << 8)
 

Enumerations

enum  serirq_mode { SERIRQ_QUIET , SERIRQ_CONTINUOUS , SERIRQ_OFF }
 

Functions

uint16_t lpc_enable_fixed_io_ranges (uint16_t io_enables)
 
uint16_t lpc_get_fixed_io_decode (void)
 
uint16_t lpc_set_fixed_io_ranges (uint16_t io_ranges, uint16_t mask)
 
void lpc_open_pmio_window (uint16_t base, uint16_t size)
 
void lpc_open_mmio_window (uintptr_t base, size_t size)
 
void lpc_soc_init (struct device *dev)
 
void pch_lpc_soc_fill_io_resources (struct device *dev)
 
void lpc_set_bios_interface_lock_down (void)
 
void lpc_set_lock_enable (void)
 
void lpc_set_eiss (void)
 
void lpc_set_serirq_mode (enum serirq_mode mode)
 
void lpc_enable_pci_clk_cntl (void)
 
void lpc_disable_clkrun (void)
 
void lpc_io_setup_comm_a_b (void)
 
void pch_enable_lpc (void)
 
void soc_get_gen_io_dec_range (uint32_t gen_io_dec[LPC_NUM_GENERIC_IO_RANGES])
 
void pch_lpc_add_new_resource (struct device *dev, uint8_t offset, uintptr_t base, size_t size, unsigned long flags)
 
void pch_enable_ioapic (void)
 
void pch_pirq_init (void)
 
void pch_misc_init (void)
 
unsigned long southbridge_write_acpi_tables (const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
 
const uint8_tlpc_get_pic_pirq_routing (size_t *num)
 
void lpc_enable_wp (void)
 
void lpc_disable_wp (void)
 

Macro Definition Documentation

◆ LPC_IOE_COMA_EN

#define LPC_IOE_COMA_EN   (1 << 0)

Definition at line 25 of file lpc_lib.h.

◆ LPC_IOE_COMB_EN

#define LPC_IOE_COMB_EN   (1 << 1)

Definition at line 24 of file lpc_lib.h.

◆ LPC_IOE_EC_4E_4F

#define LPC_IOE_EC_4E_4F   (1 << 13)

Definition at line 16 of file lpc_lib.h.

◆ LPC_IOE_EC_62_66

#define LPC_IOE_EC_62_66   (1 << 11)

Definition at line 18 of file lpc_lib.h.

◆ LPC_IOE_FDD_EN

#define LPC_IOE_FDD_EN   (1 << 3)

Definition at line 22 of file lpc_lib.h.

◆ LPC_IOE_HGE_208

#define LPC_IOE_HGE_208   (1 << 9)

Definition at line 20 of file lpc_lib.h.

◆ LPC_IOE_KBC_60_64

#define LPC_IOE_KBC_60_64   (1 << 10)

Definition at line 19 of file lpc_lib.h.

◆ LPC_IOE_LGE_200

#define LPC_IOE_LGE_200   (1 << 8)

Definition at line 21 of file lpc_lib.h.

◆ LPC_IOE_LPT_EN

#define LPC_IOE_LPT_EN   (1 << 2)

Definition at line 23 of file lpc_lib.h.

◆ LPC_IOE_SUPERIO_2E_2F

#define LPC_IOE_SUPERIO_2E_2F   (1 << 12)

Definition at line 17 of file lpc_lib.h.

◆ LPC_NUM_GENERIC_IO_RANGES

#define LPC_NUM_GENERIC_IO_RANGES   4

Definition at line 26 of file lpc_lib.h.

◆ PCR_LPC_CCE_EN

#define PCR_LPC_CCE_EN   0xf

Definition at line 30 of file lpc_lib.h.

◆ PCR_LPC_PCE_EN

#define PCR_LPC_PCE_EN   (9 << 8)

Definition at line 31 of file lpc_lib.h.

◆ PCR_LPC_PRC

#define PCR_LPC_PRC   0x341c

Definition at line 29 of file lpc_lib.h.

Enumeration Type Documentation

◆ serirq_mode

Enumerator
SERIRQ_QUIET 
SERIRQ_CONTINUOUS 
SERIRQ_OFF 

Definition at line 34 of file lpc_lib.h.

Function Documentation

◆ lpc_disable_clkrun()

void lpc_disable_clkrun ( void  )

Definition at line 297 of file lpc_lib.c.

References LPC_PCCTL, LPC_PCCTL_CLKRUN_EN, PCH_DEV_LPC, pci_read_config8(), and pci_write_config8().

Here is the call graph for this function:

◆ lpc_disable_wp()

void lpc_disable_wp ( void  )

Definition at line 218 of file lpc_lib.c.

References lpc_configure_write_protect().

Here is the call graph for this function:

◆ lpc_enable_fixed_io_ranges()

uint16_t lpc_enable_fixed_io_ranges ( uint16_t  io_enables)

Definition at line 21 of file lpc_lib.c.

References CONFIG, GPMR_LPCIOE, gpmr_write32(), LPC_IO_ENABLES, PCH_DEV_LPC, pci_read_config16(), and pci_write_config16().

Referenced by bootblock_ec_init(), bootblock_soc_early_init(), lpc_io_setup_comm_a_b(), mainboard_ec_init(), mainboard_enable(), and pch_early_iorange_init().

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

◆ lpc_enable_pci_clk_cntl()

void lpc_enable_pci_clk_cntl ( void  )

Definition at line 292 of file lpc_lib.c.

References LPC_PCCTL, LPC_PCCTL_CLKRUN_EN, PCH_DEV_LPC, and pci_write_config8().

Referenced by lpc_soc_init(), and variant_mainboard_final().

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

◆ lpc_enable_wp()

void lpc_enable_wp ( void  )

Definition at line 212 of file lpc_lib.c.

References lpc_configure_write_protect().

Referenced by lpc_lockdown_config().

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

◆ lpc_get_fixed_io_decode()

uint16_t lpc_get_fixed_io_decode ( void  )

Definition at line 34 of file lpc_lib.c.

References LPC_IO_DECODE, PCH_DEV_LPC, and pci_read_config16().

Referenced by lpc_set_fixed_io_ranges().

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

◆ lpc_get_pic_pirq_routing()

const uint8_t* lpc_get_pic_pirq_routing ( size_t num)

Definition at line 326 of file lpc_lib.c.

References ARRAY_SIZE, and pch_interrupt_routing.

Referenced by generate_pin_irq_map().

Here is the caller graph for this function:

◆ lpc_io_setup_comm_a_b()

void lpc_io_setup_comm_a_b ( void  )

Definition at line 249 of file lpc_lib.c.

References CONFIG, lpc_enable_fixed_io_ranges(), LPC_IOD_COMA_RANGE, LPC_IOD_COMA_RANGE_MASK, LPC_IOD_COMB_RANGE, LPC_IOD_COMB_RANGE_MASK, LPC_IOE_COMA_EN, LPC_IOE_COMB_EN, and lpc_set_fixed_io_ranges().

Referenced by bootblock_soc_early_init(), init_cpld(), and pch_early_iorange_init().

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

◆ lpc_open_mmio_window()

void lpc_open_mmio_window ( uintptr_t  base,
size_t  size 
)

Definition at line 128 of file lpc_lib.c.

References base, BIOS_ERR, BIOS_WARNING, CONFIG, GPMR_LPCGMR, gpmr_write32(), LPC_GENERIC_MEM_RANGE, LPC_LGMR_ADDR_MASK, LPC_LGMR_EN, LPC_LGMR_WINDOW_SIZE, PCH_DEV_LPC, pci_read_config32(), pci_write_config32(), and printk.

Referenced by mainboard_init().

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

◆ lpc_open_pmio_window()

◆ lpc_set_bios_interface_lock_down()

void lpc_set_bios_interface_lock_down ( void  )

Definition at line 177 of file lpc_lib.c.

References LPC_BC_BILD, and lpc_set_bios_control_reg().

Referenced by lpc_lockdown_config().

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

◆ lpc_set_eiss()

void lpc_set_eiss ( void  )

Definition at line 193 of file lpc_lib.c.

References LPC_BC_EISS, and lpc_set_bios_control_reg().

Referenced by lpc_lockdown_config().

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

◆ lpc_set_fixed_io_ranges()

uint16_t lpc_set_fixed_io_ranges ( uint16_t  io_ranges,
uint16_t  mask 
)

Definition at line 39 of file lpc_lib.c.

References CONFIG, GPMR_LPCIOD, gpmr_write32(), lpc_get_fixed_io_decode(), LPC_IO_DECODE, mask, PCH_DEV_LPC, and pci_write_config16().

Referenced by bootblock_soc_early_init(), lpc_io_setup_comm_a_b(), and pch_early_iorange_init().

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

◆ lpc_set_lock_enable()

void lpc_set_lock_enable ( void  )

Definition at line 185 of file lpc_lib.c.

References LPC_BC_LE, and lpc_set_bios_control_reg().

Referenced by lpc_lockdown_config().

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

◆ lpc_set_serirq_mode()

void lpc_set_serirq_mode ( enum serirq_mode  mode)

Definition at line 226 of file lpc_lib.c.

References LPC_SCNT_EN, LPC_SCNT_MODE, LPC_SERIRQ_CTL, PCH_DEV_LPC, pci_read_config8(), pci_write_config8(), SERIRQ_CONTINUOUS, SERIRQ_OFF, and SERIRQ_QUIET.

Referenced by lpc_soc_init().

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

◆ lpc_soc_init()

◆ pch_enable_ioapic()

void pch_enable_ioapic ( void  )

Definition at line 307 of file lpc_lib.c.

References IO_APIC_ADDR, ioapic_set_max_vectors(), PCH_REDIR_ETR, setup_ioapic(), and VIO_APIC_VADDR.

Here is the call graph for this function:

◆ pch_enable_lpc()

void pch_enable_lpc ( void  )

Definition at line 282 of file lpc_lib.c.

References ENV_PAYLOAD_LOADER, LPC_NUM_GENERIC_IO_RANGES, lpc_set_gen_decode_range(), pch_pirq_init(), and soc_get_gen_io_dec_range().

Here is the call graph for this function:

◆ pch_lpc_add_new_resource()

void pch_lpc_add_new_resource ( struct device dev,
uint8_t  offset,
uintptr_t  base,
size_t  size,
unsigned long  flags 
)

Definition at line 25 of file lpc.c.

References resource::base, base, resource::flags, new_resource(), offset, and resource::size.

Referenced by pch_lpc_add_io_resources(), and pch_lpc_add_mmio_resources().

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

◆ pch_lpc_soc_fill_io_resources()

void pch_lpc_soc_fill_io_resources ( struct device dev)

Definition at line 20 of file lpc.c.

Referenced by pch_lpc_add_io_resources().

Here is the caller graph for this function:

◆ pch_misc_init()

void pch_misc_init ( void  )

Definition at line 394 of file lpc_lib.c.

References CMOS_NMI, inb(), NMI_DIS, outb(), PPI_PORT_B, and SERR_DIS.

Here is the call graph for this function:

◆ pch_pirq_init()

void pch_pirq_init ( void  )

Definition at line 353 of file lpc_lib.c.

References all_devices, DEVICE_PATH_PCI, device::enabled, itss_irq_init(), device::next, device::path, pch_interrupt_routing, PCH_IRQ10, PCH_IRQ11, PCI_BDF, PCI_INTERRUPT_LINE, PCI_INTERRUPT_PIN, pci_read_config8(), pci_write_config8(), and device_path::type.

Referenced by pch_enable_lpc().

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

◆ soc_get_gen_io_dec_range()

void soc_get_gen_io_dec_range ( uint32_t  gen_io_dec[LPC_NUM_GENERIC_IO_RANGES])

Definition at line 23 of file espi.c.

References config, and config_of_soc.

Referenced by pch_enable_lpc().

Here is the caller graph for this function:

◆ southbridge_write_acpi_tables()

unsigned long southbridge_write_acpi_tables ( const struct device device,
unsigned long  current,
struct acpi_rsdp rsdp 
)

Definition at line 13 of file tables.c.

References ACPI_ACCESS_SIZE_DWORD_ACCESS, acpi_write_dbg2_pci_uart(), acpi_write_hpet(), CONFIG, and uart_get_device().

Here is the call graph for this function: