Skip to contentSkip to conversation

Add AT24Cxx I2C EEPROM device model

PATCH Jan Kiszka 1 participant 1 message Apr 29, 2013 3 messages not in the archive

lore
Share & tools
lore

Jan Kiszka

author
#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · Andreas Färber
Quoted 1 line

+static int at24_init(I2CSlave *i2c)

hw/i2c.c:i2c_slave_qdev_init() calls I2CSlaveClass::init only, so please use a realize function instead. Cf. hw/qdev-core.h.

Quoted 11 lines

Review

Quoted 9 lines
(quoted diff) +9 -0
+{
+    AT24State *s = DO_UPCAST(AT24State, i2c, i2c);
+    unsigned int page_size;
+    int64_t image_size;
+    int device_bits;
+    int hi_addr_bits;
+    int dev_no;
+
+    assert(AT24_MAX_PAGE_LEN <= BDRV_SECTOR_SIZE);

This should instead do error_setg(errp, "...") then.

I just noticed with my latest code that the messages set via error_setg do not make it to the terminal when initializing the device from the command line. Known issue?

Jan

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