From patchwork Wed Dec 16 21:45:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 557776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 33A591402BC for ; Thu, 17 Dec 2015 08:51:06 +1100 (AEDT) Received: from localhost ([::1]:49537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9JyS-0006xo-3t for incoming@patchwork.ozlabs.org; Wed, 16 Dec 2015 16:51:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9JvB-0001Sx-0Y for qemu-devel@nongnu.org; Wed, 16 Dec 2015 16:47:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9Jv6-0001JI-8E for qemu-devel@nongnu.org; Wed, 16 Dec 2015 16:47:40 -0500 Received: from mail-sn1nam02on0071.outbound.protection.outlook.com ([104.47.36.71]:37281 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Jv6-0001JC-30 for qemu-devel@nongnu.org; Wed, 16 Dec 2015 16:47:36 -0500 Received: from SN1NAM02FT035.eop-nam02.prod.protection.outlook.com (10.152.72.51) by SN1NAM02HT013.eop-nam02.prod.protection.outlook.com (10.152.73.4) with Microsoft SMTP Server (TLS) id 15.1.346.13; Wed, 16 Dec 2015 21:47:34 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none; linaro.org; 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 SN1NAM02FT035.mail.protection.outlook.com (10.152.72.145) with Microsoft SMTP Server (TLS) id 15.1.346.13 via Frontend Transport; Wed, 16 Dec 2015 21:47:34 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:48007 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1a9Jv3-0001H0-B8; Wed, 16 Dec 2015 13:47:33 -0800 Received: from [127.0.0.1] (port=54730 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1a9Jv3-0000uZ-6F; Wed, 16 Dec 2015 13:47:33 -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 tBGLgBSO030060; Wed, 16 Dec 2015 13:42:11 -0800 Received: from [172.19.74.182] (port=60246 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1a9Jv2-0000uW-Gb; Wed, 16 Dec 2015 13:47:32 -0800 From: Alistair Francis To: Date: Wed, 16 Dec 2015 13:45:13 -0800 Message-ID: <9fdf4f8bf9d08ec3993711400e79a1b7f99568f9.1450300479.git.alistair.francis@xilinx.com> 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-22004.006 X-TM-AS-Result: No--9.373-7.0-31-10 X-imss-scan-details: No--9.373-7.0-31-10 X-TMASE-MatchedRID: tVT/TTiLhCDq1YwE48CuW1z+axQLnAVBxnUMdStArZmWwmkrwBSz7/lY oV6p/cSxhVmF9kz2wxLsmLmu+LaZv4bzTO6asfbjQuFiD+xrWCyH7D1bP/FcOr5FKKSYetLBYMq SKEvXhtJPiiF3yvgxQEdWV7qYCXR1lwV2iaAfSWcURSScn+QSXt0H8LFZNFG7bkV4e2xSge7aOt udvKi275knjdO8X+QjuRNoGj5U8KqgX4QsnhRwuDZFEgw6u+Np 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)(36756003)(47776003)(85426001)(5003600100002)(19580405001)(77096005)(87936001)(5003940100001)(71366001)(19580395003)(50986999)(76176999)(50466002)(11100500001)(105606002)(2950100001)(50226001)(586003)(6806005)(86362001)(118296001)(106466001)(92566002)(33646002)(189998001)(64026002)(1220700001)(48376002)(229853001)(1096002)(110136002)(5008740100001)(5001960100002)(2351001)(81156007)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT013; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; PTR:unknown-60-96.xilinx.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT013; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046); SRVR:SN1NAM02HT013; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT013; X-Forefront-PRVS: 0792DBEAD0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2015 21:47:34.0056 (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: SN1NAM02HT013 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.71 Cc: peter.maydell@linaro.org, crosthwaitepeter@gmail.com, alistair.francis@xilinx.com Subject: [Qemu-devel] [PATCH v5 6/6] xlnx-ep108: Connect the SPI Flash 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 Connect the sst25wf080 SPI flash to the EP108 board. Signed-off-by: Alistair Francis Reviewed-by: Peter Crosthwaite --- V4: - Only add one SPI flash V3: - Don't reach into the SoC V2: - Use sst25wf080 instead of m25p80 hw/arm/xlnx-ep108.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c index 85b978f..d1912aa 100644 --- a/hw/arm/xlnx-ep108.c +++ b/hw/arm/xlnx-ep108.c @@ -33,6 +33,7 @@ static struct arm_boot_info xlnx_ep108_binfo; static void xlnx_ep108_init(MachineState *machine) { XlnxEP108 *s = g_new0(XlnxEP108, 1); + int i; Error *err = NULL; object_initialize(&s->soc, sizeof(s->soc), TYPE_XLNX_ZYNQMP); @@ -60,6 +61,21 @@ static void xlnx_ep108_init(MachineState *machine) machine->ram_size); memory_region_add_subregion(get_system_memory(), 0, &s->ddr_ram); + for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) { + SSIBus *spi_bus; + DeviceState *flash_dev; + qemu_irq cs_line; + char bus_name[6]; + + snprintf(bus_name, 6, "spi%d", i); + spi_bus = (SSIBus *)qdev_get_child_bus(DEVICE(&s->soc), bus_name); + + flash_dev = ssi_create_slave(spi_bus, "sst25wf080"); + cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0); + + sysbus_connect_irq(SYS_BUS_DEVICE(&s->soc.spi[i]), 1, cs_line); + } + xlnx_ep108_binfo.ram_size = machine->ram_size; xlnx_ep108_binfo.kernel_filename = machine->kernel_filename; xlnx_ep108_binfo.kernel_cmdline = machine->kernel_cmdline;