linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: sun8i: v3s: Enable crypto engine
@ 2020-08-27 18:00 Martin Cerveny
  2020-08-31  6:34 ` Corentin Labbe
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Cerveny @ 2020-08-27 18:00 UTC (permalink / raw)
  To: clabbe.montjoie
  Cc: davem, herbert, robh+dt, mripard, wens, m.cerveny, linux-crypto,
	devicetree, linux-arm-kernel, linux-kernel

V3S contains crypto engine that is compatible with "sun4i-ss".

Tested-by: Martin Cerveny <m.cerveny@computer.org>
Signed-off-by: Martin Cerveny <m.cerveny@computer.org>
---
 .../bindings/crypto/allwinner,sun4i-a10-crypto.yaml    |  5 ++++-
 arch/arm/boot/dts/sun8i-v3s.dtsi                       | 10 ++++++++++
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c      |  7 +++++++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml b/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml
index fc823572b..180efd13a 100644
--- a/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml
+++ b/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml
@@ -25,6 +25,7 @@ properties:
           - const: allwinner,sun4i-a10-crypto
       - items:
           - const: allwinner,sun8i-a33-crypto
+      - const: allwinner,sun8i-v3s-crypto
 
   reg:
     maxItems: 1
@@ -59,7 +60,9 @@ if:
   properties:
     compatible:
       contains:
-        const: allwinner,sun6i-a31-crypto
+        oneOf:
+          - const: allwinner,sun6i-a31-crypto
+          - const: allwinner,sun8i-v3s-crypto
 
 then:
   required:
diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index e5312869c..4fec84c40 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -234,6 +234,16 @@
 			#size-cells = <0>;
 		};
 
+		crypto: crypto@1c15000 {
+			compatible = "allwinner,sun8i-v3s-crypto";
+			reg = <0x01c15000 0x1000>;
+			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_CE>, <&ccu CLK_CE>;
+			clock-names = "ahb", "mod";
+			resets = <&ccu RST_BUS_CE>;
+			reset-names = "ahb";
+		};
+
 		usb_otg: usb@1c19000 {
 			compatible = "allwinner,sun8i-h3-musb";
 			reg = <0x01c19000 0x0400>;
diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c
index a2b67f7f8..d24496cac 100644
--- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c
+++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c
@@ -31,6 +31,10 @@ static const struct ss_variant ss_a33_variant = {
 	.sha1_in_be = true,
 };
 
+static const struct ss_variant ss_v3s_variant = {
+	.sha1_in_be = true,
+};
+
 static struct sun4i_ss_alg_template ss_algs[] = {
 {       .type = CRYPTO_ALG_TYPE_AHASH,
 	.mode = SS_OP_MD5,
@@ -505,6 +509,9 @@ static const struct of_device_id a20ss_crypto_of_match_table[] = {
 	{ .compatible = "allwinner,sun8i-a33-crypto",
 	  .data = &ss_a33_variant
 	},
+	{ .compatible = "allwinner,sun8i-v3s-crypto",
+	  .data = &ss_v3s_variant
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, a20ss_crypto_of_match_table);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: dts: sun8i: v3s: Enable crypto engine
  2020-08-27 18:00 [PATCH] ARM: dts: sun8i: v3s: Enable crypto engine Martin Cerveny
@ 2020-08-31  6:34 ` Corentin Labbe
  0 siblings, 0 replies; 2+ messages in thread
From: Corentin Labbe @ 2020-08-31  6:34 UTC (permalink / raw)
  To: Martin Cerveny
  Cc: davem, herbert, robh+dt, mripard, wens, linux-crypto, devicetree,
	linux-arm-kernel, linux-kernel

On Thu, Aug 27, 2020 at 08:00:27PM +0200, Martin Cerveny wrote:
> V3S contains crypto engine that is compatible with "sun4i-ss".
> 
> Tested-by: Martin Cerveny <m.cerveny@computer.org>
> Signed-off-by: Martin Cerveny <m.cerveny@computer.org>
> ---
>  .../bindings/crypto/allwinner,sun4i-a10-crypto.yaml    |  5 ++++-
>  arch/arm/boot/dts/sun8i-v3s.dtsi                       | 10 ++++++++++
>  drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c      |  7 +++++++
>  3 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml b/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml
> index fc823572b..180efd13a 100644
> --- a/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml
> +++ b/Documentation/devicetree/bindings/crypto/allwinner,sun4i-a10-crypto.yaml
> @@ -25,6 +25,7 @@ properties:
>            - const: allwinner,sun4i-a10-crypto
>        - items:
>            - const: allwinner,sun8i-a33-crypto
> +      - const: allwinner,sun8i-v3s-crypto
>  
>    reg:
>      maxItems: 1
> @@ -59,7 +60,9 @@ if:
>    properties:
>      compatible:
>        contains:
> -        const: allwinner,sun6i-a31-crypto
> +        oneOf:
> +          - const: allwinner,sun6i-a31-crypto
> +          - const: allwinner,sun8i-v3s-crypto
>  
>  then:
>    required:
> diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
> index e5312869c..4fec84c40 100644
> --- a/arch/arm/boot/dts/sun8i-v3s.dtsi
> +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
> @@ -234,6 +234,16 @@
>  			#size-cells = <0>;
>  		};
>  
> +		crypto: crypto@1c15000 {
> +			compatible = "allwinner,sun8i-v3s-crypto";
> +			reg = <0x01c15000 0x1000>;
> +			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&ccu CLK_BUS_CE>, <&ccu CLK_CE>;
> +			clock-names = "ahb", "mod";
> +			resets = <&ccu RST_BUS_CE>;
> +			reset-names = "ahb";
> +		};
> +
>  		usb_otg: usb@1c19000 {
>  			compatible = "allwinner,sun8i-h3-musb";
>  			reg = <0x01c19000 0x0400>;
> diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c
> index a2b67f7f8..d24496cac 100644
> --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c
> +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c
> @@ -31,6 +31,10 @@ static const struct ss_variant ss_a33_variant = {
>  	.sha1_in_be = true,
>  };
>  
> +static const struct ss_variant ss_v3s_variant = {
> +	.sha1_in_be = true,
> +};
> +
>  static struct sun4i_ss_alg_template ss_algs[] = {
>  {       .type = CRYPTO_ALG_TYPE_AHASH,
>  	.mode = SS_OP_MD5,
> @@ -505,6 +509,9 @@ static const struct of_device_id a20ss_crypto_of_match_table[] = {
>  	{ .compatible = "allwinner,sun8i-a33-crypto",
>  	  .data = &ss_a33_variant
>  	},
> +	{ .compatible = "allwinner,sun8i-v3s-crypto",
> +	  .data = &ss_v3s_variant
> +	},
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, a20ss_crypto_of_match_table);
> -- 
> 2.17.1
> 

You should split at least drivers/crypto and the dts part, as drivers/crypto patchs are merged via the cryptodev tree and dts/doc will be merged via the sunxi tree.
And ideally split patch in 3, the doc, the dts and the crypto.
See how I added the same for A33 in:
https://lore.kernel.org/linux-arm-kernel/20191120152833.20443-1-clabbe.montjoie@gmail.com/

Anyway the content is good.
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-31  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 18:00 [PATCH] ARM: dts: sun8i: v3s: Enable crypto engine Martin Cerveny
2020-08-31  6:34 ` Corentin Labbe

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).