All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: <markus.stockhausen@gmx.de>
Cc: <vigneshr@ti.com>,  <richard@nod.at>,  <tudor.ambarus@linaro.org>,
	<linux-mtd@lists.infradead.org>,
	 "'Chris Packham'" <Chris.Packham@alliedtelesis.co.nz>
Subject: Re: AW: AW: AW: NAND ECC errors
Date: Fri, 08 Aug 2025 15:31:46 +0200	[thread overview]
Message-ID: <87a54a9by5.fsf@bootlin.com> (raw)
In-Reply-To: <05e301dc0867$6195e760$24c1b620$@gmx.de> (markus stockhausen's message of "Fri, 8 Aug 2025 15:21:40 +0200")

On 08/08/2025 at 15:21:40 +02, <markus.stockhausen@gmx.de> wrote:

>> Von: linux-mtd <linux-mtd-bounces@lists.infradead.org> Im Auftrag von Miquel Raynal
>> Gesendet: Freitag, 8. August 2025 14:42
>> 
>> On 08/08/2025 at 14:25:18 +02, <markus.stockhausen@gmx.de> wrote:
>> Just to fully understand, you are trying to replicate what the software
>> BCH engine of your realtek SPI controller does?
>>
>> If so, why not just configuring the engine directly and use it? It will
>> be much faster and easier to do.
>>
>> Otherwise, if you're trying to do in software what the hardware does,
>> you must be prepared to more maths:
>> https://bootlin.com/blog/supporting-a-misbehaving-nand-ecc-engine/
>
> Idea was to start with something I have fully understood. Wantet to
> leave Hardware for later as ECC is a total new area now (as it was with 
> NAND the last week). Had a short look at the hardware engine GPL 
> code. The most basic parts look straight forward with three functions
>
> - Prepare to to encoded data
> - Prepare to be decoded data
> - Kick engine
>
> ecc-mtk seems tightly integrated into the nand contoller while 
> ecc-mxic seems to be some passthrough/pipeline integration.
>
> What would be your advise for the most simple enhancement 
> for our existing Realtek spi-mem controller?

From my current understanding, implementing the external approach (see
Maronix external ECC engine case) should be the easiest path forward.

If the engine is tightly integrated to the controller (I have no idea),
then use the pipelined example or MTK's example.

You need to implement very few callbacks for getting it to work, and
except the init which might be a bit painful they will all be simple
(like set/clear a bit, return the value of a register...).

Good luck!
Miquèl

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

  reply	other threads:[~2025-08-08 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-07 15:16 NAND ECC errors markus.stockhausen
2025-08-07 20:36 ` Chris Packham
2025-08-07 21:23   ` AW: " markus.stockhausen
2025-08-07 21:32     ` Chris Packham
2025-08-08  8:41       ` Miquel Raynal
2025-08-08 12:25         ` AW: " markus.stockhausen
2025-08-08 12:41           ` Miquel Raynal
2025-08-08 13:21             ` AW: " markus.stockhausen
2025-08-08 13:31               ` Miquel Raynal [this message]
2025-08-08  8:37   ` Miquel Raynal

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=87a54a9by5.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=Chris.Packham@alliedtelesis.co.nz \
    --cc=linux-mtd@lists.infradead.org \
    --cc=markus.stockhausen@gmx.de \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.