coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chip_common.c File Reference
#include <assert.h>
#include <console/console.h>
#include <post.h>
#include <device/pci.h>
#include <soc/chip_common.h>
#include <soc/soc_util.h>
#include <soc/util.h>
#include <stdlib.h>
Include dependency graph for chip_common.c:

Go to the source code of this file.

Data Structures

struct  pci_resource
 
struct  stack_dev_resource
 

Enumerations

enum  RES_TYPE { RES_TYPE_IO = 0 , RES_TYPE_NONPREF_MEM , RES_TYPE_PREF_MEM , MAX_RES_TYPES }
 

Functions

static RES_TYPE get_res_type (uint64_t flags)
 
static bool need_assignment (uint64_t flags)
 
static uint64_t get_resource_base (STACK_RES *stack, RES_TYPE res_type)
 
static void set_resource_base (STACK_RES *stack, RES_TYPE res_type, uint64_t base)
 
static void assign_stack_resources (struct iiostack_resource *stack_list, struct device *dev, struct resource *bridge)
 
void xeonsp_pci_domain_scan_bus (struct device *dev)
 
static void xeonsp_pci_dev_iterator (struct bus *bus, void(*dev_iterator)(struct device *, void *), void(*res_iterator)(struct device *, struct resource *, void *), void *data)
 
static void xeonsp_pci_dev_read_resources (struct device *dev, void *data)
 
static void xeonsp_pci_dev_dummy_func (struct device *dev)
 
static void xeonsp_reset_pci_op (struct device *dev, void *data)
 
static STACK_RES * find_stack_for_bus (struct iiostack_resource *info, uint8_t bus)
 
static void add_res_to_stack (struct stack_dev_resource **root, struct device *dev, struct resource *res)
 
static void reserve_dev_resources (STACK_RES *stack, RES_TYPE res_type, struct stack_dev_resource *res_root, struct resource *bridge)
 
static void reclaim_resource_mem (struct stack_dev_resource *res_root)
 
static void assign_bridge_resources (struct iiostack_resource *stack_list, struct device *dev, struct resource *bridge)
 
static uint8_t is_pci64bit_alloc (void)
 
static void xeonsp_pci_domain_read_resources (struct device *dev)
 
static void reset_resource_to_unassigned (struct device *dev, struct resource *res, void *data)
 
void xeonsp_pci_domain_set_resources (struct device *dev)
 
void attach_iio_stacks (struct device *dev)
 

Enumeration Type Documentation

◆ RES_TYPE

enum RES_TYPE
Enumerator
RES_TYPE_IO 
RES_TYPE_NONPREF_MEM 
RES_TYPE_PREF_MEM 
MAX_RES_TYPES 

Definition at line 24 of file chip_common.c.

Function Documentation

◆ add_res_to_stack()

static void add_res_to_stack ( struct stack_dev_resource **  root,
struct device dev,
struct resource res 
)
static

Definition at line 169 of file chip_common.c.

References resource::align, stack_dev_resource::align, assert, stack_dev_resource::children, pci_resource::dev, die(), malloc(), memset(), pci_resource::next, stack_dev_resource::next, NULL, and pci_resource::res.

Referenced by assign_stack_resources().

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

◆ assign_bridge_resources()

static void assign_bridge_resources ( struct iiostack_resource stack_list,
struct device dev,
struct resource bridge 
)
static

Definition at line 303 of file chip_common.c.

References assign_stack_resources(), resource::base, bridge, device::enabled, resource::flags, get_res_type(), IORESOURCE_ASSIGNED, IORESOURCE_BRIDGE, resource::limit, resource::next, and device::resource_list.

Referenced by assign_stack_resources().

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

◆ assign_stack_resources()

◆ attach_iio_stacks()

◆ find_stack_for_bus()

static STACK_RES* find_stack_for_bus ( struct iiostack_resource info,
uint8_t  bus 
)
static

Definition at line 160 of file chip_common.c.

References info, and NULL.

Referenced by assign_stack_resources().

Here is the caller graph for this function:

◆ get_res_type()

