coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pcie.c File Reference
#include <console/console.h>
#include <cpu/intel/haswell/haswell.h>
#include <delay.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pciexp.h>
#include <device/pci_def.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <soc/lpc.h>
#include <soc/pch.h>
#include <soc/pci_devs.h>
#include <soc/rcba.h>
#include <soc/intel/broadwell/pch/chip.h>
#include <southbridge/intel/lynxpoint/iobp.h>
#include <southbridge/intel/lynxpoint/lp_gpio.h>
#include <types.h>
Include dependency graph for pcie.c:

Go to the source code of this file.

Data Structures

struct  root_port_config
 

Macros

#define MAX_NUM_ROOT_PORTS   6
 

Functions

static int root_port_is_first (struct device *dev)
 
static int root_port_is_last (struct device *dev)
 
static int root_port_number (struct device *dev)
 
static void root_port_config_update_gbe_port (void)
 
static void pcie_iosf_port_grant_count (struct device *dev)
 
static void root_port_init_config (struct device *dev)
 
static void pch_pcie_device_set_func (int index, int pci_func)
 
static void pcie_enable_clock_gating (void)
 
static void root_port_commit_config (void)
 
static void root_port_mark_disable (struct device *dev)
 
static void root_port_check_disable (struct device *dev)
 
static void pcie_add_0x0202000_iobp (u32 reg)
 
static void pch_pcie_early (struct device *dev)
 
static void pch_pcie_init (struct device *dev)
 
static void pch_pcie_enable (struct device *dev)
 
static void pcie_get_ltr_max_latencies (u16 *max_snoop, u16 *max_nosnoop)
 

Variables

static struct root_port_config rpc
 
static struct pci_operations pcie_ops
 
static struct device_operations device_ops
 
static const unsigned short pcie_device_ids []
 
static const struct pci_driver pch_pcie __pci_driver
 

Macro Definition Documentation

◆ MAX_NUM_ROOT_PORTS

#define MAX_NUM_ROOT_PORTS   6

Definition at line 22 of file pcie.c.

Function Documentation

◆ pch_pcie_device_set_func()

static void pch_pcie_device_set_func ( int  index,
int  pci_func 
)
static

◆ pch_pcie_early()

static void pch_pcie_early ( struct device dev)
static

◆ pch_pcie_enable()

static void pch_pcie_enable ( struct device dev)
static

Definition at line 593 of file pcie.c.

References device::enabled, pch_pcie_early(), root_port_check_disable(), root_port_commit_config(), root_port_init_config(), and root_port_is_last().

Here is the call graph for this function:

◆ pch_pcie_init()

static void pch_pcie_init ( struct device dev)
static

◆ pcie_add_0x0202000_iobp()

static void pcie_add_0x0202000_iobp ( u32  reg)
static

Definition at line 428 of file pcie.c.

References pch_iobp_read(), and pch_iobp_write().

Referenced by pch_pcie_early().

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

◆ pcie_enable_clock_gating()

static void pcie_enable_clock_gating ( void  )
static

Definition at line 197 of file pcie.c.

References BROADWELL_FAMILY_ULT, cpu_family_model(), device::enabled, gpio_is_native(), root_port_config::num_ports, pci_or_config32(), pci_or_config8(), pci_update_config32(), pci_update_config8(), root_port_config::ports, RCBA32_OR, root_port_number(), and rpc.

Referenced by root_port_commit_config().

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

◆ pcie_get_ltr_max_latencies()

static void pcie_get_ltr_max_latencies ( u16 max_snoop,
u16 max_nosnoop 
)
static

Definition at line 613 of file pcie.c.

◆ pcie_iosf_port_grant_count()

static void pcie_iosf_port_grant_count ( struct device dev)
static

Definition at line 84 of file pcie.c.

References pci_read_config32(), and RCBA32.

Referenced by root_port_init_config().

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

◆ root_port_check_disable()

static void root_port_check_disable ( struct device dev)
static

Definition at line 357 of file pcie.c.

