coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c File Reference
#include <baseboard/variants.h>
#include <bootstate.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <device/pci_ids.h>
#include <hwilib.h>
#include <i210.h>
#include <soc/gpio.h>
#include <soc/ramstage.h>
#include <string.h>
#include <timer.h>
#include <timestamp.h>
Include dependency graph for mainboard.c:

Go to the source code of this file.

Macros

#define MAX_PATH_DEPTH   12
 
#define MAX_NUM_MAPPINGS   10
 

Functions

static uint8_t is_mac_adr_valid (uint8_t mac[MAC_ADDR_LEN])
 This function can decide if a given MAC address is valid or not. More...
 
enum cb_err mainboard_get_mac_address (struct device *dev, uint8_t mac[MAC_ADDR_LEN])
 This function will search for a MAC address which can be assigned to a MACPHY. More...
 
static void wait_for_legacy_dev (void *unused)
 
void mainboard_silicon_init_params (FSP_S_CONFIG *params)
 
static void mainboard_init (void *chip_info)
 
static void mainboard_final (void *chip_info)
 
void __weak variant_mainboard_final (void)
 
 BOOT_STATE_INIT_ENTRY (BS_DEV_ENUMERATE, BS_ON_ENTRY, wait_for_legacy_dev, NULL)
 

Variables

struct chip_operations mainboard_ops
 

Macro Definition Documentation

◆ MAX_NUM_MAPPINGS

#define MAX_NUM_MAPPINGS   10

Definition at line 19 of file mainboard.c.

◆ MAX_PATH_DEPTH

#define MAX_PATH_DEPTH   12

Definition at line 18 of file mainboard.c.

Function Documentation

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_DEV_ENUMERATE  ,
BS_ON_ENTRY  ,
wait_for_legacy_dev  ,
NULL   
)

◆ is_mac_adr_valid()

static uint8_t is_mac_adr_valid ( uint8_t  mac[MAC_ADDR_LEN])
static

This function can decide if a given MAC address is valid or not.

Currently, addresses filled with 0xff or 0x00 are not valid.

Parameters
macBuffer to the MAC address to check
Returns
0 if address is not valid, otherwise 1

Definition at line 26 of file mainboard.c.

References MAC_ADDR_LEN.

◆ mainboard_final()

static void mainboard_final ( void chip_info)
static

Definition at line 144 of file mainboard.c.

References CONFIG, dev_find_device(), PCI_COMMAND, PCI_COMMAND_MASTER, pci_or_config16(), PCI_VID_SIEMENS, and variant_mainboard_final().

Here is the call graph for this function:

◆ mainboard_get_mac_address()

enum cb_err mainboard_get_mac_address ( struct device dev,
uint8_t  mac[MAC_ADDR_LEN] 
)

This function will search for a MAC address which can be assigned to a MACPHY.

Parameters
devpointer to PCI device
macbuffer where to store the MAC address
Returns
cb_err CB_ERR or CB_SUCCESS

Definition at line 26 of file mainboard.c.

Referenced by init().

Here is the caller graph for this function:

◆ mainboard_init()

static void mainboard_init ( void chip_info)
static

Definition at line 135 of file mainboard.c.

References gpio_configure_pads(), and variant_gpio_table().

Here is the call graph for this function:

◆ mainboard_silicon_init_params()

void mainboard_silicon_init_params ( FSP_S_CONFIG params)

Definition at line 118 of file mainboard.c.

References params.

◆ variant_mainboard_final()

void __weak variant_mainboard_final ( void  )

Definition at line 164 of file mainboard.c.

◆ wait_for_legacy_dev()

static void wait_for_legacy_dev ( void unused)
static

Definition at line 93 of file mainboard.c.

References BIOS_NOTICE, CB_SUCCESS, get_us_since_boot(), printk, stopwatch_init_msecs_expire(), and stopwatch_wait_until_expired().

Here is the call graph for this function:

Variable Documentation

◆ mainboard_ops

struct chip_operations mainboard_ops
Initial value:
= {
.init = mainboard_init,
.final = mainboard_final
}
static void mainboard_init(void *chip_info)
Definition: mainboard.c:135
static void mainboard_final(void *chip_info)
Definition: mainboard.c:144

Definition at line 164 of file mainboard.c.