From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bFo-0001bA-VB for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:18:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bFl-0007fP-PR for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:18:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bFl-0007fL-K8 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:18:05 -0500 Message-ID: <1450369083.5981.19.camel@redhat.com> From: Gerd Hoffmann Date: Thu, 17 Dec 2015 17:18:03 +0100 In-Reply-To: <1804358.aPeCirA3Fj@dabox> References: <1804358.aPeCirA3Fj@dabox> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH RFC] i2c: Add AT24Cxx EEPROM model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tim Sander Cc: Peter Maydell , qemu-devel@nongnu.org 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. >=20 > 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