coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c File Reference
#include <acpi/acpi.h>
#include <baseboard/cbi_ssfc.h>
#include <baseboard/variants.h>
#include <boardid.h>
#include <bootstate.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <drivers/i2c/generic/chip.h>
#include <ec/google/chromeec/ec.h>
#include <ec/ec.h>
#include <intelblocks/xhci.h>
#include <nhlt.h>
#include <smbios.h>
#include <soc/cpu.h>
#include <soc/gpio.h>
#include <soc/nhlt.h>
#include <soc/pci_devs.h>
#include <stdint.h>
#include <variant/ec.h>
#include <variant/gpio.h>
Include dependency graph for mainboard.c:

Go to the source code of this file.

Functions

static bool is_cnvi_held_in_reset (void)
 
static void disable_wifi_wake (void)
 
static void gpio_modification_by_ssfc (struct pad_config *table, size_t num)
 
static void mainboard_init (void *chip_info)
 
static unsigned long mainboard_write_acpi_tables (const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
 
static void mainboard_enable (struct device *dev)
 
void __weak variant_update_devtree (struct device *dev)
 
static void wifi_device_update (void)
 
static void audio_codec_device_update (void)
 
void mainboard_devtree_update (struct device *dev)
 
bool __weak variant_ext_usb_status (unsigned int port_type, unsigned int port_id)
 variant_ext_usb_status() - Get status of externally visible USB ports @port_type: Type of USB port i.e. More...
 
static void disable_unused_devices (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_DEV_INIT, BS_ON_EXIT, disable_unused_devices, NULL)
 

Variables

struct chip_operations drivers_i2c_generic_ops
 
struct chip_operations drivers_i2c_cs42l42_ops
 
struct chip_operations drivers_i2c_da7219_ops
 
struct chip_operations mainboard_ops
 

Function Documentation

◆ audio_codec_device_update()

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_DEV_INIT  ,
BS_ON_EXIT  ,
disable_unused_devices  ,
NULL   
)

◆ disable_unused_devices()

static void disable_unused_devices ( void unused)
static

Definition at line 246 of file mainboard.c.

References usb_xhci_disable_unused(), and variant_ext_usb_status().

Here is the call graph for this function:

◆ disable_wifi_wake()

static void disable_wifi_wake ( void  )
static

Definition at line 45 of file mainboard.c.

References ARRAY_SIZE, GPIO_119, gpio_configure_pads(), and PAD_NC.

Referenced by mainboard_init().

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

◆ gpio_modification_by_ssfc()

static void gpio_modification_by_ssfc ( struct pad_config table,
size_t  num 
)
static

Definition at line 59 of file mainboard.c.

References BIOS_INFO, GPIO_137, NONE, NULL, pad_config::pad, PAD_CFG_GPI_APIC_IOS, printk, SSFC_AUDIO_CODEC_RT5682, SSFC_AUDIO_CODEC_RT5682_VS, and ssfc_get_audio_codec().

Referenced by mainboard_init().

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

◆ is_cnvi_held_in_reset()

static bool is_cnvi_held_in_reset ( void  )
static

Definition at line 30 of file mainboard.c.

References PCH_DEVFN_CNVI, pci_read_config32(), PCI_VENDOR_ID, and pcidev_path_on_root().

Referenced by mainboard_init(), and wifi_device_update().

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

◆ mainboard_devtree_update()

void mainboard_devtree_update ( struct device dev)

Definition at line 230 of file mainboard.c.

References audio_codec_device_update(), variant_update_devtree(), and wifi_device_update().

Referenced by mainboard_init().

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

◆ mainboard_enable()

static void mainboard_enable ( struct device dev)
static

Definition at line 139 of file mainboard.c.

References mainboard_write_acpi_tables(), and device::ops.

Here is the call graph for this function:

◆ mainboard_init()

static void mainboard_init ( void chip_info)
static

◆ mainboard_write_acpi_tables()

static unsigned long mainboard_write_acpi_tables ( const struct device device,
unsigned long  current,
acpi_rsdp_t rsdp 
)
static

Definition at line 115 of file mainboard.c.

References acpi_add_table(), nhlt_init(), nhlt_soc_serialize(), NULL, and variant_nhlt_init().

Referenced by mainboard_enable().

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

◆ variant_ext_usb_status()

bool __weak variant_ext_usb_status ( unsigned int  port_type,
unsigned int  port_id 
)

variant_ext_usb_status() - Get status of externally visible USB ports @port_type: Type of USB port i.e.

USB2/USB3 @port_id: USB Port ID

This function is supplied by the mainboard/variant to SoC's XHCI driver to identify the status of externally visible USB ports.

Return: true if the port is present, false if the port is absent.

Definition at line 240 of file mainboard.c.

Referenced by disable_unused_devices().

Here is the caller graph for this function:

◆ variant_update_devtree()

void __weak variant_update_devtree ( struct device dev)

Definition at line 149 of file mainboard.c.

Referenced by mainboard_devtree_update().

Here is the caller graph for this function:

◆ wifi_device_update()

static void wifi_device_update ( void  )
static

Definition at line 159 of file mainboard.c.

References device::enabled, is_cnvi_held_in_reset(), PCH_DEVFN_CNVI, PCH_DEVFN_PCIE1, and pcidev_path_on_root().

Referenced by mainboard_devtree_update().

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

Variable Documentation

◆ drivers_i2c_cs42l42_ops

struct chip_operations drivers_i2c_cs42l42_ops
extern

Definition at line 115 of file cs42l42.c.

Referenced by audio_codec_device_update().

◆ drivers_i2c_da7219_ops

struct chip_operations drivers_i2c_da7219_ops
extern

Definition at line 107 of file da7219.c.

◆ drivers_i2c_generic_ops

struct chip_operations drivers_i2c_generic_ops
extern

Definition at line 189 of file generic.c.

◆ mainboard_ops

struct chip_operations mainboard_ops
Initial value:
= {
.init = mainboard_init,
.enable_dev = mainboard_enable,
}
static void mainboard_init(void *chip_info)
Definition: mainboard.c:91
static void mainboard_enable(struct device *dev)
Definition: mainboard.c:139

Definition at line 139 of file mainboard.c.