* [PATCH v10 01/10] dt-bindings: qcom-qce: Convert bindings to yaml
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 02/10] MAINTAINERS: Add qcom-qce dt-binding file to QUALCOMM CRYPTO DRIVERS section Vladimir Zapolskiy
` (8 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Rob Herring,
Jordan Crouse
From: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Convert Qualcomm QCE crypto devicetree binding to YAML.
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Tested-by: Jordan Crouse <jorcrous@amazon.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
.../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 <bhupesh.sharma@linaro.org>
+
+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 <dt-bindings/clock/qcom,gcc-apq8084.h>
+ 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";
+ };
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v10 02/10] MAINTAINERS: Add qcom-qce dt-binding file to QUALCOMM CRYPTO DRIVERS section
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 01/10] dt-bindings: qcom-qce: Convert bindings to yaml Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 03/10] dt-bindings: qcom-qce: Add 'interconnects' and 'interconnect-names' Vladimir Zapolskiy
` (7 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto
From: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Add the entry for 'Documentation/devicetree/bindings/crypto/qcom-qce.yaml'
to the appropriate section for 'QUALCOMM CRYPTO DRIVERS' in
MAINTAINERS file.
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0abf3589423b..e93f0d45b400 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17272,6 +17272,7 @@ M: Thara Gopinath <thara.gopinath@gmail.com>
L: linux-crypto@vger.kernel.org
L: linux-arm-msm@vger.kernel.org
S: Maintained
+F: Documentation/devicetree/bindings/crypto/qcom-qce.yaml
F: drivers/crypto/qce/
QUALCOMM EMAC GIGABIT ETHERNET DRIVER
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v10 03/10] dt-bindings: qcom-qce: Add 'interconnects' and 'interconnect-names'
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 01/10] dt-bindings: qcom-qce: Convert bindings to yaml Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 02/10] MAINTAINERS: Add qcom-qce dt-binding file to QUALCOMM CRYPTO DRIVERS section Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 04/10] dt-bindings: qcom-qce: Add 'iommus' to optional properties Vladimir Zapolskiy
` (6 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Rob Herring,
Jordan Crouse
From: Bhupesh Sharma <bhupesh.sharma@linaro.org>
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 <andersson@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Tested-by: Jordan Crouse <jorcrous@amazon.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
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.
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v10 04/10] dt-bindings: qcom-qce: Add 'iommus' to optional properties
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
` (2 preceding siblings ...)
2023-02-16 13:14 ` [PATCH v10 03/10] dt-bindings: qcom-qce: Add 'interconnects' and 'interconnect-names' Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 05/10] dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP Vladimir Zapolskiy
` (5 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Rob Herring,
Jordan Crouse
From: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Add the missing optional property - 'iommus' to the
device-tree binding documentation for qcom-qce crypto IP.
This property describes the phandle(s) to apps_smmu node with sid mask.
Cc: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Tested-by: Jordan Crouse <jorcrous@amazon.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
Documentation/devicetree/bindings/crypto/qcom-qce.yaml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml
index 94f96ebc5dac..4e00e7925fed 100644
--- a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml
+++ b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml
@@ -32,6 +32,12 @@ properties:
- const: bus
- const: core
+ iommus:
+ minItems: 1
+ maxItems: 8
+ description:
+ phandle to apps_smmu node with sid mask.
+
interconnects:
maxItems: 1
description:
@@ -72,4 +78,8 @@ examples:
clock-names = "iface", "bus", "core";
dmas = <&cryptobam 2>, <&cryptobam 3>;
dma-names = "rx", "tx";
+ iommus = <&apps_smmu 0x584 0x0011>,
+ <&apps_smmu 0x586 0x0011>,
+ <&apps_smmu 0x594 0x0011>,
+ <&apps_smmu 0x596 0x0011>;
};
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v10 05/10] dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
` (3 preceding siblings ...)
2023-02-16 13:14 ` [PATCH v10 04/10] dt-bindings: qcom-qce: Add 'iommus' to optional properties Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-17 8:57 ` Krzysztof Kozlowski
2023-02-16 13:14 ` [PATCH v10 06/10] dt-bindings: qcom-qce: document optional clocks and clock-names properties Vladimir Zapolskiy
` (4 subsequent siblings)
9 siblings, 1 reply; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Neil Armstrong
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 compatibles 'qcom,crypto-v5.1' and 'qcom,crypto-v5.4' for
backward compatibility of DTB ABI, but mark them 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 <bhupesh.sharma@linaro.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
.../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 <dt-bindings/clock/qcom,gcc-apq8084.h>
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>,
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v10 05/10] dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP
2023-02-16 13:14 ` [PATCH v10 05/10] dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP Vladimir Zapolskiy
@ 2023-02-17 8:57 ` Krzysztof Kozlowski
0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-17 8:57 UTC (permalink / raw)
To: Vladimir Zapolskiy, Krzysztof Kozlowski, Bjorn Andersson,
Herbert Xu, Thara Gopinath, Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Neil Armstrong
On 16/02/2023 14:14, Vladimir Zapolskiy wrote:
> 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 compatibles 'qcom,crypto-v5.1' and 'qcom,crypto-v5.4' for
> backward compatibility of DTB ABI, but mark them as deprecated.
>
As I asked at v9, please mention that you document already used v5.4
compatible. You do not "keep it", because it was never there in the binding.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v10 06/10] dt-bindings: qcom-qce: document optional clocks and clock-names properties
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
` (4 preceding siblings ...)
2023-02-16 13:14 ` [PATCH v10 05/10] dt-bindings: qcom-qce: Add new SoC compatible strings for Qualcomm QCE IP Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-17 8:58 ` Krzysztof Kozlowski
2023-02-16 13:14 ` [PATCH v10 07/10] arm64: dts: qcom: sm8550: add QCE IP family compatible values Vladimir Zapolskiy
` (3 subsequent siblings)
9 siblings, 1 reply; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Neil Armstrong
On newer Qualcomm SoCs the crypto engine clocks are enabled by default
by security firmware. To drop clocks and clock-names from the list of
required properties use 'qcom,sm8150-qce' compatible name.
The change is based on Neil Armstrong's observation and an original change.
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
.../devicetree/bindings/crypto/qcom-qce.yaml | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml
index 84f57f44bb71..e375bd981300 100644
--- a/Documentation/devicetree/bindings/crypto/qcom-qce.yaml
+++ b/Documentation/devicetree/bindings/crypto/qcom-qce.yaml
@@ -81,11 +81,24 @@ properties:
- const: rx
- const: tx
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,crypto-v5.1
+ - qcom,crypto-v5.4
+ - qcom,ipq4019-qce
+
+ then:
+ required:
+ - clocks
+ - clock-names
+
required:
- compatible
- reg
- - clocks
- - clock-names
- dmas
- dma-names
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH v10 06/10] dt-bindings: qcom-qce: document optional clocks and clock-names properties
2023-02-16 13:14 ` [PATCH v10 06/10] dt-bindings: qcom-qce: document optional clocks and clock-names properties Vladimir Zapolskiy
@ 2023-02-17 8:58 ` Krzysztof Kozlowski
0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-17 8:58 UTC (permalink / raw)
To: Vladimir Zapolskiy, Krzysztof Kozlowski, Bjorn Andersson,
Herbert Xu, Thara Gopinath, Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Neil Armstrong
On 16/02/2023 14:14, Vladimir Zapolskiy wrote:
> On newer Qualcomm SoCs the crypto engine clocks are enabled by default
> by security firmware. To drop clocks and clock-names from the list of
> required properties use 'qcom,sm8150-qce' compatible name.
>
> The change is based on Neil Armstrong's observation and an original change.
>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
> ---
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v10 07/10] arm64: dts: qcom: sm8550: add QCE IP family compatible values
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
` (5 preceding siblings ...)
2023-02-16 13:14 ` [PATCH v10 06/10] dt-bindings: qcom-qce: document optional clocks and clock-names properties Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 08/10] crypto: qce: core: Add support to initialize interconnect path Vladimir Zapolskiy
` (2 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Krzysztof Kozlowski
Add a family compatible for QCE IP on SM8550 SoC, which is equal to QCE IP
found on SM8150 SoC and described in the recently updated device tree
bindings documentation, as well add a generic QCE IP family compatible.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index ff4d342c0725..05ab0d5014c6 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -1861,7 +1861,7 @@ cryptobam: dma-controller@1dc4000 {
};
crypto: crypto@1de0000 {
- compatible = "qcom,sm8550-qce";
+ compatible = "qcom,sm8550-qce", "qcom,sm8150-qce", "qcom,qce";
reg = <0x0 0x01dfa000 0x0 0x6000>;
dmas = <&cryptobam 4>, <&cryptobam 5>;
dma-names = "rx", "tx";
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v10 08/10] crypto: qce: core: Add support to initialize interconnect path
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
` (6 preceding siblings ...)
2023-02-16 13:14 ` [PATCH v10 07/10] arm64: dts: qcom: sm8550: add QCE IP family compatible values Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 09/10] crypto: qce: core: Make clocks optional Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 10/10] crypto: qce: core: Add a QCE IP family compatible 'qcom,qce' Vladimir Zapolskiy
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Jordan Crouse
From: Thara Gopinath <thara.gopinath@gmail.com>
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 <jorcrous@amazon.com>
Signed-off-by: Thara Gopinath <thara.gopinath@gmail.com>
[Bhupesh: Make header file inclusion alphabetical and use devm_of_icc_get()]
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
[vladimir: moved icc bandwidth setup closer to its acquisition]
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
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 <linux/clk.h>
#include <linux/dma-mapping.h>
+#include <linux/interconnect.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
@@ -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;
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v10 09/10] crypto: qce: core: Make clocks optional
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
` (7 preceding siblings ...)
2023-02-16 13:14 ` [PATCH v10 08/10] crypto: qce: core: Add support to initialize interconnect path Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
2023-02-16 13:14 ` [PATCH v10 10/10] crypto: qce: core: Add a QCE IP family compatible 'qcom,qce' Vladimir Zapolskiy
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto, Jordan Crouse
From: Thara Gopinath <thara.gopinath@gmail.com>
On certain Snapdragon processors, the crypto engine clocks are enabled by
default by security firmware and the driver should not handle the clocks.
Make acquiring of all the clocks optional in crypto engine driver, so that
the driver initializes properly even if no clocks are specified in the dt.
Tested-by: Jordan Crouse <jorcrous@amazon.com>
Signed-off-by: Thara Gopinath <thara.gopinath@gmail.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
[Bhupesh: Massage the commit log]
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
drivers/crypto/qce/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
index 0654b94cfb95..5bb2128c95ca 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -209,15 +209,15 @@ static int qce_crypto_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
- qce->core = devm_clk_get(qce->dev, "core");
+ qce->core = devm_clk_get_optional(qce->dev, "core");
if (IS_ERR(qce->core))
return PTR_ERR(qce->core);
- qce->iface = devm_clk_get(qce->dev, "iface");
+ qce->iface = devm_clk_get_optional(qce->dev, "iface");
if (IS_ERR(qce->iface))
return PTR_ERR(qce->iface);
- qce->bus = devm_clk_get(qce->dev, "bus");
+ qce->bus = devm_clk_get_optional(qce->dev, "bus");
if (IS_ERR(qce->bus))
return PTR_ERR(qce->bus);
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH v10 10/10] crypto: qce: core: Add a QCE IP family compatible 'qcom,qce'
2023-02-16 13:14 [PATCH v10 00/10] crypto: qcom-qce: Add YAML bindings and support for newer SoCs Vladimir Zapolskiy
` (8 preceding siblings ...)
2023-02-16 13:14 ` [PATCH v10 09/10] crypto: qce: core: Make clocks optional Vladimir Zapolskiy
@ 2023-02-16 13:14 ` Vladimir Zapolskiy
9 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2023-02-16 13:14 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Herbert Xu, Thara Gopinath,
Bhupesh Sharma
Cc: Rob Herring, Konrad Dybcio, Andy Gross, David S. Miller,
devicetree, linux-arm-msm, linux-crypto
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 <vladimir.zapolskiy@linaro.org>
---
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);
--
2.33.0
^ permalink raw reply related [flat|nested] 13+ messages in thread