From patchwork Fri Jun 9 22:39:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Clayton X-Patchwork-Id: 9779491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 54F4A60352 for ; Fri, 9 Jun 2017 22:40:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4657528437 for ; Fri, 9 Jun 2017 22:40:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 394412849E; Fri, 9 Jun 2017 22:40:15 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 D5D3628437 for ; Fri, 9 Jun 2017 22:40:14 +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=GnW9Mjsmi1r80t4FdGyb6zgczJQQMFm/xKdqY6JPdKA=; b=Hpf PdBId8gMtOQdlEgwHB4gGVpYoa/eKKxDx0rf3NMS+EY2n9ds/dkDf+QhquvtFc3JJszG/bzSL7tMd zLGXmYdjmvxgri8Z358SFQ1SSLhMEc5EmMhTcc7IAGhKrLg/uSksorh95yfXKioLR9QuyQKBtRj7q S2pmHrjNa+lZVrlwADNOW/MBP1VKlY8pFsuIq0JPRx86Fk0iVnnAmwLm4TRHmYZLzs0JKY/Xt7aFC Dbnh0amInFcBzYqcR2KV4jmxlbNV/i/f+hNMjKOwwnl0DbF+qTR7vAsY6DsO/q51vg5W/rs34swYH NiBmPRKgZHKcNjYQXoUH1HqcCn/UYyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dJSZh-0001j5-Oj; Fri, 09 Jun 2017 22:40:13 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dJSZe-0000VX-O5 for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2017 22:40:12 +0000 Received: by mail-pf0-x244.google.com with SMTP id y7so9865072pfd.3 for ; Fri, 09 Jun 2017 15:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=oAWwewD32POmRM8Qe3NBYKI3ZsojXsNvnrUqkHlHKH4=; b=nTrxn+di0FKGRHBvUK8BtANlgKxvuemruSk8pt+us2fhvfy5lyXjYCcCmMEHxjIXeH J8fV4YVjIV94I4DlA2hp+l895FCZc5DBI8Ngp0hqgZHMRd+7I3F0K4uYD9dPhK4I+uVK 2QkRGHaMx2eP7u36smXInZwmDyhvAb0/9qms4jLWfdoVYcF4Zkhf/NPX2ULfTsO+tIQn 1MJKzqdvcInE8C2VyMqzDJEXcLEzyOkRX9xVWmFTlZOTrccJgndUQL5UD6MHPYY9Zpbw BnJlIghiAvedfYI3W+ofEEMhErl8gAFMlmjiCAeejxZw5Rp5n0w0U02FE0Yi/3o7Parw hR7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oAWwewD32POmRM8Qe3NBYKI3ZsojXsNvnrUqkHlHKH4=; b=SNlXRYoyzInjRsGX6dPNtGfb8CNr4NK5Wa5b4F8mAZIVtqs4VwEUHouho6rS6B8O+t O73ceYVAOiZeE2IjeELQe6QNBlOQoAWaqkh/ACjhby8WPzFhis3av0du/K/Q4y2B9eAr WfHYEFPkvlsut24BvCKvunoNuKKur/n7Q03wMNNcVe2qAL3T9gFNepQbDh6hVS4PByB+ JEBiYbjR0TYZE8MEvoup1hj1yteHp6g0xdDk9TlKJmRgrEVHbZMLK+TMLCJLH7mSi3fL gdXHbeLAZZqlWU45PiWirGPcOucRNR9MO/IX53218Sq7emFuyWfLwO2KDeFao5T3gIGC ca5w== X-Gm-Message-State: AODbwcDRmrfkDzVvP+Q+X5U4GOC+znQF3nRu0GJD3z0C5bu6Ghl7oF0z nhwyFTWRBFM1pQ== X-Received: by 10.99.64.3 with SMTP id n3mr44885534pga.71.1497047989540; Fri, 09 Jun 2017 15:39:49 -0700 (PDT) Received: from localhost.localdomain (68-185-59-186.static.knwc.wa.charter.com. [68.185.59.186]) by smtp.gmail.com with ESMTPSA id s4sm4771804pgr.10.2017.06.09.15.39.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 15:39:48 -0700 (PDT) From: Joshua Clayton To: Alan Tull , Moritz Fischer , Anatolij Gustschin , Bastian Stender , Shawn Guo , Joshua Clayton Subject: [PATCH v13 1/6] fpga: Add flag to indicate SPI bitstream is bit-reversed Date: Fri, 9 Jun 2017 15:39:34 -0700 Message-Id: <03e591707dc72f4c2b5e63a1272060956294ea51.1497047816.git.stillcompiling@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170609_154010_813169_3168B594 X-CRM114-Status: GOOD ( 11.96 ) 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: Mark Rutland , devicetree@vger.kernel.org, linux-fpga@vger.kernel.org, Russell King , linux-kernel@vger.kernel.org, Rob Herring , Sascha Hauer , Fabio Estevam , 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 From: Anatolij Gustschin Add a flag that is passed to the write_init() callback, indicating that the SPI bitstream starts with LSB first. SPI controllers usually send data with MSB first. If an FPGA expects bitstream data as LSB first, the data must be reversed either by the SPI controller or by the driver. Alternatively the bitstream could be prepared as bit-reversed to avoid the bit-swapping while sending. This flag indicates such bit-reversed SPI bitstream. The low-level driver will deal with the flag and perform bit-reversing if needed. Signed-off-by: Anatolij Gustschin Signed-off-by: Joshua Clayton --- Changes since v12: - Change "depends on SPI || COMPILE_TEST" to "depends on SPI" in patch 3 include/linux/fpga/fpga-mgr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index b4ac24c4411d..01c348ca38b7 100644 --- a/include/linux/fpga/fpga-mgr.h +++ b/include/linux/fpga/fpga-mgr.h @@ -67,10 +67,12 @@ enum fpga_mgr_states { * FPGA Manager flags * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported * FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting + * FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first */ #define FPGA_MGR_PARTIAL_RECONFIG BIT(0) #define FPGA_MGR_EXTERNAL_CONFIG BIT(1) #define FPGA_MGR_ENCRYPTED_BITSTREAM BIT(2) +#define FPGA_MGR_BITSTREAM_LSB_FIRST BIT(3) /** * struct fpga_image_info - information specific to a FPGA image