coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smbus.c File Reference
#include <device/device.h>
#include <device/path.h>
#include <device/smbus.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <soc/smbus.h>
#include <device/smbus_host.h>
#include <intelblocks/tco.h>
#include "smbuslib.h"
Include dependency graph for smbus.c:

Go to the source code of this file.

Functions

static int lsmbus_read_byte (struct device *dev, u8 address)
 
static int lsmbus_write_byte (struct device *dev, u8 address, u8 data)
 
static void pch_smbus_init (struct device *dev)
 
static void smbus_read_resources (struct device *dev)
 
static void finalize_smbus (struct device *dev)
 

Variables

static struct smbus_bus_operations lops_smbus_bus
 
static struct device_operations smbus_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver pch_smbus __pci_driver
 

Function Documentation

◆ finalize_smbus()

static void finalize_smbus ( struct device dev)
static

Definition at line 74 of file smbus.c.

References CONFIG, and tco_lockdown().

Here is the call graph for this function:

◆ lsmbus_read_byte()

static int lsmbus_read_byte ( struct device dev,
u8  address 
)
static

Definition at line 13 of file smbus.c.

References address, resource::base, bus::dev, i2c_path::device, device, do_smbus_read_byte(), find_resource(), get_pbus_smbus(), device_path::i2c, device::path, and PCI_BASE_ADDRESS_4.

Here is the call graph for this function:

◆ lsmbus_write_byte()

static int lsmbus_write_byte ( struct device dev,
u8  address,
u8  data 
)
static

Definition at line 24 of file smbus.c.

◆ pch_smbus_init()

static void pch_smbus_init ( struct device dev)
static

Definition at line 41 of file smbus.c.

References resource::base, PCI_BASE_ADDRESS_4, pci_update_config32(), probe_resource(), smbus_set_slave_addr(), and SMBUS_SLAVE_ADDR.

Here is the call graph for this function:

◆ smbus_read_resources()

static void smbus_read_resources ( struct device dev)
static

Variable Documentation

◆ __pci_driver

const struct pci_driver pch_smbus __pci_driver
static
Initial value:
= {
.ops = &smbus_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids,
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static const unsigned short pci_device_ids[]
Definition: smbus.c:91
static struct device_operations smbus_ops
Definition: smbus.c:80

Definition at line 91 of file smbus.c.

◆ lops_smbus_bus

struct smbus_bus_operations lops_smbus_bus
static
Initial value:
= {
.read_byte = lsmbus_read_byte,
.write_byte = lsmbus_write_byte,
}
static int lsmbus_write_byte(struct device *dev, u8 address, u8 data)
Definition: smbus.c:24
static int lsmbus_read_byte(struct device *dev, u8 address)
Definition: smbus.c:13

Definition at line 24 of file smbus.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCI_DID_INTEL_CMP_SMBUS
Definition: pci_ids.h:4095
#define PCI_DID_INTEL_APL_SMBUS
Definition: pci_ids.h:4087
#define PCI_DID_INTEL_CNP_H_SMBUS
Definition: pci_ids.h:4093
#define PCI_DID_INTEL_DNV_SMBUS_LEGACY
Definition: pci_ids.h:2790
#define PCI_DID_INTEL_MCC_SMBUS
Definition: pci_ids.h:4099
#define PCI_DID_INTEL_MTL_SMBUS
Definition: pci_ids.h:4104
#define PCI_DID_INTEL_ADP_M_N_SMBUS
Definition: pci_ids.h:4103
#define PCI_DID_INTEL_LWB_SMBUS_SUPER
Definition: pci_ids.h:4091
#define PCI_DID_INTEL_CNL_SMBUS
Definition: pci_ids.h:4092
#define PCI_DID_INTEL_SPT_LP_SMBUS
Definition: pci_ids.h:4088
#define PCI_DID_INTEL_TGP_H_SMBUS
Definition: pci_ids.h:4098
#define PCI_DID_INTEL_ICP_LP_SMBUS
Definition: pci_ids.h:4094
#define PCI_DID_INTEL_LWB_SMBUS
Definition: pci_ids.h:4090
#define PCI_DID_INTEL_SPT_H_SMBUS
Definition: pci_ids.h:4089
#define PCI_DID_INTEL_TGP_LP_SMBUS
Definition: pci_ids.h:4097
#define PCI_DID_INTEL_JSP_SMBUS
Definition: pci_ids.h:4100
#define PCI_DID_INTEL_ADP_S_SMBUS
Definition: pci_ids.h:4102
#define PCI_DID_INTEL_CMP_H_SMBUS
Definition: pci_ids.h:4096
#define PCI_DID_INTEL_ADP_P_SMBUS
Definition: pci_ids.h:4101

Definition at line 91 of file smbus.c.

◆ smbus_ops

struct device_operations smbus_ops
static
Initial value:
= {
.read_resources = smbus_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.scan_bus = scan_smbus,
.init = pch_smbus_init,
.ops_pci = &pci_dev_ops_pci,
.ops_smbus_bus = &lops_smbus_bus,
.final = finalize_smbus,
}
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
void scan_smbus(struct device *bus)
Definition: root_device.c:74
static struct smbus_bus_operations lops_smbus_bus
Definition: smbus.c:36
static void pch_smbus_init(struct device *dev)
Definition: smbus.c:41
static void smbus_read_resources(struct device *dev)
Definition: smbus.c:55
static void finalize_smbus(struct device *dev)
Definition: smbus.c:74

Definition at line 74 of file smbus.c.