[PATCH qemu 3/3] ast2400: add a temp sensor device on I2C bus 3

Joel Stanley joel at jms.id.au
Wed May 18 23:29:37 AEST 2016


Hey Cedric,

On Wed, May 18, 2016 at 4:55 AM, Cédric Le Goater <clg at kaod.org> wrote:
> The palmetto platform has a tmp421 device. Qemu has not (yet). Let's
> use a tmp105 instead.
>
> The aspeed-bmc-opp-palmetto dts file should to be changed consequently
> with :
>
>         i2c2: i2c-bus at c0 {
>                 tmp423 at 4c {
>                         compatible = "ti,tmp105";
>                         reg = <0x4c>;
>                 };
>         };
>
> Temperature can be changed from the monitor with :
>
>         (qemu) qom-set /machine/unattached/device[2] temperature 12000

This takes us back to the discussion we had with the Ethernet device.
We need to make the call between emulating something that is close to
a BMC in order for us to test the OpenBMC userspace stack, and making
the Qemu model strictly follow the palmetto and barreleye machines so
we can test both the kernel and userspace.

How much does the tmp105 differ from the tmp421? Could we add a model
for the 421?

Cheers,

Joel

>
> Signed-off-by: Cédric Le Goater <clg at kaod.org>
> ---
>  hw/arm/ast2400.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/hw/arm/ast2400.c b/hw/arm/ast2400.c
> index 41bfc74493fa..d231d98a88e1 100644
> --- a/hw/arm/ast2400.c
> +++ b/hw/arm/ast2400.c
> @@ -161,6 +161,9 @@ static void ast2400_realize(DeviceState *dev, Error **errp)
>                         qdev_get_gpio_in(DEVICE(&s->vic), 12));
>
>      i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&s->i2c), 0), "ds1338", 0x68);
> +    dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&s->i2c), 2),
> +                           "tmp105", 0x4c);
> +    object_property_set_int(OBJECT(dev), 25000, "temperature", &err);
>  }
>
>  static void ast2400_class_init(ObjectClass *oc, void *data)
> --
> 2.1.4
>
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc


More information about the openbmc mailing list