2015-10-30 08:22:45

by zain

[permalink] [raw]
Subject: [RESEND PATCH 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 or 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/rk-crypto.txt | 31 ++
arch/arm/boot/dts/rk3288.dtsi | 16 +
drivers/clk/rockchip/clk-rk3288.c | 2 +-
drivers/crypto/Makefile | 1 +
drivers/crypto/rk_crypto/Makefile | 3 +
drivers/crypto/rk_crypto/rk3288_crypto.c | 393 ++++++++++++++++
drivers/crypto/rk_crypto/rk3288_crypto.h | 291 ++++++++++++
.../crypto/rk_crypto/rk3288_crypto_ablkcipher.c | 502 +++++++++++++++++++++
8 files changed, 1238 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/crypto/rk-crypto.txt
create mode 100644 drivers/crypto/rk_crypto/Makefile
create mode 100644 drivers/crypto/rk_crypto/rk3288_crypto.c
create mode 100644 drivers/crypto/rk_crypto/rk3288_crypto.h
create mode 100644 drivers/crypto/rk_crypto/rk3288_crypto_ablkcipher.c

--
1.9.1


2015-10-30 08:22:47

by zain

[permalink] [raw]
Subject: [RESEND PATCH 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 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index 9040878..d74bd5d 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(SRST_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,
--
1.9.1

2015-10-30 08:54:02

by Heiko Stübner

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

Hi Zain,

Am Freitag, 30. Oktober 2015, 16:22:47 schrieb Zain Wang:
> 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 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
> index 9040878..d74bd5d 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(SRST_CRYPTO, "crypto", "aclk_cpu_pre", 0,

the id you want to use actually is a soft-reset index, not a clock-id.
You would need to add a real id, in this case with an sclk_ prefix.

> RK3288_CLKSEL_CON(26), 6, 2, DFLAGS,
> RK3288_CLKGATE_CON(5), 4, GFLAGS),
> GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", CLK_IGNORE_UNUSED,
>

It should probably look more like below, but as suggested by Stephen Boyd
in another thread, we should coordinate with Chris to add more necessary clock
ids in one go:
-------- 8< -----------
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index 9040878..9fd9f5a 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, "sclk_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..9e0a5e9 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
--
2.6.1

-------- 8< -----------

2015-11-02 07:54:18

by zain

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

Hi Heiko,

On 2015年10月30日 16:54, Heiko Stuebner wrote:
> Hi Zain,
>
> Am Freitag, 30. Oktober 2015, 16:22:47 schrieb Zain Wang:
>> 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 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
>> index 9040878..d74bd5d 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(SRST_CRYPTO, "crypto", "aclk_cpu_pre", 0,
> the id you want to use actually is a soft-reset index, not a clock-id.
> You would need to add a real id, in this case with an sclk_ prefix.
ok! done!
>
>> RK3288_CLKSEL_CON(26), 6, 2, DFLAGS,
>> RK3288_CLKGATE_CON(5), 4, GFLAGS),
>> GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", CLK_IGNORE_UNUSED,
>>
> It should probably look more like below, but as suggested by Stephen Boyd
> in another thread, we should coordinate with Chris to add more necessary clock
> ids in one go:
> -------- 8< -----------
> diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
> index 9040878..9fd9f5a 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, "sclk_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..9e0a5e9 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