Skip to contentSkip to conversation

i2c: Add AT24Cxx EEPROM model

PATCH Superseded Jan Kiszka 5 participants 17 messages Nov 19, 2012 – Jan 16, 2013

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

cover i2c: Add AT24Cxx EEPROM model

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ds1338.c      |    2 +-
 hw/i2c.c         |    9 +-
 hw/i2c.h         |    3 +-
 hw/lm832x.c      |    2 +-
 hw/max7310.c     |    2 +-
 hw/pxa2xx.c      |    3 +-
 hw/smbus.c       |    2 +-
 hw/ssd0303.c     |    2 +-
 hw/tmp105.c      |    2 +-
 hw/tosa.c        |    2 +-
 hw/twl92230.c    |    2 +-
 hw/wm8750.c      |    2 +-
 hw/z2.c          |    2 +-
 15 files changed, 383 insertions(+), 17 deletions(-)
 create mode 100644 hw/at24.c
Signature · 1 line
1.7.3.4
author
#1 lore raw

PATCH 1/2 i2c: Introduce device address mask

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.

---
 hw/ds1338.c   |    2 +-
 hw/i2c.c      |    9 +++++----
 hw/i2c.h      |    3 ++-
 hw/lm832x.c   |    2 +-
 hw/max7310.c  |    2 +-
 hw/pxa2xx.c   |    3 ++-
 hw/smbus.c    |    2 +-
 hw/ssd0303.c  |    2 +-
 hw/tmp105.c   |    2 +-
 hw/tosa.c     |    2 +-
 hw/twl92230.c |    2 +-
 hw/wm8750.c   |    2 +-
 hw/z2.c       |    2 +-
 13 files changed, 19 insertions(+), 16 deletions(-)
hw/ds1338.c +1 -1
index b576d56..59fcc01 100644
@@ -75,7 +75,7 @@ static void inc_regptr(DS1338State *s)
     }
 }
 
-static void ds1338_event(I2CSlave *i2c, enum i2c_event event)
+static void ds1338_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     DS1338State *s = FROM_I2C_SLAVE(DS1338State, i2c);
 
hw/i2c.c +5 -4
index 296bece..72b8f07 100644
@@ -93,7 +93,7 @@ int i2c_start_transfer(i2c_bus *bus, uint8_t address, int recv)
     QTAILQ_FOREACH(kid, &bus->qbus.children, sibling) {
         DeviceState *qdev = kid->child;
         I2CSlave *candidate = I2C_SLAVE_FROM_QDEV(qdev);
-        if (candidate->address == address) {
+        if (candidate->address == (address & candidate->address_mask)) {
             slave = candidate;
             break;
         }
@@ -108,7 +108,7 @@ int i2c_start_transfer(i2c_bus *bus, uint8_t address, int recv)
        start condition.  */
     bus->current_dev = slave;
     if (sc->event) {
-        sc->event(slave, recv ? I2C_START_RECV : I2C_START_SEND);
+        sc->event(slave, recv ? I2C_START_RECV : I2C_START_SEND, address);
     }
     return 0;
 }
@@ -124,7 +124,7 @@ void i2c_end_transfer(i2c_bus *bus)
 
     sc = I2C_SLAVE_GET_CLASS(dev);
     if (sc->event) {
-        sc->event(dev, I2C_FINISH);
+        sc->event(dev, I2C_FINISH, 0);
     }
 
     bus->current_dev = NULL;
@@ -175,7 +175,7 @@ void i2c_nack(i2c_bus *bus)
 
     sc = I2C_SLAVE_GET_CLASS(dev);
     if (sc->event) {
-        sc->event(dev, I2C_NACK);
+        sc->event(dev, I2C_NACK, 0);
     }
 }
 
@@ -207,6 +207,7 @@ static int i2c_slave_qdev_init(DeviceState *dev)
     I2CSlave *s = I2C_SLAVE_FROM_QDEV(dev);
     I2CSlaveClass *sc = I2C_SLAVE_GET_CLASS(s);
 
+    s->address_mask = 0x7f;
     return sc->init(s);
 }
 
hw/i2c.h +2 -1
index 0f5682b..6cf164b 100644
@@ -39,7 +39,7 @@ typedef struct I2CSlaveClass
     int (*recv)(I2CSlave *s);
 
     /* Notify the slave of a bus state change.  */
-    void (*event)(I2CSlave *s, enum i2c_event event);
+    void (*event)(I2CSlave *s, enum i2c_event event, uint8_t param);
 } I2CSlaveClass;
 
 struct I2CSlave
