Hi Stefan,
static cmd_ret_t oem_iq65033_read_curr(msg_header_t *header, unsigned char *rep, unsigned char *compcode)
{
debug_printf(“Reading the current register:\n”);
*compcode = IPMI_SUCCESS;
rep[0] = 0xAA;
unsigned short i2c_addr = 0x0158; // IQ60533 address on MGT_I2C
// unsigned char dataPointer = 0x21; // Current Register Data_Pointer
unsigned char dataPointer = 0x28; // Temperature Register Data_Pointer
unsigned char i2c_rep; // Read value
// Write Data_Pointer
// char i2c_dev_write(unsigned short addr, unsigned char *pdata, unsigned char size)
if (i2c_dev_write(i2c_addr, &dataPointer, 1))
{debug_printf(“i2c_dev_write problem\n”);}
// Read Data
// char i2c_dev_read(unsigned short addr, unsigned char *pdata, unsigned char size)
// if (i2c_dev_read(i2c_addr, &i2c_rep, 1))
// {debug_printf(“i2c_dev_read problem\n”);}
if (i2c_io(i2c_addr | I2C_READ | I2C_START | I2C_STOP, &i2c_rep, 1) != I2C_OK) {
// print error message
}
debug_printf(“i2c_rep: %02xh \n”, i2c_rep);
// Add the i2c_rep byte to the IPMI reply - reply data buffer 5 bytes
rep[4] = i2c_rep;
return 0;
}
-bash-4.2$ ipmitool -I lan -H asml1c-stf0 -U “” -P “” -t 0x82 raw 0x2e 0x90 0x60 0x00 0x00
60 00 00 00
Reading the current register:
i2c_rep: 00h
Cheers,
Yuri
