* [PATCH 0/3] ARM: dts: Enable Exynos RNG module
@ 2015-10-19 5:00 Krzysztof Kozlowski
2015-10-19 5:00 ` [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock Krzysztof Kozlowski
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2015-10-19 5:00 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
The patchset adds necessary clock from Security SubSystem (SSS)
and enables the PRNG module of Exynos for Trats2 board.
The first patch (clock) is required for other ones so please
take everything in one step.
The actual Device Tree support (and compatible) was sent in separate
patch:
- https://patchwork.kernel.org/patch/7432891/
- http://marc.info/?l=linux-crypto-vger&m=144522952725052&w=2
The device can be tested (after applying both patchsets) with:
$ echo exynos > /sys/class/misc/hw_random/rng_current
$ dd if=/dev/hwrng of=/dev/null bs=1 count=16
Best regards,
Krzysztof
Krzysztof Kozlowski (3):
clk: samsung: exynos4: Add SSS gate clock
ARM: dts: Add PRNG module for exynos4
ARM: dts: Enable PRNG module on exynos4412-trats2
arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++
arch/arm/boot/dts/exynos4412-trats2.dts | 4 ++++
drivers/clk/samsung/clk-exynos4.c | 1 +
include/dt-bindings/clock/exynos4.h | 1 +
4 files changed, 14 insertions(+)
--
1.9.1
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock 2015-10-19 5:00 [PATCH 0/3] ARM: dts: Enable Exynos RNG module Krzysztof Kozlowski @ 2015-10-19 5:00 ` Krzysztof Kozlowski 2015-10-19 19:59 ` Stephen Boyd 2015-10-19 5:00 ` [PATCH 2/3] ARM: dts: Add PRNG module for exynos4 Krzysztof Kozlowski ` (2 subsequent siblings) 3 siblings, 1 reply; 10+ messages in thread From: Krzysztof Kozlowski @ 2015-10-19 5:00 UTC (permalink / raw) To: linux-arm-kernel Add a gate clock for controlling all clocks of Security Sub System (SSS). Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> --- drivers/clk/samsung/clk-exynos4.c | 1 + include/dt-bindings/clock/exynos4.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 7f370d3e0983..ac03e4fe2871 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -1024,6 +1024,7 @@ static struct samsung_gate_clock exynos4_gate_clks[] __initdata = { 0, 0), GATE(CLK_AC97, "ac97", "aclk100", GATE_IP_PERIL, 27, 0, 0), + GATE(CLK_SSS, "sss", "aclk133", GATE_IP_DMC, 4, 0, 0), GATE(CLK_PPMUDMC0, "ppmudmc0", "aclk133", GATE_IP_DMC, 8, 0, 0), GATE(CLK_PPMUDMC1, "ppmudmc1", "aclk133", GATE_IP_DMC, 9, 0, 0), GATE(CLK_PPMUCPU, "ppmucpu", "aclk133", GATE_IP_DMC, 10, 0, 0), diff --git a/include/dt-bindings/clock/exynos4.h b/include/dt-bindings/clock/exynos4.h index c4b1676ea674..c40111f36d5e 100644 --- a/include/dt-bindings/clock/exynos4.h +++ b/include/dt-bindings/clock/exynos4.h @@ -93,6 +93,7 @@ #define CLK_SCLK_FIMG2D 177 /* gate clocks */ +#define CLK_SSS 255 #define CLK_FIMC0 256 #define CLK_FIMC1 257 #define CLK_FIMC2 258 -- 1.9.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock 2015-10-19 5:00 ` [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock Krzysztof Kozlowski @ 2015-10-19 19:59 ` Stephen Boyd 2015-10-19 23:51 ` Krzysztof Kozlowski 0 siblings, 1 reply; 10+ messages in thread From: Stephen Boyd @ 2015-10-19 19:59 UTC (permalink / raw) To: linux-arm-kernel On 10/19, Krzysztof Kozlowski wrote: > Add a gate clock for controlling all clocks of Security Sub System > (SSS). > > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> > --- The To: list is huge, so I have no idea if you want me to apply this patch or not, and given that it's part of a series that has dts changes I guess that means it should go through arm-soc: Acked-by: Stephen Boyd <sboyd@codeaurora.org> -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock 2015-10-19 19:59 ` Stephen Boyd @ 2015-10-19 23:51 ` Krzysztof Kozlowski 0 siblings, 0 replies; 10+ messages in thread From: Krzysztof Kozlowski @ 2015-10-19 23:51 UTC (permalink / raw) To: linux-arm-kernel On 20.10.2015 04:59, Stephen Boyd wrote: > On 10/19, Krzysztof Kozlowski wrote: >> Add a gate clock for controlling all clocks of Security Sub System >> (SSS). >> >> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> >> --- > > The To: list is huge, so I have no idea if you want me to apply > this patch or not, and given that it's part of a series that has > dts changes I guess that means it should go through arm-soc: > > Acked-by: Stephen Boyd <sboyd@codeaurora.org> If you are OK with that I would like to push it through arm-soc. Thanks for the ack! Best regards, Krzysztof ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] ARM: dts: Add PRNG module for exynos4 2015-10-19 5:00 [PATCH 0/3] ARM: dts: Enable Exynos RNG module Krzysztof Kozlowski 2015-10-19 5:00 ` [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock Krzysztof Kozlowski @ 2015-10-19 5:00 ` Krzysztof Kozlowski 2015-10-19 5:00 ` [PATCH 3/3] ARM: dts: Enable PRNG module on exynos4412-trats2 Krzysztof Kozlowski 2015-10-19 16:11 ` [PATCH 0/3] ARM: dts: Enable Exynos RNG module Tobias Jakobi 3 siblings, 0 replies; 10+ messages in thread From: Krzysztof Kozlowski @ 2015-10-19 5:00 UTC (permalink / raw) To: linux-arm-kernel Add Pseudo Random Number Generator (PRNG) node of Security Sub System (SSS) to Exynos 4 DTSI. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> --- arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index 3184e10f260a..a6b9913ea2b5 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -954,4 +954,12 @@ power-domains = <&pd_lcd0>; #iommu-cells = <0>; }; + + prng: rng at 10830400 { + compatible = "samsung,exynos4-rng"; + reg = <0x10830400 0x200>; + clocks = <&clock CLK_SSS>; + clock-names = "secss"; + status = "disabled"; + }; }; -- 1.9.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] ARM: dts: Enable PRNG module on exynos4412-trats2 2015-10-19 5:00 [PATCH 0/3] ARM: dts: Enable Exynos RNG module Krzysztof Kozlowski 2015-10-19 5:00 ` [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock Krzysztof Kozlowski 2015-10-19 5:00 ` [PATCH 2/3] ARM: dts: Add PRNG module for exynos4 Krzysztof Kozlowski @ 2015-10-19 5:00 ` Krzysztof Kozlowski 2015-10-19 16:11 ` [PATCH 0/3] ARM: dts: Enable Exynos RNG module Tobias Jakobi 3 siblings, 0 replies; 10+ messages in thread From: Krzysztof Kozlowski @ 2015-10-19 5:00 UTC (permalink / raw) To: linux-arm-kernel Enable Pseudo Random Number Generator (PRNG) on Trats2 board. This allows using hardware random number generator: $ echo exynos > /sys/class/misc/hw_random/rng_current Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> --- arch/arm/boot/dts/exynos4412-trats2.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 40a474c4374b..a6f78c3da935 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -1234,6 +1234,10 @@ status = "okay"; }; +&prng { + status = "okay"; +}; + &rtc { status = "okay"; clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>; -- 1.9.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 0/3] ARM: dts: Enable Exynos RNG module 2015-10-19 5:00 [PATCH 0/3] ARM: dts: Enable Exynos RNG module Krzysztof Kozlowski ` (2 preceding siblings ...) 2015-10-19 5:00 ` [PATCH 3/3] ARM: dts: Enable PRNG module on exynos4412-trats2 Krzysztof Kozlowski @ 2015-10-19 16:11 ` Tobias Jakobi 2015-10-19 23:50 ` Krzysztof Kozlowski 3 siblings, 1 reply; 10+ messages in thread From: Tobias Jakobi @ 2015-10-19 16:11 UTC (permalink / raw) To: linux-arm-kernel Hello Krzysztof, I can confirm that this also works on a Odroid-X2, so I guess it's safe to enable the PRNG for all Exynos4412-based Odroid devices. Any chance that you might also take a look at the other hwcrypto stuff on the SoC ('samsung,exynos4210-secss' compatible)? With best wishes, Tobias Krzysztof Kozlowski wrote: > Hi, > > > The patchset adds necessary clock from Security SubSystem (SSS) > and enables the PRNG module of Exynos for Trats2 board. > > The first patch (clock) is required for other ones so please > take everything in one step. > > The actual Device Tree support (and compatible) was sent in separate > patch: > - https://patchwork.kernel.org/patch/7432891/ > - http://marc.info/?l=linux-crypto-vger&m=144522952725052&w=2 > > The device can be tested (after applying both patchsets) with: > $ echo exynos > /sys/class/misc/hw_random/rng_current > $ dd if=/dev/hwrng of=/dev/null bs=1 count=16 > > > Best regards, > Krzysztof > > Krzysztof Kozlowski (3): > clk: samsung: exynos4: Add SSS gate clock > ARM: dts: Add PRNG module for exynos4 > ARM: dts: Enable PRNG module on exynos4412-trats2 > > arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++ > arch/arm/boot/dts/exynos4412-trats2.dts | 4 ++++ > drivers/clk/samsung/clk-exynos4.c | 1 + > include/dt-bindings/clock/exynos4.h | 1 + > 4 files changed, 14 insertions(+) > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/3] ARM: dts: Enable Exynos RNG module 2015-10-19 16:11 ` [PATCH 0/3] ARM: dts: Enable Exynos RNG module Tobias Jakobi @ 2015-10-19 23:50 ` Krzysztof Kozlowski 2015-10-24 23:58 ` Tobias Jakobi 0 siblings, 1 reply; 10+ messages in thread From: Krzysztof Kozlowski @ 2015-10-19 23:50 UTC (permalink / raw) To: linux-arm-kernel On 20.10.2015 01:11, Tobias Jakobi wrote: > Hello Krzysztof, > > I can confirm that this also works on a Odroid-X2, so I guess it's safe > to enable the PRNG for all Exynos4412-based Odroid devices. Sure, I can send a patch for that. I can test it later also on Odroid-U3. > > Any chance that you might also take a look at the other hwcrypto stuff > on the SoC ('samsung,exynos4210-secss' compatible)? What do you mean? The s5p-sss driver already supports Device Tree. Best regards, Krzysztof > > With best wishes, > Tobias > > > Krzysztof Kozlowski wrote: >> Hi, >> >> >> The patchset adds necessary clock from Security SubSystem (SSS) >> and enables the PRNG module of Exynos for Trats2 board. >> >> The first patch (clock) is required for other ones so please >> take everything in one step. >> >> The actual Device Tree support (and compatible) was sent in separate >> patch: >> - https://patchwork.kernel.org/patch/7432891/ >> - http://marc.info/?l=linux-crypto-vger&m=144522952725052&w=2 >> >> The device can be tested (after applying both patchsets) with: >> $ echo exynos > /sys/class/misc/hw_random/rng_current >> $ dd if=/dev/hwrng of=/dev/null bs=1 count=16 >> >> >> Best regards, >> Krzysztof >> >> Krzysztof Kozlowski (3): >> clk: samsung: exynos4: Add SSS gate clock >> ARM: dts: Add PRNG module for exynos4 >> ARM: dts: Enable PRNG module on exynos4412-trats2 >> >> arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++ >> arch/arm/boot/dts/exynos4412-trats2.dts | 4 ++++ >> drivers/clk/samsung/clk-exynos4.c | 1 + >> include/dt-bindings/clock/exynos4.h | 1 + >> 4 files changed, 14 insertions(+) >> > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/3] ARM: dts: Enable Exynos RNG module 2015-10-19 23:50 ` Krzysztof Kozlowski @ 2015-10-24 23:58 ` Tobias Jakobi 2015-10-29 6:24 ` Krzysztof Kozlowski 0 siblings, 1 reply; 10+ messages in thread From: Tobias Jakobi @ 2015-10-24 23:58 UTC (permalink / raw) To: linux-arm-kernel Hello Krzysztof, Krzysztof Kozlowski wrote: > On 20.10.2015 01:11, Tobias Jakobi wrote: >> Hello Krzysztof, >> >> I can confirm that this also works on a Odroid-X2, so I guess it's safe >> to enable the PRNG for all Exynos4412-based Odroid devices. > > Sure, I can send a patch for that. I can test it later also on Odroid-U3. Thanks already! >> Any chance that you might also take a look at the other hwcrypto stuff >> on the SoC ('samsung,exynos4210-secss' compatible)? > > What do you mean? The s5p-sss driver already supports Device Tree. The driver supports DT, but it doesn't really work. I'm using the following DT entry to let the driver probe correctly: https://github.com/tobiasjakobi/linux-odroid/commit/82c00cddb5cbf89fad994784c28c8125beae8e13 But the crypto self-test fails on boot: alg: skcipher: encryption failed on test 1 for ecb-aes-s5p: ret=22 Another problems is that SSS and PRNG can't be used at the same time, since they both use common hardware resources (I think it was IO). With best wishes, Tobias > Best regards, > Krzysztof > >> >> With best wishes, >> Tobias >> >> >> Krzysztof Kozlowski wrote: >>> Hi, >>> >>> >>> The patchset adds necessary clock from Security SubSystem (SSS) >>> and enables the PRNG module of Exynos for Trats2 board. >>> >>> The first patch (clock) is required for other ones so please >>> take everything in one step. >>> >>> The actual Device Tree support (and compatible) was sent in separate >>> patch: >>> - https://patchwork.kernel.org/patch/7432891/ >>> - http://marc.info/?l=linux-crypto-vger&m=144522952725052&w=2 >>> >>> The device can be tested (after applying both patchsets) with: >>> $ echo exynos > /sys/class/misc/hw_random/rng_current >>> $ dd if=/dev/hwrng of=/dev/null bs=1 count=16 >>> >>> >>> Best regards, >>> Krzysztof >>> >>> Krzysztof Kozlowski (3): >>> clk: samsung: exynos4: Add SSS gate clock >>> ARM: dts: Add PRNG module for exynos4 >>> ARM: dts: Enable PRNG module on exynos4412-trats2 >>> >>> arch/arm/boot/dts/exynos4.dtsi | 8 ++++++++ >>> arch/arm/boot/dts/exynos4412-trats2.dts | 4 ++++ >>> drivers/clk/samsung/clk-exynos4.c | 1 + >>> include/dt-bindings/clock/exynos4.h | 1 + >>> 4 files changed, 14 insertions(+) >>> >> >> > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/3] ARM: dts: Enable Exynos RNG module 2015-10-24 23:58 ` Tobias Jakobi @ 2015-10-29 6:24 ` Krzysztof Kozlowski 0 siblings, 0 replies; 10+ messages in thread From: Krzysztof Kozlowski @ 2015-10-29 6:24 UTC (permalink / raw) To: linux-arm-kernel On 25.10.2015 08:58, Tobias Jakobi wrote: > Hello Krzysztof, > > > Krzysztof Kozlowski wrote: >> On 20.10.2015 01:11, Tobias Jakobi wrote: >>> Hello Krzysztof, >>> >>> I can confirm that this also works on a Odroid-X2, so I guess it's safe >>> to enable the PRNG for all Exynos4412-based Odroid devices. >> >> Sure, I can send a patch for that. I can test it later also on Odroid-U3. > Thanks already! > > > >>> Any chance that you might also take a look at the other hwcrypto stuff >>> on the SoC ('samsung,exynos4210-secss' compatible)? >> >> What do you mean? The s5p-sss driver already supports Device Tree. > The driver supports DT, but it doesn't really work. > > I'm using the following DT entry to let the driver probe correctly: > https://github.com/tobiasjakobi/linux-odroid/commit/82c00cddb5cbf89fad994784c28c8125beae8e13 > > But the crypto self-test fails on boot: > alg: skcipher: encryption failed on test 1 for ecb-aes-s5p: ret=22 > > > Another problems is that SSS and PRNG can't be used at the same time, > since they both use common hardware resources (I think it was IO). > Thanks for explaining this. I added the issue to the long TODO list but I don't know when I will be able to dig into this. If anyone wants to look into this, please go ahead... Best regards, Krzysztof ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-10-29 6:24 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-19 5:00 [PATCH 0/3] ARM: dts: Enable Exynos RNG module Krzysztof Kozlowski 2015-10-19 5:00 ` [PATCH 1/3] clk: samsung: exynos4: Add SSS gate clock Krzysztof Kozlowski 2015-10-19 19:59 ` Stephen Boyd 2015-10-19 23:51 ` Krzysztof Kozlowski 2015-10-19 5:00 ` [PATCH 2/3] ARM: dts: Add PRNG module for exynos4 Krzysztof Kozlowski 2015-10-19 5:00 ` [PATCH 3/3] ARM: dts: Enable PRNG module on exynos4412-trats2 Krzysztof Kozlowski 2015-10-19 16:11 ` [PATCH 0/3] ARM: dts: Enable Exynos RNG module Tobias Jakobi 2015-10-19 23:50 ` Krzysztof Kozlowski 2015-10-24 23:58 ` Tobias Jakobi 2015-10-29 6:24 ` Krzysztof Kozlowski
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).