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

Go to the source code of this file.

Data Structures

struct  pirq_struct
 
struct  irq_idx_name
 
struct  pci_routing_info
 Each PCI bridge has its INTx lines routed to one of the GNB IO-APIC PCI groups. More...
 

Macros

#define PCI_INTR_INDEX   0xc00
 
#define PCI_INTR_DATA   0xc01
 

Enumerations

enum  pci_routing_swizzle { PCI_SWIZZLE_ABCD = 0 , PCI_SWIZZLE_BCDA , PCI_SWIZZLE_CDAB , PCI_SWIZZLE_DABC }
 

Functions

u8 read_pci_int_idx (u8 index, int mode)
 
void write_pci_int_idx (u8 index, int mode, u8 data)
 
void write_pci_cfg_irqs (void)
 
void write_pci_int_table (void)
 
const struct irq_idx_namesb_get_apic_reg_association (size_t *size)
 
void populate_pirq_data (void)
 
const struct pci_routing_infoget_pci_routing_table (size_t *entries)
 
const struct pci_routing_infoget_pci_routing_info (unsigned int devfn)
 
unsigned int pci_calculate_irq (const struct pci_routing_info *routing_info, unsigned int pin)
 
void acpigen_write_pci_GNB_PRT (const struct device *dev)
 
void acpigen_write_pci_FCH_PRT (const struct device *dev)
 

Variables

const struct pirq_structpirq_data_ptr
 
u32 pirq_data_size
 
const u8intr_data_ptr
 
const u8picr_data_ptr
 
struct pci_routing_info __packed
 

Macro Definition Documentation

◆ PCI_INTR_DATA

#define PCI_INTR_DATA   0xc01

Definition at line 12 of file amd_pci_util.h.

◆ PCI_INTR_INDEX

#define PCI_INTR_INDEX   0xc00

Definition at line 11 of file amd_pci_util.h.

Enumeration Type Documentation

◆ pci_routing_swizzle

Enumerator
PCI_SWIZZLE_ABCD 
PCI_SWIZZLE_BCDA 
PCI_SWIZZLE_CDAB 
PCI_SWIZZLE_DABC 

Definition at line 35 of file amd_pci_util.h.

Function Documentation

◆ acpigen_write_pci_FCH_PRT()

void acpigen_write_pci_FCH_PRT ( const struct device dev)

Definition at line 195 of file acpi_prt.c.

References acpigen_write_name(), acpigen_write_PRT_PIC(), pci_path::devfn, get_pci_routing_info(), device::path, and device_path::pci.

Here is the call graph for this function:

◆ acpigen_write_pci_GNB_PRT()

void acpigen_write_pci_GNB_PRT ( const struct device dev)

◆ get_pci_routing_info()

const struct pci_routing_info* get_pci_routing_info ( unsigned int  devfn)

Definition at line 23 of file pci_routing_info.c.

References BIOS_ERR, pci_routing_info::devfn, get_pci_routing_table(), NULL, PCI_FUNC, PCI_SLOT, and printk.

Referenced by acpigen_write_pci_FCH_PRT(), and acpigen_write_pci_GNB_PRT().

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

◆ get_pci_routing_table()

const struct pci_routing_info* get_pci_routing_table ( size_t entries)

Definition at line 10 of file pci_routing_info.c.

References ARRAY_SIZE, BIOS_DEBUG, BIOS_ERR, pci_routing_info::devfn, fsp_find_extension_hob_by_guid(), pci_routing_info::group, pci_routing_info::irq, NULL, PCI_FUNC, pci_routing_table, PCI_SLOT, printk, and pci_routing_info::swizzle.

Referenced by get_pci_routing_info(), and populate_pirq_data().

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

◆ pci_calculate_irq()

unsigned int pci_calculate_irq ( const struct pci_routing_info routing_info,
unsigned int  pin 
)

Definition at line 43 of file pci_routing_info.c.

References ARRAY_SIZE, die(), pci_routing_info::group, pci_routing_info::irq, pcie_swizzle_table, and pci_routing_info::swizzle.

Referenced by acpigen_write_PRT_GSI(), acpigen_write_PRT_PIC(), and populate_pirq_data().

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

◆ populate_pirq_data()

void populate_pirq_data ( void  )

Definition at line 60 of file pci_routing_info.c.

References BIOS_ERR, calloc(), pci_routing_info::devfn, get_pci_routing_table(), pci_calculate_irq(), pirq_data_ptr, pirq_data_size, and printk.

Referenced by set_pci_irqs().

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

◆ read_pci_int_idx()

u8 read_pci_int_idx ( u8  index,
int  mode 
)

Definition at line 20 of file amd_pci_util.c.

References inb(), outb(), PCI_INTR_DATA, and PCI_INTR_INDEX.

Here is the call graph for this function:

◆ sb_get_apic_reg_association()

const struct irq_idx_name* sb_get_apic_reg_association ( size_t size)

Definition at line 75 of file fch.c.

References ARRAY_SIZE, and irq_association.

Referenced by write_pci_cfg_irqs(), and write_pci_int_table().

Here is the caller graph for this function:

◆ write_pci_cfg_irqs()

◆ write_pci_int_idx()

void write_pci_int_idx ( u8  index,
int  mode,
u8  data 
)

Definition at line 30 of file amd_pci_util.c.

References outb(), PCI_INTR_DATA, and PCI_INTR_INDEX.

Here is the call graph for this function:

◆ write_pci_int_table()

void write_pci_int_table ( void  )

Definition at line 41 of file amd_pci_util.c.

References BIOS_DEBUG, BIOS_ERR, irq_idx_name::index, intr_data_ptr, name, NULL, picr_data_ptr, printk, read_pci_int_idx(), sb_get_apic_reg_association(), and write_pci_int_idx().

Referenced by set_pci_irqs().

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

Variable Documentation

◆ __packed

◆ intr_data_ptr

const u8* intr_data_ptr
extern

Definition at line 13 of file amd_pci_util.c.

Referenced by pirq_setup(), and smp_write_config_table().

◆ picr_data_ptr

const u8* picr_data_ptr
extern

Definition at line 14 of file amd_pci_util.c.

Referenced by pirq_setup().

◆ pirq_data_ptr

const struct pirq_struct* pirq_data_ptr
extern

Definition at line 11 of file amd_pci_util.c.

Referenced by pirq_setup(), and populate_pirq_data().

◆ pirq_data_size

u32 pirq_data_size
extern

Definition at line 12 of file amd_pci_util.c.

Referenced by pirq_setup(), and populate_pirq_data().