linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Horia Geanta <horia.geanta@nxp.com>
To: Chris Spencer <spencercw@gmail.com>
Cc: Aymen Sghaier <aymen.sghaier@nxp.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	Chris Spencer <christopher.spencer@sea.co.uk>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [RFC 4/4] crypto: caam - use job ring for RNG instantiation instead of DECO
Date: Mon, 4 Mar 2019 18:13:19 +0000	[thread overview]
Message-ID: <VI1PR0402MB3485DD524A658329D51258F498710@VI1PR0402MB3485.eurprd04.prod.outlook.com> (raw)
In-Reply-To: CAGUNXRTR3=xbj-scY=t4jqErcxQTsWHJM=sVESKZxNVHrLB_0g@mail.gmail.com

On 2/28/2019 1:34 PM, Chris Spencer wrote:
> What I have found is that if I set virt_en = 1 then the RNG is able to
> initialise correctly via the DECO. The register values I am seeing
> are:
> 
> comp_params = 01914201
> scfgr = 00000001
> 
> So:
> VIRT_EN_INCL = 1 & VIRT_EN_POR = 0 & SCFGR_VIRT_EN = 0
> 
> I don't have the i.MX8 security reference manual so there's only so
RM should be available from here:
https://www.nxp.com/webapp/sps/download/mod_download.jsp?colCode=IMX8MDQLQSRM&location=null&appType=moderated

> much analysis I can do, but it seems that virtualisation is enabled in
> hardware without the registers reflecting that appropriately. If I
> patch the TF-A to set SCFGR_VIRT_EN = 1 in the same place it sets
> CAAM_JRxMID = 1 then everything seems to work, but I've got no idea if
> that is an appropriate change to make.
> 
RNG initialization should work in both cases.

The root cause for the failure in case virtualization is disabled is probably
the lack of setup of DECO DID registers (offsets A0h, A4h).

Section "Register-based service interface" mentions:
"But before requesting a DECO, software must specify the DID and SDID values
that will be used when executing descriptors under direct software control. When
virtualization is disabled (SCFGR[VIRT_EN]=0), these values are specified by
writing DID and SDID values into the appropriate DECO DID_MS and DECO DID_LS
registers."

Horia

  reply	other threads:[~2019-03-04 18:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 10:06 [RFC 0/4] crypto: caam - Add i.MX8MQ support spencercw
2019-02-22 10:06 ` [RFC 1/4] crypto: caam - fix detection of i.MX8 SoC spencercw
2019-02-25  7:50   ` Chris Spencer
2019-02-22 10:06 ` [RFC 2/4] crypto: caam - do not initialise clocks on the i.MX8 spencercw
2019-02-22 10:06 ` [RFC 3/4] crypto: caam - correct DMA address size for " spencercw
2019-02-22 10:06 ` [RFC 4/4] crypto: caam - use job ring for RNG instantiation instead of DECO spencercw
2019-02-25 14:22   ` Horia Geanta
2019-02-25 14:36     ` Chris Spencer
2019-02-26 14:53       ` Horia Geanta
2019-02-26 16:24         ` Chris Spencer
2019-02-28 11:33           ` Chris Spencer
2019-03-04 18:13             ` Horia Geanta [this message]
2019-03-05  8:54               ` Chris Spencer
2019-02-25 14:03 ` [RFC 0/4] crypto: caam - Add i.MX8MQ support Horia Geanta
2019-02-25 14:17   ` Chris Spencer
2019-02-25 19:28     ` Chris Spencer

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=VI1PR0402MB3485DD524A658329D51258F498710@VI1PR0402MB3485.eurprd04.prod.outlook.com \
    --to=horia.geanta@nxp.com \
    --cc=aymen.sghaier@nxp.com \
    --cc=christopher.spencer@sea.co.uk \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=spencercw@gmail.com \
    /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).