From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Roger Quadros <rogerq@kernel.org>
Cc: "Colin Foster" <colin.foster@in-advantage.com>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
"Pratyush Yadav" <p.yadav@ti.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Richard Weinberger" <richard@nod.at>
Subject: Re: Barebox / Kernel Omap ECC inconsistency?
Date: Wed, 2 Nov 2022 14:14:00 +0100 [thread overview]
Message-ID: <20221102141400.31125365@xps-13> (raw)
In-Reply-To: <ec160658-e251-bfdc-05ac-631bd4c716dc@kernel.org>
Hi Colin,
rogerq@kernel.org wrote on Wed, 2 Nov 2022 09:12:27 +0200:
> Hi Colin,
>
> On 01/11/2022 21:09, Colin Foster wrote:
> > Hello,
> >
> > I'm trying to revive a product that runs on a Phytec OMAP 4460 SOM. I
> > submitted a .dts RFC a month or so ago, and plan to perform the
> > suggestions and resubmit, but I'm up against one main hurdle that seems
> > to be related to flash OOB/ECC. (get_maintainers on
> > drivers/mtd/nand/raw/omap2.c is how I got this email list)
> >
> > Barebox has "native" support for the Phytec SOM:
> > https://git.pengutronix.de/cgit/barebox/tree/arch/arm/boards/phytec-phycore-omap4460
> >
> > It seems like Barebox is writing and expecting ECC bits to start at an
> > offset of 12 bytes, while the kernel (and Barebox comments suggest) the
> > ECC bytes should start at 2. I'm seeing this with
> > `nanddump -n -o -l 0x41000 -f mtdxnanddump /dev/mtdx`
> >
> > Barebox created partition with UBI (mtd3)
> > ...
> > 00000800 ff ff ff ff ff ff ff ff ff ff ff ff 56 49 fd 17
> > 00000810 b2 25 60 1a 42 1d eb 56 5d ff ff ff ff ff ff ff
> > ...
> >
> > Kernel created partition with UBI (mtd4)
> > ...
> > 00000800 ff ff 07 73 04 ac 57 6b 9b 1f 92 49 ab e0 b9 ff
> > 00000810 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> > ...
> >
> >
> > My question:
> >
> > Am I right to assume this is an issue in Barebox? Perhaps this is just a
>
> I'm guessing so. Both u-boot and Linux for OMAP put the ECC bytes right
> after the Bad block marker which is 2 bytes.
Yep. I checked, this has been like that since at least 2014, I don't
think we changed the layout in U-Boot/Linux "recently"... (I haven't
checked earlier, by laziness).
> https://elixir.bootlin.com/linux/latest/source/drivers/mtd/nand/raw/omap2.c#L1729
> https://elixir.bootlin.com/linux/latest/source/drivers/mtd/nand/raw/omap2.c#L134
>
> > bug that has been fairly dormant for 15 years. If that is the case, I
> > assume there's probably no hope in getting this mainlined, and "native"
> > barebox support is just a ruse.
> >
> > If that isn't the case, is there a hidden "shift OOB by 10" config
> > option that I'm missing? Or am I interpreting this data incorrectly?
> >
> >
> > Any suggestions would be greatly appreciated.
>
> You should fix the OMAP NAND driver/config in Barebox to match that
> with Linux OMAP NAND driver if you want them to run on the same system.
Agreed.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2022-11-02 13:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 19:09 Barebox / Kernel Omap ECC inconsistency? Colin Foster
2022-11-02 7:12 ` Roger Quadros
2022-11-02 13:14 ` Miquel Raynal [this message]
2022-11-02 15:28 ` Colin Foster
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=20221102141400.31125365@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=colin.foster@in-advantage.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=p.yadav@ti.com \
--cc=richard@nod.at \
--cc=rogerq@kernel.org \
--cc=u.kleine-koenig@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