2015-11-03 05:52:04

by zain

[permalink] [raw]
Subject: [PATCH v1 0/4] Crypto: add crypto accelerator support for rk3288

This commit support three cipher(AES/DES/DES3) and two chainmode(ecb/cbc),
and the more algorithms and new hash drivers will be added later on.

Zain Wang (4):
Crypto: Crypto driver support aes/des/des3 for rk3288
clk: rockchip: set an id for crypto clk
ARM: dts: rockchip: Add Crypto drivers for rk3288
crypto: rk_crypto - add DT bindings documentation

.../devicetree/bindings/crypto/rockchip-crypto.txt | 29 ++
arch/arm/boot/dts/rk3288.dtsi | 15 +
drivers/clk/rockchip/clk-rk3288.c | 2 +-
drivers/crypto/Kconfig | 11 +
drivers/crypto/Makefile | 1 +
drivers/crypto/rockchip/Makefile | 3 +
drivers/crypto/rockchip/rk3288_crypto.c | 383 ++++++++++++++++
drivers/crypto/rockchip/rk3288_crypto.h | 290 ++++++++++++
drivers/crypto/rockchip/rk3288_crypto_ablkcipher.c | 501 +++++++++++++++++++++
include/dt-bindings/clock/rk3288-cru.h | 1 +
10 files changed, 1235 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/crypto/rockchip-crypto.txt
create mode 100644 drivers/crypto/rockchip/Makefile
create mode 100644 drivers/crypto/rockchip/rk3288_crypto.c
create mode 100644 drivers/crypto/rockchip/rk3288_crypto.h
create mode 100644 drivers/crypto/rockchip/rk3288_crypto_ablkcipher.c

--
1.9.1


2015-11-03 05:54:43

by zain

[permalink] [raw]
Subject: [PATCH v1 4/4] crypto: rk_crypto - add DT bindings documentation

Add DT bindings documentation for the rk3288 crypto drivers.

Signed-off-by: Zain Wang <[email protected]>
---
.../devicetree/bindings/crypto/rockchip-crypto.txt | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 Documentation/devicetree/bindings/crypto/rockchip-crypto.txt

diff --git a/Documentation/devicetree/bindings/crypto/rockchip-crypto.txt b/Documentation/devicetree/bindings/crypto/rockchip-crypto.txt
new file mode 100644
index 0000000..d27e203
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/rockchip-crypto.txt
@@ -0,0 +1,29 @@
+Rockchip Electronics And Security Accelerator
+
+Required properties:
+- compatible: Should be "rockchip,rk3288-crypto"
+- reg: base physical address of the engine and length of memory mapped
+ region
+- interrupts: interrupt number
+- clocks: reference to the clocks about crypto
+- clock-names: "aclk" used to clock data
+ "hclk" used to clock data
+ "srst" used to clock crypto accelerator
+ "apb_pclk" used to clock dma
+
+Examples:
+
+ crypto: cypto-controller@ff8a0000 {
+ compatible = "rockchip,rk3288-crypto";
+ reg = <0xff8a0000 0x4000>;
+ interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru ACLK_CRYPTO>,
+ <&cru HCLK_CRYPTO>,
+ <&cru SCLK_CRYPTO>,
+ <&cru ACLK_DMAC1>;
+ clock-names = "aclk",
+ "hclk",
+ "sclk",
+ "apb_pclk";
+ status = "okay";
+ };
--
1.9.1

2015-11-03 05:54:43

by zain

[permalink] [raw]
Subject: [PATCH v1 2/4] clk: rockchip: set an id for crypto clk

set an id for crypto clk, so that it can be called in other part.

