From patchwork Tue Sep 8 16:51:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 53292 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id CC2EE22B05 for ; Tue, 8 Sep 2015 19:35:23 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf41813213wic.2 for ; Tue, 08 Sep 2015 12:35:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=7LUeTaupQQUGibeDGFPlVthHw+02OdAwNX6r6AANOLE=; b=C1BEwCAGFSKef5j+vcGru6fg4odigdwIJx+10OeYWfRp2Kc7Em9WV5UzLfPEwA6tKL QWYlRqBmZ2ln02lQtFRfXU5C8Ff9DC/82GsIY9JFxUYIwizDL2PwoXCzL7g6ITrfIzSq 0TwEdVfYMZBMJzv9VYHWQTS8wncXfEf91Fo0GvgDPJDnylFXj+Nr4hVozm6fZAuy4WBv fBiXE7HyD4fzel3HPqNsXSKyDlTzh+4KPfTS6L+uiNa1fBOdhwOadnMSWavCksJWUv+a cS87fUmXDMBfZDLoX3/P0CfuXKjNfJmsJcO31+BPyjiaymbuU/ub2Xd3ei01GtonXCIz 0SSg== X-Gm-Message-State: ALoCoQkjCzM6F7V7/DiwbNuQy/pFuVJRiZtjmS99Rfs1PJxN32YJjfGUJJAm6wegZmoxx5J02UFJ X-Received: by 10.112.132.105 with SMTP id ot9mr6953498lbb.21.1441740923079; Tue, 08 Sep 2015 12:35:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.72 with SMTP id lu8ls686601lac.66.gmail; Tue, 08 Sep 2015 12:35:22 -0700 (PDT) X-Received: by 10.112.218.42 with SMTP id pd10mr1787936lbc.114.1441740922935; Tue, 08 Sep 2015 12:35:22 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id as1si2978581lbc.94.2015.09.08.12.35.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2015 12:35:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lamp12 with SMTP id p12so74319354lam.0 for ; Tue, 08 Sep 2015 12:35:22 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr24853578lag.86.1441740922837; Tue, 08 Sep 2015 12:35:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1176108lbq; Tue, 8 Sep 2015 12:35:21 -0700 (PDT) X-Received: by 10.55.24.193 with SMTP id 62mr38411235qky.63.1441740921548; Tue, 08 Sep 2015 12:35:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a65si5110354qkh.24.2015.09.08.12.35.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 08 Sep 2015 12:35:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZMAR-0006SY-Db for patch@linaro.org; Tue, 08 Sep 2015 12:54:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZM7T-0002Sy-EF for qemu-devel@nongnu.org; Tue, 08 Sep 2015 12:51:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZM7S-0007mL-2S for qemu-devel@nongnu.org; Tue, 08 Sep 2015 12:51:43 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZM7R-0007b2-SF for qemu-devel@nongnu.org; Tue, 08 Sep 2015 12:51:42 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZZM7J-0001io-01 for qemu-devel@nongnu.org; Tue, 08 Sep 2015 17:51:33 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 8 Sep 2015 17:51:32 +0100 Message-Id: <1441731092-6513-21-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1441731092-6513-1-git-send-email-peter.maydell@linaro.org> References: <1441731092-6513-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 20/20] xlnx-zynqmp: Connect the sysbus AHCI to ZynqMP 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Alistair Francis Connect the Sysbus AHCI device to ZynqMP. Signed-off-by: Alistair Francis Reviewed-by: Sai Pavan Boddu [PMM: removed unnecessary brackets in error_propagate call] Signed-off-by: Peter Maydell --- hw/arm/xlnx-zynqmp.c | 18 ++++++++++++++++++ include/hw/arm/xlnx-zynqmp.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 6756c74..2955f3b 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -28,6 +28,10 @@ #define GIC_DIST_ADDR 0xf9010000 #define GIC_CPU_ADDR 0xf9020000 +#define SATA_INTR 133 +#define SATA_ADDR 0xFD0C0000 +#define SATA_NUM_PORTS 2 + static const uint64_t gem_addr[XLNX_ZYNQMP_NUM_GEMS] = { 0xFF0B0000, 0xFF0C0000, 0xFF0D0000, 0xFF0E0000, }; @@ -90,6 +94,9 @@ static void xlnx_zynqmp_init(Object *obj) object_initialize(&s->uart[i], sizeof(s->uart[i]), TYPE_CADENCE_UART); qdev_set_parent_bus(DEVICE(&s->uart[i]), sysbus_get_default()); } + + object_initialize(&s->sata, sizeof(s->sata), TYPE_SYSBUS_AHCI); + qdev_set_parent_bus(DEVICE(&s->sata), sysbus_get_default()); } static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) @@ -240,6 +247,17 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart[i]), 0, gic_spi[uart_intr[i]]); } + + object_property_set_int(OBJECT(&s->sata), SATA_NUM_PORTS, "num-ports", + &error_abort); + object_property_set_bool(OBJECT(&s->sata), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + + sysbus_mmio_map(SYS_BUS_DEVICE(&s->sata), 0, SATA_ADDR); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->sata), 0, gic_spi[SATA_INTR]); } static Property xlnx_zynqmp_props[] = { diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 6ccb57b..97622ec 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -22,6 +22,8 @@ #include "hw/intc/arm_gic.h" #include "hw/net/cadence_gem.h" #include "hw/char/cadence_uart.h" +#include "hw/ide/pci.h" +#include "hw/ide/ahci.h" #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \ @@ -60,6 +62,7 @@ typedef struct XlnxZynqMPState { CadenceGEMState gem[XLNX_ZYNQMP_NUM_GEMS]; CadenceUARTState uart[XLNX_ZYNQMP_NUM_UARTS]; + SysbusAHCIState sata; char *boot_cpu; ARMCPU *boot_cpu_ptr;