From patchwork Tue Oct 20 17:19:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 7449171 Return-Path: X-Original-To: patchwork-linux-arm@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 C5D349F37F for ; Tue, 20 Oct 2015 17:21:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F00CF2083C for ; Tue, 20 Oct 2015 17:21:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E12522083B for ; Tue, 20 Oct 2015 17:21:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoaZl-0001co-Is; Tue, 20 Oct 2015 17:19:53 +0000 Received: from mail-pa0-f48.google.com ([209.85.220.48]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoaZY-0001N2-6N for linux-arm-kernel@lists.infradead.org; Tue, 20 Oct 2015 17:19:40 +0000 Received: by pabrc13 with SMTP id rc13so27021541pab.0 for ; Tue, 20 Oct 2015 10:19:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WWshOqbxlf76wOEmzTRvX3a9VAmjcxpBrsyg0acrcsQ=; b=OGqK+04Mm00Wj+woDiqLwecKd4i2ZdTGi922jFAzkVDII+1oNDeoNJmvO3L5uXDHNO 2QOj+vP6AOii5KNNbxYN0bqWU6hllayMDGMvBOnXpIxvIkOiAz7dnSHfWwhWz3Syeda0 CAxMShH4Xa34jsYn4mqgeCqWkWijhTNn96blzCOJOtNriFIOD+BXNRN8J66z7mk0PiQR x1BhQP4LHv6IdS8mlTiPxt5kWBqhj8RHAZY6jjDdPO1hflye4ERpj2fFj+rbXuUb3/ou 3PJ6iJrGxso8jZ8djqm4gAqJXbSCX0MCHdBjdL+tzo76kZSe2sCnrlaYCm2WXRE9q1Rd js6w== X-Gm-Message-State: ALoCoQlSCQ35K1mXJGrtd7UOjfOLTgc/oah2AUXRI2WZPA/A+1JVskMnu5A24CHTX2V5xABLr/ks X-Received: by 10.66.145.10 with SMTP id sq10mr5162282pab.114.1445361559499; Tue, 20 Oct 2015 10:19:19 -0700 (PDT) Received: from archbook.amer.corp.natinst.com (207-114-172-147.static.twtelecom.net. [207.114.172.147]) by smtp.gmail.com with ESMTPSA id ez1sm4800410pab.6.2015.10.20.10.19.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Oct 2015 10:19:18 -0700 (PDT) From: Moritz Fischer To: atull@opensource.altera.com Subject: [PATCHv2] fpga: zynq-fpga: Change fw format to handle bin instead of bit. Date: Tue, 20 Oct 2015 10:19:56 -0700 Message-Id: <1445361596-12024-2-git-send-email-moritz.fischer@ettus.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445361596-12024-1-git-send-email-moritz.fischer@ettus.com> References: <1445361596-12024-1-git-send-email-moritz.fischer@ettus.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151020_101940_272456_30E0FF85 X-CRM114-Status: GOOD ( 15.92 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Moritz Fischer , mike.looijmans@topic.nl, gregkh@linuxfoundation.org, michal.simek@xilinx.com, linux-kernel@vger.kernel.org, soren.brinkmann@xilinx.com, joshc@ni.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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 This gets rid of the code to strip away the header and byteswap, as well as the check for the sync word. Signed-off-by: Moritz Fischer Acked-by: Michal Simek Reviewed-by: Josh Cartwright --- v2: - Removed early exit path in case synq seq is not found --- drivers/fpga/zynq-fpga.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c index 617d382..31db550 100644 --- a/drivers/fpga/zynq-fpga.c +++ b/drivers/fpga/zynq-fpga.c @@ -287,9 +287,9 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr, struct zynq_fpga_priv *priv; int err; char *kbuf; - size_t i, in_count; + size_t in_count; dma_addr_t dma_addr; - u32 transfer_length = 0; + u32 transfer_length; u32 intr_status; in_count = count; @@ -301,26 +301,6 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr, memcpy(kbuf, buf, count); - /* look for the sync word */ - for (i = 0; i < count - 4; i++) { - if (memcmp(kbuf + i, "\xAA\x99\x55\x66", 4) == 0) { - dev_dbg(priv->dev, "Found swapped sync word\n"); - break; - } - } - - /* remove the header, align the data on word boundary */ - if (i != count - 4) { - count -= i; - memmove(kbuf, kbuf + i, count); - } - - /* fixup endianness of the data */ - for (i = 0; i < count; i += 4) { - u32 *p = (u32 *)&kbuf[i]; - *p = swab32(*p); - } - /* enable clock */ err = clk_enable(priv->clk); if (err)