]> git.proxmox.com Git - mirror_qemu.git/commitdiff
versatilepb: add ds1338 rtc device
authorOskar Andero <oskar.andero@gmail.com>
Fri, 20 Apr 2012 15:38:52 +0000 (15:38 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 20 Apr 2012 15:38:52 +0000 (15:38 +0000)
Add ds1338 rtc attached on i2c.

Signed-off-by: Oskar Andero <oskar.andero@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/versatilepb.c

index 25afb1eb314efdfd70c07764dc7294d1fdb258a0..d01155406307db27c63bbb7702271730d70c6918 100644 (file)
@@ -13,6 +13,7 @@
 #include "net.h"
 #include "sysemu.h"
 #include "pci.h"
+#include "i2c.h"
 #include "boards.h"
 #include "blockdev.h"
 #include "exec-memory.h"
@@ -178,6 +179,7 @@ static void versatile_init(ram_addr_t ram_size,
     DeviceState *pl041;
     PCIBus *pci_bus;
     NICInfo *nd;
+    i2c_bus *i2c;
     int n;
     int done_smc = 0;
 
@@ -268,6 +270,10 @@ static void versatile_init(ram_addr_t ram_size,
     /* Add PL031 Real Time Clock. */
     sysbus_create_simple("pl031", 0x101e8000, pic[10]);
 
+    dev = sysbus_create_simple("versatile_i2c", 0x10002000, NULL);
+    i2c = (i2c_bus *)qdev_get_child_bus(dev, "i2c");
+    i2c_create_slave(i2c, "ds1338", 0x68);
+
     /* Add PL041 AACI Interface to the LM4549 codec */
     pl041 = qdev_create(NULL, "pl041");
     qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512);