Signed-off-by: Zain Wang <[email protected]>
---
drivers/clk/rockchip/clk-rk3288.c | 2 +-
include/dt-bindings/clock/rk3288-cru.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index 9040878..3fceda1 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -295,7 +295,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
RK3288_CLKGATE_CON(0), 4, GFLAGS),
GATE(0, "c2c_host", "aclk_cpu_src", 0,
RK3288_CLKGATE_CON(13), 8, GFLAGS),
- COMPOSITE_NOMUX(0, "crypto", "aclk_cpu_pre", 0,
+ COMPOSITE_NOMUX(SCLK_CRYPTO, "crypto", "aclk_cpu_pre", 0,
RK3288_CLKSEL_CON(26), 6, 2, DFLAGS,
RK3288_CLKGATE_CON(5), 4, GFLAGS),
GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", CLK_IGNORE_UNUSED,
diff --git a/include/dt-bindings/clock/rk3288-cru.h b/include/dt-bindings/clock/rk3288-cru.h
index c719aac..30dcd60 100644
--- a/include/dt-bindings/clock/rk3288-cru.h
+++ b/include/dt-bindings/clock/rk3288-cru.h
@@ -86,6 +86,7 @@
#define SCLK_USBPHY480M_SRC 122
#define SCLK_PVTM_CORE 123
#define SCLK_PVTM_GPU 124
+#define SCLK_CRYPTO 125

#define SCLK_MAC 151
#define SCLK_MACREF_OUT 152
--
1.9.1

2015-11-03 05:52:07

by zain

[permalink] [raw]
Subject: [PATCH v1 3/4] ARM: dts: rockchip: Add Crypto drivers for rk3288

Add Crypto drivers for rk3288 including crypto controller and dma clk.

Signed-off-by: Zain Wang <[email protected]>
---
arch/arm/boot/dts/rk3288.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 6a79c9c..7b7914e 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -170,6 +170,21 @@
};
};

+ crypto: cypto-controller@ff8a0000 {
+ compatible = "rockchip,rk3288-crypto";
+ reg = <0xff8a0000 0x4000>;
+ interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru ACLK_CRYPTO>,
+ <&cru HCLK_CRYPTO>,
+ <&cru SCLK_CRYPTO>,
+ <&cru ACLK_DMAC1>;
+ clock-names = "aclk",
+ "hclk",
+ "sclk",
+ "apb_pclk";
+ status = "okay";
+ };
+
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
--
1.9.1

2015-11-04 10:08:15

by Michael Turquette

[permalink] [raw]
Subject: Re: [PATCH v1 2/4] clk: rockchip: set an id for crypto clk

Quoting Zain Wang (2015-11-02 21:52:06)
> set an id for crypto clk, so that it can be called in other part.
>
> Signed-off-by: Zain Wang <[email protected]>

Looks good to me. I can apply after -rc1 drops, or if you prefer to take
this series all together then you have my ack:

Acked-by: Michael Turquette <[email protected]>

Regards,
Mike

> ---
> drivers/clk/rockchip/clk-rk3288.c | 2 +-
> include/dt-bindings/clock/rk3288-cru.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
> index 9040878..3fceda1 100644
> --- a/drivers/clk/rockchip/clk-rk3288.c
> +++ b/drivers/clk/rockchip/clk-rk3288.c
> @@ -295,7 +295,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
> RK3288_CLKGATE_CON(0), 4, GFLAGS),
> GATE(0, "c2c_host", "aclk_cpu_src", 0,
> RK3288_CLKGATE_CON(13), 8, GFLAGS),
> - COMPOSITE_NOMUX(0, "crypto", "aclk_cpu_pre", 0,
> + COMPOSITE_NOMUX(SCLK_CRYPTO, "crypto", "aclk_cpu_pre", 0,
> RK3288_CLKSEL_CON(26), 6, 2, DFLAGS,
> RK3288_CLKGATE_CON(5), 4, GFLAGS),
> GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", CLK_IGNORE_UNUSED,
> diff --git a/include/dt-bindings/clock/rk3288-cru.h b/include/dt-bindings/clock/rk3288-cru.h
> index c719aac..30dcd60 100644
> --- a/include/dt-bindings/clock/rk3288-cru.h
> +++ b/include/dt-bindings/clock/rk3288-cru.h
> @@ -86,6 +86,7 @@
> #define SCLK_USBPHY480M_SRC 122
> #define SCLK_PVTM_CORE 123
> #define SCLK_PVTM_GPU 124
> +#define SCLK_CRYPTO 125
>
> #define SCLK_MAC 151
> #define SCLK_MACREF_OUT 152
> --
> 1.9.1
>
>