Skip to contentSkip to conversation

arm64: dts: qcom: sm8750: Introduce crypto support for SM8750

PATCH Applied Melody Olvera 7 participants 15 messages Jan 13, 2025 – Mar 14, 2025

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover arm64: dts: qcom: sm8750: Introduce crypto support for SM8750

Document and describe the crypto engines and random number generators on the SM8750 SoC.

---
Gaurav Kashyap (6):
dt-bindings: crypto: qcom-qce: Document the SM8750 crypto engine
arm64: dts: qcom: sm8750: Add QCrypto nodes
dt-bindings: crypto: qcom,prng: Document SM8750 RNG
arm64: dts: qcom: sm8750: Add TRNG nodes
dt-bindings: crypto: qcom,inline-crypto-engine: Document the SM8750 ICE
arm64: dts: qcom: sm8750: Add ICE nodes

 .../bindings/crypto/qcom,inline-crypto-engine.yaml |  1 +
 .../devicetree/bindings/crypto/qcom,prng.yaml      |  1 +
 .../devicetree/bindings/crypto/qcom-qce.yaml       |  1 +
 arch/arm64/boot/dts/qcom/sm8750.dtsi               | 43 ++++++++++++++++++++++
 4 files changed, 46 insertions(+)

---
base-commit: 37136bf5c3a6f6b686d74f41837a6406bec6b7bc
change-id: 20250107-sm8750_crypto_master-12e2fc2fcf32

Best regards,

Signature · 1 line
Melody Olvera <[email protected]>
#1 lore raw

PATCH 1/6 dt-bindings: crypto: qcom-qce: Document the SM8750 crypto engine

From: Gaurav Kashyap <[email protected]>

Document the crypto engine on the SM8750 Platform.

---
 Documentation/devicetree/bindings/crypto/qcom-qce.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/crypto/qcom-qce.yaml +1 -0
index 7f8c0d55f6f5c300c5c5cbfefee03af628d49d7a..3ed56d9d378e38a7ed3f5cd606c4dc20955194f0 100644
@@ -54,6 +54,7 @@ properties:
               - qcom,sm8450-qce
               - qcom,sm8550-qce
               - qcom,sm8650-qce
+              - qcom,sm8750-qce
           - const: qcom,sm8150-qce
           - const: qcom,qce
 
Signature · 1 line
2.46.1
maintainer Acked-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] dt-bindings: crypto: qcom-qce: Document the SM8750 crypto engine

Quoted 10 lines · Melody Olvera

From: Gaurav Kashyap <[email protected]>

Document the crypto engine on the SM8750 Platform.

---
 Documentation/devicetree/bindings/crypto/qcom-qce.yaml | 1 +
 1 file changed, 1 insertion(+)
#3 lore raw

PATCH 2/6 arm64: dts: qcom: sm8750: Add QCrypto nodes

In reply to Melody Olvera

From: Gaurav Kashyap <[email protected]>

Add the QCE and Crypto BAM DMA nodes.

---
 arch/arm64/boot/dts/qcom/sm8750.dtsi | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/qcom/sm8750.dtsi +30 -0
index 3bbd7d18598ee0a3a0d5130c03a3166e1fc14d82..1ddb33ea83885e73bf15244c9cbd7067ae28cded 100644
@@ -1939,6 +1939,36 @@ mmss_noc: interconnect@1780000 {
 			#interconnect-cells = <2>;
 		};
 
