From patchwork Tue Jan 19 22:35:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 8065741 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C6129F96D for ; Tue, 19 Jan 2016 22:45:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6A8D2045E for ; Tue, 19 Jan 2016 22:45:21 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 0CABC2052A for ; Tue, 19 Jan 2016 22:45:21 +0000 (UTC) Received: from localhost ([::1]:39539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLf1c-0005nI-Gn for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jan 2016 17:45:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLeud-0001AT-7I for qemu-devel@nongnu.org; Tue, 19 Jan 2016 17:38:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLeua-0003xQ-0Y for qemu-devel@nongnu.org; Tue, 19 Jan 2016 17:38:07 -0500 Received: from mail-bl2nam02on0048.outbound.protection.outlook.com ([104.47.38.48]:53056 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLeuZ-0003wp-Td for qemu-devel@nongnu.org; Tue, 19 Jan 2016 17:38:03 -0500 Received: from BL2NAM02FT016.eop-nam02.prod.protection.outlook.com (10.152.76.56) by BL2NAM02HT160.eop-nam02.prod.protection.outlook.com (10.152.76.133) with Microsoft SMTP Server (TLS) id 15.1.355.15; Tue, 19 Jan 2016 22:38:01 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none; suse.de; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by BL2NAM02FT016.mail.protection.outlook.com (10.152.77.171) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Tue, 19 Jan 2016 22:38:01 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:34506 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aLeuW-0008RI-42; Tue, 19 Jan 2016 14:38:00 -0800 Received: from [127.0.0.1] (port=41725 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aLeuV-0007iY-Ux; Tue, 19 Jan 2016 14:38:00 -0800 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u0JMWQaN015321; Tue, 19 Jan 2016 14:32:26 -0800 Received: from [172.19.74.182] (port=39738 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aLeuV-0007iV-5I; Tue, 19 Jan 2016 14:37:59 -0800 From: Alistair Francis To: Date: Tue, 19 Jan 2016 14:35:32 -0800 Message-ID: X-Mailer: git-send-email 2.5.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22054.006 X-TM-AS-Result: No--7.868-7.0-31-10 X-imss-scan-details: No--7.868-7.0-31-10 X-TMASE-MatchedRID: PRmD7Rtv+W4TM9W/O3MZkxWCVBr+Ay98PgfiGiot4kmd6MvqeSL/bKIE yyeXxq2IX63Z4CdGSRWMBuS4VWoNntqmPT8JRdq4A9lly13c/gFJxv2+zCdQ5vNhzIgXtFJV+1B ysa1PtqS/hGLQWurbj3xplYx1zCP9HYnnQdbx7N7nx2TmxvCbKCwvdvzdTlpZmyiLZetSf8mfop 0ytGwvXiq2rl3dzGQ1be24hdAp6vx4roGMQ7uV89iY6AsSmsN/vkhUzSi4/bg+/l4kSBjuEg== X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(105606002)(5003940100001)(87936001)(118296001)(575784001)(36756003)(189998001)(586003)(85426001)(5008740100001)(4326007)(106466001)(64026002)(71366001)(19580405001)(2351001)(229853001)(47776003)(86362001)(33646002)(19580395003)(48376002)(1096002)(2950100001)(77096005)(81156007)(92566002)(5001960100002)(5003600100002)(50466002)(2906002)(76176999)(11100500001)(6806005)(5890100001)(50986999)(50226001)(110136002)(1220700001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2NAM02HT160; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; PTR:unknown-60-96.xilinx.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 730f51d1-90dd-4f66-1dc9-08d32121302d X-Exchange-Antispam-Report-Test: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT160; UriScan:(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(13018025)(13017025)(8121501046)(13023025)(13015025)(5005006)(13024025)(3002001)(10201501046); SRVR:BL2NAM02HT160; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT160; X-Forefront-PRVS: 0826B2F01B X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2016 22:38:01.2616 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT160 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.48 Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v2 16/16] xlnx-zynqmp: Connect the ZynqMP IOU SLCR 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Connect the I/O Unit System Level Control Registers device to the ZynqMP model. Unfortunatly the GPIO links can not be connected yet as the SD device is not yet attached to the ZynqMP machine. Signed-off-by: Alistair Francis --- V2: - Fix up device connection hw/arm/xlnx-zynqmp.c | 13 +++++++++++++ include/hw/arm/xlnx-zynqmp.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 57e926d..a1391ba 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -33,6 +33,8 @@ #define SATA_ADDR 0xFD0C0000 #define SATA_NUM_PORTS 2 +#define IOU_SLCR_ADDR 0xFF180000 + static const uint64_t gem_addr[XLNX_ZYNQMP_NUM_GEMS] = { 0xFF0B0000, 0xFF0C0000, 0xFF0D0000, 0xFF0E0000, }; @@ -118,6 +120,10 @@ static void xlnx_zynqmp_init(Object *obj) qdev_set_parent_bus(DEVICE(&s->sdhci[i]), sysbus_get_default()); } + + object_initialize(&s->iou_slcr, sizeof(s->iou_slcr), + TYPE_XLNX_ZYNQMP_IOU_SLCR); + qdev_set_parent_bus(DEVICE(&s->iou_slcr), sysbus_get_default()); } static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) @@ -324,6 +330,13 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->sdhci[i]), 0, gic_spi[sdhci_intr[i]]); } + + object_property_set_bool(OBJECT(&s->iou_slcr), true, "realized", &err); + if (err) { + error_propagate(errp, err); + return; + } + sysbus_mmio_map(SYS_BUS_DEVICE(&s->iou_slcr), 0, IOU_SLCR_ADDR); } static Property xlnx_zynqmp_props[] = { diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 1eba937..e3a1f0b 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -22,6 +22,7 @@ #include "hw/intc/arm_gic.h" #include "hw/net/cadence_gem.h" #include "hw/char/cadence_uart.h" +#include "hw/misc/xlnx-zynqmp-iou-slcr.h" #include "hw/ide/pci.h" #include "hw/ide/ahci.h" #include "hw/sd/sdhci.h" @@ -78,6 +79,7 @@ typedef struct XlnxZynqMPState { CadenceUARTState uart[XLNX_ZYNQMP_NUM_UARTS]; SysbusAHCIState sata; SDHCIState sdhci[XLNX_ZYNQMP_NUM_SDHCI]; + XlnxZynqMPIOUSLCR iou_slcr; char *boot_cpu; ARMCPU *boot_cpu_ptr;