From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Tudor Ambarus <Tudor.Ambarus@microchip.com>,
Pratyush Yadav <p.yadav@ti.com>, Michael Walle <michael@walle.cc>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Jimmy Lalande <jimmy.lalande@se.com>,
Milan Stevanovic <milan.stevanovic@se.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Gareth Williams <gareth.williams.jx@renesas.com>
Subject: Re: [PATCH 2/3] mtd: rawnand: rzn1: Add new NAND controller driver
Date: Fri, 26 Nov 2021 14:44:47 +0100 [thread overview]
Message-ID: <20211126144447.4fb300af@xps13> (raw)
In-Reply-To: <TYYPR01MB7086AF009C6D6A4440B0CB21F59C9@TYYPR01MB7086.jpnprd01.prod.outlook.com>
Hi Phil,
phil.edworthy@renesas.com wrote on Fri, 19 Nov 2021 15:04:55 +0000:
> Hi Miquel,
>
> Thanks for your patches.
>
> > Introduce Renesas RZ/N1x NAND controller driver which supports:
> > - All ONFI timing modes
> > - Different configurations of its internal ECC controller
> > - On-die (not tested) and software ECC support
> > - Several chips (not tested)
> > - Subpage accesses
> > - DMA and PIO
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> It might be worth mentioning that this controller was originally provided
> by Evatronix, then Cadence bought the Evatronix IP business.
True I've added this in the commit log as well as the main header.
> > + rzn1_nand->tim_gen_seq2 =
> > + TIM_GEN_SEQ2_D8(TO_CYCLES64(sdr->tRR_min + sdr->tREA_max,
> > period_ns)) |
> > + TIM_GEN_SEQ2_D9(TO_CYCLES64(sdr->tRR_min, period_ns)) |
> > + TIM_GEN_SEQ2_D10(TO_CYCLES64(cle - cyc, period_ns)) |
> > + TIM_GEN_SEQ2_D11(TO_CYCLES64(bef_dly, period_ns));
> In our out-of-tree driver for this controller [1], we allowed time for
> the signal to propagate through the RZ/N1 io buffers; We just added 5ns
> to all the timings. Don't you need to do something similar? I vaguely
> recall that some values programmed to 0 caused issues.
I have not experienced any issues yet, I don't think with these
calculations there are many values set to 0 anyway. But thanks for the
feedback, if anybody reports errors with these timings on another board
then we'll know where to look.
> > +static int rzn1_nand_chip_init(struct rzn1_nfc *nfc, struct device_node
> ...
> > + for (i = 0; i < nsels; i++) {
> > + ret = of_property_read_u32_index(np, "reg", i, &cs);
> > + if (ret) {
> > + dev_err(nfc->dev, "Incomplete reg property (%d)\n",
> > + ret);
> > + return ret;
> > + }
> Check cs is <= nr of bits in assigned_cs.
I believe you mean that I should check that we don't request
non-existing CS values (< 4). I've just added such a check, thanks. The
fact that a CS might be selected twice is handled by the test_and_set()
call right after.
> > +static int rzn1_nfc_probe(struct platform_device *pdev) {
> ...
> > + nfc->regs = devm_platform_ioremap_resource(pdev, 0);
> > + if (IS_ERR(nfc->regs))
> > + return PTR_ERR(nfc->regs);
> > +
> > + rzn1_nfc_dis_interrupts(nfc);
> You need to enable the clock before writing to the registers.
Absolutely, thanks for the remainder.
> > +static struct platform_driver rzn1_nfc_driver = {
> > + .driver = {
> > + .name = "renesas-nfc",
> nit: whitespace
>
> btw, there was an attempt to upstream a driver for this IP a few years back, see [2]
Didn't know about this attempt :)
>
> Thanks
> Phil
>
> [1] https://github.com/renesas-rz/rzn1_linux/blob/rzn1-stable-v4.19/drivers/mtd/nand/raw/evatronix_nand.c
> [2] https://patchwork.ozlabs.org/patch/629096/
>
>
>
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2021-11-26 13:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 11:19 [PATCH 0/3] Renesas RZ/N1 NAND controller support Miquel Raynal
2021-11-18 11:19 ` [PATCH 1/3] dt-bindings: mtd: rzn1: Describe Renesas RZ/N1 NAND controller Miquel Raynal
2021-11-19 8:41 ` Geert Uytterhoeven
2021-11-19 8:43 ` Geert Uytterhoeven
2021-11-19 9:19 ` Miquel Raynal
2021-11-19 9:36 ` Geert Uytterhoeven
2021-11-26 11:46 ` Miquel Raynal
2021-11-26 11:53 ` Geert Uytterhoeven
2021-11-18 11:19 ` [PATCH 2/3] mtd: rawnand: rzn1: Add new NAND controller driver Miquel Raynal
2021-11-19 8:55 ` Geert Uytterhoeven
2021-11-19 9:23 ` Miquel Raynal
2021-11-19 9:42 ` Geert Uytterhoeven
2021-11-19 15:04 ` Phil Edworthy
2021-11-26 13:44 ` Miquel Raynal [this message]
2021-11-18 11:19 ` [PATCH 3/3] MAINTAINERS: Add an entry for Renesas RZ/N1 NAND controller Miquel Raynal
2021-11-19 8:57 ` Geert Uytterhoeven
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=20211126144447.4fb300af@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=Tudor.Ambarus@microchip.com \
--cc=gareth.williams.jx@renesas.com \
--cc=geert+renesas@glider.be \
--cc=jimmy.lalande@se.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=michael@walle.cc \
--cc=milan.stevanovic@se.com \
--cc=p.yadav@ti.com \
--cc=phil.edworthy@renesas.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@bootlin.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