From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Frank Li <Frank.Li@nxp.com>
Cc: krzysztof.kozlowski@linaro.org, bhelgaas@google.com,
conor+dt@kernel.org, devicetree@vger.kernel.org,
festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com,
imx@lists.linux.dev, kernel@pengutronix.de,
krzysztof.kozlowski+dt@linaro.org, kw@linux.com,
l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org,
linux-imx@nxp.com, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, lpieralisi@kernel.org,
robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org
Subject: Re: [PATCH v8 01/16] PCI: imx6: Simplify clock handling by using clk_bulk*() function
Date: Fri, 19 Jan 2024 13:47:00 +0530 [thread overview]
Message-ID: <20240119081700.GD2866@thinkpad> (raw)
In-Reply-To: <20240108232145.2116455-2-Frank.Li@nxp.com>
On Mon, Jan 08, 2024 at 06:21:30PM -0500, Frank Li wrote:
> Refector the clock handling logic. Add 'clk_names' define in drvdata. Use
> clk_bulk*() api simplify the code.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
One comment below. With that addressed,
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>
> Notes:
> Change from v7 to v8
> - update comment message
> - using ARRAY_SIZE to count clk_names.
> Change from v6 to v7
> - none
> Change from v4 to v5
> - update commit message
> - direct using clk name list, instead of macro
> - still keep caculate clk list count because sizeof return pre allocated
> array size.
>
> Change from v3 to v4
> - using clk_bulk_*() API
> Change from v1 to v3
> - none
>
> Change from v4 to v5
> - update commit message
> - direct using clk name list, instead of macro
> - still keep caculate clk list count because sizeof return pre allocated
> array size.
>
> Change from v3 to v4
> - using clk_bulk_*() API
> Change from v1 to v3
> - none
>
> drivers/pci/controller/dwc/pci-imx6.c | 144 ++++++++++----------------
> 1 file changed, 54 insertions(+), 90 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 74703362aeec7..4912c6b08ecf8 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
[...]
>
> +static const char * const
> +imx6_3clks_bus_pcie_phy[] = {"pcie_bus", "pcie", "pcie_phy"};
> +static const char * const
> +imx6_3clks_bus_pcie_aux[] = {"pcie_bus", "pcie", "pcie_aux"};
> +static const char * const
> +imx6_4clks_bus_pcie_phy_aux[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"};
> +static const char * const
> +imx6_4clks_bus_pcie_phy_axi[] = {"pcie_bus", "pcie", "pcie_phy", "pcie_inbound_axi"};
> +
Use platform names for defining the array. Like,
imx6q_clks[]
imx6sx_clks[]
imx8mq_clks[]
imx8mm_clks[]
and reuse them for other platforms as well. This gives an idea of how the clocks
got inherited from some base platforms.
- Mani
> static const struct imx6_pcie_drvdata drvdata[] = {
> [IMX6Q] = {
> .variant = IMX6Q,
> @@ -1477,6 +1421,8 @@ static const struct imx6_pcie_drvdata drvdata[] = {
> IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE,
> .dbi_length = 0x200,
> .gpr = "fsl,imx6q-iomuxc-gpr",
> + .clk_names = imx6_3clks_bus_pcie_phy,
> + .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_phy),
> },
> [IMX6SX] = {
> .variant = IMX6SX,
> @@ -1484,6 +1430,8 @@ static const struct imx6_pcie_drvdata drvdata[] = {
> IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE |
> IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
> .gpr = "fsl,imx6q-iomuxc-gpr",
> + .clk_names = imx6_4clks_bus_pcie_phy_axi,
> + .clks_cnt = ARRAY_SIZE(imx6_4clks_bus_pcie_phy_axi),
> },
> [IMX6QP] = {
> .variant = IMX6QP,
> @@ -1492,40 +1440,56 @@ static const struct imx6_pcie_drvdata drvdata[] = {
> IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
> .dbi_length = 0x200,
> .gpr = "fsl,imx6q-iomuxc-gpr",
> + .clk_names = imx6_3clks_bus_pcie_phy,
> + .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_phy),
> },
> [IMX7D] = {
> .variant = IMX7D,
> .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
> .gpr = "fsl,imx7d-iomuxc-gpr",
> + .clk_names = imx6_3clks_bus_pcie_phy,
> + .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_phy),
> },
> [IMX8MQ] = {
> .variant = IMX8MQ,
> .gpr = "fsl,imx8mq-iomuxc-gpr",
> + .clk_names = imx6_4clks_bus_pcie_phy_aux,
> + .clks_cnt = ARRAY_SIZE(imx6_4clks_bus_pcie_phy_aux),
> },
> [IMX8MM] = {
> .variant = IMX8MM,
> .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
> .gpr = "fsl,imx8mm-iomuxc-gpr",
> + .clk_names = imx6_3clks_bus_pcie_aux,
> + .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_aux),
> },
> [IMX8MP] = {
> .variant = IMX8MP,
> .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
> .gpr = "fsl,imx8mp-iomuxc-gpr",
> + .clk_names = imx6_3clks_bus_pcie_aux,
> + .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_aux),
> },
> [IMX8MQ_EP] = {
> .variant = IMX8MQ_EP,
> .mode = DW_PCIE_EP_TYPE,
> .gpr = "fsl,imx8mq-iomuxc-gpr",
> + .clk_names = imx6_4clks_bus_pcie_phy_aux,
> + .clks_cnt = ARRAY_SIZE(imx6_4clks_bus_pcie_phy_aux),
> },
> [IMX8MM_EP] = {
> .variant = IMX8MM_EP,
> .mode = DW_PCIE_EP_TYPE,
> .gpr = "fsl,imx8mm-iomuxc-gpr",
> + .clk_names = imx6_3clks_bus_pcie_aux,
> + .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_aux),
> },
> [IMX8MP_EP] = {
> .variant = IMX8MP_EP,
> .mode = DW_PCIE_EP_TYPE,
> .gpr = "fsl,imx8mp-iomuxc-gpr",
> + .clk_names = imx6_3clks_bus_pcie_aux,
> + .clks_cnt = ARRAY_SIZE(imx6_3clks_bus_pcie_aux),
> },
> };
>
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-01-19 8:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-08 23:21 [PATCH v8 00/16] PCI: imx6: Clean up and add imx95 pci support Frank Li
2024-01-08 23:21 ` [PATCH v8 01/16] PCI: imx6: Simplify clock handling by using clk_bulk*() function Frank Li
2024-01-19 8:17 ` Manivannan Sadhasivam [this message]
2024-01-08 23:21 ` [PATCH v8 02/16] PCI: imx6: Simplify phy handling by using IMX6_PCIE_FLAG_HAS_PHYDRV Frank Li
2024-01-19 8:21 ` Manivannan Sadhasivam
2024-01-08 23:21 ` [PATCH v8 03/16] PCI: imx6: Simplify reset handling by using by using *_FLAG_HAS_*_RESET Frank Li
2024-01-08 23:21 ` [PATCH v8 04/16] dt-bindings: imx6q-pcie: Add linux,pci-domain as required for iMX8MQ Frank Li
2024-01-09 18:24 ` Rob Herring
2024-01-09 18:24 ` Rob Herring
2024-01-08 23:21 ` [PATCH v8 05/16] PCI: imx6: Using "linux,pci-domain" as slot ID Frank Li
2024-01-08 23:21 ` [PATCH v8 06/16] PCI: imx6: Simplify ltssm_enable() by using ltssm_off and ltssm_mask Frank Li
2024-01-08 23:21 ` [PATCH v8 07/16] PCI: imx6: Simplify configure_type() by using mode_off and mode_mask Frank Li
2024-01-19 8:22 ` Manivannan Sadhasivam
2024-01-08 23:21 ` [PATCH v8 08/16] PCI: imx6: Simplify switch-case logic by involve init_phy callback Frank Li
2024-01-19 8:25 ` Manivannan Sadhasivam
2024-01-08 23:21 ` [PATCH v8 09/16] dt-bindings: imx6q-pcie: Clean up irrationality clocks check Frank Li
2024-01-08 23:21 ` [PATCH v8 10/16] dt-bindings: imx6q-pcie: restruct reg and reg-name Frank Li
2024-01-08 23:21 ` [PATCH v8 11/16] dt-bindings: imx6q-pcie: Add imx95 pcie compatible string Frank Li
2024-01-09 18:27 ` Rob Herring
2024-01-08 23:21 ` [PATCH v8 12/16] PCI: imx6: Add iMX95 PCIe Root Complex support Frank Li
2024-01-19 8:27 ` Manivannan Sadhasivam
2024-01-08 23:21 ` [PATCH v8 13/16] PCI: imx6: Clean up get addr_space code Frank Li
2024-01-08 23:21 ` [PATCH v8 14/16] PCI: imx6: Add epc_features in imx6_pcie_drvdata Frank Li
2024-01-08 23:21 ` [PATCH v8 15/16] dt-bindings: imx6q-pcie: Add iMX95 pcie endpoint compatible string Frank Li
2024-01-09 18:27 ` Rob Herring
2024-01-08 23:21 ` [PATCH v8 16/16] PCI: imx6: Add iMX95 Endpoint (EP) support Frank Li
2024-01-19 8:36 ` Manivannan Sadhasivam
2024-01-15 19:47 ` [PATCH v8 00/16] PCI: imx6: Clean up and add imx95 pci support Frank Li
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=20240119081700.GD2866@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=Frank.Li@nxp.com \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=helgaas@kernel.org \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=kw@linux.com \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=robh@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: 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).