linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, tlanger@maxlinear.com,
	rtanwar@maxlinear.com, richard@nod.at, vigneshr@ti.com
Subject: Re: [PATCH RFC v1 0/8] intel-nand-controller: Fixes, cleanups and questions
Date: Tue, 28 Jun 2022 16:38:50 +0200	[thread overview]
Message-ID: <20220628163850.17c56935@xps-13> (raw)
In-Reply-To: <20220628112731.2041976-1-martin.blumenstingl@googlemail.com>

Hi Martin,

martin.blumenstingl@googlemail.com wrote on Tue, 28 Jun 2022 13:27:23
+0200:

> Hello,
> 
> I am trying to replace the xway_nand driver (which is still using the
> legacy NAND API) with the intel-nand-controller driver. The Intel LGM
> IP (for which intel-nand-controller was implemented) uses a newer
> version of the EBU NAND and HSNAND IP found in Lantiq XWAY SoCs. The
> most notable change is the addition of HSNAND Intel LGM SoCs (it's not
> clear to me if/which Lantiq SoCs also have this DMA engine).
> 
> While testing my changes on a Lantiq xRX200 SoC I came across some
> issues with the intel-nand-controller driver. The problems I found are:
> 1) Mismatch between dt-bindings and driver implementation (compatible
>    string, patch #1 and patch #4) and hardware capabilities (number of
>    CS lines, patch #1).
> 2) The driver reads the CS (chip select) line from the NAND controller's
>    reg property. In the dt-bindings example this is 0xe0f00000. I don't
>    understand how this can even work on Intel SoCs. My understanding is
>    that it must be read from the NAND chip (child node).

Yes

> 3) A few smaller code cleanups to make the driver easier to understand
>    (patches #5 to #8)
> 4) I tried to understand the timing parameter calculation code but found
>    that it probably doesn't work on the Intel LGM SoCs either. The
>    dt-bindings example use clock ID 125 which is LGM_GCLK_EBU. So far
>    this is fine because EBU is the actual IP block for the NAND
>    interface. However, drivers/clk/x86/clk-lgm.c defines this clock as
>    a gate without a parent, so it's rate (as read by Linux) is always 0.
>    The intel-nand-controller driver then tries to calculate:
>      rate = clk_get_rate(ctrl->clk) / HZ_PER_MHZ
>    (rate will be 0 because clk_get_rate() returns 0) and then:
>      DIV_ROUND_UP(USEC_PER_SEC, rate)
>    (this then tries to divide by zero)
> 
> Before this series is applied it would be great to have these questions
> answered:
> - My understanding is that the chip select line (reg property of the
>   NAND controller's child node) refers to the chip select line of the
>   controller. Let's say we have a controller with two CS lines. A NAND
>   flash chip (which a single chip select line) is connected to the
>   second CS line of the controller. Is my understanding correct that
>   the NAND chip device-tree node should get reg = <1> in this case?

Yes

> - Who from Maxlinear (who took over Intel's AnyWAN division, which
>   previously worked on the drivers for the Intel LGM SoCs) can send a
>   patch to correct the LGM_GCLK_EBU clock rate in
>   drivers/clk/x86/clk-lgm.c? Or is LGM dead and the various drivers
>   should be removed instead?
> - Who from Maxlinear can provide insights into which clock is connected
>   to the EBU NAND controller on Lantiq XWAY (Danube, xRX100, xRX200,
>   xRX300) SoCs as well as newer GRX350/GRX550 SoCs so that I can make
>   the intel-nand-controller work without hardcoded timing settings on
>   the XWAY SoCs?
> 
> Due to the severity of issues 2) and 4) above I am targeting linux-next
> with this series. In my opinion there's no point in backporting these
> fixes to a driver which has been broken since it was upstreamed.

The changes look good to me, please resend with the bindings file name
fixed and we should be good.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      parent reply	other threads:[~2022-06-28 14:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 11:27 [PATCH RFC v1 0/8] intel-nand-controller: Fixes, cleanups and questions Martin Blumenstingl
2022-06-28 11:27 ` [PATCH RFC v1 1/8] dt-bindings: mtd: intel: lgm-nand: Fix compatible string Martin Blumenstingl
2022-06-28 13:15   ` Rob Herring
2022-06-28 11:27 ` [PATCH RFC v1 2/8] dt-bindings: mtd: intel: lgm-nand: Fix maximum chip select value Martin Blumenstingl
2022-06-28 11:27 ` [PATCH RFC v1 3/8] mtd: rawnand: intel: Read the chip-select line from the correct OF node Martin Blumenstingl
2022-06-28 11:27 ` [PATCH RFC v1 4/8] mtd: rawnand: intel: Remove undocumented compatible string Martin Blumenstingl
2022-06-28 11:27 ` [PATCH RFC v1 5/8] mtd: rawnand: intel: Don't re-define NAND_DATA_IFACE_CHECK_ONLY Martin Blumenstingl
2022-06-28 11:27 ` [PATCH RFC v1 6/8] mtd: rawnand: intel: Remove unused nand_pa member from ebu_nand_cs Martin Blumenstingl
2022-06-28 11:27 ` [PATCH RFC v1 7/8] mtd: rawnand: intel: Remove unused clk_rate member from struct ebu_nand Martin Blumenstingl
2022-06-28 11:27 ` [PATCH RFC v1 8/8] mtd: rawnand: intel: Use devm_platform_ioremap_resource_byname() Martin Blumenstingl
2022-06-28 14:38 ` Miquel Raynal [this message]

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=20220628163850.17c56935@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=richard@nod.at \
    --cc=rtanwar@maxlinear.com \
    --cc=tlanger@maxlinear.com \
    --cc=vigneshr@ti.com \
    /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).