[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC] i2c: Add AT24Cxx EEPROM model
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH RFC] i2c: Add AT24Cxx EEPROM model |
Date: |
Thu, 17 Dec 2015 17:18:03 +0100 |
Hi,
> Some devices react on multiple addresses. To emulate this, we could
> register them multiple times, but that is cumbersome. The AT24C16, e.g.
> listens on 8 different addresses.
>
> Instead, introduce a device address mask that is applied on the
> transmitted address before matching it against the stored one. Moreover,
> the transmitted address is passed as additional parameter to the event
> callback of the device.
This interface change ...
> This implements I2C EEPROMs of the AT24Cxx series. Sizes from 1Kbit to
> 1024Kbit are supported. Each EEPROM is backed by a block device. Its
> size can be explicitly specified by selecting the exact device type
> (required for sizes < 512, the blockdev sector size) or implicitly by
> providing a block device image of the corresponding size. Device
> addresses are built from the device number property. Write protection
> can be configured by declaring the block device read-only.
... and this new device should be two separate patches (but best sent as
patch series to make clear why the interface change is needed).
cheers,
Gerd