From: Niklas Cassel <cassel@kernel.org>
To: Richard Zhu <hongxing.zhu@nxp.com>
Cc: tj@kernel.org, dlemoal@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org,
s.hauer@pengutronix.de, festevam@gmail.com,
linux-ide@vger.kernel.org, stable@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
kernel@pengutronix.de
Subject: Re: [PATCH v3 2/4] ata: ahci_imx: Clean up code by using i.MX8Q HSIO PHY driver
Date: Wed, 17 Jul 2024 20:24:46 +0200 [thread overview]
Message-ID: <ZpgMbvuSpgGoISN1@ryzen.lan> (raw)
In-Reply-To: <1721099895-26098-3-git-send-email-hongxing.zhu@nxp.com>
On Tue, Jul 16, 2024 at 11:18:13AM +0800, Richard Zhu wrote:
> Clean up code by using PHY interface.
>
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
> drivers/ata/ahci_imx.c | 396 ++++++++++-------------------------------
> 1 file changed, 98 insertions(+), 298 deletions(-)
>
> diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
> index cb768f66f0a70..e94c0fdea2260 100644
> --- a/drivers/ata/ahci_imx.c
> +++ b/drivers/ata/ahci_imx.c
> @@ -986,65 +827,22 @@ static const struct scsi_host_template ahci_platform_sht = {
>
> static int imx8_sata_probe(struct device *dev, struct imx_ahci_priv *imxpriv)
> {
> - struct resource *phy_res;
> - struct platform_device *pdev = imxpriv->ahci_pdev;
> - struct device_node *np = dev->of_node;
> -
> - if (of_property_read_u32(np, "fsl,phy-imp", &imxpriv->imped_ratio))
> - imxpriv->imped_ratio = IMX8QM_SATA_PHY_IMPED_RATIO_85OHM;
> - phy_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy");
> - if (phy_res) {
> - imxpriv->phy_base = devm_ioremap(dev, phy_res->start,
> - resource_size(phy_res));
> - if (!imxpriv->phy_base) {
> - dev_err(dev, "error with ioremap\n");
> - return -ENOMEM;
> - }
> - } else {
> - dev_err(dev, "missing *phy* reg region.\n");
> - return -ENOMEM;
> - }
> - imxpriv->gpr =
> - syscon_regmap_lookup_by_phandle(np, "hsio");
> - if (IS_ERR(imxpriv->gpr)) {
> - dev_err(dev, "unable to find gpr registers\n");
> - return PTR_ERR(imxpriv->gpr);
> - }
> -
> - imxpriv->epcs_tx_clk = devm_clk_get(dev, "epcs_tx");
> - if (IS_ERR(imxpriv->epcs_tx_clk)) {
> - dev_err(dev, "can't get epcs_tx_clk clock.\n");
> - return PTR_ERR(imxpriv->epcs_tx_clk);
> - }
> - imxpriv->epcs_rx_clk = devm_clk_get(dev, "epcs_rx");
> - if (IS_ERR(imxpriv->epcs_rx_clk)) {
> - dev_err(dev, "can't get epcs_rx_clk clock.\n");
> - return PTR_ERR(imxpriv->epcs_rx_clk);
> - }
> - imxpriv->phy_pclk0 = devm_clk_get(dev, "phy_pclk0");
> - if (IS_ERR(imxpriv->phy_pclk0)) {
> - dev_err(dev, "can't get phy_pclk0 clock.\n");
> - return PTR_ERR(imxpriv->phy_pclk0);
> - }
> - imxpriv->phy_pclk1 = devm_clk_get(dev, "phy_pclk1");
> - if (IS_ERR(imxpriv->phy_pclk1)) {
> - dev_err(dev, "can't get phy_pclk1 clock.\n");
> - return PTR_ERR(imxpriv->phy_pclk1);
> - }
> - imxpriv->phy_apbclk = devm_clk_get(dev, "phy_apbclk");
> - if (IS_ERR(imxpriv->phy_apbclk)) {
> - dev_err(dev, "can't get phy_apbclk clock.\n");
> - return PTR_ERR(imxpriv->phy_apbclk);
> - }
> -
> - /* Fetch GPIO, then enable the external OSC */
> - imxpriv->clkreq_gpiod = devm_gpiod_get_optional(dev, "clkreq",
> - GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
> - if (IS_ERR(imxpriv->clkreq_gpiod))
> - return PTR_ERR(imxpriv->clkreq_gpiod);
> - if (imxpriv->clkreq_gpiod)
> - gpiod_set_consumer_name(imxpriv->clkreq_gpiod, "SATA CLKREQ");
> -
> + if (!(dev->bus_dma_limit))
> + dev->bus_dma_limit = DMA_BIT_MASK(32);
These two lines look like a unrelated change, should be in a separate commit
with a proper commit message.
Kind regards,
Niklas
next prev parent reply other threads:[~2024-07-17 18:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 3:18 [PATCH v3 0/4] Refine i.MX8QM SATA based on generic PHY callbacks Richard Zhu
2024-07-16 3:18 ` [PATCH v3 1/4] dt-bindings: ata: Add i.MX8QM AHCI compatible string Richard Zhu
2024-07-16 3:18 ` [PATCH v3 2/4] ata: ahci_imx: Clean up code by using i.MX8Q HSIO PHY driver Richard Zhu
2024-07-17 18:17 ` Niklas Cassel
2024-07-17 18:24 ` Niklas Cassel [this message]
2024-07-16 3:18 ` [PATCH v3 3/4] ata: ahci_imx: Enlarge RX water mark for i.MX8QM SATA Richard Zhu
2024-07-17 18:17 ` Niklas Cassel
2024-07-17 23:43 ` Damien Le Moal
2024-07-16 3:18 ` [PATCH v3 4/4] ata: ahci_imx: Correct the email address Richard Zhu
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=ZpgMbvuSpgGoISN1@ryzen.lan \
--to=cassel@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlemoal@kernel.org \
--cc=festevam@gmail.com \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tj@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).