On 11 December 2012 22:58, Antoine Mathys <barsa...@gmail.com> wrote: > Signed-off-by: Antoine Mathys <barsa...@gmail.com> > --- > hw/ds1338.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/hw/ds1338.c b/hw/ds1338.c > index 0f88720..b4d5b74 100644 > --- a/hw/ds1338.c > +++ b/hw/ds1338.c > @@ -179,6 +179,15 @@ static int ds1338_init(I2CSlave *i2c) > return 0; > } > > +static void ds1338_reset(DeviceState *dev) > +{ > + DS1338State *s = FROM_I2C_SLAVE(DS1338State, I2C_SLAVE_FROM_QDEV(dev)); > + > + /* The clock is running and synchronized with the host */ > + s->offset = 0;
I think we need to reset ptr and addr_byte too... > + memset(s->nvram, 0, NVRAM_SIZE); > +} -- PMM