linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: linux-samsung-soc@vger.kernel.org, linux-crypto@vger.kernel.org
Cc: "Naveen Krishna Chatradhi <ch.naveen@samsung.com; Jonghwa Lee"
	<jonghwa3.lee@samsung.com>
Subject: Issues with HW RNG on Exynos 5422
Date: Sat, 15 Aug 2015 13:19:03 +0200	[thread overview]
Message-ID: <55CF2027.2050707@gmail.com> (raw)

I'm having issues making the hardware RNG work on a Samsung Exynos 5422 (Odroid XU4) with kernel 4.2rc6.
No random number generation is started if I write the appropriate value (0x18) to the hash control register.

What I did so far:
Splitted the sss DT node in exynos5420.dtsi into one for the s5p-sss driver and one for the exynos-rng driver.
(s5p-sss doesn't seem to need the hash registers from offset 0x400)

sss: sss@10830000 {
	icompatible = "samsung,exynos4210-secss";
	reg = <0x10830000 0x400>;
	interrupts = <0 112 0>;
	clocks = <&clock CLK_SSS>;
	clock-names = "secss";
};

rng: rng@10830400 {
	compatible = "samsung,exynosrng-secss";
	reg = <0x10830400 0x300>;
	clocks = <&clock CLK_SSS>;
	clock-names = "secss";
};

The DT binding is just for testing and after adding some DT glue logic (of_device_id table) to the exynos-rng driver
it binds to the rng platform device.
The clock also seems to be ok with a rate of 266 MHz.
As is the driver hangs in a loop because the PRNG_DONE in the status register bit never gets set.

I traced it back to the hash control register not accepting value 0x8 (or 0x18 incl. the start bit) for the PRNG.
Writing a value and reading it back works for values from 0 to 5 only.
As I have no SSS datasheet my only other reference is drivers/crypto/ace_sha.h in the uboot source code
which also uses the HW RNG.

Any hint would be appreciated.

             reply	other threads:[~2015-08-15 11:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15 11:19 Heiner Kallweit [this message]
2015-08-16 11:18 ` Issues with HW RNG / SSS on Exynos 5422 Heiner Kallweit
2015-08-17  0:19   ` Krzysztof Kozlowski
2015-08-17  6:10     ` Heiner Kallweit
2015-08-17  6:30       ` Krzysztof Kozlowski
2015-08-18  6:02         ` Heiner Kallweit
2015-08-18  6:49           ` Krzysztof Kozlowski
     [not found]   ` <55D07227.1010209@gmail.com>
2015-08-17  0:45     ` jonghwa3.lee
2015-08-24  0:33   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CF2027.2050707@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=jonghwa3.lee@samsung.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).