coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
systemagent.c File Reference
#include <cbmem.h>
#include <console/console.h>
#include <device/mmio.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 <timer.h>
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/ramstage.h>
#include <soc/systemagent.h>
#include <soc/acpi.h>
Include dependency graph for systemagent.c:

Go to the source code of this file.

Data Structures

struct  fixed_mmio_descriptor
 
struct  map_entry
 

Macros

#define _1ms   1
 
#define WAITING_STEP   100
 
#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  { TOUUD_REG , TOLUD_REG , TSEG_REG , NUM_MAP_ENTRIES }
 

Functions

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 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)
 
static void systemagent_read_resources (struct device *dev)
 
static void systemagent_init (struct device *dev)
 

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
 

Macro Definition Documentation

◆ _1ms

#define _1ms   1

Definition at line 20 of file systemagent.c.

◆ 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 151 of file systemagent.c.

◆ MAP_ENTRY_BASE_32

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

Definition at line 159 of file systemagent.c.

◆ MAP_ENTRY_BASE_64

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

Definition at line 157 of file systemagent.c.

◆ MAP_ENTRY_LIMIT_64

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

Definition at line 158 of file systemagent.c.

◆ WAITING_STEP

#define WAITING_STEP   100

Definition at line 21 of file systemagent.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TOUUD_REG 
TOLUD_REG 
TSEG_REG 
NUM_MAP_ENTRIES 

Definition at line 161 of file systemagent.c.

Function Documentation

◆ get_bar()

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

Definition at line 57 of file systemagent.c.

References base, and pci_read_config32().

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 23 of file systemagent.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 175 of file systemagent.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 182 of file systemagent.c.

References BIOS_DEBUG, map_entry::description, memory_map, NUM_MAP_ENTRIES, and printk.

Referenced by mc_add_dram_resources().

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 125 of file systemagent.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

◆ systemagent_read_resources()

static void systemagent_read_resources ( struct device dev)
static

Definition at line 285 of file systemagent.c.

References mc_add_dram_resources(), mc_add_fixed_mmio_resources(), and pci_dev_read_resources().

Here is the call 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
}
static struct device_operations systemagent_ops
Definition: systemagent.c:323
static const unsigned short systemagent_ids[]
Definition: systemagent.c:335
#define PCI_VID_INTEL
Definition: pci_ids.h:2157

Definition at line 335 of file systemagent.c.

◆ 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"},
}
static int get_pcie_bar(struct device *dev, unsigned int index, u32 *base, u32 *len)
Definition: systemagent.c:23
static int get_bar(struct device *dev, unsigned int index, u32 *base, u32 *len)
Definition: systemagent.c:57
#define MCHBAR
Definition: host_bridge.h:7
#define PCIEXBAR
Definition: host_bridge.h:32
#define MCH_BASE_SIZE
Definition: memmap.h:6

Definition at line 57 of file systemagent.c.

Referenced by mc_add_fixed_mmio_resources().

◆ memory_map

struct map_entry memory_map[NUM_MAP_ENTRIES]
static
Initial value:
= {
}
@ TSEG_REG
Definition: systemagent.c:164
@ TOUUD_REG
Definition: systemagent.c:162
@ TOLUD_REG
Definition: systemagent.c:163
#define MAP_ENTRY_BASE_64(reg_, desc_)
Definition: systemagent.c:157
#define MAP_ENTRY_BASE_32(reg_, desc_)
Definition: systemagent.c:159
#define TOLUD
Definition: host_bridge.h:61
#define TOUUD
Definition: host_bridge.h:57
#define TSEGMB
Definition: host_bridge.h:48

Definition at line 125 of file systemagent.c.

Referenced by mc_read_map_entries(), and mc_report_map_entries().

◆ systemagent_ids

const unsigned short systemagent_ids[]
static
Initial value:
= {
0
}
#define PCI_DID_INTEL_DNVAD_SA
Definition: pci_ids.h:2762
#define PCI_DID_INTEL_DNV_SA
Definition: pci_ids.h:2761

Definition at line 335 of file systemagent.c.

◆ systemagent_ops

struct device_operations systemagent_ops
static
Initial value:
= {
.read_resources = systemagent_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.ops_pci = &soc_pci_ops,
}
static void systemagent_init(struct device *dev)
Definition: systemagent.c:297
static void systemagent_read_resources(struct device *dev)
Definition: systemagent.c:285
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
struct pci_operations soc_pci_ops
Definition: chip.c:51

Definition at line 297 of file systemagent.c.