[PATCH qemu 2/3] ast2400: add a rtc device on I2C bus 0

Cédric Le Goater clg at kaod.org
Wed May 18 05:25:01 AEST 2016


The palmetto platform has a ds3231 RTC device but not qemu. Let's use
a ds1338 instead.

The aspeed-bmc-opp-palmetto dts file needs to be changed consequently
with :

	rtc at 68 {
		compatible = "dallas,ds1338";
		reg = <0x68>;
	};

Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 hw/arm/ast2400.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/arm/ast2400.c b/hw/arm/ast2400.c
index 4576e67cd483..41bfc74493fa 100644
--- a/hw/arm/ast2400.c
+++ b/hw/arm/ast2400.c
@@ -159,6 +159,8 @@ static void ast2400_realize(DeviceState *dev, Error **errp)
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c), 0, AST2400_I2C_BASE);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c), 0,
                        qdev_get_gpio_in(DEVICE(&s->vic), 12));
+
+    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&s->i2c), 0), "ds1338", 0x68);
 }
 
 static void ast2400_class_init(ObjectClass *oc, void *data)
-- 
2.1.4



More information about the openbmc mailing list