public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: sbabic@denx.de
To: Michael Trimarchi <michael@amarulasolutions.com>,u-boot@lists.denx.de
Subject: [PATCH V4 2/5] mtd: nand: mxs_nand_spl: Fix bad block skipping
Date: Fri, 20 May 2022 15:43:51 +0200 (CEST)	[thread overview]
Message-ID: <20220520134356.553F883F63@phobos.denx.de> (raw)
In-Reply-To: <20220515093534.1737172-3-michael@amarulasolutions.com>

> The specific implementation was having bug. Those bugs are since
> the beginning of the implementation. Some manufactures can already
> experience this bug in their SPL code. This bug can be more visible on
> architecture that has complicated boot process like imx8mn. Older
> version of uboot can be affected if the bad block
> appear in correspoding of the beginning of u-boot image. In order to
> adjust the function we scan from the first erase block.
> The problematic part of old code was in this part:
> while (is_badblock(mtd, offs, 1)) {
>            page = page + nand_page_per_block;
>           /* Check i we've reached the end of flash. */
>           if (page >= mtd->size >> chip->page_shift) {
>                       free(page_buf);
>                       return -ENOMEM;
>          }
> }
> Even we fix it adding increment of the offset of one erase block size
> , we don't fix the problem, because the first erase block where the
> image start is not checked. The code was tested on an imx8mn where
> the boot rom api was not able to skip it. This code is used by other
> architecures like imx6 and imx8mm
> Cc: Han Xu <han.xu@nxp.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Acked-by: Han Xu <han.xu@nxp.com>
> Tested-By: Tim Harvey <tharvey@gateworks.com>
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

  reply	other threads:[~2022-05-20 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15  9:35 [PATCH V4 0/5] MXS nand fixes in SPL Michael Trimarchi
2022-05-15  9:35 ` [PATCH V4 1/5] nand: raw: mxs_nand: Fix specific hook registration Michael Trimarchi
2022-05-20 13:42   ` sbabic
2022-05-15  9:35 ` [PATCH V4 2/5] mtd: nand: mxs_nand_spl: Fix bad block skipping Michael Trimarchi
2022-05-20 13:43   ` sbabic [this message]
2022-05-15  9:35 ` [PATCH V4 3/5] arm: mach-imx: cmd_nandbcb fix bad block handling Michael Trimarchi
2022-05-20 13:42   ` sbabic
2022-05-15  9:35 ` [PATCH V4 4/5] spl: spl_nand: Fix bad block handling in fitImage Michael Trimarchi
2022-05-20 13:41   ` sbabic
2022-05-15  9:35 ` [PATCH V4 5/5] board: bsh: Switch to nand spl load instead of romapi Michael Trimarchi
2022-05-18 10:17   ` Michael Nazzareno Trimarchi
2022-05-18 11:53     ` Stefano Babic
2022-05-15 12:54 ` [PATCH V4 0/5] MXS nand fixes in SPL Fabio Estevam

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=20220520134356.553F883F63@phobos.denx.de \
    --to=sbabic@denx.de \
    --cc=michael@amarulasolutions.com \
    --cc=u-boot@lists.denx.de \
    /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