* [PATCH v6 0/2] Add support for Texas Instruments DTHEv2 Crypto Engine
@ 2025-08-19 6:12 T Pratham
2025-08-19 6:12 ` [PATCH v6 1/2] dt-bindings: crypto: Add binding for TI DTHE V2 T Pratham
0 siblings, 1 reply; 4+ messages in thread
From: T Pratham @ 2025-08-19 6:12 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: T Pratham, linux-crypto, devicetree, linux-kernel,
Kamlesh Gurudasani, Manorit Chawdhry, Vignesh Raghavendra,
Praneeth Bajjuri, Vishal Mahaveer, Kavitha Malarvizhi
Data Transform and Hashing Engine (DTHE) v2 is a new cryptography engine
introduced i TI AM62L SoC. DTHEv2 consists of multiple crypto IPs[1] (such
as AES Engine, hashing engine, TRNG, etc.) which can be used for
offloading cryptographic operations off of the CPU. The primary benefit
of DTHEv2 is enhanced side-channel attack resistance, with AES and PKE
engine being DPA and EMA resistant. These side-channel resistances are
the underlying requirement for various certifications like SESIP, PSA,
and IEC62443 (lvl 3+). Thus, DTHEv2 provides critical security benefits
for embedded systems that require protection against passive physical
attacks.
The AES Engine of DTHEv2 supports multiple AES modes (ECB, CBC, CTR,
CFB, f8), several protocols (GCM, CCM, XTS) and authentication modes
(CBC-MAC and f9). The hashing engine supports MD5, SHA1, and SHA2 (224,
256, 384, 512) algorithms along with HMAC. This patch series introduces
basic driver support for DTHEv2 engine, beginning with suporting AES-ECB
and AES-CBC algorithms. Other algorithms are planned to be added
gradually in phases after initial suppport is added.
The driver is tested using full kernel crypto selftests (CRYPTO_SELFTESTS)
which all pass successfully [2].
Signed-off-by: T Pratham <t-pratham@ti.com>
---
[1]: Section 14.6.3 (DMA Control Registers -> DMASS_DTHE)
Link: https://www.ti.com/lit/ug/sprujb4/sprujb4.pdf
[2]: DTHEv2 AES-ECB and AES-CBC kernel self-tests logs
Link: https://gist.github.com/Pratham-T/aaa499cf50d20310cb27266a645bfd60
Change log:
v6:
- Reworded the cover letter and commit messages to name DTHEv2 as a
crypto engine instead of crypto accelerator.
- Reworded the cover letter completely to emphasise more on the utility
of DTHEv2 as better resistance against physical attacks
- Reworded DTHEv2 description (help text) in KConfig
- Added dma_terminate_sync calls to ensure DMA requests are removed in
case when completion times-out.
- Some rearrangement of fields between dthe_tfm_ctx and dthe_aes_req_ctx
struct, so that per tfm members are correctly placed in tfm_ctx and per
request members are in req_ctx. Subsequently setkey, encrypt and
decrypt functions are also changed.
- Removed exit_tfm function which was useless and not required.
- Removed unnecessary zeroing of tfm_ctx object in init_tfm.
- Corrected return value in dthe_aes_run function.
- Reduced cra_priority of DTHEv2 algorithms.
v5:
- Simplified tfm ctx struct
- Set cra_reqsize instead of using crypto_skcipher_set_reqsize()
- Move setting sysconfig and irqenable registers to dthe_aes_run
v4:
- Corrected dt-bindings example indentation
- Simplified dt-bindings example, removing the node surrounding crypto
- Fixed typo in dthev2-common.h header guard
- Removed unused ctx field in dev_data struct
- Moved per-op data into request context
v3:
- Corrected dt-bindings reg length is too long error
- Converted AES driver code to use crypto_engine APIs for using
internal crypto queue instead of mutex.
- Removed calls to skcipher_request_complete in paths not returning
-EINPROGRESS before.
- Added missing KConfig import, which was accidentally removed in v2.
v2:
- Corrected dt-bindings syntax errors and other review comments in v1.
- Completely changed driver code structure, splitting code into
multiple files
Link to previous versions:
v5: https://lore.kernel.org/all/20250603124217.957116-1-t-pratham@ti.com/
v4: https://lore.kernel.org/all/20250508101723.846210-2-t-pratham@ti.com/
v3: https://lore.kernel.org/all/20250502121253.456974-2-t-pratham@ti.com/
v2: https://lore.kernel.org/all/20250411091321.2925308-1-t-pratham@ti.com/
v1: https://lore.kernel.org/all/20250206-dthe-v2-aes-v1-0-1e86cf683928@ti.com/
---
T Pratham (2):
dt-bindings: crypto: Add binding for TI DTHE V2
crypto: ti: Add driver for DTHE V2 AES Engine (ECB, CBC)
.../bindings/crypto/ti,am62l-dthev2.yaml | 50 +++
MAINTAINERS | 7 +
drivers/crypto/Kconfig | 1 +
drivers/crypto/Makefile | 1 +
drivers/crypto/ti/Kconfig | 14 +
drivers/crypto/ti/Makefile | 3 +
drivers/crypto/ti/dthev2-aes.c | 411 ++++++++++++++++++
drivers/crypto/ti/dthev2-common.c | 220 ++++++++++
drivers/crypto/ti/dthev2-common.h | 101 +++++
9 files changed, 808 insertions(+)
create mode 100644 Documentation/devicetree/bindings/crypto/ti,am62l-dthev2.yaml
create mode 100644 drivers/crypto/ti/Kconfig
create mode 100644 drivers/crypto/ti/Makefile
create mode 100644 drivers/crypto/ti/dthev2-aes.c
create mode 100644 drivers/crypto/ti/dthev2-common.c
create mode 100644 drivers/crypto/ti/dthev2-common.h
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v6 1/2] dt-bindings: crypto: Add binding for TI DTHE V2
2025-08-19 6:12 [PATCH v6 0/2] Add support for Texas Instruments DTHEv2 Crypto Engine T Pratham
@ 2025-08-19 6:12 ` T Pratham
2025-08-20 7:43 ` Krzysztof Kozlowski
0 siblings, 1 reply; 4+ messages in thread
From: T Pratham @ 2025-08-19 6:12 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: T Pratham, Krzysztof Kozlowski, linux-crypto, devicetree,
linux-kernel, Kamlesh Gurudasani, Manorit Chawdhry,
Vignesh Raghavendra, Praneeth Bajjuri, Vishal Mahaveer,
Kavitha Malarvizhi
Add DT binding for Texas Instruments DTHE V2 cryptography engine.
DTHE V2 is introduced as a part of TI AM62L SoC and can currently be
only found in it.
Signed-off-by: T Pratham <t-pratham@ti.com>
Reviewed-By: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../bindings/crypto/ti,am62l-dthev2.yaml | 50 +++++++++++++++++++
MAINTAINERS | 6 +++
2 files changed, 56 insertions(+)
create mode 100644 Documentation/devicetree/bindings/crypto/ti,am62l-dthev2.yaml
diff --git a/Documentation/devicetree/bindings/crypto/ti,am62l-dthev2.yaml b/Documentation/devicetree/bindings/crypto/ti,am62l-dthev2.yaml
new file mode 100644
index 000000000000..5486bfeb2fe8
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/ti,am62l-dthev2.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/crypto/ti,am62l-dthev2.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: K3 SoC DTHE V2 crypto module
+
+maintainers:
+ - T Pratham <t-pratham@ti.com>
+
+properties:
+ compatible:
+ enum:
+ - ti,am62l-dthev2
+
+ reg:
+ maxItems: 1
+
+ dmas:
+ items:
+ - description: AES Engine RX DMA Channel
+ - description: AES Engine TX DMA Channel
+ - description: SHA Engine TX DMA Channel
+
+ dma-names:
+ items:
+ - const: rx
+ - const: tx1
+ - const: tx2
+
+required:
+ - compatible
+ - reg
+ - dmas
+ - dma-names
+
+additionalProperties: false
+
+examples:
+ - |
+ crypto@40800000 {
+ compatible = "ti,am62l-dthev2";
+ reg = <0x40800000 0x10000>;
+
+ dmas = <&main_bcdma 0 0 0x4700 0>,
+ <&main_bcdma 0 0 0xc701 0>,
+ <&main_bcdma 0 0 0xc700 0>;
+ dma-names = "rx", "tx1", "tx2";
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index fe168477caa4..0f5bb8ad7653 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -25169,6 +25169,12 @@ S: Odd Fixes
F: drivers/clk/ti/
F: include/linux/clk/ti.h
+TI DATA TRANSFORM AND HASHING ENGINE (DTHE) V2 CRYPTO DRIVER
+M: T Pratham <t-pratham@ti.com>
+L: linux-crypto@vger.kernel.org
+S: Supported
+F: Documentation/devicetree/bindings/crypto/ti,am62l-dthev2.yaml
+
TI DAVINCI MACHINE SUPPORT
M: Bartosz Golaszewski <brgl@bgdev.pl>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v6 1/2] dt-bindings: crypto: Add binding for TI DTHE V2
2025-08-19 6:12 ` [PATCH v6 1/2] dt-bindings: crypto: Add binding for TI DTHE V2 T Pratham
@ 2025-08-20 7:43 ` Krzysztof Kozlowski
2025-08-20 8:52 ` T Pratham
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-20 7:43 UTC (permalink / raw)
To: T Pratham
Cc: Herbert Xu, David S . Miller, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-crypto, devicetree, linux-kernel,
Kamlesh Gurudasani, Manorit Chawdhry, Vignesh Raghavendra,
Praneeth Bajjuri, Vishal Mahaveer, Kavitha Malarvizhi
On Tue, Aug 19, 2025 at 11:42:44AM +0530, T Pratham wrote:
> Add DT binding for Texas Instruments DTHE V2 cryptography engine.
>
> DTHE V2 is introduced as a part of TI AM62L SoC and can currently be
> only found in it.
>
> Signed-off-by: T Pratham <t-pratham@ti.com>
> Reviewed-By: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Why are you changing the tags?!?
This is not really acceptable. You must use the tag exactly as given to
you. Not alter it anyhow!
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6 1/2] dt-bindings: crypto: Add binding for TI DTHE V2
2025-08-20 7:43 ` Krzysztof Kozlowski
@ 2025-08-20 8:52 ` T Pratham
0 siblings, 0 replies; 4+ messages in thread
From: T Pratham @ 2025-08-20 8:52 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Herbert Xu, David S . Miller, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-crypto, devicetree, linux-kernel,
Kamlesh Gurudasani, Manorit Chawdhry, Vignesh Raghavendra,
Praneeth Bajjuri, Vishal Mahaveer, Kavitha Malarvizhi
On 20/08/25 13:13, Krzysztof Kozlowski wrote:
> On Tue, Aug 19, 2025 at 11:42:44AM +0530, T Pratham wrote:
>> Add DT binding for Texas Instruments DTHE V2 cryptography engine.
>>
>> DTHE V2 is introduced as a part of TI AM62L SoC and can currently be
>> only found in it.
>>
>> Signed-off-by: T Pratham <t-pratham@ti.com>
>> Reviewed-By: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Why are you changing the tags?!?
>
> This is not really acceptable. You must use the tag exactly as given to
> you. Not alter it anyhow!
>
> Best regards,
> Krzysztof
>
Apologies! Genuine error from my side adding the tag in v5. Got carried over to v6 as well.
Will correct this in next re-spin.
Regards
T Pratham
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-20 8:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 6:12 [PATCH v6 0/2] Add support for Texas Instruments DTHEv2 Crypto Engine T Pratham
2025-08-19 6:12 ` [PATCH v6 1/2] dt-bindings: crypto: Add binding for TI DTHE V2 T Pratham
2025-08-20 7:43 ` Krzysztof Kozlowski
2025-08-20 8:52 ` T Pratham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).