From patchwork Wed Oct 24 07:53:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Looijmans X-Patchwork-Id: 10654319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1364813BF for ; Wed, 24 Oct 2018 07:53:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3A9629E12 for ; Wed, 24 Oct 2018 07:53:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E82A929E1A; Wed, 24 Oct 2018 07:53:45 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A2E0A29E12 for ; Wed, 24 Oct 2018 07:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: References:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZMB7954rFW6Dhs8ADiSSHPIn2ohI/WBkDxNLAp3tTq4=; b=Kgz4/Fj+RxNNvBpuN8BLPGs9UA pGhTdw4ybFIzVIqxtTwX9FYv245gQ7d0dtrUzOaOUyLi9DuRceQDJgMef5l8g1lMj3GHEuEzg3VU6 NFWcUC9UAwMEuEU7PVzl3VgRGiskNi7JZCdqoanVPiXTZnBI1txtYUf9ci0aPyggp4GrF7j+ZFNoR OdVWHBBiMI92JQU/ySx1e3vtT3dvdTnsf+0ZYBp+0U5/83KxE1yy23N4mQnQlqRGeD/IQ5xvt/BLy wzRPezZV3H5zRLSTh26/JmIPuNG5UszBSdoIvk3zwFAz94mYlwZXQN5FcR60r4DOTR3A2z9LKwpjh F+Pq/ZYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFDyu-0001sj-LX; Wed, 24 Oct 2018 07:53:32 +0000 Received: from atl4mhob08.registeredsite.com ([209.17.115.46]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFDyp-0001rN-4S for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2018 07:53:30 +0000 Received: from mailpod.hostingplatform.com (atl4qobmail03pod0.registeredsite.com [10.30.71.205]) by atl4mhob08.registeredsite.com (8.14.4/8.14.4) with ESMTP id w9O7rANW027293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 24 Oct 2018 03:53:10 -0400 Received: (qmail 14926 invoked by uid 0); 24 Oct 2018 07:53:09 -0000 X-TCPREMOTEIP: 81.173.50.109 X-Authenticated-UID: mike@milosoftware.com Received: from unknown (HELO mikebuntu.TOPIC.LOCAL) (mike@milosoftware.com@81.173.50.109) by 0 with ESMTPA; 24 Oct 2018 07:53:09 -0000 From: Mike Looijmans To: linux-fpga@vger.kernel.org Subject: [PATCH v2] zynq-fpga: Only route PR via PCAP when required Date: Wed, 24 Oct 2018 09:53:03 +0200 Message-Id: <1540367583-5413-1-git-send-email-mike.looijmans@topic.nl> X-Mailer: git-send-email 1.9.1 References: <1540276279-2903-1-git-send-email-mike.looijmans@topic.nl> In-Reply-To: <1540276279-2903-1-git-send-email-mike.looijmans@topic.nl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181024_005327_291621_AF75445D X-CRM114-Status: GOOD ( 10.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: atull@kernel.org, Mike Looijmans , linux-kernel@vger.kernel.org, michal.simek@xilinx.com, mdf@kernel.org, git@xilinx.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Xilinx Zynq FPGA driver takes ownership of the PR interface, making it impossible to use the ICAP interface for partial reconfiguration. This patch changes the driver to only activate PR over PCAP while the device is actively being accessed by the driver for programming. This allows both PCAP and ICAP interfaces to be used for PR. Signed-off-by: Mike Looijmans Reviewed-by: Moritz Fischer Acked-by: Alan Tull --- v2: Move the register setting in between the clock enable/disable drivers/fpga/zynq-fpga.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c index 3110e00..ff3a427 100644 --- a/drivers/fpga/zynq-fpga.c +++ b/drivers/fpga/zynq-fpga.c @@ -501,6 +501,10 @@ static int zynq_fpga_ops_write_complete(struct fpga_manager *mgr, if (err) return err; + /* Release 'PR' control back to the ICAP */ + zynq_fpga_write(priv, CTRL_OFFSET, + zynq_fpga_read(priv, CTRL_OFFSET) & ~CTRL_PCAP_PR_MASK); + err = zynq_fpga_poll_timeout(priv, INT_STS_OFFSET, intr_status, intr_status & IXR_PCFG_DONE_MASK, INIT_POLL_DELAY,