Some problems about FruDevice in the entity-manager

Henbin Chang henbinchang at gmail.com
Mon Mar 25 12:39:15 AEDT 2019


Thanks for your response.

I also encountered another problem.

That's,  I found the content of 16-bit EEPROM through the combination of
the SMBUS APIs was not incorrect.

    /* This is for 16 bit addressing EEPROM device. First an offset
     * needs to be written before read data from a offset
     */
    int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }

    return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);

So I referred to i2c-tools to modify them.
And then I could see my FRU under the tree of
'xyz/openbmc_project/FruDevice/'

    int ret = i2c_smbus_write_byte_data(file, high_addr, low_addr);
    //int ret = i2c_smbus_write_byte_data(file, 0, low_addr);
    if (ret < 0)
    {
        return ret;
    }
    while (index < len){
buf[index] = i2c_smbus_read_byte(file);
index++;
    }

    //return i2c_smbus_read_i2c_block_data(file, high_addr, len, buf);
    return len;

Let me know if you have any comments.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20190325/d333c8c8/attachment.htm>


More information about the openbmc mailing list