From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Iuliana Prodan <iuliana.prodan@nxp.com>
Cc: "linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
Chris Spencer <christopher.spencer@sea.co.uk>,
Cory Tusar <cory.tusar@zii.aero>, Chris Healy <cphealy@gmail.com>,
Lucas Stach <l.stach@pengutronix.de>,
Horia Geanta <horia.geanta@nxp.com>,
Aymen Sghaier <aymen.sghaier@nxp.com>,
Leonard Crestez <leonard.crestez@nxp.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 02/16] crypto: caam - simplify clock initialization
Date: Mon, 15 Jul 2019 11:14:43 -0700 [thread overview]
Message-ID: <CAHQ1cqFCraDXFr4DYCE5XHM-fM=xQ5VrZkTVdV1NyrtdDyoR_A@mail.gmail.com> (raw)
In-Reply-To: <VI1PR04MB44452213E0EB98FA1FCC31688CFA0@VI1PR04MB4445.eurprd04.prod.outlook.com>
On Thu, Jul 4, 2019 at 8:43 AM Iuliana Prodan <iuliana.prodan@nxp.com> wrote:
>
> On 7/3/2019 11:15 AM, Andrey Smirnov wrote:
> > Simplify clock initialization code by converting it to use clk-bulk,
> > devres and soc_device_match() match table. No functional change
> > intended.
> >
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Cc: Chris Spencer <christopher.spencer@sea.co.uk>
> > Cc: Cory Tusar <cory.tusar@zii.aero>
> > Cc: Chris Healy <cphealy@gmail.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> > Cc: Horia Geantă <horia.geanta@nxp.com>
> > Cc: Aymen Sghaier <aymen.sghaier@nxp.com>
> > Cc: Leonard Crestez <leonard.crestez@nxp.com>
> > Cc: linux-crypto@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> > drivers/crypto/caam/ctrl.c | 203 +++++++++++++++++------------------
> > drivers/crypto/caam/intern.h | 7 +-
> > 2 files changed, 98 insertions(+), 112 deletions(-)
> >
> > diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
> > index e674d8770cdb..908d3ecf6d1c 100644
> > --- a/drivers/crypto/caam/ctrl.c
> > +++ b/drivers/crypto/caam/ctrl.c
> > @@ -25,16 +25,6 @@ EXPORT_SYMBOL(caam_dpaa2);
> > #include "qi.h"
> > #endif
> >
> > -/*
> > - * i.MX targets tend to have clock control subsystems that can
> > - * enable/disable clocking to our device.
> > - */
> > -static inline struct clk *caam_drv_identify_clk(struct device *dev,
> > - char *clk_name)
> > -{
> > - return caam_imx ? devm_clk_get(dev, clk_name) : NULL;
> > -}
> > -
> > /*
> > * Descriptor to instantiate RNG State Handle 0 in normal mode and
> > * load the JDKEK, TDKEK and TDSK registers
> > @@ -342,13 +332,6 @@ static int caam_remove(struct platform_device *pdev)
> > /* Unmap controller region */
> > iounmap(ctrl);
> >
> > - /* shut clocks off before finalizing shutdown */
> > - clk_disable_unprepare(ctrlpriv->caam_ipg);
> > - if (ctrlpriv->caam_mem)
> > - clk_disable_unprepare(ctrlpriv->caam_mem);
> > - clk_disable_unprepare(ctrlpriv->caam_aclk);
> > - if (ctrlpriv->caam_emi_slow)
> > - clk_disable_unprepare(ctrlpriv->caam_emi_slow);
> > return 0;
> > }
> >
> > @@ -497,20 +480,102 @@ static const struct of_device_id caam_match[] = {
> > };
> > MODULE_DEVICE_TABLE(of, caam_match);
> >
> > +struct caam_imx_data {
> > + const struct clk_bulk_data *clks;
> > + int num_clks;
> > +};
> > +
> > +static const struct clk_bulk_data caam_imx6_clks[] = {
> > + { .id = "ipg" },
> > + { .id = "mem" },
> > + { .id = "aclk" },
> > + { .id = "emi_slow" },
> > +};
> > +
> > +static const struct caam_imx_data caam_imx6_data = {
> > + .clks = caam_imx6_clks,
> > + .num_clks = ARRAY_SIZE(caam_imx6_clks),
> > +};
> > +
> > +static const struct clk_bulk_data caam_imx7_clks[] = {
> > + { .id = "ipg" },
> > + { .id = "aclk" },
> > +};
> > +
> > +static const struct caam_imx_data caam_imx7_data = {
> > + .clks = caam_imx7_clks,
> > + .num_clks = ARRAY_SIZE(caam_imx7_clks),
> > +};
> > +
> > +static const struct clk_bulk_data caam_imx6ul_clks[] = {
> > + { .id = "ipg" },
> > + { .id = "mem" },
> > + { .id = "aclk" },
> > +};
> > +
> > +static const struct caam_imx_data caam_imx6ul_data = {
> > + .clks = caam_imx6ul_clks,
> > + .num_clks = ARRAY_SIZE(caam_imx6ul_clks),
> > +};
> > +
> > +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 },
> > + { .family = "Freescale i.MX" },
> > +};
>
> You need to add a {/* sentinel */} in caam_imx_soc_table, otherwise will
> crash for other than i.MX targets, when trying to identify the SoC.
>
Ugh, definitely, my bad. Thanks for catching this!
Thanks,
Andrey Smirnov
next prev parent reply other threads:[~2019-07-15 18:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 8:13 [PATCH v4 00/16] crypto: caam - Add i.MX8MQ support Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 01/16] crypto: caam - move DMA mask selection into a function Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 02/16] crypto: caam - simplify clock initialization Andrey Smirnov
2019-07-03 13:54 ` Leonard Crestez
2019-07-04 15:43 ` Iuliana Prodan
2019-07-15 18:14 ` Andrey Smirnov [this message]
2019-07-03 8:13 ` [PATCH v4 03/16] crypto: caam - move tasklet_init() call down Andrey Smirnov
2019-07-03 13:51 ` Leonard Crestez
2019-07-03 17:14 ` Andrey Smirnov
2019-07-03 23:45 ` Leonard Crestez
2019-07-05 10:33 ` Horia Geanta
2019-07-03 8:13 ` [PATCH v4 04/16] crypto: caam - use deveres to allocate 'entinfo' Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 05/16] crypto: caam - use devres to allocate 'outring' Andrey Smirnov
2019-07-04 9:54 ` Horia Geanta
2019-07-03 8:13 ` [PATCH v4 06/16] crypto: caam - use devres to allocate 'inpring' Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 07/16] crytpo: caam - make use of iowrite64*_hi_lo in wr_reg64 Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 08/16] crypto: caam - use ioread64*_hi_lo in rd_reg64 Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 09/16] crypto: caam - drop 64-bit only wr/rd_reg64() Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 10/16] crypto: caam - make CAAM_PTR_SZ dynamic Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 11/16] crypto: caam - move cpu_to_caam_dma() selection to runtime Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 12/16] crypto: caam - drop explicit usage of struct jr_outentry Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 13/16] crypto: caam - don't hardcode inpentry size Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 14/16] crypto: caam - force DMA address to 32-bit on 64-bit i.MX SoCs Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 15/16] crypto: caam - always select job ring via RSR on i.MX8MQ Andrey Smirnov
2019-07-03 8:13 ` [PATCH v4 16/16] crypto: caam - add clock entry for i.MX8MQ Andrey Smirnov
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='CAHQ1cqFCraDXFr4DYCE5XHM-fM=xQ5VrZkTVdV1NyrtdDyoR_A@mail.gmail.com' \
--to=andrew.smirnov@gmail.com \
--cc=aymen.sghaier@nxp.com \
--cc=christopher.spencer@sea.co.uk \
--cc=cory.tusar@zii.aero \
--cc=cphealy@gmail.com \
--cc=horia.geanta@nxp.com \
--cc=iuliana.prodan@nxp.com \
--cc=l.stach@pengutronix.de \
--cc=leonard.crestez@nxp.com \
--cc=linux-crypto@vger.kernel.org \
--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 NNTP newsgroup(s).