coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sema.c File Reference
#include <arch/io.h>
#include <console/console.h>
#include <device/device.h>
#include <delay.h>
#include <OEM.h>
#include <Porting.h>
#include <AGESA.h>
#include <northbridge/amd/agesa/dimmSpd.h>
#include "sema.h"
Include dependency graph for sema.c:

Go to the source code of this file.

Macros

#define SMB0_STATUS   ((SMBUS0_BASE_ADDRESS) + 0)
 
#define SMB0_CONTROL   ((SMBUS0_BASE_ADDRESS) + 2)
 
#define SMB0_HOSTCMD   ((SMBUS0_BASE_ADDRESS) + 3)
 
#define SMB0_ADDRESS   ((SMBUS0_BASE_ADDRESS) + 4)
 
#define SMB0_DATA0   ((SMBUS0_BASE_ADDRESS) + 5)
 
#define SMB0_BLOCKDATA   ((SMBUS0_BASE_ADDRESS) + 7)
 
#define RETRY_COUNT   100
 

Functions

static int smb_write_blk (u8 slave, u8 command, u8 length, const u8 *data)
 
static void early_mdelay (int msecs)
 
int sema_send_alive (void)
 

Macro Definition Documentation

◆ RETRY_COUNT

#define RETRY_COUNT   100

Definition at line 37 of file sema.c.

◆ SMB0_ADDRESS

#define SMB0_ADDRESS   ((SMBUS0_BASE_ADDRESS) + 4)

Definition at line 18 of file sema.c.

◆ SMB0_BLOCKDATA

#define SMB0_BLOCKDATA   ((SMBUS0_BASE_ADDRESS) + 7)

Definition at line 20 of file sema.c.

◆ SMB0_CONTROL

#define SMB0_CONTROL   ((SMBUS0_BASE_ADDRESS) + 2)

Definition at line 16 of file sema.c.

◆ SMB0_DATA0

#define SMB0_DATA0   ((SMBUS0_BASE_ADDRESS) + 5)

Definition at line 19 of file sema.c.

◆ SMB0_HOSTCMD

#define SMB0_HOSTCMD   ((SMBUS0_BASE_ADDRESS) + 3)

Definition at line 17 of file sema.c.

◆ SMB0_STATUS

#define SMB0_STATUS   ((SMBUS0_BASE_ADDRESS) + 0)

Definition at line 15 of file sema.c.

Function Documentation

◆ early_mdelay()

static void early_mdelay ( int  msecs)
static

Definition at line 40 of file sema.c.

References inb().

Referenced by sema_send_alive().

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

◆ sema_send_alive()

int sema_send_alive ( void  )

Definition at line 49 of file sema.c.

References BIOS_CRIT, BIOS_INFO, early_mdelay(), ENV_ROMSTAGE, printk, RETRY_COUNT, smb_write_blk(), and smbus_readSpd().

Referenced by init().

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

◆ smb_write_blk()

static int smb_write_blk ( u8  slave,
u8  command,
u8  length,
const u8 data 
)
static

Definition at line 22 of file sema.c.

References length, slave, SMB0_ADDRESS, SMB0_BLOCKDATA, SMB0_CONTROL, SMB0_DATA0, SMB0_HOSTCMD, and SMB0_STATUS.

Referenced by sema_send_alive().

Here is the caller graph for this function: