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

Cédric Le Goater clg at kaod.org
Mon Nov 28 20:51:24 AEDT 2016


On 11/28/2016 03:04 AM, Andrew Jeffery wrote:
> 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?

Regarding aspeed_i2c_bus_init() ? Yes but this patch was sent 
before. 

I was thinking putting these patches on hold and wait for 
Alastair's  proposal to add I2C devices to the board.


C.

> 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) {
>>>
>>



More information about the openbmc mailing list