From: Pankaj Gupta <pankaj.gupta@nxp.com>
To: Horia Geanta <horia.geanta@nxp.com>,
Gaurav Jain <gaurav.jain@nxp.com>, Varun Sethi <V.Sethi@nxp.com>,
"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
"davem@davemloft.net" <davem@davemloft.net>,
Iuliana Prodan <iuliana.prodan@nxp.com>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>,
Francesco Dolcini <francesco@dolcini.it>
Subject: RE: [PATCH v2] caam: init-clk based on caam-page0-access
Date: Mon, 15 Apr 2024 09:29:56 +0000 [thread overview]
Message-ID: <AM9PR04MB86042D682CC2E411826020A595092@AM9PR04MB8604.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <ab774af1-1599-46ff-843e-6333a55a97a3@nxp.com>
> -----Original Message-----
> From: Horia Geanta <horia.geanta@nxp.com>
> Sent: Friday, April 12, 2024 6:20 PM
> To: Pankaj Gupta <pankaj.gupta@nxp.com>; Gaurav Jain
> <gaurav.jain@nxp.com>; Varun Sethi <V.Sethi@nxp.com>;
> herbert@gondor.apana.org.au; davem@davemloft.net; Iuliana Prodan
> <iuliana.prodan@nxp.com>; linux-crypto@vger.kernel.org; linux-
> kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Francesco Dolcini
> <francesco@dolcini.it>
> Subject: Re: [PATCH v2] caam: init-clk based on caam-page0-access
>
> On 4/10/2024 11:00 AM, Pankaj Gupta wrote:
> > CAAM clock initialization to be done based on, soc specific info
> > stored in struct caam_imx_data:
> > - caam-page0-access flag
> > - num_clks
> >
> [...]
> > +static const struct caam_imx_data caam_imx8ulp_data = {
> > + .page0_access = false,
> > + .clks = NULL,
> > + .num_clks = 0,
> > +};
> Not needed, an empty static struct would do.
Accepted.
Will add this as part of separate patch, requested below.
>
> > static const struct soc_device_attribute caam_imx_soc_table[] = {
> > { .soc_id = "i.MX6UL", .data = &caam_imx6ul_data },
> > { .soc_id = "i.MX6*", .data = &caam_imx6_data },
> > { .soc_id = "i.MX7*", .data = &caam_imx7_data },
> > { .soc_id = "i.MX8M*", .data = &caam_imx7_data },
> > + { .soc_id = "i.MX8ULP", .data = &caam_imx8ulp_data },
> > { .soc_id = "VF*", .data = &caam_vf610_data },
> > { .family = "Freescale i.MX" },
> > { /* sentinel */ }
> As Francesco pointed out in v1, this change is not related.
>
> Ideally, adding support for i.MX8ULP SoC should be done in a separate patch,
> explaining a bit the particularities - similar to the commit message here:
> https://github.com/nxp-imx/linux-
> imx/commit/d420f224ee02c164f6bdb3c8bbb5ec5827eaba37
Will create a separate patch for this change.
>
> > @@ -889,7 +902,15 @@ static int caam_probe(struct platform_device
> > *pdev)
> >
> > reg_access = !ctrlpriv->optee_en;
> >
> > - if (!imx_soc_match->data) {
> > + if (imx_soc_match->data) {
> > + imx_soc_data = imx_soc_match->data;
> > + reg_access = reg_access && imx_soc_data-
> >page0_access;
> > + /*
> > + * CAAM clocks cannot be controlled from kernel.
> > + */
> > + if (!imx_soc_data->num_clks)
> > + goto iomap_ctrl;
> > + } else {
> > dev_err(dev, "No clock data provided for i.MX SoC");
> > return -EINVAL;
> > }
> if/else could be avoided, making code simpler:
>
> if (!imx_soc_match->data) {
> dev_err(dev, "No clock data provided for i.MX SoC");
> return -EINVAL;
> }
>
> imx_soc_data = imx_soc_match->data;
> reg_access = reg_access && imx_soc_data->page0_access;
> /* CAAM clocks cannot be controlled from kernel. */
> if (!imx_soc_data->num_clks)
> goto iomap_ctrl;
>
[Accepted]
> Regards,
> Horia
prev parent reply other threads:[~2024-04-15 9:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 7:58 [PATCH v2] caam: init-clk based on caam-page0-access Pankaj Gupta
2024-04-10 11:25 ` Gaurav Jain
2024-04-12 12:49 ` Horia Geanta
2024-04-15 9:29 ` Pankaj Gupta [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=AM9PR04MB86042D682CC2E411826020A595092@AM9PR04MB8604.eurprd04.prod.outlook.com \
--to=pankaj.gupta@nxp.com \
--cc=V.Sethi@nxp.com \
--cc=davem@davemloft.net \
--cc=francesco@dolcini.it \
--cc=gaurav.jain@nxp.com \
--cc=herbert@gondor.apana.org.au \
--cc=horia.geanta@nxp.com \
--cc=iuliana.prodan@nxp.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@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 read-only IMAP folder(s) and NNTP newsgroup(s).