Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
From: Jeff Kletsky <lede@allycomm.com>
To: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: nand: Proper definition of "extra" OOB regions? (4x interleaved, then one bulk user)
Date: Thu, 13 Jun 2019 12:32:53 -0700
Message-ID: <0145346c-f1c3-bc50-6bb7-492bbe4f2da4@allycomm.com> (raw)

TL;DR

I've been trying to track down the proper way to express the Paragon
SPI NAND's OOB "user" data segments, but am not clear how upper
layers interpret the combination of `mtd_ooblayout_ops.free` and the
overall OOB size, typically set through the `NAND_MEMORG` macro.

Rather than churn Patchwork and those that donate their time and
energy follow, review, and manage patches, would it be possible to
confirm that the last 64 bytes of this chip's user OOB, which
is not contiguous with any other user areas, should (or should not)
be defined in `.free` as a fifth section?

---

In the case of the Paragon chips, there is a total of 128 bytes of OOB,
split into a 4-byte BBM reservation, four repeats of 15-byte sections
with "factory" and "user" areas interleaved, then the remaining 64 bytes
available as a user area, not contiguous with other user areas[1].

0x800 -- 4 bytes BBM

0x804 -- 2 bytes user
0x806 -- 13 bytes factory ECC

0x813 -- 2 bytes user
0x815 -- 13 bytes factory ECC

0x822 -- 2 bytes user
0x824 -- 13 bytes factory ECC

0x831 -- 2 bytes user
0x833 -- 13 bytes factory ECC

0x840 -- 64 bytes user      <== this is the subject of the question

Clearly, the 4 regions of interleaved OOB data needs to be described
in both `.ecc` and `.free`. What isn't completely clear to me is the
remaining 64-byte area.

Is that the OOB area is defined as 128 bytes and that only 64 bytes
have been reserved sufficient, or should those 64 bytes, which
are not contiguous with any of the other "user" segments be a fifth
section in defining `.free`?


That the driver "works" without defining a fifth region in a specific,
UBI-based application doesn't assure me that it will work properly
in all applications with all upper-layer consumers.


Examining supported chips with similar OOB layouts with multiple
sections then an "additional" area, such as the GigaDevice GD5FxGQ4xA,
was not terribly insightful. The GD5F1GQ4UAY datasheet[2] marks the
upper 64-byte region as "reserved", in contrast to "User meta data"
and it is not described in the current `gigadevice.c`[3]. As such,
it isn't convincing evidence that it was omitted as "not required",
because it was marked "reserved", or perhaps for some other reason.


As a side note, the datasheet also marks the first byte of each region
as "reserved", which is not reflected in the current `gigadevice.c`,
which includes it in the free region for sections 1-3.


Thanks!

Jeff




[1]http://www.xtxtech.com/upfile/2016082517274590.pdf
     pg. 36

[2]https://datasheet4u.com/datasheet-pdf-file/791680/GigaDevice/GD5F1GQ4UAY/1
     pg. 33

[3]https://elixir.bootlin.com/linux/v5.2-rc4/source/drivers/mtd/nand/spi/gigadevice.c#L45


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

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 19:32 Jeff Kletsky [this message]
     [not found] ` <CAJsYDVL6ykGPNiL0-8VdKfh8MkAPj3-SLSeUMqC1SSYX4_zX0A@mail.gmail.com>
2019-06-14  2:54   ` Jeff Kletsky

Reply instructions:

You may reply publically 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=0145346c-f1c3-bc50-6bb7-492bbe4f2da4@allycomm.com \
    --to=lede@allycomm.com \
    --cc=linux-mtd@lists.infradead.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

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org linux-mtd@archiver.kernel.org
	public-inbox-index linux-mtd


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/ public-inbox