Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp501850rwe; Thu, 25 Aug 2022 04:29:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SFN2qFB4o3FAFBmkFdacVoU+xnsHQT1nXE5k4NGiJUuwqFw/M7PgOad0vwK7zoUeQE44L X-Received: by 2002:a17:906:730d:b0:73d:c8a1:a8ee with SMTP id di13-20020a170906730d00b0073dc8a1a8eemr2165712ejc.661.1661426968476; Thu, 25 Aug 2022 04:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661426968; cv=none; d=google.com; s=arc-20160816; b=eUbm0ITZWpdVlSDpZ2whXDzGA+9lfmqXumsOiO0Qbb4kStT8JFw69TQ+CPxlDbyUj0 W7btrF3JsmE9jJ7Aptblusc2fVSm9f882y9840WmNlSu8Kp4PIjZ6Kghye2H60QDBeQN 08+IQ9ZNDFQwNEBmfm1XDMC11D6pu6JbBu+Gmu8SfC4fy4wKzRGDy48MHzR1fEdNnAFF AjPNSrZvnpcvm2YBYpepUzbt+s8hH9LWTJe/atn36lkgHPD9aDNYIF6gPjJ2GDT8t1lp FQ1qAaJsfSKYfmQiNPBkZUCEqjKP8ShxZs8XsJEZVXjLjH06QzoCtlj9vaG4d3rK0Fc+ 1hUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HWvBxm1CnnPlyReVJ96IGh71zL+71TF9h6YSr2lFuNs=; b=ztT8gmRQD/ZezAlrZZs+kVMOJ8+5p5WPdejlwod7VcOmL3enjgLECZjBbBIxx5nMzp S2pwcxgWFtk1ZCLvt+Q1NG5hUaZxg22OYmHwPn2CUKxBQHtFmLWItTsGZkPCZVv33SIR UIcrICLnSnkymfdlbbmlfljgpGzSP+QrXO9pfuLOx+Oo+/IsX2r+L4j3Z2hJvhDrVo3W pTnJpPj4DBj3jcvF+4VvYLX7AfUNbYWxOH/muL/UOjBI7NrU9ew8X7LWGUbAFZH/lwyh s8Al3IH/r5sEb58ssiFd0R5JLsk2IdzH0GVlm8iLthlFnnjWgkZUgtIOmPwr8+LXezPt HffQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b=nawjfB4R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp28-20020a1709071b1c00b00734e0361d1esi3585060ejc.826.2022.08.25.04.29.02; Thu, 25 Aug 2022 04:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b=nawjfB4R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241596AbiHYL0g (ORCPT + 99 others); Thu, 25 Aug 2022 07:26:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238494AbiHYL02 (ORCPT ); Thu, 25 Aug 2022 07:26:28 -0400 Received: from mail.pr-group.ru (mail.pr-group.ru [178.18.215.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60FF1832EE; Thu, 25 Aug 2022 04:26:24 -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=Mv/97l15e0hqXuaF4guUD5ZlSAMRyrUECRF+IN2t5ro=; b=nawjfB4RvbtuwzE+P1/sD9DuSpSFEtd8NbnpRMTkIWqCyK2jjz4s5IOefesrZLB2D0F00ZmJFZvdZ D2vgP1tnZkrcj3lVDbLBr77tS1C/aAZkQg6jgGihILlKMYUgn3JG3PrLgq7tcorlhRhfxqME6AMqd4 f3FD9Q3wbA4ojGHG1uXtzFY6OdVakk1WIY7qaAZhVnrs846jThGF7WzCrtacL1UtDmLmSvyE9qU+UV Xxlx6Dt3I1260fCx4i0/6y8o15tybkCwvNDXYB1hHIyQ5ER+4ekFw05BQlf3UzY9IJ+zJ3/u1Tvf2M dMaOZe4EFWf9IDXQ+/UpIbgK5iMwv5Q== X-Kerio-Anti-Spam: Build: [Engines: 2.16.4.1445, Stamp: 3], Multi: [Enabled, t: (0.000010,0.010494)], BW: [Enabled, t: (0.000015,0.000001)], RTDA: [Enabled, t: (0.083994), Hit: No, Details: v2.41.0; Id: 15.52k544.1gbac0gpf.nlk; mclb], total: 0(700) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: X-Footer: bWV0cm90ZWsucnU= Received: from h-e2.ddg ([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)); Thu, 25 Aug 2022 14:25:44 +0300 From: Ivan Bornyakov To: mdf@kernel.org, hao.wu@intel.com, yilun.xu@intel.com, trix@redhat.com, dg@emlix.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: Ivan Bornyakov , linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, system@metrotek.ru Subject: [PATCH v8 0/2] Lattice sysCONFIG SPI FPGA manager Date: Thu, 25 Aug 2022 14:24:31 +0300 Message-Id: <20220825112433.14583-1-i.bornyakov@metrotek.ru> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to the FPGA manager for programming Lattice FPGAs over slave SPI sysCONFIG interface. ECP5 and MachXO2 are supported. WARNING: I only have HW with ECP5, so can't vouch for the MachXO2. MachXO2's support is based on existing machxo2-spi.c and publicly available documentation, it's not tested on real hardware. ChangeLog: v1 -> v2: * remove "spi" from compatible string * reword description in dt-bindings doc * add reference to spi-peripheral-props.yaml in dt-binding doc * fix DTS example in dt-bindings doc: 4-spaces indentations, no undersores in node names. v2 -> v3: * fix typo "##size-cells" -> "#size-cells" in dt-bindings example v3 -> v4: * dt-bindings: reword description * dt-bindings: revert props order v4 -> v5: * dt-bindings: remove trailing dot from title * dt-bindings: reword description to avoid driver reference * dt-bindings: add "Reviewed-by: Krzysztof Kozlowski" tag v5 -> v6: * ecp5-spi: lock SPI bus for exclusive usage in ecp5_ops_write_init(), release in ecp5_ops_write_complete() or on error v6 -> v7: * ecp5-spi.c -> lattice-sysconfig-spi.c. Reworked to represent generalized sysCONFIG port with implementations for ECP5 and MachXO2 * lattice,ecp5-fpga-mgr.yaml -> lattice,sysconfig.yaml. Reworked to document both ECP5 and MachXO2 sysCONFIG. * dt-bindings: remove "Reviewed-by: Krzysztof Kozlowski" tag as doc was rewritten by a considerable amount. v7 -> v8: * dt-bindings: move "program-gpios", "init-gpios" and "done-gpios" to top-level properties and disallow them for MachXO2 variant. Ivan Bornyakov (2): fpga: lattice-sysconfig-spi: add Lattice sysCONFIG FPGA manager dt-bindings: fpga: document Lattice sysCONFIG FPGA manager .../bindings/fpga/lattice,sysconfig.yaml | 109 +++ drivers/fpga/Kconfig | 7 + drivers/fpga/Makefile | 1 + drivers/fpga/lattice-sysconfig-spi.c | 630 ++++++++++++++++++ 4 files changed, 747 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/lattice,sysconfig.yaml create mode 100644 drivers/fpga/lattice-sysconfig-spi.c -- 2.37.2