Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2275233pxp; Mon, 21 Mar 2022 15:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIupWuoi33Vrr88AVOhjXl9ySWoRA5wEUZQIqkc5bnOAay7ZWksHgkAjUATcgjuCM8EWe8 X-Received: by 2002:a17:902:e882:b0:154:445d:9818 with SMTP id w2-20020a170902e88200b00154445d9818mr10571816plg.40.1647902225021; Mon, 21 Mar 2022 15:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647902225; cv=none; d=google.com; s=arc-20160816; b=DQALUsmpbSOPQf0+6lzhTqzDsOuA8piZvjOQBGfMmY1lAjWPjZgtFs+Mai50sPvhs+ jzZkmtn0Pu04saNK1PCOcMqdQc7kitlatY5PbklwZvTTO/oqUO1OIqi21Tg5V2yw5Clh CT1iqM0AW+6iEpzp+KxoF9fRmiOwYeMx7LHv5Kou2WiaEui+h4NMZozDbTyj7L9LXAbW L33mqIfhfIqKjrvEfZR3yjTJDhTlbbWWrLWBvxpuni27YSog+DiewHHeIb8RWsvO6YAa UDK9yd5xTJxgWXvGLFhir+q4oQ8mfIh5p2Dd605h3qxQG+T4D5fnSpPnfrtpw+ywnWkA V/PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=eYV/3lJO+RucmEDnHepkrx7wGSiNKYG7HuPE70LkvwI=; b=BrANcZMRuwVPYgv4C846xVHdXvE1f0r753BuDCkR6jwOKYgdY4mXK6lQc98Diz2VL0 vLUJhovtDZO/4bpBcvAmlFSom5df5vUEfJRkRkPYjaIadMAlvDenM/ND9FjA7yYTU2oK QVRU95Hugf2zI6DCR8pc+Bh+CKcvAGEqE4Zt98G0I1yW+GFShhdR9UPqKA+Ote/q/mrO qM9l4em8H6ccM/OTecVpkq/zeSSvMD7kAGqtV2WnH7HSalIWnq0q4dqrc/multfTme/U MZ9YRDl6hjjAtbO94jXITcNKdptguP0MiR+x4dP08pOlrSaoylrTTzHSSbZo9mDqZQoE tHGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b=e1ailRQk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h29-20020a63531d000000b003823f33cdd2si8851547pgb.209.2022.03.21.15.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:37:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b=e1ailRQk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 747EF3BE1D2; Mon, 21 Mar 2022 14:49:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345300AbiCUIdg (ORCPT + 99 others); Mon, 21 Mar 2022 04:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345286AbiCUIda (ORCPT ); Mon, 21 Mar 2022 04:33:30 -0400 Received: from mail.pr-group.ru (mail.pr-group.ru [178.18.215.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07E995D1AA; Mon, 21 Mar 2022 01:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metrotek.ru; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding; bh=XMXNSMJsHoBcTaN7FyF3mPMBw90PZZ++kgwHn83Gnm0=; b=e1ailRQkQmG95cN3IilLUATQppKcrC2KcRViJ75hIujDdjV7sAlKaVftRWQ+XNlquCjRQa05N7cPX 4Ft9e6TaxWfSZBemw2kYVhrwv4DCGEKgKe8yhZtBRXrYr/oGFqXExe2QR1uab3toW90LXPfvktIYfC ToeMFuFxGZokY07OnP9LnB48CwG0z0MAizWLiJ5LTA5Hd170HnF6cAO088sNOtqm/uTezj6zRzOYPW kBsKtJj0alNJMR+JVobx2FPauxPpHYAE0rsAfqxfQPqjqxcWvlUAkJvPXGuHJOyThGrjRNvQ1t3fa5 5Soy3fFgt9qydwbCgYKdZVljSV+gbrQ== X-Kerio-Anti-Spam: Build: [Engines: 2.16.2.1410, Stamp: 3], Multi: [Enabled, t: (0.000008,0.007038)], BW: [Enabled, t: (0.000018,0.000001)], RTDA: [Enabled, t: (0.063542), Hit: No, Details: v2.28.0; Id: 15.52kce0.1fulpl0km.306h; mclb], total: 0(700) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: X-Footer: bWV0cm90ZWsucnU= Received: from localhost.localdomain ([85.143.252.66]) (authenticated user i.bornyakov@metrotek.ru) by mail.pr-group.ru with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Mon, 21 Mar 2022 11:31:43 +0300 From: Ivan Bornyakov Cc: Ivan Bornyakov , mdf@kernel.org, hao.wu@intel.com, yilun.xu@intel.com, trix@redhat.com, conor.dooley@microchip.com, robh+dt@kernel.org, system@metrotek.ru, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v5 0/2] Microchip Polarfire FPGA manager Date: Mon, 21 Mar 2022 11:11:58 +0300 Message-Id: <20220321081200.6912-1-i.bornyakov@metrotek.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to the FPGA manager for programming Microchip Polarfire FPGAs over slave SPI interface with .dat formatted bitsream image. Changelog: v1 -> v2: fix printk formating v2 -> v3: * replace "microsemi" with "microchip" * replace prefix "microsemi_fpga_" with "mpf_" * more sensible .compatible and .name strings * remove unused defines STATUS_SPI_VIOLATION and STATUS_SPI_ERROR v3 -> v4: fix unused variable warning Put 'mpf_of_ids' definition under conditional compilation, so it would not hang unused if CONFIG_OF is not enabled. v4 -> v5: * prefix defines with MPF_ * mdelay() -> usleep_range() * formatting fixes * add DT bindings doc * rework fpga_manager_ops.write() to fpga_manager_ops.write_sg() We can't parse image header in write_init() because image header size is not known beforehand. Thus parsing need to be done in fpga_manager_ops.write() callback, but fpga_manager_ops.write() also need to be reenterable. On the other hand, fpga_manager_ops.write_sg() is called once. Thus, rework usage of write() callback to write_sg(). Ivan Bornyakov (2): fpga: microchip-spi: add Microchip MPF FPGA manager dt-bindings: fpga: add binding doc for microchip-spi fpga mgr .../fpga/microchip,mpf-spi-fpga-mgr.yaml | 32 ++ drivers/fpga/Kconfig | 10 + drivers/fpga/Makefile | 1 + drivers/fpga/microchip-spi.c | 448 ++++++++++++++++++ 4 files changed, 491 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/microchip,mpf-spi-fpga-mgr.yaml create mode 100644 drivers/fpga/microchip-spi.c -- 2.34.1