mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Trent Piepho <trent.piepho@igorinstitute.com>
Cc: Andrej Picej <andrej.picej@norik.com>,
	Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/2] ARM: i.MX: xload: consider ECC strength when reading page
Date: Tue, 15 Jun 2021 16:35:35 +0200	[thread overview]
Message-ID: <20210615143535.GJ9782@pengutronix.de> (raw)
In-Reply-To: <CAMHeXxNttLL84+xoJXALcK7dnBSUVJUDj9fR=wUBEfSg8eG7=A@mail.gmail.com>

On Mon, Jun 14, 2021 at 03:14:22PM -0700, Trent Piepho wrote:
> On Tue, Jun 8, 2021 at 11:34 PM Andrej Picej <andrej.picej@norik.com> wrote:
> > On 8. 06. 21 14:38, Trent Piepho wrote:
> > > On Tue, Jun 8, 2021 at 12:23 AM Andrej Picej <andrej.picej@norik.com> wrote:
> > >> On 7. 06. 21 22:03, Trent Piepho wrote:
> > > Ok, so 4 ecc bits was used for testing, but your actual use case is
> > > for flash that uses 8 bits when NAND has 128 OOB bytes, which the
> > > current code uses a value different than 8?  My calculation is that
> > > 0x800+0x80 would use 18 bit ECC.
> >
> > Actually 8 ECC bits was used for testing. Maybe it was wrong that I
> > named EccBlockNEccType (from i.MX 6Dual/6Quad Applications Processor
> > Reference Manual) as ECC strength (in commit message) as it gets shifted
> > to the left for one bit to get ECC size in bits. So yes, we agree, 8 bit
> > ECC for 0x800+0x80 (4<<1 = 8) and 18 bit ECC for 0x800+0x80 (9<<1 = 18).
> 
> Ok, I see.  I discovered this too, as the kernel bug caused Linux to
> use 4 bit ECC instead of 8 bit. I instrumented Linux driver and found
> it was using 4 bit.  I inspected the FCB manually and it was 0x04, so
> 4 bit ECC is connect?  But I have all these NAND errors! I was sure it
> would be bad BCH config!  Maybe NAND timing?  Bad PCB?  Nope.  FCB ECC
> field is half the real ECC value and this is not documented in RM.  If
> the FCB is 0x04 that is called 8 bits in all BCH documentation in iMX
> RM and also Linux driver, dts properties, and so on.
> 
> > OK, I see. This is a valid point. Didn't really understand that updating
> > only 2nd stage barebox is a common practice. Do you know of any imx6
> > board that does that, because this xloader is imx6 specific?
> 
> I do not see any imx nand xloader users at all in mainlinux Barebox
> codebase.  Which is annoying, since I'm trying to boot barebox from
> NAND on iMX6ULL and there are no boards in barebox that do this.  So I
> have to do it from scratch, even though I know such boards exist and
> in fact you are using one.
> 
> Do I do not know of any specific imx6 boards that do this.  As there
> are apparently no imx boards booting barebox from nand....

There are several i.MX6 boards mainline that support booting from NAND,
one of them being the phyFLEX-i.MX6 board which I am using all day. It
doesn't use any xload mechanism, theres's only one stage in NAND. We
also have imx6_nand_start_image() which can be used when a xload
mechanism is desired for cases when the SDRAM shall be initialized in
code rather than using DCD data. This part indeed has no users in tree,
but there shouldn't be much to implement to get this working.

I wonder which parts are missing that make you think that booting from
NAND ist not supported?

> 
> I do know of a specific cyclone5 board that does this.
> 
> There is also plenty of documentation that calls for writing 2nd stage
> bootloader in Linux with nandwrite.  So I think it's reasonable
> someone would do this.  I think if I setup rauc to do a software
> update, I do not see support for FCB update, but there is a raw nand
> partition that can easily do 2nd stage bootloader.
> 
> But consider that even if barebox spl can support two different BCH
> configs on same nand device for booting, neither Barebox nor Linux
> support this concept at all.

At least the OMAP NAND driver in barebox supports different ECC configs
that are switchable during runtime. The ECC scheme once switched is used
for the whole device though, what's missing is indeed to attach an ECC
scheme to a partition rather than to the whole device. I have that dream
each time when hacking OMAP NAND...

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-06-15 17:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07  9:09 [PATCH 1/2] ARM: i.MX: xload-gpmi-nand: fix bad block mark swapping Andrej Picej
2021-06-07  9:09 ` [PATCH 2/2] ARM: i.MX: xload: consider ECC strength when reading page Andrej Picej
2021-06-07 20:03   ` Trent Piepho
2021-06-08  6:28     ` Sascha Hauer
2021-06-08  7:23     ` Andrej Picej
2021-06-08 12:38       ` Trent Piepho
2021-06-09  6:34         ` Andrej Picej
2021-06-14 22:14           ` Trent Piepho
2021-06-15 14:35             ` Sascha Hauer [this message]
2021-06-15 20:25               ` Trent Piepho
2021-06-16  7:48                 ` Andrej Picej

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=20210615143535.GJ9782@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=andrej.picej@norik.com \
    --cc=barebox@lists.infradead.org \
    --cc=trent.piepho@igorinstitute.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