@@ -48,6 +48,7 @@ struct I2CSlave
 
     /* Remaining fields for internal use by the I2C code.  */
     uint8_t address;
+    uint8_t address_mask;
 };
 
 i2c_bus *i2c_init_bus(DeviceState *parent, const char *name);
hw/lm832x.c +1 -1
index 8e09f9b..d69aa4b 100644
@@ -378,7 +378,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int byte, uint8_t value)
     }
 }
 
-static void lm_i2c_event(I2CSlave *i2c, enum i2c_event event)
+static void lm_i2c_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     LM823KbdState *s = FROM_I2C_SLAVE(LM823KbdState, i2c);
 
hw/max7310.c +1 -1
index 1ed18ba..63999be 100644
@@ -123,7 +123,7 @@ static int max7310_tx(I2CSlave *i2c, uint8_t data)
     return 0;
 }
 
-static void max7310_event(I2CSlave *i2c, enum i2c_event event)
+static void max7310_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     MAX7310State *s = (MAX7310State *) i2c;
     s->len = 0;
hw/pxa2xx.c +2 -1
index e616979..fb1fd0d 100644
@@ -1239,7 +1239,8 @@ static void pxa2xx_i2c_update(PXA2xxI2CState *s)
 }
 
 /* These are only stubs now.  */
-static void pxa2xx_i2c_event(I2CSlave *i2c, enum i2c_event event)
+static void pxa2xx_i2c_event(I2CSlave *i2c, enum i2c_event event,
+                             uint8_t param)
 {
     PXA2xxI2CSlaveState *slave = FROM_I2C_SLAVE(PXA2xxI2CSlaveState, i2c);
     PXA2xxI2CState *s = slave->host;
hw/smbus.c +1 -1
index e3cf6a2..7d070d9 100644
@@ -66,7 +66,7 @@ static void smbus_do_write(SMBusDevice *dev)
     }
 }
 
-static void smbus_i2c_event(I2CSlave *s, enum i2c_event event)
+static void smbus_i2c_event(I2CSlave *s, enum i2c_event event, uint8_t param)
 {
     SMBusDevice *dev = SMBUS_DEVICE(s);
 
hw/ssd0303.c +1 -1
index d7fd828..19a8d66 100644
@@ -173,7 +173,7 @@ static int ssd0303_send(I2CSlave *i2c, uint8_t data)
     return 0;
 }
 
-static void ssd0303_event(I2CSlave *i2c, enum i2c_event event)
+static void ssd0303_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     ssd0303_state *s = (ssd0303_state *)i2c;
     switch (event) {
hw/tmp105.c +1 -1
index 8e8dbd9..a6dc39a 100644
@@ -163,7 +163,7 @@ static int tmp105_tx(I2CSlave *i2c, uint8_t data)
     return 0;
 }
 
-static void tmp105_event(I2CSlave *i2c, enum i2c_event event)
+static void tmp105_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     TMP105State *s = (TMP105State *) i2c;
 
hw/tosa.c +1 -1
index 512278c..2d2ac54 100644
@@ -157,7 +157,7 @@ static int tosa_dac_send(I2CSlave *i2c, uint8_t data)
     return 0;
 }
 
-static void tosa_dac_event(I2CSlave *i2c, enum i2c_event event)
+static void tosa_dac_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     TosaDACState *s = FROM_I2C_SLAVE(TosaDACState, i2c);
     s->len = 0;
hw/twl92230.c +1 -1
index 0d70d84..898d3a1 100644
@@ -706,7 +706,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value)
     }
 }
 
-static void menelaus_event(I2CSlave *i2c, enum i2c_event event)
+static void menelaus_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     MenelausState *s = (MenelausState *) i2c;
 
hw/wm8750.c +1 -1
index 44f138f..9358342 100644
@@ -297,7 +297,7 @@ static void wm8750_reset(I2CSlave *i2c)
     s->i2c_len = 0;
 }
 
-static void wm8750_event(I2CSlave *i2c, enum i2c_event event)
+static void wm8750_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     WM8750State *s = (WM8750State *) i2c;
 
hw/z2.c +1 -1
index f62b806..ca69f60 100644
@@ -216,7 +216,7 @@ static int aer915_send(I2CSlave *i2c, uint8_t data)
     return 0;
 }
 