static RES_TYPE get_res_type ( uint64_t  flags)
static

Definition at line 31 of file chip_common.c.

References BIOS_DEBUG, BIOS_ERR, die(), IORESOURCE_IO, IORESOURCE_MEM, IORESOURCE_PREFETCH, printk, RES_TYPE_IO, RES_TYPE_NONPREF_MEM, and RES_TYPE_PREF_MEM.

Referenced by assign_bridge_resources(), and assign_stack_resources().

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

◆ get_resource_base()

static uint64_t get_resource_base ( STACK_RES *  stack,
RES_TYPE  res_type 
)
static

Definition at line 56 of file chip_common.c.

References assert, RES_TYPE_IO, and RES_TYPE_NONPREF_MEM.

Referenced by reserve_dev_resources().

Here is the caller graph for this function:

◆ is_pci64bit_alloc()

static uint8_t is_pci64bit_alloc ( void  )
static

Definition at line 406 of file chip_common.c.

References get_iio_uds().

Referenced by xeonsp_pci_domain_read_resources().

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

◆ need_assignment()

static bool need_assignment ( uint64_t  flags)
static

Definition at line 47 of file chip_common.c.

References IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_RESERVE, and IORESOURCE_STORED.

Referenced by assign_stack_resources().

Here is the caller graph for this function:

◆ reclaim_resource_mem()

static void reclaim_resource_mem ( struct stack_dev_resource res_root)
static

Definition at line 285 of file chip_common.c.

References stack_dev_resource::children, free(), pci_resource::next, and stack_dev_resource::next.

Referenced by assign_stack_resources().

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

◆ reserve_dev_resources()

static void reserve_dev_resources ( STACK_RES *  stack,
RES_TYPE  res_type,
struct stack_dev_resource res_root,
struct resource bridge 
)
static

◆ reset_resource_to_unassigned()

static void reset_resource_to_unassigned ( struct device dev,
struct resource res,
void data 
)
static

Definition at line 457 of file chip_common.c.

References IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_IO, IORESOURCE_MEM, IORESOURCE_RESERVE, and iiostack_resource::res.

Referenced by xeonsp_pci_domain_set_resources().

Here is the caller graph for this function:

◆ set_resource_base()

static void set_resource_base ( STACK_RES *  stack,
RES_TYPE  res_type,
uint64_t  base 
)
static

Definition at line 70 of file chip_common.c.

References assert, base, RES_TYPE_IO, and RES_TYPE_NONPREF_MEM.

Referenced by reserve_dev_resources().

Here is the caller graph for this function:

◆ xeonsp_pci_dev_dummy_func()

static void xeonsp_pci_dev_dummy_func ( struct device dev)
static

Definition at line 150 of file chip_common.c.

Referenced by xeonsp_reset_pci_op().

Here is the caller graph for this function:

◆ xeonsp_pci_dev_iterator()

static void xeonsp_pci_dev_iterator ( struct bus bus,
void(*)(struct device *, void *)  dev_iterator,
void(*)(struct device *, struct resource *, void *)  res_iterator,
void data 
)
static

◆ xeonsp_pci_dev_read_resources()

static void xeonsp_pci_dev_read_resources ( struct device dev,
void data 
)
static

Definition at line 144 of file chip_common.c.

References bus::dev, device::ops, post_log_path(), and device_operations::read_resources.

Referenced by xeonsp_pci_domain_read_resources().

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

◆ xeonsp_pci_domain_read_resources()

static void xeonsp_pci_domain_read_resources ( struct device dev)
static

◆ xeonsp_pci_domain_scan_bus()

void xeonsp_pci_domain_scan_bus ( struct device dev)

◆ xeonsp_pci_domain_set_resources()

void xeonsp_pci_domain_set_resources ( struct device dev)

◆ xeonsp_reset_pci_op()

static void xeonsp_reset_pci_op ( struct device dev,
void data 
)
static

Definition at line 154 of file chip_common.c.

References bus::dev, device::ops, device_operations::read_resources, and xeonsp_pci_dev_dummy_func().

Referenced by xeonsp_pci_domain_read_resources().

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