References device::enabled, root_port_config::gbe_port, root_port_config::pin_ownership, root_port_mark_disable(), root_port_number(), rpc, and root_port_config::strpfusecfg1.

Referenced by pch_pcie_enable().

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

◆ root_port_commit_config()

static void root_port_commit_config ( void  )
static

◆ root_port_config_update_gbe_port()

static void root_port_config_update_gbe_port ( void  )
static

Definition at line 59 of file pcie.c.

References BIOS_DEBUG, root_port_config::gbe_port, printk, rpc, and root_port_config::strpfusecfg1.

Referenced by root_port_init_config().

Here is the caller graph for this function:

◆ root_port_init_config()

◆ root_port_is_first()

static int root_port_is_first ( struct device dev)
inlinestatic

Definition at line 43 of file pcie.c.

References pci_path::devfn, device::path, device_path::pci, and PCI_FUNC.

Referenced by root_port_init_config().

Here is the caller graph for this function:

◆ root_port_is_last()

static int root_port_is_last ( struct device dev)
inlinestatic

Definition at line 48 of file pcie.c.

References pci_path::devfn, root_port_config::num_ports, device::path, device_path::pci, PCI_FUNC, and rpc.

Referenced by pch_pcie_enable().

Here is the caller graph for this function:

◆ root_port_mark_disable()

static void root_port_mark_disable ( struct device dev)
static

Definition at line 349 of file pcie.c.

References pci_path::devfn, device::enabled, root_port_config::new_rpfn, device::path, device_path::pci, PCI_FUNC, rpc, and RPFN_HIDE.

Referenced by root_port_check_disable().

Here is the caller graph for this function:

◆ root_port_number()

static int root_port_number ( struct device dev)
inlinestatic

Definition at line 54 of file pcie.c.

References pci_path::devfn, device::path, device_path::pci, and PCI_FUNC.

Referenced by pch_pcie_early(), pcie_enable_clock_gating(), root_port_check_disable(), and root_port_init_config().

Here is the caller graph for this function:

Variable Documentation

◆ __pci_driver

const struct pci_driver pch_pcie __pci_driver
static
Initial value:
= {
.ops = &device_ops,
.vendor = PCI_VID_INTEL,
.devices = pcie_device_ids,
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static struct device_operations device_ops
Definition: pcie.c:624
static const unsigned short pcie_device_ids[]
Definition: pcie.c:634

Definition at line 634 of file pcie.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = pci_bus_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_bus_enable_resources,
.init = pch_pcie_init,
.enable = pch_pcie_enable,
.scan_bus = pciexp_scan_bridge,
.ops_pci = &pcie_ops,
}
void pci_bus_enable_resources(struct device *dev)
Definition: pci_device.c:758
void pci_bus_read_resources(struct device *dev)
Definition: pci_device.c:540
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
void pciexp_scan_bridge(struct device *dev)
static void pch_pcie_enable(struct device *dev)
Definition: pcie.c:593
static void pch_pcie_init(struct device *dev)
Definition: pcie.c:573
static struct pci_operations pcie_ops
Definition: pcie.c:619

Definition at line 613 of file pcie.c.

◆ pcie_device_ids

const unsigned short pcie_device_ids[]
static
Initial value:
= {
0x9c10, 0x9c12, 0x9c14, 0x9c16, 0x9c18, 0x9c1a,
0x9c90, 0x9c92, 0x9c94, 0x9c96, 0x9c98, 0x9c9a, 0x2448,
0
}

Definition at line 634 of file pcie.c.

◆ pcie_ops

struct pci_operations pcie_ops
static
Initial value:
= {
.set_subsystem = pci_dev_set_subsystem,
.get_ltr_max_latencies = pcie_get_ltr_max_latencies,
}
void pci_dev_set_subsystem(struct device *dev, unsigned int vendor, unsigned int device)
Definition: pci_device.c:791
static void pcie_get_ltr_max_latencies(u16 *max_snoop, u16 *max_nosnoop)
Definition: pcie.c:613

Definition at line 613 of file pcie.c.

◆ rpc