From patchwork Tue May 25 08:48:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 447168 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp4071217jac; Tue, 25 May 2021 01:50:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx/sV9MGoO9Nu5P6Lu+Vs//sq4gXpQM4pFVXics7PRQjoUBbwMwNRrutR4xTPETw1qpUYu X-Received: by 2002:a92:c607:: with SMTP id p7mr20710242ilm.97.1621932654208; Tue, 25 May 2021 01:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621932654; cv=none; d=google.com; s=arc-20160816; b=jgilqoQ3vrMLhJyg72iVZV5fgWB/H02F7VJKA964xrdHyVpJHmdXwXrA3GOzkUu8w1 3zseZDoOmYk10kdUmG9RoF9PbuIJ2pr3fCN6C+E1CWNiYJGWzZBq8D12Q8SOZQ1JzDLV aPiHAteBwhxR5tDSknZcqpyZFGRZ2jixRj52QsozmNdmD1wwX7UuUEDPTUcqcMuk3JE7 JEOQQcUOPCUUGWt9zSZKYutRKrdYrZ3xVwlAh4GBsuYeoGqZU2ePg5L786e25NfeXhEf 8x/GgoQwZoJ573ucg+fkSwGCb66k2c+TYlW7Ci/lpCtIwMXp/nwystLhHvEVNwkndDZI Q8Aw== 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=DbMMPA0d0ePjL1VjuJjy136dZpAizIfUqGIRbEJxoo0=; b=nPZhXXXXCmNctw2hOv/oOftThhwH1NIbJrGAEPc25coqdfnnHHn1DA6Vl8F21QNzOX q2mXFColD9HordwQUeWZvEx+7e+FCytzPqREIqsq1fIyzeKWCDEo2sZJDtpo5672LJUn CfYAhML1RPkBIH2lL+706O/UZbbfyGWU+/9z1VolZts4xQGByixtvlXerzA4r7uihub/ woVhR9j+3Nam3b0wuBJ+SdewFMMxF19kMTn7kgsEbP8zGwn1JfrM5fxhOQI1qhUkx0F5 rFuw51HXOWFprKnvBctZKZPIVCA3TIPZCBpS3ofW4HjZgfsj1jAlXdQ2Mp1MT7OJulBI SqHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zqrRIKYt; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si18695108jat.35.2021.05.25.01.50.53; Tue, 25 May 2021 01:50:54 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zqrRIKYt; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbhEYIwW (ORCPT + 7 others); Tue, 25 May 2021 04:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbhEYIwV (ORCPT ); Tue, 25 May 2021 04:52:21 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5185FC061574 for ; Tue, 25 May 2021 01:50:51 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id c10so23842467lfm.0 for ; Tue, 25 May 2021 01:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DbMMPA0d0ePjL1VjuJjy136dZpAizIfUqGIRbEJxoo0=; b=zqrRIKYtlMguwPWrm3z54icYn31Nsn5WscKIpzMdrwBIJcRuPGa5o2gagNBbmHvw+d voASIjNCQJHXb4apy14uEbKiRTl3hfryQqGugFodJY3m+sqVxmDggz67No+jOWqmWRn5 kQC3LsZed1S808ULKqGZ5U5CtZyJ8PpNYdR1m7ias305HgxciAmrL61VJt2YxBvrBowo cq+5VOPjLVxX7vU4f5STTkp4zdgYUzUSS3elA4E7RAETMtXVqhgjiuzWlZsJy4XW+Ch5 /7/Xmt1wGUE4uBOuOwPnjjxrdyFEpaRmyPZLFFbbBQ7obK7DR8hiRJszZj5IWYRUXpev 6DbQ== 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:mime-version :content-transfer-encoding; bh=DbMMPA0d0ePjL1VjuJjy136dZpAizIfUqGIRbEJxoo0=; b=H9TwnSfHq5lfhFP21xNbXFE8IhO6o06hXiE32E/KuxT7XCEnjED+WM/3rZfHoWUub6 1pdrlezpaoDkgmqa7wD/TKzW7b7VEOHcTZd2dvjHF5sYd7x2IUDbPzs3Ha23wOEJugk1 gzMiVvVe3mFt2O2n+jl1qtIiIzY4RYjP4s6/Ag6fq7wLhxPn3jhaaMM8XaoW0jtQ/OvJ CwACyPN/Cccscf93jf13YUfgl7LsILofgOvakhDLSEtaKKgJmL/MLFtiCY+jqe6br4CM HuXVa7obznErPHTk+ZMTRdMS16recCIbV5mTviEslgXxBi18XwnOqgDhX5Z+KKOs2KoK ho1g== X-Gm-Message-State: AOAM531lXSbS0+gtOSBDyajqXNTWrUMfX5cdxMg/ty6DtoygIc/c6oN5 6bhjVhEk3nLEoV0T9nMesXHVLA== X-Received: by 2002:a19:7c2:: with SMTP id 185mr13422620lfh.561.1621932649539; Tue, 25 May 2021 01:50:49 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id s17sm2139991ljo.117.2021.05.25.01.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 01:50:49 -0700 (PDT) From: Linus Walleij To: linux-crypto@vger.kernel.org, Herbert Xu , "David S . Miller" , Corentin Labbe Cc: linux-arm-kernel@lists.infradead.org, Imre Kaloz , Krzysztof Halasa , Arnd Bergmann , Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 2/3 v4] crypto: ixp4xx: Add DT bindings Date: Tue, 25 May 2021 10:48:46 +0200 Message-Id: <20210525084846.1114575-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds device tree bindings for the ixp4xx crypto engine. Cc: Corentin Labbe Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Revert back to the phandle to the NPE with the instance in the cell as in v1. Use intel,npe-handle just like the ethernet driver does. - Drop the other changes related to using an u32 or reg and revert back to v1. - Keep the other useful stuff from v2 and v3. ChangeLog v2->v3: - Use the reg property to set the NPE instance number for the crypto engine. - Add address-cells and size-cells to the NPE bindings consequently. - Use a patternProperty to match the cryto engine child "crypto@N". - Define as crypto@2 in the example. - Describe the usage of the queue instance cell for the queue manager phandles. ChangeLog v1->v2: - Drop the phandle to self, just add an NPE instance number instead. - Add the crypto node to the NPE binding. - Move the example over to the NPE binding where it appears in context. --- .../bindings/crypto/intel,ixp4xx-crypto.yaml | 47 +++++++++++++++++++ ...ntel,ixp4xx-network-processing-engine.yaml | 22 +++++++-- 2 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/crypto/intel,ixp4xx-crypto.yaml -- 2.31.1 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/crypto/intel,ixp4xx-crypto.yaml b/Documentation/devicetree/bindings/crypto/intel,ixp4xx-crypto.yaml new file mode 100644 index 000000000000..9c53c27bd20a --- /dev/null +++ b/Documentation/devicetree/bindings/crypto/intel,ixp4xx-crypto.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2018 Linaro Ltd. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/crypto/intel,ixp4xx-crypto.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Intel IXP4xx cryptographic engine + +maintainers: + - Linus Walleij + +description: | + The Intel IXP4xx cryptographic engine makes use of the IXP4xx NPE + (Network Processing Engine). Since it is not a device on its own + it is defined as a subnode of the NPE, if crypto support is + available on the platform. + +properties: + compatible: + const: intel,ixp4xx-crypto + + intel,npe-handle: + $ref: '/schemas/types.yaml#/definitions/phandle-array' + maxItems: 1 + description: phandle to the NPE this crypto engine is using, the cell + describing the NPE instance to be used. + + queue-rx: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: phandle to the RX queue on the NPE, the cell describing + the queue instance to be used. + + queue-txready: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: phandle to the TX READY queue on the NPE, the cell describing + the queue instance to be used. + +required: + - compatible + - intel,npe-handle + - queue-rx + - queue-txready + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml b/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml index 1bd2870c3a9c..c435c9f369a4 100644 --- a/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml +++ b/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml @@ -26,9 +26,16 @@ properties: reg: items: - - description: NPE0 register range - - description: NPE1 register range - - description: NPE2 register range + - description: NPE0 (NPE-A) register range + - description: NPE1 (NPE-B) register range + - description: NPE2 (NPE-C) register range + + crypto: + $ref: /schemas/crypto/intel,ixp4xx-crypto.yaml# + type: object + description: Optional node for the embedded crypto engine, the node + should be named with the instance number of the NPE engine used for + the crypto engine. required: - compatible @@ -38,8 +45,15 @@ additionalProperties: false examples: - | - npe@c8006000 { + npe: npe@c8006000 { compatible = "intel,ixp4xx-network-processing-engine"; reg = <0xc8006000 0x1000>, <0xc8007000 0x1000>, <0xc8008000 0x1000>; + + crypto { + compatible = "intel,ixp4xx-crypto"; + intel,npe-handle = <&npe 2>; + queue-rx = <&qmgr 30>; + queue-txready = <&qmgr 29>; + }; }; ...