From: Frieder Schrempf <frieder.schrempf@kontron.de> To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan <peng.fan@nxp.com> Subject: Re: [PATCH V3 3/4] soc: imx: Add generic blk-ctl driver Date: Thu, 6 May 2021 09:31:13 +0200 [thread overview] Message-ID: <32ffebc3-2155-4b92-5795-37d63235eb51@kontron.de> (raw) In-Reply-To: <20210506041555.10719-4-peng.fan@oss.nxp.com> On 06.05.21 06:15, Peng Fan (OSS) wrote: > From: Peng Fan <peng.fan@nxp.com> > > The i.MX8MM introduces an IP named BLK_CTL and usually is comprised of > some GPRs. > > The GPRs has some clock bits and reset bits, but here we take it > as virtual PDs, because of the clock and power domain A/B lock issue > when taking it as a clock controller. > > For some bits, it might be good to also make it as a reset controller, > but to i.MX8MM, we not add that support for now. > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > --- > drivers/soc/imx/Makefile | 2 +- > drivers/soc/imx/blk-ctl.c | 307 ++++++++++++++++++++++++++++++++++++++ > drivers/soc/imx/blk-ctl.h | 77 ++++++++++ > 3 files changed, 385 insertions(+), 1 deletion(-) > create mode 100644 drivers/soc/imx/blk-ctl.c > create mode 100644 drivers/soc/imx/blk-ctl.h > > diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile > index 078dc918f4f3..d3d2b49a386c 100644 > --- a/drivers/soc/imx/Makefile > +++ b/drivers/soc/imx/Makefile > @@ -4,4 +4,4 @@ obj-$(CONFIG_ARCH_MXC) += soc-imx.o > endif > obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o > obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o > -obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o > +obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o > diff --git a/drivers/soc/imx/blk-ctl.c b/drivers/soc/imx/blk-ctl.c > new file mode 100644 > index 000000000000..e184d862b26b > --- /dev/null > +++ b/drivers/soc/imx/blk-ctl.c > @@ -0,0 +1,307 @@ [...] > + > + blk_ctl->power_count--; > + > + if (!blk_ctl->power_count) { > + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); > + if (ret) > + dev_err(blk_ctl->dev, "Hankshake failed when power off\n"); You still have a 'k' instead of a 'd' in "Handshake"! > + } > + > +hsk_fail: > + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); > + > + mutex_unlock(&blk_ctl->lock); > + > + return ret; > +} > + > +int imx_blk_ctl_power_on(struct generic_pm_domain *domain) > +{ > + struct imx_blk_ctl_domain *pd = to_imx_blk_ctl_pd(domain); > + struct imx_blk_ctl *blk_ctl = pd->blk_ctl; > + struct regmap *regmap = blk_ctl->regmap; > + const struct imx_blk_ctl_hw *hw = &blk_ctl->dev_data->pds[pd->id]; > + int ret; > + > + mutex_lock(&blk_ctl->lock); > + > + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); > + if (ret) { > + mutex_unlock(&blk_ctl->lock); > + return ret; > + } > + > + if (!blk_ctl->power_count) { > + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); > + if (ret) { > + dev_err(blk_ctl->dev, "Hankshake failed when power on\n"); You still have a 'k' instead of a 'd' in "Handshake"! > + goto disable_clk; > + } > + } > + [...]
WARNING: multiple messages have this Message-ID (diff)
From: Frieder Schrempf <frieder.schrempf@kontron.de> To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan <peng.fan@nxp.com> Subject: Re: [PATCH V3 3/4] soc: imx: Add generic blk-ctl driver Date: Thu, 6 May 2021 09:31:13 +0200 [thread overview] Message-ID: <32ffebc3-2155-4b92-5795-37d63235eb51@kontron.de> (raw) In-Reply-To: <20210506041555.10719-4-peng.fan@oss.nxp.com> On 06.05.21 06:15, Peng Fan (OSS) wrote: > From: Peng Fan <peng.fan@nxp.com> > > The i.MX8MM introduces an IP named BLK_CTL and usually is comprised of > some GPRs. > > The GPRs has some clock bits and reset bits, but here we take it > as virtual PDs, because of the clock and power domain A/B lock issue > when taking it as a clock controller. > > For some bits, it might be good to also make it as a reset controller, > but to i.MX8MM, we not add that support for now. > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > --- > drivers/soc/imx/Makefile | 2 +- > drivers/soc/imx/blk-ctl.c | 307 ++++++++++++++++++++++++++++++++++++++ > drivers/soc/imx/blk-ctl.h | 77 ++++++++++ > 3 files changed, 385 insertions(+), 1 deletion(-) > create mode 100644 drivers/soc/imx/blk-ctl.c > create mode 100644 drivers/soc/imx/blk-ctl.h > > diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile > index 078dc918f4f3..d3d2b49a386c 100644 > --- a/drivers/soc/imx/Makefile > +++ b/drivers/soc/imx/Makefile > @@ -4,4 +4,4 @@ obj-$(CONFIG_ARCH_MXC) += soc-imx.o > endif > obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o > obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o > -obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o > +obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o > diff --git a/drivers/soc/imx/blk-ctl.c b/drivers/soc/imx/blk-ctl.c > new file mode 100644 > index 000000000000..e184d862b26b > --- /dev/null > +++ b/drivers/soc/imx/blk-ctl.c > @@ -0,0 +1,307 @@ [...] > + > + blk_ctl->power_count--; > + > + if (!blk_ctl->power_count) { > + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); > + if (ret) > + dev_err(blk_ctl->dev, "Hankshake failed when power off\n"); You still have a 'k' instead of a 'd' in "Handshake"! > + } > + > +hsk_fail: > + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); > + > + mutex_unlock(&blk_ctl->lock); > + > + return ret; > +} > + > +int imx_blk_ctl_power_on(struct generic_pm_domain *domain) > +{ > + struct imx_blk_ctl_domain *pd = to_imx_blk_ctl_pd(domain); > + struct imx_blk_ctl *blk_ctl = pd->blk_ctl; > + struct regmap *regmap = blk_ctl->regmap; > + const struct imx_blk_ctl_hw *hw = &blk_ctl->dev_data->pds[pd->id]; > + int ret; > + > + mutex_lock(&blk_ctl->lock); > + > + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); > + if (ret) { > + mutex_unlock(&blk_ctl->lock); > + return ret; > + } > + > + if (!blk_ctl->power_count) { > + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); > + if (ret) { > + dev_err(blk_ctl->dev, "Hankshake failed when power on\n"); You still have a 'k' instead of a 'd' in "Handshake"! > + goto disable_clk; > + } > + } > + [...] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-06 7:31 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-06 4:15 [PATCH V3 0/4] soc: imx: add i.MX BLK-CTL support Peng Fan (OSS) 2021-05-06 4:15 ` Peng Fan (OSS) 2021-05-06 4:15 ` [PATCH V3 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Peng Fan (OSS) 2021-05-06 4:15 ` Peng Fan (OSS) 2021-05-06 7:15 ` Frieder Schrempf 2021-05-06 7:15 ` Frieder Schrempf 2021-05-06 7:51 ` Abel Vesa 2021-05-06 7:51 ` Abel Vesa 2021-05-06 4:15 ` [PATCH V3 2/4] Documentation: bindings: clk: Add bindings for i.MX BLK_CTL Peng Fan (OSS) 2021-05-06 4:15 ` Peng Fan (OSS) 2021-05-07 1:02 ` Rob Herring 2021-05-07 1:02 ` Rob Herring 2021-05-06 4:15 ` [PATCH V3 3/4] soc: imx: Add generic blk-ctl driver Peng Fan (OSS) 2021-05-06 4:15 ` Peng Fan (OSS) 2021-05-06 7:31 ` Frieder Schrempf [this message] 2021-05-06 7:31 ` Frieder Schrempf 2021-05-06 4:15 ` [PATCH V3 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Peng Fan (OSS) 2021-05-06 4:15 ` Peng Fan (OSS) 2021-05-06 7:56 ` Abel Vesa 2021-05-06 7:56 ` Abel Vesa 2021-05-07 12:53 ` Adam Ford 2021-05-07 12:53 ` Adam Ford 2021-05-08 0:54 ` Peng Fan 2021-05-08 0:54 ` Peng Fan
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=32ffebc3-2155-4b92-5795-37d63235eb51@kontron.de \ --to=frieder.schrempf@kontron.de \ --cc=abel.vesa@nxp.com \ --cc=aford173@gmail.com \ --cc=agx@sigxcpu.org \ --cc=andrew.smirnov@gmail.com \ --cc=devicetree@vger.kernel.org \ --cc=festevam@gmail.com \ --cc=kernel@pengutronix.de \ --cc=krzk@kernel.org \ --cc=l.stach@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-imx@nxp.com \ --cc=linux-kernel@vger.kernel.org \ --cc=marex@denx.de \ --cc=p.zabel@pengutronix.de \ --cc=peng.fan@nxp.com \ --cc=peng.fan@oss.nxp.com \ --cc=ping.bai@nxp.com \ --cc=robh+dt@kernel.org \ --cc=s.hauer@pengutronix.de \ --cc=shawnguo@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: linkBe 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.