coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sm.c File Reference
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/smbus.h>
#include <arch/ioapic.h>
#include "hudson.h"
#include "smbus.c"
Include dependency graph for sm.c:

Go to the source code of this file.

Macros

#define NMI_OFF   0
 
#define MAINBOARD_POWER_OFF   0
 
#define MAINBOARD_POWER_ON   1
 

Functions

static void sm_init (struct device *dev)
 
static int lsmbus_recv_byte (struct device *dev)
 
static int lsmbus_send_byte (struct device *dev, u8 val)
 
static int lsmbus_read_byte (struct device *dev, u8 address)
 
static int lsmbus_write_byte (struct device *dev, u8 address, u8 val)
 
static void hudson_sm_read_resources (struct device *dev)
 
static void hudson_sm_set_resources (struct device *dev)
 

Variables

static struct smbus_bus_operations lops_smbus_bus
 
static struct device_operations smbus_ops
 
static const struct pci_driver smbus_driver __pci_driver
 

Macro Definition Documentation

◆ MAINBOARD_POWER_OFF

#define MAINBOARD_POWER_OFF   0

Definition at line 14 of file sm.c.

◆ MAINBOARD_POWER_ON

#define MAINBOARD_POWER_ON   1

Definition at line 15 of file sm.c.

◆ NMI_OFF

#define NMI_OFF   0

Definition at line 12 of file sm.c.

Function Documentation

◆ hudson_sm_read_resources()

static void hudson_sm_read_resources ( struct device dev)
static

Definition at line 89 of file sm.c.

◆ hudson_sm_set_resources()

static void hudson_sm_set_resources ( struct device dev)
static

Definition at line 93 of file sm.c.

◆ lsmbus_read_byte()

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

Definition at line 55 of file sm.c.

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

Here is the call graph for this function:

◆ lsmbus_recv_byte()

static int lsmbus_recv_byte ( struct device dev)
static

Definition at line 27 of file sm.c.

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

Here is the call graph for this function:

◆ lsmbus_send_byte()

static int lsmbus_send_byte ( struct device dev,
u8  val 
)
static

Definition at line 41 of file sm.c.

References resource::base, bus::dev, i2c_path::device, device, do_smbus_send_byte(), find_resource(), get_pbus_smbus(), device_path::i2c, device::path, and val.

Here is the call graph for this function:

◆ lsmbus_write_byte()

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

Definition at line 69 of file sm.c.

◆ sm_init()

static void sm_init ( struct device dev)
static

Definition at line 22 of file sm.c.

References setup_ioapic(), and VIO_APIC_VADDR.

Here is the call graph for this function:

Variable Documentation

◆ __pci_driver

const struct pci_driver smbus_driver __pci_driver
static
Initial value:
= {
.ops = &smbus_ops,
.vendor = PCI_VID_AMD,
}
#define PCI_VID_AMD
Definition: pci_ids.h:496
#define PCI_DID_AMD_SB900_SM
Definition: pci_ids.h:530
static struct device_operations smbus_ops
Definition: sm.c:97

Definition at line 93 of file sm.c.

◆ lops_smbus_bus

struct smbus_bus_operations lops_smbus_bus
static
Initial value:
= {
.recv_byte = lsmbus_recv_byte,
.send_byte = lsmbus_send_byte,
.read_byte = lsmbus_read_byte,
.write_byte = lsmbus_write_byte,
}
static int lsmbus_recv_byte(struct device *dev)
Definition: sm.c:27
static int lsmbus_write_byte(struct device *dev, u8 address, u8 val)
Definition: sm.c:69
static int lsmbus_send_byte(struct device *dev, u8 val)
Definition: sm.c:41
static int lsmbus_read_byte(struct device *dev, u8 address)
Definition: sm.c:55

Definition at line 69 of file sm.c.

◆ smbus_ops

struct device_operations smbus_ops
static
Initial value:
= {
.read_resources = hudson_sm_read_resources,
.set_resources = hudson_sm_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sm_init,
.scan_bus = scan_smbus,
.ops_pci = &pci_dev_ops_pci,
.ops_smbus_bus = &lops_smbus_bus,
}
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 scan_smbus(struct device *bus)
Definition: root_device.c:74
static void hudson_sm_read_resources(struct device *dev)
Definition: sm.c:89
static void sm_init(struct device *dev)
Definition: sm.c:22
static void hudson_sm_set_resources(struct device *dev)
Definition: sm.c:93
static struct smbus_bus_operations lops_smbus_bus
Definition: sm.c:82

Definition at line 93 of file sm.c.