From patchwork Thu Feb 10 23:12:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 82688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 79696B7126 for ; Fri, 11 Feb 2011 10:20:05 +1100 (EST) Received: from localhost ([127.0.0.1]:44108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pnfnu-0006E3-Ny for incoming@patchwork.ozlabs.org; Thu, 10 Feb 2011 18:20:02 -0500 Received: from [140.186.70.92] (port=41198 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pnfgo-0002hq-No for qemu-devel@nongnu.org; Thu, 10 Feb 2011 18:12:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pnfgl-0003eJ-Ng for qemu-devel@nongnu.org; Thu, 10 Feb 2011 18:12:42 -0500 Received: from mail.serverraum.org ([78.47.150.89]:59729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pnfgl-0003dG-3g for qemu-devel@nongnu.org; Thu, 10 Feb 2011 18:12:39 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.serverraum.org (Postfix) with ESMTP id E332B3EEFD; Fri, 11 Feb 2011 00:12:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.serverraum.org Received: from mail.serverraum.org ([127.0.0.1]) by localhost (web.serverraum.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IUzZQ2jMa3uu; Fri, 11 Feb 2011 00:12:38 +0100 (CET) Received: from thanatos.fritz.box (91-66-128-56-dynip.superkabel.de [91.66.128.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.serverraum.org (Postfix) with ESMTPSA id 791923EEFE; Fri, 11 Feb 2011 00:12:38 +0100 (CET) From: Michael Walle To: qemu-devel@nongnu.org Date: Fri, 11 Feb 2011 00:12:01 +0100 Message-Id: <1297379530-23487-9-git-send-email-michael@walle.cc> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1297379530-23487-1-git-send-email-michael@walle.cc> References: <1297379530-23487-1-git-send-email-michael@walle.cc> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 78.47.150.89 Cc: "Edgar E. Iglesias" , Michael Walle , Alexander Graf , Richard Henderson Subject: [Qemu-devel] [PATCH 08/17] lm32: pic and juart helper functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds init functions for the PIC and JTAG UART commonly used in the board initialization. Signed-off-by: Michael Walle --- hw/lm32.h | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) create mode 100644 hw/lm32.h diff --git a/hw/lm32.h b/hw/lm32.h new file mode 100644 index 0000000..9369499 --- /dev/null +++ b/hw/lm32.h @@ -0,0 +1,31 @@ + +#include "qemu-common.h" + +static inline DeviceState *lm32_pic_init(CPUState *env, qemu_irq cpu_irq) +{ + DeviceState *dev; + SysBusDevice *d; + + dev = qdev_create(NULL, "lm32-pic"); + qdev_init_nofail(dev); + d = sysbus_from_qdev(dev); + sysbus_connect_irq(d, 0, cpu_irq); + + env->pic_env = (struct LM32PicState *)dev; + + return dev; +} + +static inline DeviceState *lm32_juart_init(CPUState *env) +{ + DeviceState *dev; + SysBusDevice *d; + + dev = qdev_create(NULL, "lm32-juart"); + qdev_init_nofail(dev); + d = sysbus_from_qdev(dev); + + env->juart_env = (struct LM32JuartState *)dev; + + return dev; +}