4. Smbus Access - MSI MS-98J8 User Manual

Industrial computer board
Table of Contents

Advertisement

SMBus Access
4. SMBus Access 
The base address of SMBus must be known before access. The relevant bus and device information are 
as following. 
 
#define IO_SC     
#define IO_DA     
#define PCIBASEADDRESS    0x80000000 
#define PCI_BUS_NUM         0 
#define PCI_DEV_NUM         31 
#define PCI_FUN_NUM         
 
4.1
Get SMBus Base Address 
int SMBUS_BASE; 
int DATA_ADDR = PCIBASEADDRESS + (PCI_BUS_NUM<<16) +   
 
 
 
 
                             
 
Outportl 
(DATA_ADDR + 0x20, IO_SC); 
Inportl 
SMBUS_BASE = 
 
4.2
SMBus_ReadByte (char DEVID, char offset) 
Read the value of OFFSET from SMBus device DEVID. 
 
Outportb (LOWORD (
Outportb (LOWORD (
Outportb (LOWORD (
Outportb (LOWORD (
mdelay (20);     
while ((Inportl (
SMBUS_BASE
_DATA = Inportb (LOWORD (
SMB
 
4.3
SMBus_WriteByte (char DEVID, char offset, char DATA) 
Write DATA to OFFSET on SMBus device DEVID. 
 
Outportb (LOWORD (
Outportb (LOWORD (
Outportb (LOWORD (
Outportb (LOWORD (
Outportb (LOWORD (
mdelay (20);   
   
        0xCF8 
        0xCFC 
1
 
 
 
    (PCI_DEV_NUM<<11) + 
 
 
    (PCI_FUN_NUM<<8); 
(IO_DA) & 0xfffffff0; 
), 0xFE); 
SMBUS_BASE
) + 0x04, DEVID + 1); //out Base + 04, (DEVID + 1) 
SMBUS_BASE
) + 0x03, OFFSET);   //out Base + 03, OFFSET 
SMBUS_BASE
) + 0x02, 0x48);   
SMBUS_BASE
 
 
 
 
 
 
) & 0x01) != 0);   
 
) + 0x05); //input Base + 05 
SMBUS_BASE
), 0xFE); 
SMBUS_BASE
) + 0x04, DEVID);   
SMBUS_BASE
) + 0x03, OFFSET); 
SMBUS_BASE
) + 0x05, DATA); 
SMBUS_BASE
) + 0x02, 0x48);   
SMBUS_BASE
 
 
 
 
 
 
//out Base + 02, 48H 
//delay 20ms to let data ready 
//wait SMBus ready 
//out Base + 04, (DEVID) 
 //out Base + 03, OFFSET 
//out Base + 05, DATA 
//out Base + 02, 48H 
//wait 20ms 
MS-98J8
A-7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents