coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
northbridge.c File Reference
#include <console/console.h>
#include <cpu/intel/haswell/haswell.h>
#include <acpi/acpi.h>
#include <device/pci_ops.h>
#include <stdint.h>
#include <delay.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <soc/acpi.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/refcode.h>
#include <soc/systemagent.h>
Include dependency graph for northbridge.c:

Go to the source code of this file.

Data Structures

struct  fixed_mmio_descriptor
 
struct  map_entry
 

Macros

#define MAP_ENTRY(reg_, is_64_, is_limit_, desc_)
 
#define MAP_ENTRY_BASE_64(reg_, desc_)    MAP_ENTRY(reg_, 1, 0, desc_)
 
#define MAP_ENTRY_LIMIT_64(reg_, desc_)    MAP_ENTRY(reg_, 1, 1, desc_)
 
#define MAP_ENTRY_BASE_32(reg_, desc_)    MAP_ENTRY(reg_, 0, 0, desc_)
 

Enumerations

enum  {
  TOM_REG , TOUUD_REG , MESEG_BASE_REG , MESEG_LIMIT_REG ,
  REMAP_BASE_REG , REMAP_LIMIT_REG , TOLUD_REG , BGSM_REG ,
  BDSM_REG , TSEG_REG , NUM_MAP_ENTRIES
}
 

Functions

u8 systemagent_revision (void)
 
static int get_pcie_bar (struct device *dev, unsigned int index, u32 *base, u32 *len)
 
static int get_bar (struct device *dev, unsigned int index, u32 *base, u32 *len)
 
static int get_bar_in_mchbar (struct device *dev, unsigned int index, u32 *base, u32 *len)
 
static void mc_add_fixed_mmio_resources (struct device *dev)
 
static void read_map_entry (struct device *dev, struct map_entry *entry, uint64_t *result)
 
static void mc_read_map_entries (struct device *dev, uint64_t *values)
 
static void mc_report_map_entries (struct device *dev, uint64_t *values)
 
static void mc_add_dram_resources (struct device *dev, int *resource_cnt)
 
static void systemagent_read_resources (struct device *dev)
 
static void systemagent_init (struct device *dev)
 
static void broadwell_enable (struct device *dev)
 
static void broadwell_init_pre_device (void *chip_info)
 

Variables

struct fixed_mmio_descriptor mc_fixed_resources []
 
static struct map_entry memory_map [NUM_MAP_ENTRIES]
 
static struct device_operations systemagent_ops
 
static const unsigned short systemagent_ids []
 
static const struct pci_driver systemagent_driver __pci_driver
 
static struct device_operations pci_domain_ops
 
static struct device_operations cpu_bus_ops
 
struct chip_operations soc_intel_broadwell_ops
 

Macro Definition Documentation

◆ MAP_ENTRY

#define MAP_ENTRY (   reg_,
  is_64_,
  is_limit_,
  desc_ 
)
Value:
{ \
.reg = reg_, \
.is_64_bit = is_64_, \
.is_limit = is_limit_, \
.description = desc_, \
}

Definition at line 198 of file northbridge.c.

◆ MAP_ENTRY_BASE_32

#define MAP_ENTRY_BASE_32 (   reg_,
  desc_ 
)     MAP_ENTRY(reg_, 0, 0, desc_)

Definition at line 210 of file northbridge.c.

◆ MAP_ENTRY_BASE_64

#define MAP_ENTRY_BASE_64 (   reg_,
  desc_ 
)     MAP_ENTRY(reg_, 1, 0, desc_)

Definition at line 206 of file northbridge.c.

◆ MAP_ENTRY_LIMIT_64

#define MAP_ENTRY_LIMIT_64 (   reg_,
  desc_ 
)     MAP_ENTRY(reg_, 1, 1, desc_)

Definition at line 208 of file northbridge.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TOM_REG 
TOUUD_REG 
MESEG_BASE_REG 
MESEG_LIMIT_REG 
REMAP_BASE_REG 
REMAP_LIMIT_REG 
TOLUD_REG 
BGSM_REG 
BDSM_REG 
TSEG_REG 
NUM_MAP_ENTRIES 

Definition at line 213 of file northbridge.c.

Function Documentation

◆ broadwell_enable()

static void broadwell_enable ( struct device dev)
static

◆ broadwell_init_pre_device()

