All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gaurav Jain <gaurav.jain@nxp.com>
To: Stefano Babic <sbabic@denx.de>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Cc: Fabio Estevam <festevam@gmail.com>,
	Priyanka Jain <priyanka.jain@nxp.com>,  Ye Li <ye.li@nxp.com>,
	Horia Geanta <horia.geanta@nxp.com>,
	Silvano Di Ninno <silvano.dininno@nxp.com>,
	Varun Sethi <V.Sethi@nxp.com>, dl-uboot-imx <uboot-imx@nxp.com>
Subject: RE: [EXT] Re: [PATCH] i.MX8 crypto/fsl: Enable fsl CAAM rng driver
Date: Fri, 22 Apr 2022 11:11:51 +0000	[thread overview]
Message-ID: <VI1PR04MB5342ECBBC92279C3EBB9CBAEE7F79@VI1PR04MB5342.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <d63390e3-7eb5-b121-80b4-5ecc5ca4b94e@denx.de>

Hello Stefano

> -----Original Message-----
> From: Stefano Babic <sbabic@denx.de>
> Sent: Friday, April 22, 2022 2:29 AM
> To: Gaurav Jain <gaurav.jain@nxp.com>; Stefano Babic <sbabic@denx.de>; u-
> boot@lists.denx.de
> Cc: Fabio Estevam <festevam@gmail.com>; Priyanka Jain
> <priyanka.jain@nxp.com>; Ye Li <ye.li@nxp.com>; Horia Geanta
> <horia.geanta@nxp.com>; Silvano Di Ninno <silvano.dininno@nxp.com>; Varun
> Sethi <V.Sethi@nxp.com>; dl-uboot-imx <uboot-imx@nxp.com>
> Subject: [EXT] Re: [PATCH] i.MX8 crypto/fsl: Enable fsl CAAM rng driver
> 
> Caution: EXT Email
> 
> Hi Gaurav,
> 
> Il 19.04.22 16:04, Gaurav Jain ha scritto:
> > rng driver enabled to read random number using caam.
> >
> > Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
> > ---
> >   drivers/crypto/fsl/jr.c  | 8 +++++++-
> >   drivers/crypto/fsl/rng.c | 8 +++++++-
> >   2 files changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/crypto/fsl/jr.c b/drivers/crypto/fsl/jr.c index
> > 85a3dac796..acd29924f7 100644
> > --- a/drivers/crypto/fsl/jr.c
> > +++ b/drivers/crypto/fsl/jr.c
> > @@ -767,8 +767,14 @@ init:
> >               return -1;
> >       }
> >   #if CONFIG_IS_ENABLED(OF_CONTROL)
> > -     if (ofnode_valid(scu_node))
> > +     if (ofnode_valid(scu_node)) {
> > +             if (IS_ENABLED(CONFIG_DM_RNG)) {
> > +                     ret = device_bind_driver(NULL, "caam-rng", "caam-rng", NULL);
> > +                     if (ret)
> > +                             printf("Couldn't bind rng driver (%d)\n", ret);
> > +             }
> >               return ret;
> > +     }
> >   #endif
> >
> >   #ifdef CONFIG_FSL_CORENET
> > diff --git a/drivers/crypto/fsl/rng.c b/drivers/crypto/fsl/rng.c index
> > 0636494805..b568c337a6 100644
> > --- a/drivers/crypto/fsl/rng.c
> > +++ b/drivers/crypto/fsl/rng.c
> > @@ -26,10 +26,16 @@ struct caam_rng_priv {
> >
> >   static int caam_rng_read_one(struct caam_rng_priv *priv)
> >   {
> > +     struct udevice *dev;
> >       int size = ALIGN(CAAM_RNG_MAX_FIFO_STORE_SIZE,
> ARCH_DMA_MINALIGN);
> >       int ret;
> >
> > -     ret = run_descriptor_jr(priv->desc);
> > +     if (uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr),
> &dev) || !dev) {
> > +             printf("No CAAM device\n");
> > +             return -ENODEV;
> > +     }
> > +
> > +     ret = misc_ioctl(dev, CAAM_JR_RUN_DESC, priv->desc);
> >       if (ret < 0)
> >               return -EIO;
> >
> 
> This breaks the kontron_sl28 board. Can you check and fix it, please ?
> Thanks !

Sent v2 of this patch after fixing the error.

Regards
Gaurav Jain
> 
> Best regards,
> Stefano
> 
> --
> =================================================================
> ====
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
> =================================================================
> ====

      reply	other threads:[~2022-04-22 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 14:04 [PATCH] i.MX8 crypto/fsl: Enable fsl CAAM rng driver Gaurav Jain
2022-04-21 20:59 ` Stefano Babic
2022-04-22 11:11   ` Gaurav Jain [this message]

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=VI1PR04MB5342ECBBC92279C3EBB9CBAEE7F79@VI1PR04MB5342.eurprd04.prod.outlook.com \
    --to=gaurav.jain@nxp.com \
    --cc=V.Sethi@nxp.com \
    --cc=festevam@gmail.com \
    --cc=horia.geanta@nxp.com \
    --cc=priyanka.jain@nxp.com \
    --cc=sbabic@denx.de \
    --cc=silvano.dininno@nxp.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.