mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 3/3] mtd: nand: make interleaved placement optional
Date: Fri, 14 Jun 2024 15:36:03 +0200	[thread overview]
Message-ID: <20240614133603.2452891-4-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20240614133603.2452891-1-s.hauer@pengutronix.de>

Currently only one driver in the tree (denali.c) needs interleaved
layout support. Make support for it optional to safe a few bytes
of binary space when interleaved support is not needed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/nand/raw/Kconfig     | 4 ++++
 drivers/mtd/nand/raw/nand_base.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index e9d1b83706..b6c6e62731 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -35,6 +35,9 @@ config NAND_ALLOW_ERASE_BAD
 config NAND_NEED_EXEC_OP
 	bool
 
+config NAND_NEED_ECC_PLACEMENT_INTERLEAVED
+	bool
+
 comment "Raw/parallel NAND flash controllers"
 
 config NAND_IMX
@@ -156,6 +159,7 @@ config MTD_NAND_DENALI
 	tristate "Support Denali NAND controller"
 	depends on HAS_DMA
 	select NAND_NEED_EXEC_OP
+	select NAND_NEED_ECC_PLACEMENT_INTERLEAVED
 	help
 	  Enable support for the Denali NAND controller.  This should be
 	  combined with either the PCI or platform drivers to provide device
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index cf4d510211..5ab5e9e03a 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5671,6 +5671,8 @@ static int nand_set_ecc_on_host_ops(struct nand_chip *chip)
 		fallthrough;
 
 	case NAND_ECC_PLACEMENT_INTERLEAVED:
+		if (!IS_ENABLED(CONFIG_NAND_NEED_ECC_PLACEMENT_INTERLEAVED))
+			break;
 		if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) &&
 		    (!ecc->read_page ||
 		     ecc->read_page == nand_read_page_hwecc ||
-- 
2.39.2




  parent reply	other threads:[~2024-06-14 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 13:36 [PATCH 0/3] mtd: nand: trim down NAND layer a bit Sascha Hauer
2024-06-14 13:36 ` [PATCH 1/3] mtd: nand: Kconfig: whitespace cleanups Sascha Hauer
2024-06-14 13:36 ` [PATCH 2/3] mtd: nand: make exec_op optional Sascha Hauer
2024-06-14 13:36 ` Sascha Hauer [this message]
2024-06-18  6:13 ` [PATCH 0/3] mtd: nand: trim down NAND layer a bit Sascha Hauer

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=20240614133603.2452891-4-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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