static void broadwell_init_pre_device ( void chip_info)
static

Definition at line 452 of file northbridge.c.

References broadwell_run_reference_code().

Here is the call graph for this function:

◆ get_bar()

static int get_bar ( struct device dev,
unsigned int  index,
u32 base,
u32 len 
)
static

Definition at line 58 of file northbridge.c.

References base, and pci_read_config32().

Here is the call graph for this function:

◆ get_bar_in_mchbar()

static int get_bar_in_mchbar ( struct device dev,
unsigned int  index,
u32 base,
u32 len 
)
static

Definition at line 77 of file northbridge.c.

References base, and mchbar_read32().

Here is the call graph for this function:

◆ get_pcie_bar()

static int get_pcie_bar ( struct device dev,
unsigned int  index,
u32 base,
u32 len 
)
static

Definition at line 24 of file northbridge.c.

References base, and pci_read_config32().

Here is the call graph for this function:

◆ mc_add_dram_resources()

◆ mc_add_fixed_mmio_resources()

static void mc_add_fixed_mmio_resources ( struct device dev)
static

◆ mc_read_map_entries()

static void mc_read_map_entries ( struct device dev,
uint64_t values 
)
static

Definition at line 241 of file northbridge.c.

References memory_map, NUM_MAP_ENTRIES, and read_map_entry().

Referenced by mc_add_dram_resources().

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

◆ mc_report_map_entries()

static void mc_report_map_entries ( struct device dev,
uint64_t values 
)
static

Definition at line 248 of file northbridge.c.

References BIOS_DEBUG, map_entry::description, GGC, memory_map, NUM_MAP_ENTRIES, pci_read_config16(), and printk.

Referenced by mc_add_dram_resources().

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

◆ read_map_entry()

static void read_map_entry ( struct device dev,
struct map_entry entry,
uint64_t result 
)
static

Definition at line 172 of file northbridge.c.

Referenced by mc_read_map_entries().

Here is the caller graph for this function:

◆ systemagent_init()

static void systemagent_init ( struct device dev)
static

Definition at line 387 of file northbridge.c.

References BIOS_DEBUG, BIOS_RESET_CPL, MCH_PAIR, mchbar_clrsetbits8(), mchbar_setbits8, mdelay(), printk, and set_power_limits().

Here is the call graph for this function:

◆ systemagent_read_resources()

static void systemagent_read_resources ( struct device dev)
static

◆ systemagent_revision()

u8 systemagent_revision ( void  )

Definition at line 18 of file northbridge.c.

References pci_read_config8(), PCI_REVISION_ID, pcidev_path_on_root(), and SA_DEVFN_ROOT.

Referenced by igd_init().

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

Variable Documentation

◆ __pci_driver

