Some problems about FruDevice in the entity-manager

Vijay Khemka vijaykhemka at fb.com
Sat Mar 23 05:10:00 AEDT 2019



On 3/22/19, 8:55 AM, "James Feist" <james.feist at linux.intel.com> wrote:

    On 3/21/19 10:41 PM, Henbin Chang wrote:
    > Hi James,
    > 
    > There is EEPROM (AT24C64) with the valid FRU data on my board.
    > 
    > But the FruDevice would fail to format it.
    > 
    > I added some debug information to determine what's wrong with it.
    > 
    > Then I found the flag variable returned by isDevice16Bit() was equal 0.
    > That's, the FruDevice could think it's 8-bit EEPROM.
    > /* Check for Device type if it is 8 bit or 16 bit */
    > int flag = isDevice16Bit(file);
    > 
    > There is the below comment in the isDevice16Bit().
    
    Vijay, can you comment on this?
    
    I believe the logic here was that the 16bit eeproms Vijay was using 
    auto-increment the address, so reading twice over the header should give 
    different answers, as the checksum is in the header. That being said I 
    don't have any 16bit eeproms in my system so I haven't tried this 
    branch. Vijay authored this so he might have a better idea of what is 
    going on.
    
    Thanks,
    
    James

The issues here is eeprom index is not at 00 which was an assumption. In this case, it
is not pointing to first 8 byte header but it is pointing to garbage where all next 
8 bytes are same which means my check is failing. We need better way to find if i2c device
Is eeprom and then find 8 bit or 16 bits. I will look into it. In the meanwhile there is patch 
for direct reading from sysfs, please use that and see if it solves for time being. I will send gerrit
link for patch soon.

-Vijay

    
    
    > 
    > /* Read 7 more bytes, it will read same first byte in case of
    >   * 8 bit but it will read next byte in case of 16 bit
    > */
    > But the rule isn't applicable to my EEPROM (AT24C64) .
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile# i2ctransfer -f -y 6 w1 at 0x50 0 r1
    > 0x00
    > root at henbin:/var/volatile#
    > 
    > Could you give some suggestion?
    > 
    > Thanks.
    



More information about the openbmc mailing list