From patchwork Thu Aug 25 06:41:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peter A. G. Crosthwaite" X-Patchwork-Id: 111469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 608A0B6F70 for ; Thu, 25 Aug 2011 16:43:43 +1000 (EST) Received: from localhost ([::1]:40432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTf6-0008IT-Lz for incoming@patchwork.ozlabs.org; Thu, 25 Aug 2011 02:43:36 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTeu-00084i-Qk for qemu-devel@nongnu.org; Thu, 25 Aug 2011 02:43:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwTet-0003xx-Cr for qemu-devel@nongnu.org; Thu, 25 Aug 2011 02:43:24 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:35807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTet-0003xs-A3 for qemu-devel@nongnu.org; Thu, 25 Aug 2011 02:43:23 -0400 Received: by ywf9 with SMTP id 9so1676398ywf.4 for ; Wed, 24 Aug 2011 23:43:22 -0700 (PDT) Received: by 10.150.115.10 with SMTP id n10mr540891ybc.16.1314254602683; Wed, 24 Aug 2011 23:43:22 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id d26sm357280ybl.29.2011.08.24.23.43.19 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Aug 2011 23:43:22 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com, edgar.iglesias@gmail.com, john.williams@petalogix.com, michal.simek@petalogix.com Date: Thu, 25 Aug 2011 16:41:10 +1000 Message-Id: <1314254480-22438-5-git-send-email-peter.crosthwaite@petalogix.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1314254480-22438-1-git-send-email-peter.crosthwaite@petalogix.com> References: <1314254480-22438-1-git-send-email-peter.crosthwaite@petalogix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.45 Cc: "Peter A. G. Crosthwaite" Subject: [Qemu-devel] [RFC PATCH V1 04/14] xilinx_uartlite: Added fdt gen. platform support 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 Signed-off-by: Peter A. G. Crosthwaite --- hw/xilinx_uartlite.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/hw/xilinx_uartlite.c b/hw/xilinx_uartlite.c index 467a26c..dc2debd 100644 --- a/hw/xilinx_uartlite.c +++ b/hw/xilinx_uartlite.c @@ -218,3 +218,27 @@ static void xilinx_uart_register(void) } device_init(xilinx_uart_register) + +#ifdef CONFIG_FDT + +#include "fdt_generic_util.h" + +static int xilinx_uartlite_fdt_init(char *node_path, FDTMachineInfo *fdti, + void *unused) +{ + target_phys_addr_t base; + qemu_irq irqline; + char irq_info[1024]; + + base = qemu_devtree_getprop(fdti->fdt, NULL, node_path, "reg", 0, 0); + irqline = fdt_get_irq_info(fdti, node_path, 0, NULL, irq_info); + printf("FDT: UARTLITE: baseaddr: 0x" TARGET_FMT_plx ", irq: %s\n", base, + irq_info); + sysbus_create_simple("xilinx,uartlite", base, irqline); + return 0; +} + +fdt_register_compatibility(xilinx_uartlite_fdt_init, + "xlnx,xps-uartlite-1.00.a"); + +#endif /* CONFIG_FDT */