const struct pci_driver systemagent_driver __pci_driver
static
Initial value:
= {
.ops = &systemagent_ops,
.vendor = PCI_VID_INTEL,
.devices = systemagent_ids
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static struct device_operations systemagent_ops
Definition: northbridge.c:404
static const unsigned short systemagent_ids[]
Definition: northbridge.c:413

Definition at line 413 of file northbridge.c.

◆ cpu_bus_ops

struct device_operations cpu_bus_ops
static
Initial value:
= {
.read_resources = noop_read_resources,
.set_resources = noop_set_resources,
.init = mp_cpu_bus_init,
}
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
Definition: device.h:73
static void noop_set_resources(struct device *dev)
Definition: device.h:74
static void mp_cpu_bus_init(struct device *dev)
Definition: device.h:240

Definition at line 413 of file northbridge.c.

Referenced by broadwell_enable().

◆ mc_fixed_resources

struct fixed_mmio_descriptor mc_fixed_resources[]
Initial value:
= {
{ PCIEXBAR, 0, get_pcie_bar, "PCIEXBAR" },
{ MCHBAR, MCH_BASE_SIZE, get_bar, "MCHBAR" },
{ DMIBAR, DMI_BASE_SIZE, get_bar, "DMIBAR" },
{ EPBAR, EP_BASE_SIZE, get_bar, "EPBAR" },
}
#define MCHBAR
Definition: host_bridge.h:7
#define PCIEXBAR
Definition: host_bridge.h:32
#define DMIBAR
Definition: host_bridge.h:33
#define EPBAR
Definition: host_bridge.h:6
#define EDRAMBAR
Definition: mchbar.h:19
#define GDXCBAR
Definition: mchbar.h:22
#define DMI_BASE_SIZE
Definition: memmap.h:8
#define EP_BASE_SIZE
Definition: memmap.h:10
#define GDXC_BASE_SIZE
Definition: memmap.h:16
#define MCH_BASE_SIZE
Definition: memmap.h:6
#define EDRAM_BASE_SIZE
Definition: memmap.h:13
static int get_bar_in_mchbar(struct device *dev, unsigned int index, u32 *base, u32 *len)
Definition: northbridge.c:77
static int get_pcie_bar(struct device *dev, unsigned int index, u32 *base, u32 *len)
Definition: northbridge.c:24
static int get_bar(struct device *dev, unsigned int index, u32 *base, u32 *len)
Definition: northbridge.c:58

Definition at line 77 of file northbridge.c.

◆ memory_map

struct map_entry memory_map[NUM_MAP_ENTRIES]
static
Initial value:
= {
}
#define REMAPLIMIT
Definition: e7505.h:36
#define REMAPBASE
Definition: e7505.h:35
#define MESEG_LIMIT
Definition: host_bridge.h:36
#define TOLUD
Definition: host_bridge.h:61
#define MESEG_BASE
Definition: host_bridge.h:35
#define TOUUD
Definition: host_bridge.h:57
#define TSEG
Definition: host_bridge.h:60
#define BDSM
Definition: host_bridge.h:58
#define TOM
Definition: host_bridge.h:56
#define BGSM
Definition: host_bridge.h:59
@ TOM_REG
Definition: northbridge.c:192
@ TSEG_REG
Definition: northbridge.c:201
@ BDSM_REG
Definition: northbridge.c:200
@ BGSM_REG
Definition: northbridge.c:199
@ MESEG_LIMIT_REG
Definition: northbridge.c:195
@ TOUUD_REG
Definition: northbridge.c:193
@ MESEG_BASE_REG
Definition: northbridge.c:194
@ REMAP_BASE_REG
Definition: northbridge.c:196
@ TOLUD_REG
Definition: northbridge.c:198
@ REMAP_LIMIT_REG
Definition: northbridge.c:197
#define MAP_ENTRY_LIMIT_64(reg_, desc_)
Definition: northbridge.c:208
#define MAP_ENTRY_BASE_64(reg_, desc_)
Definition: northbridge.c:206
#define MAP_ENTRY_BASE_32(reg_, desc_)
Definition: northbridge.c:210

Definition at line 172 of file northbridge.c.

Referenced by mc_read_map_entries(), and mc_report_map_entries().

◆ pci_domain_ops

struct device_operations pci_domain_ops
static
Initial value:
= {
.read_resources = &pci_domain_read_resources,
.set_resources = &pci_domain_set_resources,
.scan_bus = &pci_domain_scan_bus,
}
void pci_domain_read_resources(struct device *dev)
Definition: pci_device.c:547
void pci_domain_set_resources(struct device *dev)
Definition: pci_device.c:564
void pci_domain_scan_bus(struct device *dev)
Scan a PCI domain.
Definition: pci_device.c:1610

Definition at line 413 of file northbridge.c.

Referenced by broadwell_enable().

◆ soc_intel_broadwell_ops

struct chip_operations soc_intel_broadwell_ops
Initial value:
= {
.enable_dev = &broadwell_enable,
}
static void broadwell_init_pre_device(void *chip_info)
Definition: northbridge.c:452
static void broadwell_enable(struct device *dev)
Definition: northbridge.c:442

Definition at line 452 of file northbridge.c.

◆ systemagent_ids

const unsigned short systemagent_ids[]
static
Initial value:
= {
0x0a04,
0x1604,
0x1610,
0x1614,
0
}

Definition at line 413 of file northbridge.c.

◆ systemagent_ops

struct device_operations systemagent_ops
static
Initial value:
= {
.read_resources = systemagent_read_resources,
.acpi_fill_ssdt = generate_cpu_entries,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.ops_pci = &pci_dev_ops_pci,
}
void generate_cpu_entries(const struct device *device)
Definition: acpi.c:334
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
static void systemagent_init(struct device *dev)
Definition: northbridge.c:387
static void systemagent_read_resources(struct device *dev)
Definition: northbridge.c:363

Definition at line 387 of file northbridge.c.