diff mbox series

[v5,2/2] clk: imx95-blk-ctl: Add one clock gate for HSIO block

Message ID 1728977644-8207-3-git-send-email-hongxing.zhu@nxp.com (mailing list archive)
State New, archived
Headers show
Series Add one clock gate for i.MX95 HSIO block | expand

Commit Message

Hongxing Zhu Oct. 15, 2024, 7:34 a.m. UTC
CREF_EN (Bit6) of LFAST_IO_REG control i.MX95 PCIe REF clock out
enable/disable.

Add compatible string "nxp,imx95-hsio-blk-ctl" to support PCIe REF clock
out gate.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/imx/clk-imx95-blk-ctl.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Alexander Stein Oct. 15, 2024, 9:18 a.m. UTC | #1
Hi Richard,

Am Dienstag, 15. Oktober 2024, 09:34:04 CEST schrieb Richard Zhu:
> CREF_EN (Bit6) of LFAST_IO_REG control i.MX95 PCIe REF clock out
> enable/disable.
> 
> Add compatible string "nxp,imx95-hsio-blk-ctl" to support PCIe REF clock
> out gate.
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/clk/imx/clk-imx95-blk-ctl.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-imx95-blk-ctl.c b/drivers/clk/imx/clk-imx95-blk-ctl.c
> index 19a62da74be4..25974947ad0c 100644
> --- a/drivers/clk/imx/clk-imx95-blk-ctl.c
> +++ b/drivers/clk/imx/clk-imx95-blk-ctl.c
> @@ -277,6 +277,25 @@ static const struct imx95_blk_ctl_dev_data netcmix_dev_data = {
>  	.clk_reg_offset = 0,
>  };
>  
> +static const struct imx95_blk_ctl_clk_dev_data hsio_blk_ctl_clk_dev_data[] = {
> +	[0] = {
> +		.name = "hsio_blk_ctl_clk",
> +		.parent_names = (const char *[]){ "hsio_pll", },
> +		.num_parents = 1,
> +		.reg = 0,

According to RM the register LFAST_IO_REG has offset 0xc0. How does the DT node look like?
If this is the HSIO block control I would have expected this to control the whole block.

Best regards,
Alexander

> +		.bit_idx = 6,
> +		.bit_width = 1,
> +		.type = CLK_GATE,
> +		.flags = CLK_SET_RATE_PARENT,
> +	}
> +};
> +
> +static const struct imx95_blk_ctl_dev_data hsio_blk_ctl_dev_data = {
> +	.num_clks = 1,
> +	.clk_dev_data = hsio_blk_ctl_clk_dev_data,
> +	.clk_reg_offset = 0,
> +};
> +
>  static int imx95_bc_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> @@ -447,6 +466,7 @@ static const struct of_device_id imx95_bc_of_match[] = {
>  	{ .compatible = "nxp,imx95-display-master-csr", },
>  	{ .compatible = "nxp,imx95-lvds-csr", .data = &lvds_csr_dev_data },
>  	{ .compatible = "nxp,imx95-display-csr", .data = &dispmix_csr_dev_data },
> +	{ .compatible = "nxp,imx95-hsio-blk-ctl", .data = &hsio_blk_ctl_dev_data },
>  	{ .compatible = "nxp,imx95-vpu-csr", .data = &vpublk_dev_data },
>  	{ .compatible = "nxp,imx95-netcmix-blk-ctrl", .data = &netcmix_dev_data},
>  	{ /* Sentinel */ },
>
Hongxing Zhu Oct. 16, 2024, 2:55 a.m. UTC | #2
Hi Alexander:

> -----Original Message-----
> From: Alexander Stein <alexander.stein@ew.tq-group.com>
> Sent: 2024年10月15日 17:19
> To: robh@kernel.org; krzk+dt@kernel.org; conor+dt@kernel.org;
> abelvesa@kernel.org; Peng Fan <peng.fan@nxp.com>;
> mturquette@baylibre.com; sboyd@kernel.org; shawnguo@kernel.org;
> s.hauer@pengutronix.de; festevam@gmail.com; Hongxing Zhu
> <hongxing.zhu@nxp.com>
> Cc: Hongxing Zhu <hongxing.zhu@nxp.com>; devicetree@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-clk@vger.kernel.org; imx@lists.linux.dev; kernel@pengutronix.de
> Subject: Re: [PATCH v5 2/2] clk: imx95-blk-ctl: Add one clock gate for HSIO block
>
> Hi Richard,
>
> Am Dienstag, 15. Oktober 2024, 09:34:04 CEST schrieb Richard Zhu:
> > CREF_EN (Bit6) of LFAST_IO_REG control i.MX95 PCIe REF clock out
> > enable/disable.
> >
> > Add compatible string "nxp,imx95-hsio-blk-ctl" to support PCIe REF
> > clock out gate.
> >
> > Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > Reviewed-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  drivers/clk/imx/clk-imx95-blk-ctl.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/drivers/clk/imx/clk-imx95-blk-ctl.c
> > b/drivers/clk/imx/clk-imx95-blk-ctl.c
> > index 19a62da74be4..25974947ad0c 100644
> > --- a/drivers/clk/imx/clk-imx95-blk-ctl.c
> > +++ b/drivers/clk/imx/clk-imx95-blk-ctl.c
> > @@ -277,6 +277,25 @@ static const struct imx95_blk_ctl_dev_data
> netcmix_dev_data = {
> >     .clk_reg_offset = 0,
> >  };
> >
> > +static const struct imx95_blk_ctl_clk_dev_data hsio_blk_ctl_clk_dev_data[] =
> {
> > +   [0] = {
> > +           .name = "hsio_blk_ctl_clk",
> > +           .parent_names = (const char *[]){ "hsio_pll", },
> > +           .num_parents = 1,
> > +           .reg = 0,
>
> According to RM the register LFAST_IO_REG has offset 0xc0. How does the DT
> node look like?
> If this is the HSIO block control I would have expected this to control the whole
> block.
>
Thanks for your comments.
i.MX95 HSIO_BLK_CTL is a mix of kinds of setting registers of HSIO modules.
For example, Wakeup control of USB, AXI master QoS of USB and PCIe, and so on.
Only LFAST_IO_REG(offset 0xc0) register is used as clock out control.
So, only this register is contained in the commit.

Best Regards
Richard Zhu
> Best regards,
> Alexander
>
> > +           .bit_idx = 6,
> > +           .bit_width = 1,
> > +           .type = CLK_GATE,
> > +           .flags = CLK_SET_RATE_PARENT,
> > +   }
> > +};
> > +
> > +static const struct imx95_blk_ctl_dev_data hsio_blk_ctl_dev_data = {
> > +   .num_clks = 1,
> > +   .clk_dev_data = hsio_blk_ctl_clk_dev_data,
> > +   .clk_reg_offset = 0,
> > +};
> > +
> >  static int imx95_bc_probe(struct platform_device *pdev)  {
> >     struct device *dev = &pdev->dev;
> > @@ -447,6 +466,7 @@ static const struct of_device_id imx95_bc_of_match[]
> = {
> >     { .compatible = "nxp,imx95-display-master-csr", },
> >     { .compatible = "nxp,imx95-lvds-csr", .data = &lvds_csr_dev_data },
> >     { .compatible = "nxp,imx95-display-csr", .data =
> > &dispmix_csr_dev_data },
> > +   { .compatible = "nxp,imx95-hsio-blk-ctl", .data =
> > +&hsio_blk_ctl_dev_data },
> >     { .compatible = "nxp,imx95-vpu-csr", .data = &vpublk_dev_data },
> >     { .compatible = "nxp,imx95-netcmix-blk-ctrl", .data = &netcmix_dev_data},
> >     { /* Sentinel */ },
> >
>
>
> --
> TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
> Amtsgericht München, HRB 105018
> Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
> http://www.tq-g/
> roup.com%2F&data=05%7C02%7Chongxing.zhu%40nxp.com%7Cd6eebc10596
> 440beb9a008dcecfa6a25%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0
> %7C638645807490320855%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&s
> data=dwZ8j9yLIr0h1aO0qZYE9xjMrQVXsr1iboa4wDLwmss%3D&reserved=0
>
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-imx95-blk-ctl.c b/drivers/clk/imx/clk-imx95-blk-ctl.c
index 19a62da74be4..25974947ad0c 100644
--- a/drivers/clk/imx/clk-imx95-blk-ctl.c
+++ b/drivers/clk/imx/clk-imx95-blk-ctl.c
@@ -277,6 +277,25 @@  static const struct imx95_blk_ctl_dev_data netcmix_dev_data = {
 	.clk_reg_offset = 0,
 };
 
+static const struct imx95_blk_ctl_clk_dev_data hsio_blk_ctl_clk_dev_data[] = {
+	[0] = {
+		.name = "hsio_blk_ctl_clk",
+		.parent_names = (const char *[]){ "hsio_pll", },
+		.num_parents = 1,
+		.reg = 0,
+		.bit_idx = 6,
+		.bit_width = 1,
+		.type = CLK_GATE,
+		.flags = CLK_SET_RATE_PARENT,
+	}
+};
+
+static const struct imx95_blk_ctl_dev_data hsio_blk_ctl_dev_data = {
+	.num_clks = 1,
+	.clk_dev_data = hsio_blk_ctl_clk_dev_data,
+	.clk_reg_offset = 0,
+};
+
 static int imx95_bc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -447,6 +466,7 @@  static const struct of_device_id imx95_bc_of_match[] = {
 	{ .compatible = "nxp,imx95-display-master-csr", },
 	{ .compatible = "nxp,imx95-lvds-csr", .data = &lvds_csr_dev_data },
 	{ .compatible = "nxp,imx95-display-csr", .data = &dispmix_csr_dev_data },
+	{ .compatible = "nxp,imx95-hsio-blk-ctl", .data = &hsio_blk_ctl_dev_data },
 	{ .compatible = "nxp,imx95-vpu-csr", .data = &vpublk_dev_data },
 	{ .compatible = "nxp,imx95-netcmix-blk-ctrl", .data = &netcmix_dev_data},
 	{ /* Sentinel */ },