+		cryptobam: dma-controller@1dc4000 {
+			compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0";
+			reg = <0x0 0x01dc4000 0x0 0x28000>;
+
+			interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
+
+			#dma-cells = <1>;
+
+			iommus = <&apps_smmu 0x480 0>,
+				 <&apps_smmu 0x481 0>;
+
+			qcom,ee = <0>;
+			qcom,controlled-remotely;
+		};
+
+		crypto: crypto@1dfa000 {
+			compatible = "qcom,sm8750-qce", "qcom,sm8150-qce", "qcom,qce";
+			reg = <0x0 0x01dfa000 0x0 0x6000>;
+
+			interconnects = <&aggre2_noc MASTER_CRYPTO QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+			interconnect-names = "memory";
+
+			dmas = <&cryptobam 4>, <&cryptobam 5>;
+			dma-names = "rx", "tx";
+
+			iommus = <&apps_smmu 0x480 0>,
+				 <&apps_smmu 0x481 0>;
+		};
+
 		tcsr_mutex: hwlock@1f40000 {
 			compatible = "qcom,tcsr-mutex";
 			reg = <0x0 0x01f40000 0x0 0x20000>;
Signature · 1 line
2.46.1
#4 lore raw

Re: [PATCH 2/6] arm64: dts: qcom: sm8750: Add QCrypto nodes

Quoted 18 lines · Melody Olvera

From: Gaurav Kashyap <[email protected]>

Add the QCE and Crypto BAM DMA nodes.

---
 arch/arm64/boot/dts/qcom/sm8750.dtsi | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/qcom/sm8750.dtsi +0 -0
index 3bbd7d18598ee0a3a0d5130c03a3166e1fc14d82..1ddb33ea83885e73bf15244c9cbd7067ae28cded 100644
@@ -1939,6 +1939,36 @@ mmss_noc: interconnect@1780000 {
 			#interconnect-cells = <2>;
 		};
 

arch/arm64/boot/dts/qcom/sm8750.dtsi mmss_noc: interconnect@1780000 { · line 1951

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8750.dtsi +10 -0
+		cryptobam: dma-controller@1dc4000 {
+			compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0";
+			reg = <0x0 0x01dc4000 0x0 0x28000>;
+
+			interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
+
+			#dma-cells = <1>;
+
+			iommus = <&apps_smmu 0x480 0>,
+				 <&apps_smmu 0x481 0>;

Should be equivalent to iommus = <&apps_smmu 0x480 0x1>?

arch/arm64/boot/dts/qcom/sm8750.dtsi mmss_noc: interconnect@1780000 { · line 1954

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8750.dtsi +3 -0
+
+			qcom,ee = <0>;
+			qcom,controlled-remotely;

If you don't have clocks here, you need to provide num-channels and qcom,num-ees. Otherwise, there is a risk this will crash if the BAM is not up while being probed.

Thanks,
Stephan

#5 lore raw

RE: [PATCH 2/6] arm64: dts: qcom: sm8750: Add QCrypto nodes

Quoted 25 lines · Stephan Gerhold
Quoted 13 lines · Melody Olvera

From: Gaurav Kashyap <[email protected]>

Add the QCE and Crypto BAM DMA nodes.

---
 arch/arm64/boot/dts/qcom/sm8750.dtsi | 30
++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/qcom/sm8750.dtsi +0 -0
Quoted 2 lines

index

3bbd7d18598ee0a3a0d5130c03a3166e1fc14d82..1ddb33ea83885e73bf15244c 9cbd

Quoted 7 lines

7067ae28cded 100644

arch/arm64/boot/dts/qcom/sm8750.dtsi +0 -0
@@ -1939,6 +1939,36 @@ mmss_noc: interconnect@1780000 {
                      #interconnect-cells = <2>;
              };
 
Quoted 13 lines

arch/arm64/boot/dts/qcom/sm8750.dtsi mmss_noc: interconnect@1780000 { · line 1951

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8750.dtsi +10 -0
+             cryptobam: dma-controller@1dc4000 {
+                     compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0";
+                     reg = <0x0 0x01dc4000 0x0 0x28000>;
+
+                     interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
+
+                     #dma-cells = <1>;
+
+                     iommus = <&apps_smmu 0x480 0>,
+                              <&apps_smmu 0x481 0>;

Should be equivalent to iommus = <&apps_smmu 0x480 0x1>?

Hello Stephan, we tried this out internally, and the use case was not functional. The masks are explicitly mentioned in our hardware documents and we are just following that.

So, we are looking to keep it the same.

Quoted 8 lines

arch/arm64/boot/dts/qcom/sm8750.dtsi mmss_noc: interconnect@1780000 { · line 1954

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8750.dtsi +3 -0
+
+                     qcom,ee = <0>;
+                     qcom,controlled-remotely;

If you don't have clocks here, you need to provide num-channels and qcom,num-ees. Otherwise, there is a risk this will crash if the BAM is not up while being probed.

Ack.

Quoted 2 lines

Thanks,
Stephan

Regards,
Gaurav

#6 lore raw

PATCH 3/6 dt-bindings: crypto: qcom,prng: Document SM8750 RNG

In reply to Melody Olvera

From: Gaurav Kashyap <[email protected]>

Document SM8750 compatible for the True Random Number Generator.

---
 Documentation/devicetree/bindings/crypto/qcom,prng.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/crypto/qcom,prng.yaml +1 -0
index d38e8d3b2f3a83dcb0e3559a7aaedb5d49df18f4..5e6f8b6425454d6440a8653567235380d934cc2c 100644
@@ -27,6 +27,7 @@ properties:
               - qcom,sm8450-trng
               - qcom,sm8550-trng
               - qcom,sm8650-trng
+              - qcom,sm8750-trng
           - const: qcom,trng
 
   reg:
Signature · 1 line
2.46.1
maintainer Acked-by on v1 3/6
#7 lore raw

Re: [PATCH 3/6] dt-bindings: crypto: qcom,prng: Document SM8750 RNG

Quoted 10 lines · Melody Olvera

From: Gaurav Kashyap <[email protected]>

Document SM8750 compatible for the True Random Number Generator.

---
 Documentation/devicetree/bindings/crypto/qcom,prng.yaml | 1 +
 1 file changed, 1 insertion(+)
#8 lore raw

PATCH 4/6 arm64: dts: qcom: sm8750: Add TRNG nodes

In reply to Melody Olvera

From: Gaurav Kashyap <[email protected]>

Add the SM8750 nodes for the True Random Number Generator (TRNG).

---
 arch/arm64/boot/dts/qcom/sm8750.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/sm8750.dtsi +5 -0
index 1ddb33ea83885e73bf15244c9cbd7067ae28cded..9b2ac8c30013b02ca78140eb4144b4530aba5d6a 100644
@@ -1883,6 +1883,11 @@ &clk_virt SLAVE_QUP_CORE_1 QCOM_ICC_TAG_ALWAYS>,
 			};
 		};
 
+		rng: rng@10c3000 {
+			compatible = "qcom,sm8750-trng", "qcom,trng";
+			reg = <0x0 0x010c3000 0x0 0x1000>;
+		};
+
 		cnoc_main: interconnect@1500000 {
 			compatible = "qcom,sm8750-cnoc-main";
 			reg = <0x0 0x01500000 0x0 0x16080>;
Signature · 1 line
2.46.1
#9 lore raw

PATCH 5/6 dt-bindings: crypto: qcom,inline-crypto-engine: Document the SM8750 ICE

In reply to Melody Olvera

From: Gaurav Kashyap <[email protected]>

Document the Inline Crypto Engine (ICE) on the SM8750 Platform.

---
 Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml +1 -0
index 657693867ddfc9dd3633b52633519ca101f59d7c..08fe6a707a3714ff11d01b36afc8a2aab1ad490c 100644
@@ -20,6 +20,7 @@ properties:
           - qcom,sm8450-inline-crypto-engine
           - qcom,sm8550-inline-crypto-engine
           - qcom,sm8650-inline-crypto-engine
+          - qcom,sm8750-inline-crypto-engine
       - const: qcom,inline-crypto-engine
 
   reg:
Signature · 1 line
2.46.1
maintainer Acked-by on v1 5/6
#10 lore raw

Re: [PATCH 5/6] dt-bindings: crypto: qcom,inline-crypto-engine: Document the SM8750 ICE

Quoted 10 lines · Melody Olvera

From: Gaurav Kashyap <[email protected]>

Document the Inline Crypto Engine (ICE) on the SM8750 Platform.

---
 Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml | 1 +
 1 file changed, 1 insertion(+)
#11 lore raw

PATCH 6/6 arm64: dts: qcom: sm8750: Add ICE nodes

In reply to Melody Olvera

From: Gaurav Kashyap <[email protected]>

Add the SM8750 nodes for the UFS Inline Crypto Engine (ICE).

---
 arch/arm64/boot/dts/qcom/sm8750.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/qcom/sm8750.dtsi +8 -0
index 9b2ac8c30013b02ca78140eb4144b4530aba5d6a..63231f4d72e2ca2a109efff00ab7a21c7475888a 100644
@@ -1944,6 +1944,14 @@ mmss_noc: interconnect@1780000 {
 			#interconnect-cells = <2>;
 		};
 
+		ice: crypto@1d88000 {
+			compatible = "qcom,sm8750-inline-crypto-engine",
+				     "qcom,inline-crypto-engine";
+			reg = <0x0 0x01d88000 0x0 0x18000>;
+
+			clocks = <&gcc GCC_UFS_PHY_ICE_CORE_CLK>;
+		};
+
 		cryptobam: dma-controller@1dc4000 {
 			compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0";
 			reg = <0x0 0x01dc4000 0x0 0x28000>;
Signature · 1 line
2.46.1
maintainer
#13 lore raw
In reply to Melody Olvera
Quoted 18 lines · Melody Olvera

Document and describe the crypto engines and random number generators on the SM8750 SoC.

---
Gaurav Kashyap (6):
dt-bindings: crypto: qcom-qce: Document the SM8750 crypto engine
arm64: dts: qcom: sm8750: Add QCrypto nodes
dt-bindings: crypto: qcom,prng: Document SM8750 RNG
arm64: dts: qcom: sm8750: Add TRNG nodes
dt-bindings: crypto: qcom,inline-crypto-engine: Document the SM8750 ICE
arm64: dts: qcom: sm8750: Add ICE nodes

 .../bindings/crypto/qcom,inline-crypto-engine.yaml |  1 +
 .../devicetree/bindings/crypto/qcom,prng.yaml      |  1 +
 .../devicetree/bindings/crypto/qcom-qce.yaml       |  1 +
 arch/arm64/boot/dts/qcom/sm8750.dtsi               | 43 ++++++++++++++++++++++
 4 files changed, 46 insertions(+)
Quoted 7 lines

---
base-commit: 37136bf5c3a6f6b686d74f41837a6406bec6b7bc
change-id: 20250107-sm8750_crypto_master-12e2fc2fcf32

Best regards,

Signature · 1 line
Melody Olvera <[email protected]>

Patches 1/3/5 applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
maintainer Applied
#14 lore raw

Re: (subset) [PATCH 0/6] arm64: dts: qcom: sm8750: Introduce crypto support for SM8750

In reply to Melody Olvera
Quoted 4 lines · Melody Olvera

Document and describe the crypto engines and random number generators on the SM8750 SoC.

Applied, thanks!

[2/6] arm64: dts: qcom: sm8750: Add QCrypto nodes

      commit: eeb0f3e4ea67cb1c2dd7cacfef218bfa0ae56970
[4/6] arm64: dts: qcom: sm8750: Add TRNG nodes
      commit: 9f9dcac2f85e6a0641a4a4f7f3b2c35a984ed4cc
[6/6] arm64: dts: qcom: sm8750: Add ICE nodes
      commit: b1dac789c650a20a54d5089b23fbb800fb289b8b

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>