From nobody Thu Apr 2 15:36:23 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D73E386424 for ; Fri, 27 Mar 2026 11:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774612132; cv=none; b=EJ9cQen56XxvqsMSnON6QIWDQttVxlpluUmAwZDZBsNLSc/rHMU8xoDflbVWLLvXJ9OOgpTH02hLzTTn8qfA41C4rjtkLhKx8BPPy66LCChl3s9PUGhFpVvAR4XxbHPDkP3yBMpYp9fHrZNGPCvRs96fmfsnqep7SjIjPbgTXDA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774612132; c=relaxed/simple; bh=Dd3x4WBKvhqfMwm6I/iaCaqL9LzIkZkFwPA0xsebKOQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jy1DUxERozhRbYbH/LYAC/u2+oQ+zIXfyvjQACCAYvyKtCmbk2IY0y2RX/n+pZaton/mBPksr0mBtJXjMynqZvfsRxOwfbV6sB3g5l4Q9umSMBKmDr36ln3szeULk6ZtDP+HncyuJ/ASMMTwcZqCbp2hr9/oj0X8zm96/AkBCA0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AlmseoMS; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AlmseoMS" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-48374014a77so24420955e9.3 for ; Fri, 27 Mar 2026 04:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774612130; x=1775216930; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SlDICnktaJaM8Uj3TXIg53Glb9nXu0vfJwdqBVHvmvg=; b=AlmseoMS9EOPtt8zjmdimJUMNfBM6/teHhLrvQusdX9lZtVfXrflsWCNu63T8zEAJJ 9BNsODWkS23rnwDXXGPfL9dEoau5V1BMpICRuWnTKO7gzhb3UuHu0Csicqgv6oR3NhZF JSBZ6E7YURtKwEm4uC96s45Kh5a8hhQZ9+bHO8LS59la4mdrrkh0x1NBVO1dwwxYUQ5R h7J9UcLUmr6er3doxJjPgrG0rg88Z9515UjiHgivWDjc3ZY3BHrsJbHpx2G8gHoozv4U lb45SKkSKrYfrOr9g93vixSh0u9ZyO/HlVrO96Vbu4azSsxLvyU7hcA4yzcjbb+TuiFk MEyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774612130; x=1775216930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SlDICnktaJaM8Uj3TXIg53Glb9nXu0vfJwdqBVHvmvg=; b=FPdZJ0W36zbeuAYg7a9HvuJzv58ZdnOAJP5iz+SgZ2d+l3QVgdlHyaxG2AKZuwdC0K yF2q46UCO7ekXCt1anGjU/OB4b5v5JxZHssIiIQCFJewzRGkkgNl93CmodaoPDotcbBk nl/o7+4qF5H8LguPu4AlqPZ9shOnM3GTEJ+ObI92SAV3RCArK8y1kxA9XpiXSRCqUBGz NRHvGA/ZHAX7o7UovQ3FMG68ka0HF3+3VfKGc+Qc76R7l/sl3dhPlOYo1GUhrLCu5AWk G3UhzXborX38VKHU6o2Z6UxooJNU/XHK9D5PV0+6AIgPkI4AV5KteCwg6xpPLMkjswNA QCVw== X-Forwarded-Encrypted: i=1; AJvYcCU/SE8G509pBQgLFRDWRLNDcc9F5REySvkV1SdQYSlbdaGS7D7G9en1a/phrececH8qg4mnLYJxnFYNzTs=@vger.kernel.org X-Gm-Message-State: AOJu0YxHMKcwougCfCFF3RfmwMfHxOR4x0cWwDvrV/C/egwpAyCQEx9a TubtQ8518SmOdGm9BkRbKwnJeHPSxzT/GOu2klYW7yHP6CX6dYeeuIfJ X-Gm-Gg: ATEYQzwFINHtIvgAWEV+gOVhy6d802oYlRgUw0/UFX8VIwBqA8EDSynpGhYwuFm+YE1 2GddM0mq8OlelPOxDB7KFhSpYMv4S9uRfjR0COKuffHWLw2XexoEgRvrfoht6sC54qmzt0+24O+ K1zD3pWuQHistzuLJHFsmO4m0eONDYOppAasTiOC+8a8EelvxtXsi07ddLmSNYVXuMPsc83AbL4 3B8QGZ/FN0BM/RF70ex+014ZuclPQbiMmBCL05NGfcu4SEuW//Wq4NjpTSyl1tEnKiY2+eHPBpp tn+vwAPRVfjjGtniqO4TpVXql2hQHL335ihSFs21hIcMdBBc70OnIpW2W1zi8biVBx+eeZolJak 9GeVPqMtTrZUwQyQhwxBVVQ7TOLDHfo9D2QUY+yDCEy8l7hLZL34YR2Lkfx3ipITvqAhwc2NVuW mw00rDGrRU3JgjAMQZcySleKkjT7CK4nTmMewMr3VMBHPiFqjNd7iRuDpNaeSXkYe2unTNBENT5 gU9FxsbA94JJg9VSya/f/abMw== X-Received: by 2002:a05:600c:c8f:b0:487:21c7:2885 with SMTP id 5b1f17b1804b1-48727d45a8emr36404505e9.5.1774612129939; Fri, 27 Mar 2026 04:48:49 -0700 (PDT) Received: from iris-Ian.fritz.box (p200300eb5f28a7005a7787565d4257d0.dip0.t-ipconnect.de. [2003:eb:5f28:a700:5a77:8756:5d42:57d0]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48722d49c18sm90506115e9.14.2026.03.27.04.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 04:48:49 -0700 (PDT) From: iansdannapel@gmail.com To: linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mdf@kernel.org, yilun.xu@intel.com, trix@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org, heiko@sntech.de, marex@nabladev.com, prabhakar.mahadev-lad.rj@bp.renesas.com, dev@kael-k.io, Ian Dannapel , Conor Dooley , Alexander Dahl Subject: [PATCH v6 1/3] dt-bindings: vendor-prefix: Add prefix for Efinix, Inc. Date: Fri, 27 Mar 2026 12:48:39 +0100 Message-ID: <20260327114842.1300284-2-iansdannapel@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260327114842.1300284-1-iansdannapel@gmail.com> References: <20260327114842.1300284-1-iansdannapel@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ian Dannapel Add entry for Efinix, Inc. (https://www.efinixinc.com/) Signed-off-by: Ian Dannapel Acked-by: Conor Dooley Acked-by: Alexander Dahl --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Docum= entation/devicetree/bindings/vendor-prefixes.yaml index ee7fd3cfe203..dd3837500915 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -481,6 +481,8 @@ patternProperties: description: Emtop Embedded Solutions "^eeti,.*": description: eGalax_eMPIA Technology Inc + "^efinix,.*": + description: Efinix, Inc. "^egnite,.*": description: egnite GmbH "^einfochips,.*": --=20 2.43.0 From nobody Thu Apr 2 15:36:23 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EE6938F647 for ; Fri, 27 Mar 2026 11:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774612135; cv=none; b=P2rgdPBI2B1UbViG3kGSgtjrC2g9415mnYLH+L62DVFWOjL/k/Jxz6gmJxMrMu9D35zohrHkD1XSxhVOARufkbElt45LKtOszN4FjlSaurzZ8avw1u/1XTiEMNbY6dOoIzCrelOx3hvrDeMOY1R0mIt/4YtcUlW3MreCnYU6/aI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774612135; c=relaxed/simple; bh=sp/IhDBmUKnNkZq4UW3TtZjgx9RAlyfRMXoZdagEuIg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rCNtBXKaQN4M8VXGwJZSrD9GVgmGb/3F0Qr7SOrzBtIVR1+7+qs51s4xF8kA0/QMIB+2aNDamUynsiYn4a6iFBYlOYukKxbeYl/zccBpgm+f4fKsXa4EMV8fB9aEssS8j2ZOq/5wv8Md7jzbrihjz2l9WzEYPtJ4HuRBVyNJUPY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=huvlQWQO; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="huvlQWQO" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-486fd3a577eso17939535e9.1 for ; Fri, 27 Mar 2026 04:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774612132; x=1775216932; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hmqha9k/Jw7r6pvW2ms6JnuZxlOdkxkRhbawPY0Y7FI=; b=huvlQWQObB5l7oFaJ8JSkM0FHitiZiQktq5euRBTWQIVCdolbTdiiBcPEPUd2fUMDO TlqIk87sNpXpdqL0YiKdI3fox+vwyI0+q02+C8XclhYPwEcAwk0NSRuVYqUx5wjqsKWH tFHJOUMqtYKyuXnYV8bcKCCggx2seP7VxtYe34BMl+YtqaBfjFan5PtXtYJ0TQ0l30kN hNnl0Dsqb2QkE61oXPVEg9FiEpSv63xUEBENgGEcS2kzsTgK/mxJ1ltyjECAj6buTdPY rPb6nMF+gRB13x+cySXNQoBhgXVPE7sOxNi15Kh77WLEFSj2EtehG/vLh+Oo7mMRMMmL p0JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774612132; x=1775216932; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Hmqha9k/Jw7r6pvW2ms6JnuZxlOdkxkRhbawPY0Y7FI=; b=Vqs/lc7w/zJCwDLHRvK1WQ4CoQq+ezi9Yv5AnyjRm1aUQgqrPgT6WlqyXmrvDKdXzZ kyh14jT1YLdiWIJSNd6GVkafYTArIkpKcNb6nBAw4R7hwAY/IPsBpYIHwrNDcuEyvwUU mOYpv9bhmmLDmyZIpJHn6BHsfc9bvpgTMBL/rS+cycD74hH6NA55w3xtBztQgWtg12Eq KwY7sn5LslHu6bt7jvK9vnMbFR70BTMQsU9UI4OlMpo5cJt68JB7Hya3N/R+ZtZDOOUm mYxoDaPCm8yBAWOSGEk2iy1i4eNmmruNUVf5Uwcan4K4OjEnuU5h6MvsIu+++WtfkAHl 4CSw== X-Forwarded-Encrypted: i=1; AJvYcCXamWat8zqY9mlQAF0NdtLE5iUd+E5arKAI6d0ZEZHOa0nZbkkFMaq/iYZxjPIrGLhNgRn9FtgXBu0GsC8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxq8XKW3Si6alV+h8SeWk649OU+7ggnCTsbHqsWHn05my3ygazW ADQDtMjTOgBmr7ejv9MyA9N3xGzBHRNaXD9K/x0XSKT3o306jmd/q3h8 X-Gm-Gg: ATEYQzyBcSFU4Is44OjmAI8B36d1aOW9I6TuP6+6kRi80cFSswSQTnoWBC8HFo/0KRn TNq/trxM6iBm2SXLwNLk76MyguYWdmkmDRY3jlIhnohrgQqJhup4fQBoGPzRSHBO2Tru27ONU3m pwdl8P8G1MUbC0T6b3evUnNK8dXEtqjvojtC1w07p0MbjFBBI0RYnNTkK4Srl/qQd0754hAYELj gxbzxu9v1ssKDMaIihvkVv0fgQt10uvzGLVMNTG8BrnBLgBKHQTpbHzqiFxvcbmj0JLseeT9hJJ aNw7Vjj6fFnBwwJw/xtMdB0Zok87gKAaqIBD/wMz6Tz45xdsYHW26kBtl9JJYj1CjIdN4FZRXv9 NpP7Eb3V5w7mdTrN3yDgwJETjAEVuMSSX1EGljFXL0AwS/Cl9wkL757JjIABoYLZtj88skonr7g IZ2M7Qk6a2NE8pJhTTO+OANRnZkpf0vxZbpzAFf67zX0Fz0EssLrdECJQRVPXdvx3H3Xpt6Ajc0 AIQIS8zrXCViY+g65WNcZLNnw== X-Received: by 2002:a05:600c:6287:b0:485:3b5b:eb8 with SMTP id 5b1f17b1804b1-48727ef6617mr34445785e9.26.1774612132393; Fri, 27 Mar 2026 04:48:52 -0700 (PDT) Received: from iris-Ian.fritz.box (p200300eb5f28a7005a7787565d4257d0.dip0.t-ipconnect.de. [2003:eb:5f28:a700:5a77:8756:5d42:57d0]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48722d49c18sm90506115e9.14.2026.03.27.04.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 04:48:51 -0700 (PDT) From: iansdannapel@gmail.com To: linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mdf@kernel.org, yilun.xu@intel.com, trix@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org, heiko@sntech.de, marex@nabladev.com, prabhakar.mahadev-lad.rj@bp.renesas.com, dev@kael-k.io, Ian Dannapel Subject: [PATCH v6 2/3] dt-bindings: fpga: Add Efinix SPI programming bindings Date: Fri, 27 Mar 2026 12:48:40 +0100 Message-ID: <20260327114842.1300284-3-iansdannapel@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260327114842.1300284-1-iansdannapel@gmail.com> References: <20260327114842.1300284-1-iansdannapel@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ian Dannapel Add device tree bindings documentation for configuring Efinix FPGA using serial SPI passive programming mode. Signed-off-by: Ian Dannapel --- .../bindings/fpga/efinix,trion-config.yaml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/efinix,trion-con= fig.yaml diff --git a/Documentation/devicetree/bindings/fpga/efinix,trion-config.yam= l b/Documentation/devicetree/bindings/fpga/efinix,trion-config.yaml new file mode 100644 index 000000000000..7e84397e242c --- /dev/null +++ b/Documentation/devicetree/bindings/fpga/efinix,trion-config.yaml @@ -0,0 +1,96 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/fpga/efinix,trion-config.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Efinix SPI FPGA Manager + +maintainers: + - Ian Dannapel + +description: | + Efinix FPGAs (Trion, Topaz, and Titanium families) support loading bitst= reams + through "SPI Passive Mode". + Additional pin hogs for bus width configuration should be set + elsewhere, if necessary. + + References: + - https://www.efinixinc.com/docs/an006-configuring-trion-fpgas-v6.3.pdf + - https://www.efinixinc.com/docs/an033-configuring-titanium-fpgas-v2.8.p= df + - https://www.efinixinc.com/docs/an061-configuring-topaz-fpgas-v1.1.pdf + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + oneOf: + - items: + - enum: + - efinix,titanium-config + - efinix,topaz-config + - const: efinix,trion-config + - const: efinix,trion-config + + spi-cpha: true + + spi-cpol: true + + spi-max-frequency: + maximum: 25000000 + + reg: + maxItems: 1 + + reset-gpios: + description: + reset and re-configuration trigger pin (low active) + maxItems: 1 + + cdone-gpios: + description: + optional configuration done status pin (high active) + maxItems: 1 + +required: + - compatible + - reg + - reset-gpios + +unevaluatedProperties: false + +examples: + - | + #include + spi { + #address-cells =3D <1>; + #size-cells =3D <0>; + cs-gpios =3D <&gpio5 13 GPIO_ACTIVE_LOW>; + fpga-mgr@0 { + compatible =3D "efinix,trion-config"; + reg =3D <0>; + spi-max-frequency =3D <25000000>; + spi-cpha; + spi-cpol; + reset-gpios =3D <&gpio4 17 GPIO_ACTIVE_LOW>; + cdone-gpios =3D <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + }; + - | + #include + spi { + #address-cells =3D <1>; + #size-cells =3D <0>; + cs-gpios =3D <&gpio5 13 GPIO_ACTIVE_LOW>; + fpga-mgr@0 { + compatible =3D "efinix,titanium-config", "efinix,trion-config"; + reg =3D <0>; + spi-max-frequency =3D <25000000>; + spi-cpha; + spi-cpol; + reset-gpios =3D <&gpio4 17 GPIO_ACTIVE_LOW>; + cdone-gpios =3D <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + }; +... --=20 2.43.0 From nobody Thu Apr 2 15:36:23 2026 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 987E138F923 for ; Fri, 27 Mar 2026 11:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774612138; cv=none; b=mRbg/fpyMQ62kLZyPeHOreJPUdipamDitRZuuXGKpOXzNoRo6/V5qQU90tHJc+F+L4NOKV8Afax+FbIOXVhGzIPdWo1VH/8LrH8LBlcUIsZgMvPZlrCdmfGdsZpdW8Rrk3e+ua1O1i5Fq90DElJXvcOEKZ8V2f82CZxaKBST5+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774612138; c=relaxed/simple; bh=KVNBLzsJSlo69J81bVVT04FUHX00uKtaPw+6RZMH99o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jmKTOLIhwzApRbEpAsVkqaGMHuxdTdWp2jodaIoAdyF6p8vvWcAlfq+43upTYqnTeUEQ/6uqfLDvk2o+LNEzcAJrLpX8MTcFkn/0xgMGBs1goKVBWuoE8MVGQfRHUulMUr7IRqOt2hUTYbA5uLktPiaqiwJ7mTRr55dz1ONvjP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DXA7dLMR; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DXA7dLMR" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-486fb439299so19108595e9.0 for ; Fri, 27 Mar 2026 04:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774612135; x=1775216935; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JFBGm0691jNrch3w/l7G28yS+4rdPlF/SBkrUrWasg8=; b=DXA7dLMR1k6tw3d1/z1uBZ1oQ9tRXkDwMtpkoJWSC8PsLSV4qVuzw9AMFI00kZ8pmk /U1lq8Lc68Webbdup3Tazy6byCUtScb7lUOMQV4pvI2P/7i6VDiNboRTSzf8888D5gEC A2+SsgtDBbDpvTIVFPCGTzJlQmvAcMGlFZGOXC9vryTix06w+5pVweAIpQjIE9L+FYp4 SiwFS0hgMrn2H+6TT09jz17HeVE75PGrHC72pSy0KSrtoaxJB/I05FzbpuHa5Sa2lLXW YqJg2xnpRT+nM1c1iDZA+egAHTZwLvz7o/JOauQSyw4BXyU7DR/XuqbQmaql+mY7r/NX sCVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774612135; x=1775216935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JFBGm0691jNrch3w/l7G28yS+4rdPlF/SBkrUrWasg8=; b=RsCqA9/X3uFnGxfRgy0TDKBz4LzLMzW53tMeZd7iX1J8ur/dsa1O7c4kfE8IUuDz6u n8G5jE3f2mN3XJNjNOudmi1lkWnSCJRkg3J+zhiBwaXVaAz7R5JO4UDw5Wt1gRGf+dRu 8JF/TuHUgfvSqKUOT7O3PfPla/On2uQqLMnVifyW7rpgsLt3P2S7OdGzpafn/4yEc8lu rsovsZOtXWmXB7LqexbFiTLdwvWR+5QNvcZAuzrC0fArfUXd591cGhHIuSQ6JrMRdXfg SccXCYF4zzV+qwc6JXxdypigrVWobma5LkTu6zUUDos84YdVupSZNA6yySE+8sB3Knox 3Ifw== X-Forwarded-Encrypted: i=1; AJvYcCUvPERjC7obyDJ0U1coxm9iUl1Jlp/kp/o3Rtpw/sIj2K8Qr0NFeC7Wa5zZEoIJjnTWBqxAT6OV7BFhHlw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx2tCcR60l0tbXBVizMO631Aclf+fXj30X/P/coHENFwhfXuH2E GIakaHjzZXT7zQ/i67BvTh8MrXZz9zQVPOOv0ssfSc7xgog3GXhdbiFS X-Gm-Gg: ATEYQzxS0prZLybDCzdtfbkzHY8kstE3EdyHUNufcYN/euX+iL1czYsgVKaU5g2TFOV 1t+wgYu0NH5t8v9RBiFERvn0YMgLaEHrJVQdK4SEKSN5KY7josgXGbfyYwK9knP8ng7cKIUtaML AbmT2249iULXjprqEr9gzKKaUUtprLiQ5/CLkWcziiuYMIARHaE8UIIF4i3Y4MThMfxesm8aTrg 2SGmwSpxj8oRg7nZC038gHt6zhT7z951i7eqYxqHINmeKRfp4BwRnBiwQ7ckVusRbGxNviXxF35 4pVFcHLnXX0ZcxyJz+GECDp8dRu0r+HJBOBpeZ/IljJ2NLkUWRUGN2AiSecbtg3/4pjhkpffRxe xpceERUXWeNmSoWw1mzRcbUQpP2nhQ6YPUTkCUYPiAzmja7uYD4jILNM1HYMoU1Qz2GCifH2BgR LBe4Wl3uWyTvIxqyglmWXO+QfsrSKo/SQPLXbAZ5xziK5p6+ix/KSvWZwpUBEn39V1IsT+l7teh ZKuybsfr1Zj0p7FAgaWER1q3g== X-Received: by 2002:a05:600c:4e0d:b0:487:1c2:6a4f with SMTP id 5b1f17b1804b1-487280c2c50mr37164825e9.31.1774612134818; Fri, 27 Mar 2026 04:48:54 -0700 (PDT) Received: from iris-Ian.fritz.box (p200300eb5f28a7005a7787565d4257d0.dip0.t-ipconnect.de. [2003:eb:5f28:a700:5a77:8756:5d42:57d0]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48722d49c18sm90506115e9.14.2026.03.27.04.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 04:48:54 -0700 (PDT) From: iansdannapel@gmail.com To: linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mdf@kernel.org, yilun.xu@intel.com, trix@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org, heiko@sntech.de, marex@nabladev.com, prabhakar.mahadev-lad.rj@bp.renesas.com, dev@kael-k.io, Ian Dannapel Subject: [PATCH v6 3/3] fpga-mgr: Add Efinix SPI programming driver Date: Fri, 27 Mar 2026 12:48:41 +0100 Message-ID: <20260327114842.1300284-4-iansdannapel@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260327114842.1300284-1-iansdannapel@gmail.com> References: <20260327114842.1300284-1-iansdannapel@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Ian Dannapel Add a new driver for loading binary firmware to configuration RAM using "SPI passive mode" on Efinix FPGAs. Efinix passive SPI configuration requires chip select to remain asserted from reset until the complete bitstream and trailing idle clocks have been transferred, so the driver keeps CS active with cs_change and locks the SPI bus for the duration of configuration. Signed-off-by: Ian Dannapel --- drivers/fpga/Kconfig | 7 + drivers/fpga/Makefile | 1 + drivers/fpga/efinix-spi.c | 263 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+) create mode 100644 drivers/fpga/efinix-spi.c diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index 37b35f58f0df..748fc210c135 100644 --- a/drivers/fpga/Kconfig +++ b/drivers/fpga/Kconfig @@ -288,6 +288,13 @@ config FPGA_MGR_LATTICE_SYSCONFIG_SPI FPGA manager driver support for Lattice FPGAs programming over slave SPI sysCONFIG interface. =20 +config FPGA_MGR_EFINIX_SPI + tristate "Efinix FPGA configuration over SPI" + depends on SPI + help + FPGA manager driver support for Efinix FPGAs configuration over SPI + (passive mode only). + source "drivers/fpga/tests/Kconfig" =20 endif # FPGA diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile index aeb89bb13517..21eb0ef1fc2e 100644 --- a/drivers/fpga/Makefile +++ b/drivers/fpga/Makefile @@ -24,6 +24,7 @@ obj-$(CONFIG_FPGA_MGR_VERSAL_FPGA) +=3D versal-fpga.o obj-$(CONFIG_FPGA_MGR_MICROCHIP_SPI) +=3D microchip-spi.o obj-$(CONFIG_FPGA_MGR_LATTICE_SYSCONFIG) +=3D lattice-sysconfig.o obj-$(CONFIG_FPGA_MGR_LATTICE_SYSCONFIG_SPI) +=3D lattice-sysconfig-spi.o +obj-$(CONFIG_FPGA_MGR_EFINIX_SPI) +=3D efinix-spi.o obj-$(CONFIG_ALTERA_PR_IP_CORE) +=3D altera-pr-ip-core.o obj-$(CONFIG_ALTERA_PR_IP_CORE_PLAT) +=3D altera-pr-ip-core-plat.o =20 diff --git a/drivers/fpga/efinix-spi.c b/drivers/fpga/efinix-spi.c new file mode 100644 index 000000000000..5cd6de0c5411 --- /dev/null +++ b/drivers/fpga/efinix-spi.c @@ -0,0 +1,263 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * FPGA Manager Driver for Efinix + * + * Copyright (C) 2025 iris-GmbH infrared & intelligent sensors + * + * Ian Dannapel + * + * Load Efinix FPGA firmware over SPI using the serial configuration inter= face. + * + * Note: Only passive mode (host initiates transfer) is currently supporte= d. + */ + +#include +#include +#include +#include +#include +#include + +/* + * 13 dummy bytes generate 104 SPI clock cycles (8 bits each). + * Used to meet the requirement for >100 clock cycles idle sequence. + */ +#define EFINIX_SPI_IDLE_CYCLES_BYTES 13 + +/* + * tDMIN: Minimum time between deassertion of CRESET_N to first + * valid configuration data. (32 =C2=B5s) + */ +#define EFINIX_TDMIN_US_MIN 35 +#define EFINIX_TDMIN_US_MAX 40 + +/* + * tCRESET_N: Minimum CRESET_N low pulse width required to + * trigger re-configuration. (320 ns) + */ +#define EFINIX_TCRESETN_DELAY_MIN_US 1 +#define EFINIX_TCRESETN_DELAY_MAX_US 2 + +/* + * tUSER: Minimum configuration duration after CDONE goes high + * before entering user mode. (25 =C2=B5s) + */ +#define EFINIX_TUSER_US_MIN 30 +#define EFINIX_TUSER_US_MAX 35 + +struct efinix_spi_conf { + struct spi_device *spi; + struct gpio_desc *cdone; + struct gpio_desc *reset; +}; + +static void efinix_spi_reset(struct efinix_spi_conf *conf) +{ + gpiod_set_value(conf->reset, 1); + usleep_range(EFINIX_TCRESETN_DELAY_MIN_US, EFINIX_TCRESETN_DELAY_MAX_US); + gpiod_set_value(conf->reset, 0); + usleep_range(EFINIX_TDMIN_US_MIN, EFINIX_TDMIN_US_MAX); +} + +static enum fpga_mgr_states efinix_spi_state(struct fpga_manager *mgr) +{ + struct efinix_spi_conf *conf =3D mgr->priv; + + if (conf->cdone && gpiod_get_value(conf->cdone) =3D=3D 1) + return FPGA_MGR_STATE_OPERATING; + + return FPGA_MGR_STATE_UNKNOWN; +} + +static int efinix_spi_write_init(struct fpga_manager *mgr, + struct fpga_image_info *info, + const char *buf, size_t count) +{ + struct device *dev =3D &mgr->dev; + struct efinix_spi_conf *conf =3D mgr->priv; + struct spi_transfer assert_cs =3D { + .cs_change =3D 1, + }; + struct spi_message message; + int ret; + + if (info->flags & FPGA_MGR_PARTIAL_RECONFIG) { + dev_err(dev, "Partial reconfiguration not supported\n"); + return -EOPNOTSUPP; + } + + /* + * Efinix passive SPI configuration requires chip select to stay + * asserted from reset until the bitstream is fully clocked in. + * Lock the SPI bus so no other device can toggle CS between the + * reset pulse and the write/complete transfers. + */ + spi_bus_lock(conf->spi->controller); + spi_message_init_with_transfers(&message, &assert_cs, 1); + ret =3D spi_sync_locked(conf->spi, &message); + if (ret) { + spi_bus_unlock(conf->spi->controller); + return ret; + } + + /* Reset with CS asserted */ + efinix_spi_reset(conf); + + return 0; +} + +static int efinix_spi_write(struct fpga_manager *mgr, const char *buf, + size_t count) +{ + struct device *dev =3D &mgr->dev; + struct spi_transfer write_xfer =3D { + .tx_buf =3D buf, + .len =3D count, + .cs_change =3D 1, /* Keep CS asserted */ + }; + struct efinix_spi_conf *conf =3D mgr->priv; + struct spi_message message; + int ret; + + spi_message_init_with_transfers(&message, &write_xfer, 1); + ret =3D spi_sync_locked(conf->spi, &message); + if (ret) { + dev_err(dev, "SPI error in firmware write: %d\n", ret); + spi_bus_unlock(conf->spi->controller); + } + + return ret; +} + +static int efinix_spi_write_complete(struct fpga_manager *mgr, + struct fpga_image_info *info) +{ + unsigned long timeout =3D + jiffies + usecs_to_jiffies(info->config_complete_timeout_us); + struct spi_transfer clk_cycles =3D { + .len =3D EFINIX_SPI_IDLE_CYCLES_BYTES, + /* Release CS after the trailing idle clocks are sent. */ + .cs_change =3D 0, + }; + struct efinix_spi_conf *conf =3D mgr->priv; + struct spi_message message; + int done, ret; + bool expired =3D false; + u8 *dummy_buf; + + dummy_buf =3D kzalloc(EFINIX_SPI_IDLE_CYCLES_BYTES, GFP_KERNEL); + if (!dummy_buf) { + ret =3D -ENOMEM; + goto unlock_spi; + } + + /* + * Keep the bus locked while sending the trailing idle clocks, then + * let this final transfer deassert CS to terminate configuration. + */ + clk_cycles.tx_buf =3D dummy_buf; + spi_message_init_with_transfers(&message, &clk_cycles, 1); + ret =3D spi_sync_locked(conf->spi, &message); + if (ret) { + dev_err(&mgr->dev, "SPI error in write complete: %d\n", ret); + goto free_buf; + } + + if (conf->cdone) { + while (!expired) { + done =3D gpiod_get_value(conf->cdone); + if (done < 0) { + ret =3D done; + goto free_buf; + } + if (done) + break; + + usleep_range(10, 20); + expired =3D time_after(jiffies, timeout); + } + + if (expired) { + dev_err(&mgr->dev, "Timeout waiting for CDONE\n"); + ret =3D -ETIMEDOUT; + goto free_buf; + } + } + + usleep_range(EFINIX_TUSER_US_MIN, EFINIX_TUSER_US_MAX); + +free_buf: + kfree(dummy_buf); +unlock_spi: + spi_bus_unlock(conf->spi->controller); + + return ret; +} + +static const struct fpga_manager_ops efinix_spi_ops =3D { + .state =3D efinix_spi_state, + .write_init =3D efinix_spi_write_init, + .write =3D efinix_spi_write, + .write_complete =3D efinix_spi_write_complete, +}; + +static int efinix_spi_probe(struct spi_device *spi) +{ + struct efinix_spi_conf *conf; + struct fpga_manager *mgr; + + if (!(spi->mode & SPI_CPHA) || !(spi->mode & SPI_CPOL)) + return dev_err_probe(&spi->dev, -EINVAL, + "Unsupported SPI mode, set CPHA and CPOL\n"); + + conf =3D devm_kzalloc(&spi->dev, sizeof(*conf), GFP_KERNEL); + if (!conf) + return -ENOMEM; + + conf->reset =3D devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(conf->reset)) + return dev_err_probe(&spi->dev, PTR_ERR(conf->reset), + "Failed to get RESET gpio\n"); + + conf->cdone =3D devm_gpiod_get_optional(&spi->dev, "cdone", GPIOD_IN); + if (IS_ERR(conf->cdone)) + return dev_err_probe(&spi->dev, PTR_ERR(conf->cdone), + "Failed to get CDONE gpio\n"); + + conf->spi =3D spi; + + mgr =3D devm_fpga_mgr_register(&spi->dev, + "Efinix FPGA Manager", + &efinix_spi_ops, conf); + + return PTR_ERR_OR_ZERO(mgr); +} + +static const struct of_device_id efinix_spi_of_match[] =3D { + { .compatible =3D "efinix,trion-config", }, + {} +}; +MODULE_DEVICE_TABLE(of, efinix_spi_of_match); + +static const struct spi_device_id efinix_ids[] =3D { + { "trion-config", 0 }, + { "titanium-config", 0 }, + { "topaz-config", 0 }, + {}, +}; +MODULE_DEVICE_TABLE(spi, efinix_ids); + +static struct spi_driver efinix_spi_driver =3D { + .driver =3D { + .name =3D "efinix-spi", + .of_match_table =3D efinix_spi_of_match, + }, + .probe =3D efinix_spi_probe, + .id_table =3D efinix_ids, +}; + +module_spi_driver(efinix_spi_driver); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Ian Dannapel "); +MODULE_DESCRIPTION("Efinix FPGA SPI Programming Driver"); --=20 2.43.0