From patchwork Wed Feb 22 17:22:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 655766 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 037A7C678D5 for ; Wed, 22 Feb 2023 17:22:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232602AbjBVRWw (ORCPT ); Wed, 22 Feb 2023 12:22:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232624AbjBVRWu (ORCPT ); Wed, 22 Feb 2023 12:22:50 -0500 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 793C1E3 for ; Wed, 22 Feb 2023 09:22:48 -0800 (PST) Received: by mail-lj1-x241.google.com with SMTP id a30so8713966ljr.0 for ; Wed, 22 Feb 2023 09:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=Rf0VgEByS+dEGqCN3splXKV9KTkduOfaE2qRRkUgcps=; b=USPplJAXm9cNt2GhdD0uw8AhC2hR4Y25sIj0OI55puZ4eDnsja4BaMgWyCZAKzze7k 07bgzaC2sMN2ZDLMLLRkoRyrSRmzPAeIBHhH4M/XsjOP6E5CTI0ja2myas4yCbvcC4W+ r3H6NcsZukQAFVCCWRTjjwL9pU0QW5A1hpAgL9ZigoR8Tsuo0IhVUquCWSLCzmOcKcgz fMe0hMocsBYSB9tSjHez5Ld1CCjNmrtuRlS8Ni4CuKtccYb4FXzlkoMOJ0QsJgvjDBjg pY6ct+X8R0gMgWW/McLRXfUhMtlUWmxOzvUF68cgTLl6eSlGc2x8C5IETOmQPXYu/Urk 5peA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rf0VgEByS+dEGqCN3splXKV9KTkduOfaE2qRRkUgcps=; b=nYNoVkA/Bww1GZB7V1bw92QzbtgGi9IZd5CUs/Wi6rFBhGMLRczb51zu7L1W/Z8dGj j4tVmEgeaII6+3lmc5SXASsShvlGz+hXZs5r8ZjsL3hFDjWnAHkGCEhk0AMILjyy/puC D0zlLr6B5U8FI10h4Klt+hSrDWTJRI0CrBH6CUaBLzt0SswTXHeJMkexEIdxzGCErzb4 amn8pQ9nt/Vj8utcTREX2ZicP7GFoKrMgBFJ4wdbPdo2tmkodISMIYWDjm4GRb57Me7B zl3R1/B9YHQYdBys7IyyokX0AfvQsiy+tXxfm4SLCNuySlLDRUm84bHZkLDq/TaumKnX G22A== X-Gm-Message-State: AO0yUKWyYf+JO7509/uJ1KmasfR9FknVEURzhipLs2xBbzr/zHnRTVzM Nwzv3vg1bdVrlg4THNUutad6SA== X-Google-Smtp-Source: AK7set+7jLvom9RkpViOD8GqNSSmHcCk51nJhqJTEZyCEr/P0YCLyBApHR3FkcMaoPvbvffgDaeJsw== X-Received: by 2002:a05:651c:12c2:b0:295:8bea:99a2 with SMTP id 2-20020a05651c12c200b002958bea99a2mr2995910lje.1.1677086566867; Wed, 22 Feb 2023 09:22:46 -0800 (PST) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id r3-20020a2e80c3000000b0029358afcc9esm805233ljg.34.2023.02.22.09.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 09:22:45 -0800 (PST) From: Vladimir Zapolskiy To: Krzysztof Kozlowski , Bjorn Andersson , Herbert Xu , Thara Gopinath , Bhupesh Sharma Cc: Rob Herring , Konrad Dybcio , Andy Gross , "David S. Miller" , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, Rob Herring , Jordan Crouse Subject: [PATCH v11 01/10] dt-bindings: qcom-qce: Convert bindings to yaml Date: Wed, 22 Feb 2023 19:22:31 +0200 Message-Id: <20230222172240.3235972-2-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> References: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bhupesh Sharma Convert Qualcomm QCE crypto devicetree binding to YAML. Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Tested-by: Jordan Crouse Signed-off-by: Bhupesh Sharma Signed-off-by: Vladimir Zapolskiy --- .../devicetree/bindings/crypto/qcom-qce.txt | 25 ------- .../devicetree/bindings/crypto/qcom-qce.yaml | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 25 deletions(-) delete mode 100644 Documentation/devicetree/bindings/crypto/qcom-qce.txt create mode 100644 Documentation/devicetree/bindings/crypto/qcom-qce.yaml diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.txt b/Documentation/devicetree/bindings/crypto/qcom-qce.txt deleted file mode 100644 index fdd53b184ba8..000000000000 --- a/Documentation/devicetree/bindings/crypto/qcom-qce.txt +++ /dev/null @@ -1,25 +0,0 @@ -Qualcomm crypto engine driver - -Required properties: - -- compatible : should be "qcom,crypto-v5.1" -- reg : specifies base physical address and size of the registers map -- clocks : phandle to clock-controller plus clock-specifier pair -- clock-names : "iface" clocks register interface - "bus" clocks data transfer interface - "core" clocks rest of the crypto block -- dmas : DMA specifiers for tx and rx dma channels. For more see - Documentation/devicetree/bindings/dma/dma.txt -- dma-names : DMA request names should be "rx" and "tx" - -Example: - crypto@fd45a000 { - compatible = "qcom,crypto-v5.1"; - reg = <0xfd45a000 0x6000>; - clocks = <&gcc GCC_CE2_AHB_CLK>, - <&gcc GCC_CE2_AXI_CLK>, - <&gcc GCC_CE2_CLK>; - clock-names = "iface", "bus", "core"; - dmas = <&cryptobam 2>, <&cryptobam 3>; - dma-names = "rx", "tx"; - }; diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml new file mode 100644 index 000000000000..8df47e8513b8 --- /dev/null +++ b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/crypto/qcom-qce.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm crypto engine driver + +maintainers: + - Bhupesh Sharma + +description: + This document defines the binding for the QCE crypto + controller found on Qualcomm parts. + +properties: + compatible: + const: qcom,crypto-v5.1 + + reg: + maxItems: 1 + + clocks: + items: + - description: iface clocks register interface. + - description: bus clocks data transfer interface. + - description: core clocks rest of the crypto block. + + clock-names: + items: + - const: iface + - const: bus + - const: core + + dmas: + items: + - description: DMA specifiers for rx dma channel. + - description: DMA specifiers for tx dma channel. + + dma-names: + items: + - const: rx + - const: tx + +required: + - compatible + - reg + - clocks + - clock-names + - dmas + - dma-names + +additionalProperties: false + +examples: + - | + #include + crypto-engine@fd45a000 { + compatible = "qcom,crypto-v5.1"; + reg = <0xfd45a000 0x6000>; + clocks = <&gcc GCC_CE2_AHB_CLK>, + <&gcc GCC_CE2_AXI_CLK>, + <&gcc GCC_CE2_CLK>; + clock-names = "iface", "bus", "core"; + dmas = <&cryptobam 2>, <&cryptobam 3>; + dma-names = "rx", "tx"; + }; From patchwork Wed Feb 22 17:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 655765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3695CC636D6 for ; Wed, 22 Feb 2023 17:23:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbjBVRW7 (ORCPT ); Wed, 22 Feb 2023 12:22:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232305AbjBVRWy (ORCPT ); Wed, 22 Feb 2023 12:22:54 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62D293C0E for ; Wed, 22 Feb 2023 09:22:52 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id s20so10706082lfb.11 for ; Wed, 22 Feb 2023 09:22:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677086570; 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=/cQTcEdA6/1Tvp2AynCxy/uYQRIV6AL4re0IqB5Qt5w=; b=fHuuyouzTvGCL0sWP47s89a0eK5uxjT/81Lp7+j0Bqslh/YSxDXoB8XEDpmyvIch8c V+/4PKq/0aACOzIYjBB0cpfHZnOvtoTXF8gKDJIMJ9ENo2TO8xY1aavA4CCxvTTJoxVj V1DwYI1G1hyy1wWaQZ7EpZEBbtoJUaUIbTn2lBPlpmJO9DlP8qwQliMJAl+nwEkci3nI tUng7XNoV8BFJS3VJdg18TguACaihRglbMNRruaGqc/Pgcw/M266oifMqoyVTQQzf8qQ UTZtUtz5N0LPjraSMSRG5+SAyxENnu+/TdpargPXiO+HXSQrKngdRGBb9YR2mMh7IZkV GqZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677086570; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/cQTcEdA6/1Tvp2AynCxy/uYQRIV6AL4re0IqB5Qt5w=; b=T2fkNtwX1OcrhI1AU4ncy9T7mVmGf2ziVj9E0RNKeofGTQ1W81bfKbF4xBWNVszi09 cvrlmmls6s4aJw9F80Lkuz6S//7e8j3VUVWx742ybSsIK23sFMx0UUPkgq/Xf+5g4bhW a2/eL/YDfwvJMhhpXP3WYnW8hejRT7/8ujw+avuI+oDcMzW/N5ycH6nY3hBvA2Klc1C2 Y28AUEnkdQ03xGqJQb52xuXEDFYmpNPP4isWMOTpzS0DK9BF5/hH5ehsbKe4rELotnSk UO6SiTOCNuJ4g3f8f1Mb7oZlxjai+Qau0A7yUlgx3cmeOTtf1udYkJ5tgChrbY0W3gnp CY6w== X-Gm-Message-State: AO0yUKWW7K69PmfRcXcb905O6juXRU8BCffAfcDW5PbDCk7vrVJ1rGnJ +bYm4GdwEWAPJu0IT3V0Z+w8ww== X-Google-Smtp-Source: AK7set9cQxIEC+FQ+YBVsN0qLM18D1ZUsClXkUtfswdmz9265xp3gXUVKlEVwex4GmbRawJ0r8uTfA== X-Received: by 2002:ac2:5106:0:b0:4cc:96f8:f9c2 with SMTP id q6-20020ac25106000000b004cc96f8f9c2mr3194374lfb.2.1677086570194; Wed, 22 Feb 2023 09:22:50 -0800 (PST) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id r3-20020a2e80c3000000b0029358afcc9esm805233ljg.34.2023.02.22.09.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 09:22:49 -0800 (PST) From: Vladimir Zapolskiy To: Krzysztof Kozlowski , Bjorn Andersson , Herbert Xu , Thara Gopinath , Bhupesh Sharma Cc: Rob Herring , Konrad Dybcio , Andy Gross , "David S. Miller" , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, Rob Herring , Jordan Crouse Subject: [PATCH v11 03/10] dt-bindings: qcom-qce: Add 'interconnects' and 'interconnect-names' Date: Wed, 22 Feb 2023 19:22:33 +0200 Message-Id: <20230222172240.3235972-4-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> References: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bhupesh Sharma Add 'interconnects' and 'interconnect-names' as optional properties to the device-tree binding documentation for Qualcomm crypto IP. These properties describe the interconnect path between crypto and main memory and the interconnect type respectively. Cc: Bjorn Andersson Acked-by: Rob Herring Tested-by: Jordan Crouse Signed-off-by: Bhupesh Sharma Signed-off-by: Vladimir Zapolskiy --- Documentation/devicetree/bindings/crypto/qcom-qce.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml index 8df47e8513b8..94f96ebc5dac 100644 --- a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml +++ b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml @@ -32,6 +32,14 @@ properties: - const: bus - const: core + interconnects: + maxItems: 1 + description: + Interconnect path between qce crypto and main memory. + + interconnect-names: + const: memory + dmas: items: - description: DMA specifiers for rx dma channel. From patchwork Wed Feb 22 17:22:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 655764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B472C61DA4 for ; Wed, 22 Feb 2023 17:23:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232680AbjBVRXI (ORCPT ); Wed, 22 Feb 2023 12:23:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbjBVRW7 (ORCPT ); Wed, 22 Feb 2023 12:22:59 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD7AD76B9 for ; Wed, 22 Feb 2023 09:22:55 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id e24so2357585ljj.3 for ; Wed, 22 Feb 2023 09:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677086574; 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=bNKLwBHwPw1lEE61Bg4S2Go1fSCcBOdaNH5bLSqYv1w=; b=EQLZNzI8AvFJUtLVK9f6DK297fposcITZsp2J7KwKNSZWYLlxU4w77W25G1CR7FECR yv/31F2Op++wZdwDcMPrEDRyDjOEDPcsquKOeKrkosJs7w2XGuP1AWOFvBszyDnbRHSu jDMqlFCFt0a+oL5Hz/JKj0apuqDA/wRExLYJbaISbpwi/T9m08lOgES/ZgSzdBCabFOb j9DG9+F7i6Uf+xjBcQInftSQZweSqJI313KlnB2QMg432ULvSRVns0GguqraYCtJtMcg VuMthb9hNN9Nsl+ICC/s40UfEilgEUZdKuA5K8TSoFsX4czij2Xk5Fto/2QzjcBk1Pq2 QHHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677086574; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bNKLwBHwPw1lEE61Bg4S2Go1fSCcBOdaNH5bLSqYv1w=; b=Sx8TnQc6cYU5Nc89UOCTmOKLAQNU+fTJoR6jQSeLo/+Xqw/n/4NO3GYvBeA1nFaoQj pVInVy14GBiICXONOpF5CZnvjrnH04rSiqGe1LmXdYE2ZYsbP8nZF2tzlLthxx2WzjWi eEgrc8MxuijmBv7/pNwyA8G1ig9U/x+AzK3qVdQTAqxp+VFMjfwioGFMkaO4dcqCFa5j YshxbPUmTJT6GYYx/LB+u0t+TAyZ5z1yVvyVNAmjsGsduPI0mCJc79WAOSltYGNho10L RZZy6txucHRWtKERDvcpFzF7A6h4szkVwokabEtgIjJcw6B2WEseFXelPmoUHbYtxs2H wofg== X-Gm-Message-State: AO0yUKW1C/uaUDYzh1YZsX/EEakYnAR6aoC390foEpYem6cbTAgsOZA4 s2+LaEGupXzJJewuviEquqUHAQ== X-Google-Smtp-Source: AK7set8IqwOJCZ/gUltz5168tjCvqYLrDlXIy85IPgsxTpPrdxapHrvrE8RxvjWTYrve8QPNPjfM+Q== X-Received: by 2002:a2e:3008:0:b0:294:70b7:ff90 with SMTP id w8-20020a2e3008000000b0029470b7ff90mr3027118ljw.0.1677086573884; Wed, 22 Feb 2023 09:22:53 -0800 (PST) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id r3-20020a2e80c3000000b0029358afcc9esm805233ljg.34.2023.02.22.09.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 09:22:52 -0800 (PST) From: Vladimir Zapolskiy To: Krzysztof Kozlowski , Bjorn Andersson , Herbert Xu , Thara Gopinath , Bhupesh Sharma Cc: Rob Herring , Konrad Dybcio , Andy Gross , "David S. Miller" , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, Neil Armstrong , Krzysztof Kozlowski Subject: [PATCH v11 05/10] dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP Date: Wed, 22 Feb 2023 19:22:35 +0200 Message-Id: <20230222172240.3235972-6-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> References: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Introduce a generic IP family compatible 'qcom,qce' and its two derivatives based on SoC names rather than on IP versions. Having a generic compatible is only partially sufficient, the QCE IP version can be discovered in runtime, however there are two known groups of QCE IP versions, which require different DT properties, these two groups are populated with SoC based compatibles known at the moment. Keep the old compatible 'qcom,crypto-v5.1' and document an existing and already used but not previously documented compatible 'qcom,crypto-v5.4' for backward compatibility of DTB ABI, mark both of the compatibles as deprecated. The change is based on the original one written by Bhupesh Sharma, adding a generic family compatible is suggested by Neil Armstrong. Cc: Bhupesh Sharma Cc: Neil Armstrong Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vladimir Zapolskiy --- .../devicetree/bindings/crypto/qcom-qce.yaml | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml index 4e00e7925fed..84f57f44bb71 100644 --- a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml +++ b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml @@ -15,7 +15,32 @@ description: properties: compatible: - const: qcom,crypto-v5.1 + oneOf: + - const: qcom,crypto-v5.1 + deprecated: true + description: Kept only for ABI backward compatibility + + - const: qcom,crypto-v5.4 + deprecated: true + description: Kept only for ABI backward compatibility + + - items: + - enum: + - qcom,ipq6018-qce + - qcom,ipq8074-qce + - qcom,msm8996-qce + - qcom,sdm845-qce + - const: qcom,ipq4019-qce + - const: qcom,qce + + - items: + - enum: + - qcom,sm8250-qce + - qcom,sm8350-qce + - qcom,sm8450-qce + - qcom,sm8550-qce + - const: qcom,sm8150-qce + - const: qcom,qce reg: maxItems: 1 @@ -70,7 +95,7 @@ examples: - | #include crypto-engine@fd45a000 { - compatible = "qcom,crypto-v5.1"; + compatible = "qcom,ipq6018-qce", "qcom,ipq4019-qce", "qcom,qce"; reg = <0xfd45a000 0x6000>; clocks = <&gcc GCC_CE2_AHB_CLK>, <&gcc GCC_CE2_AXI_CLK>, From patchwork Wed Feb 22 17:22:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 655763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4286C678D5 for ; Wed, 22 Feb 2023 17:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbjBVRXQ (ORCPT ); Wed, 22 Feb 2023 12:23:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232302AbjBVRXG (ORCPT ); Wed, 22 Feb 2023 12:23:06 -0500 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61B8BAD09 for ; Wed, 22 Feb 2023 09:23:00 -0800 (PST) Received: by mail-lj1-x236.google.com with SMTP id f16so8549140ljq.10 for ; Wed, 22 Feb 2023 09:23:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=MKtgUKcE8D4PdOsG4pco92R7REX4loOPN7r7BcAijX4=; b=bgw+D02vIBGlqTMX5kxPekSLrBSjn2WYXpjJnhq/cFXXJkA7vIfZbkVAhGy1sIwLlo ZxR0rzVfZDBr1SJuqEuP8wQP0DuQxNDuZdY1DA4YGMva270rtGF5ycraO36nJwb6CCum 3B8R8mv7YnWhnbAX64jvQTN+GL9Swp/h+CBuL5MOtpapuCWPpY8SE9DARVNCHLY0QNYe IGrOE/9w3FiBAgiFbK9nTtuI9mNp+krdW6rBhBAW0vEzuyDYYt79jSRXAQetdJtL0aSy OJ/MpxBu67g4Ya2o2BpiVKYIa3GA576bUJotpt+RLI6vBEYrTkhrq9yi6605YUe7w3+Q gUVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MKtgUKcE8D4PdOsG4pco92R7REX4loOPN7r7BcAijX4=; b=c+UDzbbGsTkkLS4MAxRd4pavW9tG3D2EsyenzZR/qAd4PQx/ArL5kCdIOfA0ZeUaNz qPjNHccopMg5UTd4WUYkmlCOB/8aD20BGZThcNcAP7GvJM7JTx66O3k1Fxs73mVvJ3be orMFnlGgi8rahNPZrkMzXCYxqu/NYq9g1a7P9csBA6hlM8yTHeIJyFQD0X29ZGQn6J6t tbG86U312HiSBrS7p8PZF625SFCCxDBs1Qi1jOPWkl4R2QC21MuwD9+MuVaRlcH3UYn1 6jVPE3roHyDc13rv5kNHgesSKzhRHpuXB9ugRf9cRLB2ChIZCrnoClx3+ewuxCLFVyHB eTPw== X-Gm-Message-State: AO0yUKWef4DQpoQOHMGDF0ZLa9ryjP218BJYWSkuyIaae+ZsApvQK62v 9swCWF2THOZqV34emeVZXa0+CQ== X-Google-Smtp-Source: AK7set+hLbqPJHD4L8hIu7kc4tqcoexO6btD0vYTbBci0azcqWgIFyiqQGoRqAHYMkAAdhe931sHgA== X-Received: by 2002:a2e:bd03:0:b0:293:4ba3:3013 with SMTP id n3-20020a2ebd03000000b002934ba33013mr3459107ljq.5.1677086579768; Wed, 22 Feb 2023 09:22:59 -0800 (PST) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id r3-20020a2e80c3000000b0029358afcc9esm805233ljg.34.2023.02.22.09.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 09:22:58 -0800 (PST) From: Vladimir Zapolskiy To: Krzysztof Kozlowski , Bjorn Andersson , Herbert Xu , Thara Gopinath , Bhupesh Sharma Cc: Rob Herring , Konrad Dybcio , Andy Gross , "David S. Miller" , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, Jordan Crouse Subject: [PATCH v11 08/10] crypto: qce: core: Add support to initialize interconnect path Date: Wed, 22 Feb 2023 19:22:38 +0200 Message-Id: <20230222172240.3235972-9-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> References: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Thara Gopinath Crypto engine on certain Snapdragon processors like sm8150, sm8250, sm8350 etc. requires interconnect path between the engine and memory to be explicitly enabled and bandwidth set prior to any operations. Add support in the qce core to enable the interconnect path appropriately. Tested-by: Jordan Crouse Signed-off-by: Thara Gopinath [Bhupesh: Make header file inclusion alphabetical and use devm_of_icc_get()] Signed-off-by: Bhupesh Sharma [vladimir: moved icc bandwidth setup closer to its acquisition] Signed-off-by: Vladimir Zapolskiy --- drivers/crypto/qce/core.c | 16 +++++++++++++++- drivers/crypto/qce/core.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c index 74deca4f96e0..0654b94cfb95 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -22,6 +23,8 @@ #define QCE_MAJOR_VERSION5 0x05 #define QCE_QUEUE_LENGTH 1 +#define QCE_DEFAULT_MEM_BANDWIDTH 393600 + static const struct qce_algo_ops *qce_ops[] = { #ifdef CONFIG_CRYPTO_DEV_QCE_SKCIPHER &skcipher_ops, @@ -218,10 +221,18 @@ static int qce_crypto_probe(struct platform_device *pdev) if (IS_ERR(qce->bus)) return PTR_ERR(qce->bus); - ret = clk_prepare_enable(qce->core); + qce->mem_path = devm_of_icc_get(qce->dev, "memory"); + if (IS_ERR(qce->mem_path)) + return PTR_ERR(qce->mem_path); + + ret = icc_set_bw(qce->mem_path, QCE_DEFAULT_MEM_BANDWIDTH, QCE_DEFAULT_MEM_BANDWIDTH); if (ret) return ret; + ret = clk_prepare_enable(qce->core); + if (ret) + goto err_mem_path_disable; + ret = clk_prepare_enable(qce->iface); if (ret) goto err_clks_core; @@ -260,6 +271,9 @@ static int qce_crypto_probe(struct platform_device *pdev) clk_disable_unprepare(qce->iface); err_clks_core: clk_disable_unprepare(qce->core); +err_mem_path_disable: + icc_set_bw(qce->mem_path, 0, 0); + return ret; } diff --git a/drivers/crypto/qce/core.h b/drivers/crypto/qce/core.h index 085774cdf641..228fcd69ec51 100644 --- a/drivers/crypto/qce/core.h +++ b/drivers/crypto/qce/core.h @@ -35,6 +35,7 @@ struct qce_device { void __iomem *base; struct device *dev; struct clk *core, *iface, *bus; + struct icc_path *mem_path; struct qce_dma_data dma; int burst_size; unsigned int pipe_pair_id; From patchwork Wed Feb 22 17:22:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 655762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 379B4C6FD18 for ; Wed, 22 Feb 2023 17:23:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232619AbjBVRXS (ORCPT ); Wed, 22 Feb 2023 12:23:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbjBVRXH (ORCPT ); Wed, 22 Feb 2023 12:23:07 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B50104EE4 for ; Wed, 22 Feb 2023 09:23:04 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id b13so9568396ljf.6 for ; Wed, 22 Feb 2023 09:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=9Yd9lAcpRbHxF9RdOizjwYgJ/PMIKmYOw1xnRDHR/30=; b=XXW5OMHy/Ep3rE1cyCMMyjv41Cxcwe0bWk6m626Cvkdu/gigRgK3hrhr4wZLNRkzTb RUdpKqVumScTcWzJKenYZ7Z9M4Qb8AEpyXcLa1shTpiq1rK5F+3FZPepli7+JyiM//Ht 3mIrKnSczUR/hRWn+MZuKPZGSAqqS2Cn/ZOAq1773Rm63F9Ysk4l7emUqIxmDflkgIOO tFYRAlq8CgIbsWjqwJBXwEmqdkThdAHX9GbpSKqUhRDUV87nCWigWEar2v2aFqM0eePc JEaythDhhcjkzzm3yebBJJ2jCkyThfTDE/MxilZaqx3xIFtiBpOUTpxUYnnvxBxyY4r5 mB+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9Yd9lAcpRbHxF9RdOizjwYgJ/PMIKmYOw1xnRDHR/30=; b=FPufNnDs6KvDEcY6kB4tmtuARJwDxDj+1HXnFBTLwNitlDmPi3W8cccDoNK75ysQgW Sg1OpMfVo6m21v1gEKo9eUwpbZne+bhnHrQfTUzil1Jp743EOKg1orDn6LxPxwoifBws PXkut2QkJAL3PQpj6nntp9P674AoxtNpNQUWEDmjD3nMos/Q9MbPANPFCReTnii8ACyl O4UGuHXZB2ruepgbH8g0GaH2zmjuZGBo+ApwngUpQTayO1wB/SimbdktlbBmxhqWpkP5 o+4SNYLJHQTE3uuDaXS99Mwi2ge0H8k/2/xG3gZoZYJ1+bWO6Qrxa99vW06S3+AjHi0a 97vQ== X-Gm-Message-State: AO0yUKW7Mx3iGdPfrLLli6fSya7Q7t12tWYvrwess+FApcuUUjvyL7eq MYEOe/A+IuxluoNZUZcsnQ194w== X-Google-Smtp-Source: AK7set9+a35SyzaMThPps2maGPeQlYFoOjNpp1u5BGY+WfsSwIKGlEUp5XIadUP2Yt0ULp3kTp73Pg== X-Received: by 2002:a05:651c:12c2:b0:295:8bea:99a2 with SMTP id 2-20020a05651c12c200b002958bea99a2mr2996064lje.1.1677086582964; Wed, 22 Feb 2023 09:23:02 -0800 (PST) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id r3-20020a2e80c3000000b0029358afcc9esm805233ljg.34.2023.02.22.09.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 09:23:02 -0800 (PST) From: Vladimir Zapolskiy To: Krzysztof Kozlowski , Bjorn Andersson , Herbert Xu , Thara Gopinath , Bhupesh Sharma Cc: Rob Herring , Konrad Dybcio , Andy Gross , "David S. Miller" , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [PATCH v11 10/10] crypto: qce: core: Add a QCE IP family compatible 'qcom,qce' Date: Wed, 22 Feb 2023 19:22:40 +0200 Message-Id: <20230222172240.3235972-11-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> References: <20230222172240.3235972-1-vladimir.zapolskiy@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The added 'qcom,qce' compatible value will serve as a sole QCE IP family compatible, since a particular QCE IP version is discoverablem thus, if it'd be needed to differentiate various IP versions, it can be obtained in runtime. Two IP version based compatibles are left untouched to preserve backward DTB ABI compatibility. Signed-off-by: Vladimir Zapolskiy --- drivers/crypto/qce/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c index 5bb2128c95ca..fce49c0dee3e 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -293,6 +293,7 @@ static int qce_crypto_remove(struct platform_device *pdev) static const struct of_device_id qce_crypto_of_match[] = { { .compatible = "qcom,crypto-v5.1", }, { .compatible = "qcom,crypto-v5.4", }, + { .compatible = "qcom,qce", }, {} }; MODULE_DEVICE_TABLE(of, qce_crypto_of_match);