From patchwork Mon Jun 6 14:21:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S09OUkFEIEZyw6lkw6lyaWM=?= X-Patchwork-Id: 9158321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A9AF60573 for ; Mon, 6 Jun 2016 14:26:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48AC61FFC9 for ; Mon, 6 Jun 2016 14:26:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BC1B26490; Mon, 6 Jun 2016 14:26:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FSL_HELO_HOME, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC48B1FFC9 for ; Mon, 6 Jun 2016 14:26:21 +0000 (UTC) Received: from localhost ([::1]:42779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vTw-00079H-WA for patchwork-qemu-devel@patchwork.kernel.org; Mon, 06 Jun 2016 10:26:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vPz-00042V-5i for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:22:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9vPq-0002EQ-Vt for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:22:14 -0400 Received: from greensocs.com ([193.104.36.180]:47228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vPq-0002EC-M8 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:22:06 -0400 Received: from localhost (localhost [127.0.0.1]) by greensocs.com (Postfix) with ESMTP id 1B54213E00A2; Mon, 6 Jun 2016 16:22:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1465222926; bh=CbyLlCSw+5nf8bU5zIoK8K4U736xesra3b/Q2HpFcp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cI1QhK62zjENVFpamZO5au5XK66xcR82z0glmhxw3b+SXREW8I36J+8m+Vs6OTisM cxdl3QQHf6fFHfW4NY1uRiycby8zvGmLamq9HLttTCqubqmRO3LEUgauXi3AHcd4ow kJyidJ0a2Syw88YQm3KbmrhrOEUMm0bHbs8FBeU0= X-Virus-Scanned: amavisd-new at greensocs.com Authentication-Results: gs-01.greensocs.com (amavisd-new); dkim=pass (1024-bit key) header.d=greensocs.com Received: from greensocs.com ([127.0.0.1]) by localhost (gs-01.greensocs.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RmqZWPqsUkGf; Mon, 6 Jun 2016 16:22:05 +0200 (CEST) Received: from corsair.home (AToulouse-659-1-125-198.w90-60.abo.wanadoo.fr [90.60.180.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: fred.konrad@greensocs.com) by greensocs.com (Postfix) with ESMTPSA id 798B513E00AE; Mon, 6 Jun 2016 16:22:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1465222923; bh=CbyLlCSw+5nf8bU5zIoK8K4U736xesra3b/Q2HpFcp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dhwTXJszMqkcVxzAQruShN7pbx7AqvGBXJvx8Id7ZaP1GaJAs62bABYNebxHj1rny YV4QIw69ojWXUIVv1pBbu0JPAQB5TtofDtP876ZAXuJHuCRxWn40GWYjNISge1DPDA jw2b50W7QUqAWCz59N/nbIz1ZDqbGj7uxeGddV9o= From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org Date: Mon, 6 Jun 2016 16:21:47 +0200 Message-Id: <1465222907-19168-10-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1465222907-19168-1-git-send-email-fred.konrad@greensocs.com> References: <1465222907-19168-1-git-send-email-fred.konrad@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 193.104.36.180 Subject: [Qemu-devel] [PATCH V8 9/9] arm: xlnx-zynqmp: Add xlnx-dp and xlnx-dpdma X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, hyunk@xilinx.com, mark.burton@greensocs.com, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, guillaume.delbergue@greensocs.com, fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: KONRAD Frederic This adds the DP and the DPDMA to the Zynq MP platform. Signed-off-by: KONRAD Frederic Reviewed-by: Peter Crosthwaite Reviewed-by: Alistair Francis Tested-By: Hyun Kwon --- hw/arm/xlnx-zynqmp.c | 32 +++++++++++++++++++++++++++++++- include/hw/arm/xlnx-zynqmp.h | 4 ++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 4d504da..5069df2 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -36,6 +36,12 @@ #define SATA_ADDR 0xFD0C0000 #define SATA_NUM_PORTS 2 +#define DP_ADDR 0xfd4a0000 +#define DP_IRQ 113 + +#define DPDMA_ADDR 0xfd4c0000 +#define DPDMA_IRQ 116 + static const uint64_t gem_addr[XLNX_ZYNQMP_NUM_GEMS] = { 0xFF0B0000, 0xFF0C0000, 0xFF0D0000, 0xFF0E0000, }; @@ -135,6 +141,12 @@ static void xlnx_zynqmp_init(Object *obj) TYPE_XILINX_SPIPS); qdev_set_parent_bus(DEVICE(&s->spi[i]), sysbus_get_default()); } + + object_initialize(&s->dp, sizeof(s->dp), TYPE_XLNX_DP); + qdev_set_parent_bus(DEVICE(&s->dp), sysbus_get_default()); + + object_initialize(&s->dpdma, sizeof(s->dpdma), TYPE_XLNX_DPDMA); + qdev_set_parent_bus(DEVICE(&s->dpdma), sysbus_get_default()); } static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) @@ -364,8 +376,26 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) object_property_add_alias(OBJECT(s), bus_name, OBJECT(&s->spi[i]), "spi0", &error_abort); - g_free(bus_name); + g_free(bus_name); + } + + object_property_set_bool(OBJECT(&s->dp), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + sysbus_mmio_map(SYS_BUS_DEVICE(&s->dp), 0, DP_ADDR); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->dp), 0, gic_spi[DP_IRQ]); + + object_property_set_bool(OBJECT(&s->dpdma), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; } + object_property_set_link(OBJECT(&s->dp), OBJECT(&s->dpdma), "dpdma", + &error_abort); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->dpdma), 0, DPDMA_ADDR); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->dpdma), 0, gic_spi[DPDMA_IRQ]); } static Property xlnx_zynqmp_props[] = { diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 2332596..3067aaa 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -26,6 +26,8 @@ #include "hw/ide/ahci.h" #include "hw/sd/sdhci.h" #include "hw/ssi/xilinx_spips.h" +#include "hw/dma/xlnx_dpdma.h" +#include "hw/display/xlnx_dp.h" #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \ @@ -81,6 +83,8 @@ typedef struct XlnxZynqMPState { SysbusAHCIState sata; SDHCIState sdhci[XLNX_ZYNQMP_NUM_SDHCI]; XilinxSPIPS spi[XLNX_ZYNQMP_NUM_SPIS]; + XlnxDPState dp; + XlnxDPDMAState dpdma; char *boot_cpu; ARMCPU *boot_cpu_ptr;