All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Jonker <jbx6244@gmail.com>
To: kever.yang@rock-chips.com
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu,
	dario.binacchi@amarulasolutions.com,
	michael@amarulasolutions.com, marex@denx.de,
	u-boot@lists.denx.de
Subject: [PATCH v5 1/8] mtd: nand: raw: rockchip_nfc: add NAND_SKIP_BBTSCAN option
Date: Wed, 18 Oct 2023 16:00:27 +0200	[thread overview]
Message-ID: <894721e5-72e4-e6ce-b59e-4d751fb66a22@gmail.com> (raw)
In-Reply-To: <7fd0d9d1-2e93-a48b-edfd-6d4fec314a60@gmail.com>

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        | 9 +++++++++
 drivers/mtd/nand/raw/rockchip_nfc.c | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index d624589a892b..72547f00fbec 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -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
diff --git a/drivers/mtd/nand/raw/rockchip_nfc.c b/drivers/mtd/nand/raw/rockchip_nfc.c
index 6ad51df4acff..df6742c2f9bb 100644
--- a/drivers/mtd/nand/raw/rockchip_nfc.c
+++ b/drivers/mtd/nand/raw/rockchip_nfc.c
@@ -981,6 +981,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)
--
2.39.2


  reply	other threads:[~2023-10-18 14:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 13:58 [PATCH v5 0/8] Add rkmtd command Johan Jonker
2023-10-18 14:00 ` Johan Jonker [this message]
2023-10-18 14:00 ` [PATCH v5 2/8] rockchip: dm: prepare rkmtd UCLASS Johan Jonker
2023-10-18 16:09   ` Simon Glass
2023-10-18 14:00 ` [PATCH v5 3/8] rockchip: block: add rkmtd class and drivers Johan Jonker
2023-10-18 14:01 ` [PATCH v5 4/8] rockchip: block: blk-uclass: add bounce buffer flag to blk_desc Johan Jonker
2023-10-18 16:10   ` Simon Glass
2023-10-23  8:22   ` Kever Yang
2023-10-18 14:01 ` [PATCH v5 5/8] rockchip: cmd: add rkmtd command Johan Jonker
2023-10-18 14:01 ` [PATCH v5 6/8] rockchip: test: dm: add rkmtd test Johan Jonker
2023-10-18 14:02 ` [PATCH v5 7/8] rockchip: doc: add rkmtd.rst Johan Jonker
2023-10-18 14:02 ` [PATCH v5 8/8] rockchip: configs: sandbox: enable rkmtd command Johan Jonker

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=894721e5-72e4-e6ce-b59e-4d751fb66a22@gmail.com \
    --to=jbx6244@gmail.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=marex@denx.de \
    --cc=michael@amarulasolutions.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.