coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pcie.c File Reference
#include "chip.h"
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ops.h>
#include <device/pciexp.h>
#include <device/pci_ids.h>
#include <reg_script.h>
#include <soc/pci_devs.h>
#include <soc/pcie.h>
#include <soc/ramstage.h>
#include <soc/smm.h>
Include dependency graph for pcie.c:

Go to the source code of this file.

Functions

static int root_port_offset (struct device *dev)
 
static int is_first_port (struct device *dev)
 
static void pcie_init (struct device *dev)
 
static void check_port_enabled (struct device *dev)
 
static void check_device_present (struct device *dev)
 
static void pcie_enable (struct device *dev)
 

Variables

static int pll_en_off
 
static uint32_t strpfusecfg
 
static const struct reg_script no_dev_behind_port []
 
static struct device_operations device_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver pcie_root_ports __pci_driver
 

Function Documentation

◆ check_device_present()

static void check_device_present ( struct device dev)
static

◆ check_port_enabled()

static void check_port_enabled ( struct device dev)
static

Definition at line 40 of file pcie.c.

References reg_script::dev, device::enabled, LANECFG_MASK, LANECFG_SHIFT, PCIE_PORT1_FUNC, PCIE_PORT2_FUNC, PCIE_PORT3_FUNC, PCIE_PORT4_FUNC, root_port_offset(), and strpfusecfg.

Here is the call graph for this function:

◆ is_first_port()

static int is_first_port ( struct device dev)
inlinestatic

Definition at line 24 of file pcie.c.

References PCIE_PORT1_FUNC, and root_port_offset().

Referenced by check_device_present().

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

◆ pcie_enable()

static void pcie_enable ( struct device dev)
static

Definition at line 116 of file pcie.c.

◆ pcie_init()

static void pcie_init ( struct device dev)
static

Definition at line 29 of file pcie.c.

Referenced by mainboard_romstage_entry().

Here is the caller graph for this function:

◆ root_port_offset()

static int root_port_offset ( struct device dev)
inlinestatic

Definition at line 19 of file pcie.c.

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

Referenced by check_port_enabled(), and is_first_port().

Here is the caller graph for this function:

Variable Documentation

◆ __pci_driver

const struct pci_driver pcie_root_ports __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: pcie.c:137
static const unsigned short pci_device_ids[]
Definition: pcie.c:147

Definition at line 147 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 = pcie_init,
.scan_bus = pciexp_scan_bridge,
.enable = pcie_enable,
.ops_pci = &pci_dev_ops_pci,
}
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
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 pciexp_scan_bridge(struct device *dev)
static void pcie_enable(struct device *dev)
Definition: pcie.c:116
static void pcie_init(struct device *dev)
Definition: pcie.c:29

Definition at line 116 of file pcie.c.

◆ no_dev_behind_port

const struct reg_script no_dev_behind_port[]
static
Initial value:
= {
REG_PCI_OR32(PCIEALC, (1 << 26)),
REG_PCI_POLL32(PCIESTS1, 0x1f000000, (1 << 24), 50000),
}
#define PCIESTS1
Definition: pcie.h:78
#define SQDIS
Definition: pcie.h:82
#define PHYCTL4
Definition: pcie.h:81
#define PCIEALC
Definition: pcie.h:79
#define REG_PCI_OR32(reg_, value_)
Definition: reg_script.h:187
#define REG_SCRIPT_END
Definition: reg_script.h:427
#define REG_PCI_POLL32(reg_, mask_, value_, timeout_)
Definition: reg_script.h:193

Definition at line 29 of file pcie.c.

Referenced by check_device_present().

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCIE_PORT1_DEVID
Definition: pci_devs.h:130
#define PCIE_PORT3_DEVID
Definition: pci_devs.h:132
#define PCIE_PORT2_DEVID
Definition: pci_devs.h:131
#define PCIE_PORT4_DEVID
Definition: pci_devs.h:133

Definition at line 147 of file pcie.c.

◆ pll_en_off

int pll_en_off
static

Definition at line 16 of file pcie.c.

◆ strpfusecfg

uint32_t strpfusecfg
static

Definition at line 17 of file pcie.c.

Referenced by check_port_enabled().