From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] mtd: nand: mxc_nand: support software ECC
Date: Thu, 16 May 2024 10:33:21 +0200 [thread overview]
Message-ID: <20240516103321.25b49576@xps-13> (raw)
In-Reply-To: <ZkRyTT7FcDQ-5UeV@pengutronix.de>
Hi Sascha,
> > + /*
> > + * During a page write the i.MX NAND controller will read 512b from
> > + * main_area0 SRAM, then oob_per_subpage bytes from spare0 SRAM, then
> > + * 512b from main_area1 SRAM and so on until the full page is written.
> > + * For software ECC we want to have a 1:1 mapping between the raw page
> > + * data on the NAND chip and the view of the NAND core. This is
> > + * necessary to make the NAND_CMD_RNDOUT read the data it expects.
> > + * To accomplish this we have to write the data in the order the controller
> > + * reads it. This is reversed in copy_page_from_sram() below.
> > + */
> > + for (i = 0; i < no_subpages; i++) {
> > + memcpy16_toio(host->main_area0 + i * 512, buf, 512);
> > + buf += 512;
> > +
> > + memcpy16_toio(host->spare0 + i * host->devtype_data->spare_len, buf,
> > + oob_per_subpage);
> > + buf += oob_per_subpage;
> > + }
> > +}
>
> I noticed the nandbiterr test won't work with this. It needs the following
> fixup. The problem is that the core wants to write only user data
> without OOB, so we have to make sure the remaining SRAM is filled up
> with 0xff.
Yes. I looked rapidly at the diff, looks ok.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2024-05-16 8:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 14:25 [PATCH v3 0/3] mtd: nand: mxc_nand: Convert to exec_op Sascha Hauer
2024-05-14 14:25 ` [PATCH v3 1/3] mtd: nand: mxc_nand: separate page read from ecc calc Sascha Hauer
2024-05-14 14:25 ` [PATCH v3 2/3] mtd: nand: mxc_nand: implement exec_op Sascha Hauer
2024-05-16 8:32 ` Miquel Raynal
2024-05-16 10:25 ` Sascha Hauer
2024-05-16 10:44 ` Miquel Raynal
2024-05-16 11:36 ` Sascha Hauer
2024-05-16 13:05 ` Miquel Raynal
2024-05-14 14:25 ` [PATCH v3 3/3] mtd: nand: mxc_nand: support software ECC Sascha Hauer
2024-05-15 8:29 ` Sascha Hauer
2024-05-16 8:33 ` 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=20240516103321.25b49576@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=s.hauer@pengutronix.de \
--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