coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
soc_util.c File Reference
#include <stdint.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <device/pci.h>
#include <device/pci_def.h>
#include <device/device.h>
#include <string.h>
#include <soc/iomap.h>
#include <soc/soc_util.h>
#include <soc/pmc.h>
#include <soc/smbus.h>
#include <soc/lpc.h>
#include <soc/pci_devs.h>
#include <soc/systemagent.h>
Include dependency graph for soc_util.c:

Go to the source code of this file.

Functions

struct deviceget_hostbridge_dev (void)
 
struct deviceget_lpc_dev (void)
 
struct deviceget_pmc_dev (void)
 
struct deviceget_smbus_dev (void)
 
uint32_t get_pciebase (void)
 
uint32_t get_pcielength (void)
 
uint32_t get_tseg_memory (void)
 
uint32_t get_top_of_low_memory (void)
 
uint64_t get_top_of_upper_memory (void)
 
uint16_t get_pmbase (void)
 
uint16_t get_tcobase (void)
 
void mmio_andthenor32 (void *addr, uint32_t val2and, uint32_t val2or)
 
uint8_t silicon_stepping (void)
 
voidmemcpy_s (void *dest, const void *src, size_t n)
 

Function Documentation

◆ get_hostbridge_dev()

struct device* get_hostbridge_dev ( void  )

Definition at line 24 of file soc_util.c.

References pcidev_on_root(), SA_DEV, and SA_FUNC.

Referenced by get_pciebase(), get_pcielength(), get_top_of_low_memory(), get_top_of_upper_memory(), and get_tseg_memory().

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

◆ get_lpc_dev()

struct device* get_lpc_dev ( void  )

Definition at line 36 of file soc_util.c.

References LPC_DEV, LPC_FUNC, and pcidev_on_root().

Referenced by silicon_stepping().

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

◆ get_pciebase()

uint32_t get_pciebase ( void  )

Definition at line 66 of file soc_util.c.

References get_hostbridge_dev(), MASK_PCIEXBAR_128M, MASK_PCIEXBAR_256M, MASK_PCIEXBAR_64M, MASK_PCIEXBAR_LENGTH, MASK_PCIEXBAR_LENGTH_128M, MASK_PCIEXBAR_LENGTH_256M, MASK_PCIEXBAR_LENGTH_64M, pci_read_config32(), and PCIEXBAR.

Referenced by soc_fill_gnvs().

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

◆ get_pcielength()

uint32_t get_pcielength ( void  )

◆ get_pmbase()

uint16_t get_pmbase ( void  )

Definition at line 185 of file soc_util.c.

References get_pmc_dev(), pci_read_config16(), and PMC_ACPI_BASE.

Here is the call graph for this function:

◆ get_pmc_dev()

struct device* get_pmc_dev ( void  )

Definition at line 48 of file soc_util.c.

References pcidev_on_root(), PMC_DEV, and PMC_FUNC.

Referenced by get_pmbase(), and soc_read_sci_irq_select().

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

◆ get_smbus_dev()

struct device* get_smbus_dev ( void  )

Definition at line 60 of file soc_util.c.

References pcidev_on_root(), SMBUS_DEV, and SMBUS_FUNC.

Referenced by get_tcobase().

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

◆ get_tcobase()

uint16_t get_tcobase ( void  )

Definition at line 200 of file soc_util.c.

References get_smbus_dev(), MASK_TCOBASE, pci_read_config16(), and TCOBASE.

Referenced by reset_tco_status().

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

◆ get_top_of_low_memory()

uint32_t get_top_of_low_memory ( void  )

Definition at line 153 of file soc_util.c.

References get_hostbridge_dev(), MASK_TOLUD, pci_read_config32(), and TOLUD.

Referenced by soc_fill_gnvs().

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

◆ get_top_of_upper_memory()

uint64_t get_top_of_upper_memory ( void  )

Definition at line 168 of file soc_util.c.

References get_hostbridge_dev(), MASK_TOUUD_HI, MASK_TOUUD_LO, pci_read_config32(), TOUUD_HI, and TOUUD_LO.

Referenced by soc_fill_gnvs().

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

◆ get_tseg_memory()

uint32_t get_tseg_memory ( void  )

Definition at line 138 of file soc_util.c.

References get_hostbridge_dev(), MASK_TSEGMB, pci_read_config32(), and TSEGMB.

Referenced by soc_fill_gnvs().

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

◆ memcpy_s()

void* memcpy_s ( void dest,
const void src,
size_t  n 
)

Definition at line 243 of file soc_util.c.

References UINT32_MAX.

◆ mmio_andthenor32()

void mmio_andthenor32 ( void addr,
uint32_t  val2and,
uint32_t  val2or 
)

Definition at line 215 of file soc_util.c.

References addr, read32(), and write32().

Referenced by gpio_configure_dnv_pads().

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

◆ silicon_stepping()

uint8_t silicon_stepping ( void  )

Definition at line 225 of file soc_util.c.

References get_lpc_dev(), pci_read_config8(), PCI_REVISION_ID, and revision_id.

Referenced by early_pmc_init().

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