coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smbus.h File Reference
#include <stdint.h>
Include dependency graph for smbus.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SMBHSTSTAT   0x0
 
#define SMBSLVSTAT   0x1
 
#define SMBHSTCTRL   0x2
 
#define SMBHSTCMD   0x3
 
#define SMBHSTADDR   0x4
 
#define SMBHSTDAT0   0x5
 
#define SMBHSTDAT1   0x6
 
#define SMBHSTBLKDAT   0x7
 
#define SMBSLVCTRL   0x8
 
#define SMBSLVCMD_SHADOW   0x9
 
#define SMBSLVEVT   0xa
 
#define SMBSLVDAT   0xc
 
#define AX_INDXC   0
 
#define AX_INDXP   2
 
#define AXCFG   4
 
#define ABCFG   6
 
#define RC_INDXC   1
 
#define RC_INDXP   3
 
#define AB_INDX   0xcd8
 
#define AB_DATA   (AB_INDX + 4)
 
#define SMBUS_TIMEOUT   (100*1000*10)
 
#define abcfg_reg(reg, mask, val)    alink_ab_indx((ABCFG), (reg), (mask), (val))
 
#define axcfg_reg(reg, mask, val)    alink_ab_indx((AXCFG), (reg), (mask), (val))
 
#define axindxc_reg(reg, mask, val)    alink_ax_indx((AX_INDXC), (reg), (mask), (val))
 
#define axindxp_reg(reg, mask, val)    alink_ax_indx((AX_INDXP), (reg), (mask), (val))
 
#define rcindxc_reg(reg, port, mask, val)    alink_rc_indx((RC_INDXC), (reg), (port), (mask), (val))
 
#define rcindxp_reg(reg, port, mask, val)    alink_rc_indx((RC_INDXP), (reg), (port), (mask), (val))
 

Functions

int do_smbus_read_byte (u32 smbus_io_base, u32 device, u32 address)
 
int do_smbus_write_byte (u32 smbus_io_base, u32 device, u32 address, u8 val)
 
int do_smbus_recv_byte (u32 smbus_io_base, u32 device)
 
int do_smbus_send_byte (u32 smbus_io_base, u32 device, u8 val)
 
void alink_rc_indx (u32 reg_space, u32 reg_addr, u32 port, u32 mask, u32 val)
 
void alink_ab_indx (u32 reg_space, u32 reg_addr, u32 mask, u32 val)
 
void alink_ax_indx (u32 space, u32 axindc, u32 mask, u32 val)
 

Macro Definition Documentation

◆ AB_DATA

#define AB_DATA   (AB_INDX + 4)

Definition at line 30 of file smbus.h.

◆ AB_INDX

#define AB_INDX   0xcd8

Definition at line 29 of file smbus.h.

◆ ABCFG

#define ABCFG   6

Definition at line 25 of file smbus.h.

◆ abcfg_reg

#define abcfg_reg (   reg,
  mask,
  val 
)     alink_ab_indx((ABCFG), (reg), (mask), (val))

Definition at line 37 of file smbus.h.

◆ AX_INDXC

#define AX_INDXC   0

Definition at line 22 of file smbus.h.

◆ AX_INDXP

#define AX_INDXP   2

Definition at line 23 of file smbus.h.

◆ AXCFG

#define AXCFG   4

Definition at line 24 of file smbus.h.

◆ axcfg_reg

#define axcfg_reg (   reg,
  mask,
  val 
)     alink_ab_indx((AXCFG), (reg), (mask), (val))

Definition at line 39 of file smbus.h.

◆ axindxc_reg

#define axindxc_reg (   reg,
  mask,
  val 
)     alink_ax_indx((AX_INDXC), (reg), (mask), (val))

Definition at line 41 of file smbus.h.

◆ axindxp_reg

#define axindxp_reg (   reg,
  mask,
  val 
)     alink_ax_indx((AX_INDXP), (reg), (mask), (val))

Definition at line 43 of file smbus.h.

◆ RC_INDXC

#define RC_INDXC   1

Definition at line 26 of file smbus.h.

◆ RC_INDXP

#define RC_INDXP   3

Definition at line 27 of file smbus.h.

◆ rcindxc_reg

#define rcindxc_reg (   reg,
  port,
  mask,
  val 
)     alink_rc_indx((RC_INDXC), (reg), (port), (mask), (val))

Definition at line 45 of file smbus.h.

◆ rcindxp_reg

