From patchwork Tue Oct 23 06:31:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Looijmans X-Patchwork-Id: 10652747 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 70FB714BD for ; Tue, 23 Oct 2018 06:32:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4989929012 for ; Tue, 23 Oct 2018 06:32:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C0202907F; Tue, 23 Oct 2018 06:32:01 +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 702B629052 for ; Tue, 23 Oct 2018 06:32:00 +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: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:In-Reply-To: References:List-Owner; bh=CmIzEVDpuTvFrCoK0b+1FnJQ3e9lBaLPEUhqJBHgEFw=; b=Uq1 48D6vTH19Gllg+aVVykidWbIbok3XrP5RrljxsLc9rLG72CMW0uK5PyvEFb92fzrS4Tmn7UpjVpTK hu0dNlixrEWdrohqWcZZ7agM5eMOt+rGZmepfXTjJnc9DFEr1/ckQPt84KpTvouv51Ct2R8vWDBwh pH/4VHaVF96XGFdX8qfPNexoV7V2+XJW3Mi+RauwXuNEsDbGNsIR7peQqRWX6h20wmWBWCryX1PB4 /Fc+E/DNS2Y7PQ8Jd/D8u0H5VRsZHK+WJ0B1Ju032GnHaswzTK+duLoYKR7H3geyo/0x+rWlFx4UL FgEWtxDC1pH5SAu+067At9r+/YK6mHg==; 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 1gEqEH-0007uc-T5; Tue, 23 Oct 2018 06:31:49 +0000 Received: from atl4mhob04.registeredsite.com ([209.17.115.42]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEqEC-0007sl-SP for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 06:31:48 +0000 Received: from mailpod.hostingplatform.com (atl4qobmail03pod0.registeredsite.com [10.30.71.205]) by atl4mhob04.registeredsite.com (8.14.4/8.14.4) with ESMTP id w9N6VToh020598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 23 Oct 2018 02:31:29 -0400 Received: (qmail 8254 invoked by uid 0); 23 Oct 2018 06:31:29 -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; 23 Oct 2018 06:31:29 -0000 From: Mike Looijmans To: linux-fpga@vger.kernel.org Subject: [PATCH] zynq-fpga: Only route PR via PCAP when required Date: Tue, 23 Oct 2018 08:31:19 +0200 Message-Id: <1540276279-2903-1-git-send-email-mike.looijmans@topic.nl> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181022_233145_043392_932E3194 X-CRM114-Status: GOOD ( 10.27 ) 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, 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 --- 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..f6c205a 100644 --- a/drivers/fpga/zynq-fpga.c +++ b/drivers/fpga/zynq-fpga.c @@ -497,6 +497,10 @@ static int zynq_fpga_ops_write_complete(struct fpga_manager *mgr, int err; u32 intr_status; + /* Release 'PR' control back to the ICAP */ + zynq_fpga_write(priv, CTRL_OFFSET, + zynq_fpga_read(priv, CTRL_OFFSET) & ~CTRL_PCAP_PR_MASK); + err = clk_enable(priv->clk); if (err) return err;