[PATCH qemu] arm: aspeed: Add palmetto and evb EEPROM I2C devices

Cédric Le Goater clg at kaod.org
Mon Sep 18 17:59:44 AEST 2017


On 09/18/2017 05:26 AM, Joel Stanley wrote:
> On Fri, Sep 15, 2017 at 4:55 PM, Cédric Le Goater <clg at kaod.org> wrote:
>> On 09/15/2017 08:18 AM, Joel Stanley wrote:
>>> Signed-off-by: Joel Stanley <joel at jms.id.au>
>>
>> We could fill the eeprom_buf with some valid data if needed.
> 
> 
> 
> That's a good idea.
> 
> When I use this I see the following error:
> 
> # pwd
> /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c at 1e78a000/1e78a100.i2c-bus

hmm, the address is I2C bus 3.

> # hexdump -C i2c-0/0-0050/eeprom

But you use bus 0 ? weird.

> hexdump: i2c-0/0-0050/eeprom: Operation timed out
> 00000000  74 65 73 74 20 64 61 74  61 0a 00 00 00 00 00     |test data......|
> 0000000f
> 
> A strace shows three reads, with the first succeeding and the second
> two failing:
> 
> # strace hexdump -C i2c-0/0-0050/eeprom
> execve("/usr/bin/hexdump", ["hexdump", "-C", "i2c-0/0-0050/eeprom"],
> [/* 12 vars */]) = 0
> set_tls(0x76fad764, 0x3c, 0x76fac47c, 0x24, 0x76fad698) = 0
> set_tid_address(0x76fad6b4)             = 581
> getuid32()                              = 0
> open("i2c-0/0-0050/eeprom", O_RDONLY|O_LARGEFILE) = 3
> dup2(3, 0)                              = 0
> close(3)                                = 0
> readv(0, [{iov_base="test data\n\0\0\0\0\0", iov_len=15},
> {iov_base="", iov_len=1024}], 2) = 15
> readv(0, 0x7e898cd4, 2)                 = -1 ETIMEDOUT (Operation timed out)
> readv(0, 0x7e898cd4, 2)                 = -1 ETIMEDOUT (Operation timed out)
> write(2, "hexdump: i2c-0/0-0050/eeprom: Op"..., 50hexdump:
> i2c-0/0-0050/eeprom: Operation timed out
> ) = 50
> ioctl(1, TIOCGWINSZ, {ws_row=0, ws_col=0, ws_xpixel=0, ws_ypixel=0}) = 0
> writev(1, [{iov_base="00000000  74 65 73 74 20 64 61 7"...,
> iov_len=76}, {iov_base="|\n", iov_len=2}], 200000000  74 65 73 74 20
> 64 61 74  61 0a 00 00 00 00 00     |test data......|
> ) = 78
> writev(1, [{iov_base="0000000f", iov_len=8}, {iov_base="\n",
> iov_len=1}], 20000000f
> ) = 9
> exit_group(0)                           = ?
> +++ exited with 0 +++
> 
> Any ideas there?


If I use your patch adding the eeprom to bus 0 on the palmetto machine, I don't 
see any issues while reading the contents.

  hexdump -C  /sys/devices/platform/ahb/ahb:apb/ahb:apb:i2c at 1e78a000/1e78a040.i2c-bus/i2c-0/0-0050/eeprom
  00000000  00 80 80 80 80 80 80 80  80 80 80 80 80 80 80 80  |................|
  00000010  80 80 80 80 80 80 80 80  80 80 80 80 80 80 80 80  |................|
  *
  ...
  00007f80  80 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  00007f90  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
  *
  00008000


Cheers,

C. 


More information about the openbmc mailing list