#define rcindxp_reg (   reg,
  port,
  mask,
  val 
)     alink_rc_indx((RC_INDXP), (reg), (port), (mask), (val))

Definition at line 47 of file smbus.h.

◆ SMBHSTADDR

#define SMBHSTADDR   0x4

Definition at line 12 of file smbus.h.

◆ SMBHSTBLKDAT

#define SMBHSTBLKDAT   0x7

Definition at line 15 of file smbus.h.

◆ SMBHSTCMD

#define SMBHSTCMD   0x3

Definition at line 11 of file smbus.h.

◆ SMBHSTCTRL

#define SMBHSTCTRL   0x2

Definition at line 10 of file smbus.h.

◆ SMBHSTDAT0

#define SMBHSTDAT0   0x5

Definition at line 13 of file smbus.h.

◆ SMBHSTDAT1

#define SMBHSTDAT1   0x6

Definition at line 14 of file smbus.h.

◆ SMBHSTSTAT

#define SMBHSTSTAT   0x0

Definition at line 8 of file smbus.h.

◆ SMBSLVCMD_SHADOW

#define SMBSLVCMD_SHADOW   0x9

Definition at line 18 of file smbus.h.

◆ SMBSLVCTRL

#define SMBSLVCTRL   0x8

Definition at line 17 of file smbus.h.

◆ SMBSLVDAT

#define SMBSLVDAT   0xc

Definition at line 20 of file smbus.h.

◆ SMBSLVEVT

#define SMBSLVEVT   0xa

Definition at line 19 of file smbus.h.

◆ SMBSLVSTAT

#define SMBSLVSTAT   0x1

Definition at line 9 of file smbus.h.

◆ SMBUS_TIMEOUT

#define SMBUS_TIMEOUT   (100*1000*10)

Definition at line 35 of file smbus.h.

Function Documentation

◆ alink_ab_indx()

void alink_ab_indx ( u32  reg_space,
u32  reg_addr,
u32  mask,
u32  val 
)

Definition at line 8 of file alink.c.

References AB_DATA, AB_INDX, BIOS_DEBUG, inl(), mask, outl(), printk, and val.

Here is the call graph for this function:

◆ alink_ax_indx()

void alink_ax_indx ( u32  space,
u32  axindc,
u32  mask,
u32  val 
)

Definition at line 60 of file alink.c.

References AB_DATA, AB_INDX, BIOS_DEBUG, inl(), mask, outl(), printk, and val.

Here is the call graph for this function:

◆ alink_rc_indx()

void alink_rc_indx ( u32  reg_space,
u32  reg_addr,
u32  port,
u32  mask,
u32  val 
)

Definition at line 32 of file alink.c.

References AB_DATA, AB_INDX, BIOS_DEBUG, inl(), mask, outl(), printk, and val.

Here is the call graph for this function:

◆ do_smbus_read_byte()

int do_smbus_read_byte ( u32  smbus_io_base,
u32  device,
u32  address 
)

Definition at line 104 of file smbus.c.

References address, BIOS_DEBUG, inb(), outb(), printk, SMBHSTADDR, SMBHSTCMD, SMBHSTCTRL, SMBHSTDAT0, smbus_wait_until_done(), and smbus_wait_until_ready().

Here is the call graph for this function:

◆ do_smbus_recv_byte()

int do_smbus_recv_byte ( u32  smbus_io_base,
u32  device 
)

Definition at line 50 of file smbus.c.

References BIOS_DEBUG, inb(), outb(), printk, SMBHSTADDR, SMBHSTCMD, SMBHSTCTRL, smbus_wait_until_done(), and smbus_wait_until_ready().

Here is the call graph for this function:

◆ do_smbus_send_byte()

int do_smbus_send_byte ( u32  smbus_io_base,
u32  device,
u8  val 
)

Definition at line 77 of file smbus.c.

References BIOS_DEBUG, inb(), outb(), printk, SMBHSTADDR, SMBHSTCMD, SMBHSTCTRL, smbus_wait_until_done(), smbus_wait_until_ready(), and val.

Here is the call graph for this function:

◆ do_smbus_write_byte()

int do_smbus_write_byte ( u32  smbus_io_base,
u32  device,
u32  address,
u8  val 
)

Definition at line 134 of file smbus.c.

References address, BIOS_DEBUG, inb(), outb(), printk, SMBHSTADDR, SMBHSTCMD, SMBHSTCTRL, SMBHSTDAT0, smbus_wait_until_done(), smbus_wait_until_ready(), and val.

Here is the call graph for this function: