Download Dynamic Engineering PMC2PCI Specifications

Transcript
INTELLIGENT PLATFORM MANAGEMENT INTERFACE
7.6
Programming Examples
7.6.1 Using the SMIC Interface
The PP 41x/03x board utilizes the Server Management Interface Controller (SMIC) as its interface
with the I/O ports at the standard addresses (i.e. 0CA9h, 0CAAh and 0CABh). The IPMI
specification has a complete description of the SMIC interface. The following C program fragment
reads and writes IPMI messages using the SMIC interface:
/* Addresses of SMIC registers */
#define SMIC_DATA
#define SMIC_CONTROL
#define SMIC_FLAGS
0x0CA9
0x0CAA
0x0CAB
/* Data Register */
/* Control & Status Register */
/* Flag Register */
/* SMS Transfer Stream Control Codes */
#define
#define
#define
#define
#define
#define
#define
CC_SMS_GET_STATUS
CC_SMS_WR_START
CC_SMS_WR_NEXT
CC_SMS_WR_END
CC_SMS_RD_START
CC_SMS_RD_NEXT
CC_SMS_RD_END
0x40
0x41
0x42
0x43
0x44
0x45
0x46
/* SMS Transfer Stream Status Codes */
#define
#define
#define
#define
#define
#define
#define
SC_SMS_RDY
SC_SMS_WR_START
SC_SMS_WR_NEXT
SC_SMS_WR_END
SC_SMS_RD_START
SC_SMS_RD_NEXT
SC_SMS_RD_END
0xC0
0xC1
0xC2
0xC3
0xC4
0xC5
0xC6
/* Masks for SMIC Flags Registers Bits */
#define
#define
#define
#define
#define
#define
FLAG_RX_DATA_RDY
FLAG_TX_DATA_RDY
FLAG_SMI
FLAG_EVT_ATN
FLAG_SMS_ATN
FLAG_BUSY
0x80
0x40
0x10
0x08
0x04
0x01
#define FLAGS_BUSY
0x01
#define FLAGS_TX_DATA_READY 0x40
#define FLAGS_RX_DATA_READY 0x80
/* macros */
#define bReadSmicFlags (inb (SMIC_FLAGS))
#define bReadSmicStatus (inb (SMIC_CONTROL))
#define bReadSmicData
(inb (SMIC_DATA))
#define vWriteSmicControl(data)
#define vWriteSmicData(data)
#define vWriteSmicFlags(data)
PP 41x/03x
outb(SMIC_CONTROL, data)
outb(SMIC_DATA, data)
outb(SMIC_FLAGS, data)
7-13