]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: nand: raw: rockchip_nfc: add NAND_SKIP_BBTSCAN option
authorJohan Jonker <jbx6244@gmail.com>
Wed, 18 Oct 2023 14:00:27 +0000 (16:00 +0200)
committerKever Yang <kever.yang@rock-chips.com>
Tue, 24 Oct 2023 07:55:16 +0000 (15:55 +0800)
On Rockchip SoCs the first boot stages are written on NAND
with help of manufacturer software that uses a different format
then the MTD framework. Skip the automatic BBT scan with the
NAND_SKIP_BBTSCAN option to be able to pass the driver probe
function and to let the original data unchanged.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/mtd/nand/raw/Kconfig
drivers/mtd/nand/raw/rockchip_nfc.c

index d624589a892bd5e8d287242652e57ad8e84c40c2..72547f00fbecc9360e2c352e6b88cb0130e38bc7 100644 (file)
@@ -611,6 +611,15 @@ config ROCKCHIP_NAND
            NFC v800: RK3308, RV1108
            NFC v900: PX30, RK3326
 
+config ROCKCHIP_NAND_SKIP_BBTSCAN
+       bool "Skip the automatic BBT scan with Rockchip NAND controllers"
+       depends on ROCKCHIP_NAND
+       default n
+       help
+         Skip the automatic BBT scan with the NAND_SKIP_BBTSCAN
+         option when data content is not in MTD format or
+         must remain unchanged.
+
 config TEGRA_NAND
        bool "Support for NAND controller on Tegra SoCs"
        depends on ARCH_TEGRA
index 274489ecbc65b57cb7ae23cf5ed5cff1ed7b9a69..088cc7fead24147ff30d50e25bf792e490af56a9 100644 (file)
@@ -955,6 +955,9 @@ static int rk_nfc_nand_chip_init(ofnode node, struct rk_nfc *nfc, int devnum)
        chip->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
        chip->options |= NAND_NO_SUBPAGE_WRITE | NAND_USE_BOUNCE_BUFFER;
 
+       if (IS_ENABLED(CONFIG_ROCKCHIP_NAND_SKIP_BBTSCAN))
+               chip->options |= NAND_SKIP_BBTSCAN;
+
        rk_nfc_hw_init(nfc);
        ret = nand_scan_ident(mtd, nsels, NULL);
        if (ret)