-static void aer915_event(I2CSlave *i2c, enum i2c_event event)
+static void aer915_event(I2CSlave *i2c, enum i2c_event event, uint8_t param)
 {
     AER915State *s = FROM_I2C_SLAVE(AER915State, i2c);
     switch (event) {
Signature · 1 line
1.7.3.4
author
#2 lore raw

PATCH 2/2 Add AT24Cxx I2C EEPROM device model

In reply to Jan Kiszka

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 the "size" property (required for sizes < 512, the blockdev sector size) or is derived from the size of the backing block device. Device addresses are built from the device number property. Write protection can be configured by declaring the block device read-only.

---
 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 364 insertions(+), 1 deletions(-)
 create mode 100644 hw/at24.c
hw/Makefile.objs +1 -1
index ea46f81..0c64712 100644
@@ -170,7 +170,7 @@ common-obj-$(CONFIG_SSD0323) += ssd0323.o
 common-obj-$(CONFIG_ADS7846) += ads7846.o
 common-obj-$(CONFIG_MAX111X) += max111x.o
 common-obj-$(CONFIG_DS1338) += ds1338.o
-common-obj-y += i2c.o smbus.o smbus_eeprom.o
+common-obj-y += i2c.o smbus.o smbus_eeprom.o at24.o
 common-obj-y += eeprom93xx.o
 common-obj-y += scsi-disk.o cdrom.o hd-geometry.o block-common.o
 common-obj-y += scsi-generic.o scsi-bus.o
hw/at24.c new file +363 -0

363 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

Quoted 6 lines · Jan Kiszka
hw/at24.c new file +6 -0
+static void at24_flush_transfer_buffer(AT24State *s)
+{
+    if (s->cached_sector < 0 || !s->cache_dirty) {
+        return;
+    }
+    bdrv_write(s->bs, s->cached_sector, s->sector_buffer, 1);

[...]

hw/at24.c line 128

Quoted 8 lines
hw/at24.c new file +8 -0
+static int at24_cache_sector(AT24State *s, int sector)
+{
+    int ret;
+
+    if (s->cached_sector == sector) {
+        return 0;
+    }
+    ret = bdrv_read(s->bs, sector, s->sector_buffer, 1);

Can you use bdrv_aio_writev()/bdrv_aio_readv()? We should avoid adding new synchronous block I/O. Because it forces us to run a nested event loop that blocks the guest until I/O completes.

Stefan

author
#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

Quoted 8 lines · Stefan Hajnoczi
Quoted 6 lines · Jan Kiszka
hw/at24.c new file +6 -0
+static void at24_flush_transfer_buffer(AT24State *s)
+{
+    if (s->cached_sector < 0 || !s->cache_dirty) {
+        return;
+    }
+    bdrv_write(s->bs, s->cached_sector, s->sector_buffer, 1);

[...]

Quoted 12 lines

hw/at24.c line 128

Quoted 8 lines
hw/at24.c new file +8 -0
+static int at24_cache_sector(AT24State *s, int sector)
+{
+    int ret;
+
+    if (s->cached_sector == sector) {
+        return 0;
+    }
+    ret = bdrv_read(s->bs, sector, s->sector_buffer, 1);

Can you use bdrv_aio_writev()/bdrv_aio_readv()? We should avoid adding new synchronous block I/O. Because it forces us to run a nested event loop that blocks the guest until I/O completes.

The call is synchronous as the I2C bus model is as well. How do I model this with bdrv_aio_*?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

Quoted 22 lines · Jan Kiszka
Quoted 8 lines · Stefan Hajnoczi
Quoted 6 lines · Jan Kiszka
hw/at24.c new file +6 -0
+static void at24_flush_transfer_buffer(AT24State *s)
+{
+    if (s->cached_sector < 0 || !s->cache_dirty) {
+        return;
+    }
+    bdrv_write(s->bs, s->cached_sector, s->sector_buffer, 1);

[...]

Quoted 12 lines

hw/at24.c line 128

Quoted 8 lines
hw/at24.c new file +8 -0
+static int at24_cache_sector(AT24State *s, int sector)
+{
+    int ret;
+
+    if (s->cached_sector == sector) {
+        return 0;
+    }
+    ret = bdrv_read(s->bs, sector, s->sector_buffer, 1);

Can you use bdrv_aio_writev()/bdrv_aio_readv()? We should avoid adding new synchronous block I/O. Because it forces us to run a nested event loop that blocks the guest until I/O completes.

Quoted 2 lines

The call is synchronous as the I2C bus model is as well. How do I model this with bdrv_aio_*?

The bus model needs to be asynchronous.

There are still a few bdrv_read()/bdrv_write() users in hw/ today so it's not the end of the world if you can't make it async, but it means someone else will have to do the work eventually :(.

Stefan

author
#6 lore raw

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

Quoted 23 lines · Stefan Hajnoczi
Quoted 22 lines · Jan Kiszka
Quoted 20 lines · Stefan Hajnoczi
Quoted 6 lines · Jan Kiszka
hw/at24.c new file +6 -0
+static void at24_flush_transfer_buffer(AT24State *s)
+{
+    if (s->cached_sector < 0 || !s->cache_dirty) {
+        return;
+    }
+    bdrv_write(s->bs, s->cached_sector, s->sector_buffer, 1);

[...]

hw/at24.c line 128

Quoted 8 lines
hw/at24.c new file +8 -0
+static int at24_cache_sector(AT24State *s, int sector)
+{
+    int ret;
+
+    if (s->cached_sector == sector) {
+        return 0;
+    }
+    ret = bdrv_read(s->bs, sector, s->sector_buffer, 1);

Can you use bdrv_aio_writev()/bdrv_aio_readv()? We should avoid adding new synchronous block I/O. Because it forces us to run a nested event loop that blocks the guest until I/O completes.

Quoted 4 lines
Quoted 2 lines

The call is synchronous as the I2C bus model is as well. How do I model this with bdrv_aio_*?

The bus model needs to be asynchronous.

That's not easy, even in theory. I2C allows a slave to defer its answer by holding the clock line down, but not all masters support this, and some (e.g. SMBus) even demand an upper limit. So we risk timeouts of the guest when deferring normally synchronous accesses like on these EEPROMs.

IOW: There will likely be a need for synchronously waiting on block layer I/O requests also in the future.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#7 lore raw

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

Quoted 29 lines · Jan Kiszka
Quoted 23 lines · Stefan Hajnoczi
Quoted 22 lines · Jan Kiszka
Quoted 20 lines · Stefan Hajnoczi
Quoted 6 lines · Jan Kiszka
hw/at24.c new file +6 -0
+static void at24_flush_transfer_buffer(AT24State *s)
+{
+    if (s->cached_sector < 0 || !s->cache_dirty) {
+        return;
+    }
+    bdrv_write(s->bs, s->cached_sector, s->sector_buffer, 1);

[...]

hw/at24.c line 128

Quoted 8 lines
hw/at24.c new file +8 -0
+static int at24_cache_sector(AT24State *s, int sector)
+{
+    int ret;
+
+    if (s->cached_sector == sector) {
+        return 0;
+    }
+    ret = bdrv_read(s->bs, sector, s->sector_buffer, 1);

Can you use bdrv_aio_writev()/bdrv_aio_readv()? We should avoid adding new synchronous block I/O. Because it forces us to run a nested event loop that blocks the guest until I/O completes.

Quoted 4 lines
Quoted 2 lines

The call is synchronous as the I2C bus model is as well. How do I model this with bdrv_aio_*?

The bus model needs to be asynchronous.

Quoted 7 lines

That's not easy, even in theory. I2C allows a slave to defer its answer by holding the clock line down, but not all masters support this, and some (e.g. SMBus) even demand an upper limit. So we risk timeouts of the guest when deferring normally synchronous accesses like on these EEPROMs.

IOW: There will likely be a need for synchronously waiting on block layer I/O requests also in the future.

How large are the EEPROMs? Perhaps the data should be in memory?

Stefan

author
#8 lore raw

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

Quoted 35 lines · Stefan Hajnoczi
Quoted 34 lines · Jan Kiszka
Quoted 23 lines · Stefan Hajnoczi
Quoted 22 lines · Jan Kiszka
Quoted 20 lines · Stefan Hajnoczi
Quoted 6 lines · Jan Kiszka
hw/at24.c new file +6 -0
+static void at24_flush_transfer_buffer(AT24State *s)
+{
+    if (s->cached_sector < 0 || !s->cache_dirty) {
+        return;
+    }
+    bdrv_write(s->bs, s->cached_sector, s->sector_buffer, 1);

[...]

hw/at24.c line 128

Quoted 8 lines
hw/at24.c new file +8 -0
+static int at24_cache_sector(AT24State *s, int sector)
+{
+    int ret;
+
+    if (s->cached_sector == sector) {
+        return 0;
+    }
+    ret = bdrv_read(s->bs, sector, s->sector_buffer, 1);

Can you use bdrv_aio_writev()/bdrv_aio_readv()? We should avoid adding new synchronous block I/O. Because it forces us to run a nested event loop that blocks the guest until I/O completes.

Quoted 4 lines
Quoted 2 lines

The call is synchronous as the I2C bus model is as well. How do I model this with bdrv_aio_*?

The bus model needs to be asynchronous.

That's not easy, even in theory. I2C allows a slave to defer its answer by holding the clock line down, but not all masters support this, and some (e.g. SMBus) even demand an upper limit. So we risk timeouts of the guest when deferring normally synchronous accesses like on these EEPROMs.

Quoted 4 lines
Quoted 2 lines

IOW: There will likely be a need for synchronously waiting on block layer I/O requests also in the future.

How large are the EEPROMs? Perhaps the data should be in memory?

Up to 128K with these models. But that only solves the read delay. Writes can be delayed by the EEPROM but have an upper limit for the completion time (between 5 and 20 ms).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
author
#9 lore raw

PATCH v2 2/2 Add AT24Cxx I2C EEPROM device model

In reply to Jan Kiszka

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 the "size" property (required for sizes < 512, the blockdev sector size) or is derived from the size of the backing block device. Device addresses are built from the device number property. Write protection can be configured by declaring the block device read-only.

---

Changes in v2:
- trivial update to account for blockdev.h moving

 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 364 insertions(+), 1 deletions(-)
 create mode 100644 hw/at24.c
hw/Makefile.objs +1 -1
index 74b07a7..d9394dd 100644
@@ -176,7 +176,7 @@ common-obj-$(CONFIG_SSD0323) += ssd0323.o
 common-obj-$(CONFIG_ADS7846) += ads7846.o
 common-obj-$(CONFIG_MAX111X) += max111x.o
 common-obj-$(CONFIG_DS1338) += ds1338.o
-common-obj-y += i2c.o smbus.o smbus_eeprom.o
+common-obj-y += i2c.o smbus.o smbus_eeprom.o at24.o
 common-obj-y += eeprom93xx.o
 common-obj-y += scsi-disk.o cdrom.o hd-geometry.o block-common.o
 common-obj-y += scsi-generic.o scsi-bus.o
hw/at24.c new file +363 -0

363 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#10 lore raw
In reply to Jan Kiszka

Am 19.11.2012 15:24, schrieb Jan Kiszka:

Quoted 6 lines

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

Is AT24Cxx compatible to Microchip 24C02SC or SGS Thomson ST24C02 (which are emulated in hw/mips_malta.c)? Could we share code?

Stefan

author
#11 lore raw
Quoted 10 lines · Stefan Weil

Am 19.11.2012 15:24, schrieb Jan Kiszka:

Quoted 6 lines

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

Is AT24Cxx compatible to Microchip 24C02SC or SGS Thomson ST24C02 (which are emulated in hw/mips_malta.c)? Could we share code?

Possibly, but definitely not before someone implemented a real I2C controller model in mips_malta.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
author
#12 lore raw
In reply to Jan Kiszka
Quoted 15 lines · Jan Kiszka

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ds1338.c      |    2 +-
 hw/i2c.c         |    9 +-
 hw/i2c.h         |    3 +-
 hw/lm832x.c      |    2 +-
 hw/max7310.c     |    2 +-
 hw/pxa2xx.c      |    3 +-
 hw/smbus.c       |    2 +-
Quoted 9 lines
 hw/ssd0303.c     |    2 +-
 hw/tmp105.c      |    2 +-
 hw/tosa.c        |    2 +-
 hw/twl92230.c    |    2 +-
 hw/wm8750.c      |    2 +-
 hw/z2.c          |    2 +-
 15 files changed, 383 insertions(+), 17 deletions(-)
 create mode 100644 hw/at24.c

Ping. Both still apply over latest master, and addressable review comments are not pending according to my understanding.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#13 lore raw
Quoted 26 lines · Jan Kiszka
Quoted 15 lines · Jan Kiszka

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ds1338.c      |    2 +-
 hw/i2c.c         |    9 +-
 hw/i2c.h         |    3 +-
 hw/lm832x.c      |    2 +-
 hw/max7310.c     |    2 +-
 hw/pxa2xx.c      |    3 +-
 hw/smbus.c       |    2 +-
Quoted 9 lines
 hw/ssd0303.c     |    2 +-
 hw/tmp105.c      |    2 +-
 hw/tosa.c        |    2 +-
 hw/twl92230.c    |    2 +-
 hw/wm8750.c      |    2 +-
 hw/z2.c          |    2 +-
 15 files changed, 383 insertions(+), 17 deletions(-)
 create mode 100644 hw/at24.c
Quoted 2 lines

Ping. Both still apply over latest master, and addressable review comments are not pending according to my understanding.

Hi Jan,
Just going through my piled up qemu-devel mailbox. You're asking for a qemu.git commit to merge this, right?

Stefan

author
#14 lore raw
Quoted 27 lines · Stefan Hajnoczi
Quoted 26 lines · Jan Kiszka
Quoted 24 lines · Jan Kiszka

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ds1338.c      |    2 +-
 hw/i2c.c         |    9 +-
 hw/i2c.h         |    3 +-
 hw/lm832x.c      |    2 +-
 hw/max7310.c     |    2 +-
 hw/pxa2xx.c      |    3 +-
 hw/smbus.c       |    2 +-
 hw/ssd0303.c     |    2 +-
 hw/tmp105.c      |    2 +-
 hw/tosa.c        |    2 +-
 hw/twl92230.c    |    2 +-
 hw/wm8750.c      |    2 +-
 hw/z2.c          |    2 +-
 15 files changed, 383 insertions(+), 17 deletions(-)
 create mode 100644 hw/at24.c
Quoted 6 lines
Quoted 2 lines

Ping. Both still apply over latest master, and addressable review comments are not pending according to my understanding.

Hi Jan,
Just going through my piled up qemu-devel mailbox. You're asking for a qemu.git commit to merge this, right?

Yes, I'm seeing no blocker for this. I just don't know who feels responsible for merging things in this domain (I2C).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#15 lore raw
In reply to Jan Kiszka

Am 12.12.2012 10:44, schrieb Jan Kiszka:

Quoted 26 lines · Jan Kiszka
Quoted 15 lines

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ds1338.c      |    2 +-
 hw/i2c.c         |    9 +-
 hw/i2c.h         |    3 +-
 hw/lm832x.c      |    2 +-
 hw/max7310.c     |    2 +-
 hw/pxa2xx.c      |    3 +-
 hw/smbus.c       |    2 +-
Quoted 9 lines
 hw/ssd0303.c     |    2 +-
 hw/tmp105.c      |    2 +-
 hw/tosa.c        |    2 +-
 hw/twl92230.c    |    2 +-
 hw/wm8750.c      |    2 +-
 hw/z2.c          |    2 +-
 15 files changed, 383 insertions(+), 17 deletions(-)
 create mode 100644 hw/at24.c
Quoted 2 lines

Ping. Both still apply over latest master, and addressable review comments are not pending according to my understanding.

Hello Jan, did you see my recent proposal of an I2C qtest framework? :) For one I'd be interested in feedback from someone who knows I2C and for another maybe you could follow-up your patch with some test case (I2C master shouldn't matter, I guess).

Cheers,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
author
#16 lore raw
Quoted 27 lines · Andreas Färber

Am 12.12.2012 10:44, schrieb Jan Kiszka:

Quoted 26 lines · Jan Kiszka
Quoted 24 lines

See patches for details.

Jan Kiszka (2):
i2c: Introduce device address mask
Add AT24Cxx I2C EEPROM device model

 hw/Makefile.objs |    2 +-
 hw/at24.c        |  363 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ds1338.c      |    2 +-
 hw/i2c.c         |    9 +-
 hw/i2c.h         |    3 +-
 hw/lm832x.c      |    2 +-
 hw/max7310.c     |    2 +-
 hw/pxa2xx.c      |    3 +-
 hw/smbus.c       |    2 +-
 hw/ssd0303.c     |    2 +-
 hw/tmp105.c      |    2 +-
 hw/tosa.c        |    2 +-
 hw/twl92230.c    |    2 +-
 hw/wm8750.c      |    2 +-
 hw/z2.c          |    2 +-
 15 files changed, 383 insertions(+), 17 deletions(-)
 create mode 100644 hw/at24.c
Quoted 7 lines
Quoted 2 lines

Ping. Both still apply over latest master, and addressable review comments are not pending according to my understanding.

Hello Jan, did you see my recent proposal of an I2C qtest framework? :) For one I'd be interested in feedback from someone who knows I2C and for another maybe you could follow-up your patch with some test case (I2C master shouldn't matter, I guess).

I haven't seen your test framework yet, and I'm unfortunately lacking time to work on test cases ATM. We were simply testing this device against the Linux driver. Wasn't there also some test environment that builds on top of a guest OS?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux