From patchwork Fri Apr 20 17:44:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 154081 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2C783B6EEC for ; Sat, 21 Apr 2012 03:45:32 +1000 (EST) Received: from localhost ([::1]:39028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLHti-0004YP-3z for incoming@patchwork.ozlabs.org; Fri, 20 Apr 2012 13:45:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLHsk-0001gB-Bc for qemu-devel@nongnu.org; Fri, 20 Apr 2012 13:44:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLHsf-00005z-3t for qemu-devel@nongnu.org; Fri, 20 Apr 2012 13:44:29 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:49432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLHse-0008UP-Rz for qemu-devel@nongnu.org; Fri, 20 Apr 2012 13:44:25 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1SLHsL-0002rN-SM; Fri, 20 Apr 2012 18:44:05 +0100 From: Peter Maydell To: Anthony Liguori Date: Fri, 20 Apr 2012 18:44:03 +0100 Message-Id: <1334943845-10964-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1334943845-10964-1-git-send-email-peter.maydell@linaro.org> References: <1334943845-10964-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Blue Swirl , qemu-devel@nongnu.org, Paul Brook Subject: [Qemu-devel] [PATCH 2/4] versatilepb: add ds1338 rtc device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Oskar Andero Add ds1338 rtc attached on i2c. Signed-off-by: Oskar Andero Signed-off-by: Peter Maydell --- hw/versatilepb.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/versatilepb.c b/hw/versatilepb.c index 25afb1e..d011554 100644 --- a/hw/versatilepb.c +++ b/hw/versatilepb.c @@ -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);