[PATCH v1] mtd: nand: raw: rockchip_nfc: fix ecc setup

Simon Glass sjg at chromium.org
Mon Jul 13 15:04:21 CEST 2026


Hi Johan,

On 2026-07-12T15:56:07, Johan Jonker <jbx6244 at gmail.com> wrote:
> mtd: nand: raw: rockchip_nfc: fix ecc setup
>
> The Rockchip boot ROM only checks for nand chip 0 and with
> reduced ecc strength. Currently only the read page functions
> have a condition check added. Fix by adding the same condition
> to all read and write page functions.
>
> The NAND_IS_BOOT_MEDIUM option was introduced more recently
> then this driver. Use it to behave identical with the Linux
> driver.
>
> Fixes: b12dc5d6fa76 ("mtd: nand: NFC drivers for RK3308, RK2928 and others")
> Signed-off-by: Johan Jonker <jbx6244 at gmail.com>
> Tested-by: Hüseyin BIYIK <boogiepop at gmx.com>
>
> drivers/mtd/nand/raw/rockchip_nfc.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)

> The NAND_IS_BOOT_MEDIUM option was introduced more recently
> then this driver. Use it to behave identical with the Linux
> driver.

Typos: 'then' should be 'than', and 'identical' should be 'identically to'.

> diff --git a/drivers/mtd/nand/raw/rockchip_nfc.c b/drivers/mtd/nand/raw/rockchip_nfc.c
> @@ -624,8 +626,8 @@ static int rk_nfc_read_page_raw(struct mtd_info *mtd,
> -     if ((page < (pages_per_blk * rknand->boot_blks)) &&
> -         nfc->selected_bank == 0 &&
> +     if ((chip->options & NAND_IS_BOOT_MEDIUM) &&
> +         (page < (pages_per_blk * rknand->boot_blks)) &&

The commit message only mentions adding the condition to all read and
write page functions, but this patch also drops the existing
selected_bank == 0 check from both read functions, so chip-selects
other than 0 on a boot-medium chip now get the boot ROM layout too. I
suspect that is intentional (reads and writes must use the same
layout), but it sits oddly with the first sentence, which stresses
that the boot ROM only checks chip 0. Please can you mention this in
the commit message and explain why it is correct?

These are just wording changes, so:

Reviewed-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list