[PATCH qemu 28/38] aspeed: add a temp sensor device on I2C bus 3

Andrew Jeffery andrew at aj.id.au
Mon Nov 28 13:04:48 AEDT 2016


On Tue, 2016-11-22 at 17:57 +0100, Cédric Le Goater wrote:
> On 11/18/2016 03:22 PM, Cédric Le Goater wrote:
> > Temperatures can be changed from the monitor with :
> > 
> > 	(qemu) qom-set /machine/unattached/device[2] temperature0 12000
> 
> 
> These devices should be defined at the machine level, in palmetto_bmc_init(), 
> and not at the SoC level. 

Agreed. Did you see my comments on Alistair's RTC patch along these
lines?

Andrew

> 
> C.
> 
> > > > Signed-off-by: Cédric Le Goater <clg at kaod.org>
> > ---
> >  hw/arm/aspeed_soc.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> > index 24354f700115..2aa15d90cc31 100644
> > --- a/hw/arm/aspeed_soc.c
> > +++ b/hw/arm/aspeed_soc.c
> > @@ -268,6 +268,14 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
> >      sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c), 0,
> >                         qdev_get_gpio_in(DEVICE(&s->vic), 12));
> >  
> > +    /* add a TMP423 temperature sensor */
> > +    dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&s->i2c), 2),
> > +                           "tmp423", 0x4c);
> > +    object_property_set_int(OBJECT(dev), 31000, "temperature0", &err);
> > +    object_property_set_int(OBJECT(dev), 28000, "temperature1", &err);
> > +    object_property_set_int(OBJECT(dev), 20000, "temperature2", &err);
> > +    object_property_set_int(OBJECT(dev), 110000, "temperature3", &err);
> > +
> >      /* FMC */
> >      fmc_num_cs = aspeed_fmc_get_cs(s, &err);
> >      if (err) {
> > 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20161128/a5fd5b2b/attachment.sig>


More information about the openbmc mailing list