linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 09/11] mtd: nand: stm_nand_bch: adding BBT header
Date: Wed,  5 Nov 2014 16:59:51 +0000	[thread overview]
Message-ID: <1415206793-25670-10-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1415206793-25670-1-git-send-email-lee.jones@linaro.org>

This header will be used firstly by the BCH main driver, then the
Bad Block Table (BBT) code which will be added immediately after.
Doing it this way provides the cleanest method of keeping the
patch-set bisectable.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 include/linux/mtd/stm_nand_bbt.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 include/linux/mtd/stm_nand_bbt.h

diff --git a/include/linux/mtd/stm_nand_bbt.h b/include/linux/mtd/stm_nand_bbt.h
new file mode 100644
index 0000000..8f5deaa
--- /dev/null
+++ b/include/linux/mtd/stm_nand_bbt.h
@@ -0,0 +1,22 @@
+#ifndef __LINUX_MTD_STM_BBT_H
+#define __LINUX_MTD_STM_BBT_H
+
+#include <linux/mtd/stm_nand.h>
+
+/* BCH ECC sizes */
+static int bch_ecc_sizes[] = {
+	[BCH_18BIT_ECC] = 32,
+	[BCH_30BIT_ECC] = 54,
+	[BCH_NO_ECC] = 0,
+};
+
+#if IS_ENABLED(CONFIG_MTD_NAND_STM_BCH_BBT)
+extern void nandi_dump_bad_blocks(struct nandi_controller *nandi);
+extern int bch_scan_bbt(struct mtd_info *mtd);
+extern int bch_block_isbad(struct mtd_info *mtd, loff_t offs, int getchip);
+extern int bch_block_markbad(struct mtd_info *mtd, loff_t offs);
+#else
+static inline void nandi_dump_bad_blocks(struct nandi_controller *nandi) {}
+#endif
+
+#endif /* __LINUX_MTD_STM_BBT_H */
-- 
1.9.1

  parent reply	other threads:[~2014-11-05 16:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 16:59 [PATCH v4 00/11] mtd: nand: Support for new DT NAND driver Lee Jones
2014-11-05 16:59 ` [PATCH v4 01/11] ARM: multi-v7: Enable ST BCH NAND Lee Jones
2014-11-05 16:59 ` [PATCH v4 02/11] ARM: sti: Add two new clock definitions for use with ST's NAND controllers Lee Jones
2014-11-05 16:59 ` [PATCH v4 03/11] ARM: sti: Add BCH (NAND Flash) Controller support for STiH41x (Orly) SoCs Lee Jones
2014-11-05 16:59 ` [PATCH v4 04/11] ARM: sti: Enable BCH NAND for STiH416 B2020-RevE Lee Jones
2014-11-05 16:59 ` [PATCH v4 05/11] mtd: nand: Add new generic NAND Device Tree property 'nand-chip-select' Lee Jones
2014-11-05 16:59 ` [PATCH v4 06/11] mtd: nand: WARN() if EEC Bytes per page is larger than the OOB Lee Jones
2014-11-05 16:59 ` [PATCH v4 07/11] mtd: nand: stm_nand_bch: provide Device Tree documentation Lee Jones
2014-11-05 16:59 ` [PATCH v4 08/11] mtd: nand: stm_nand_bch: add shared register defines for ST's NAND Controller drivers Lee Jones
2014-11-05 16:59 ` Lee Jones [this message]
2014-11-05 16:59 ` [PATCH v4 10/11] mtd: nand: stm_nand_bch: add support for ST's BCH NAND controller Lee Jones
2014-12-16 22:46   ` Brian Norris
2014-11-05 16:59 ` [PATCH v4 11/11] mtd: nand: stm_nand_bch: provide ST's implementation of Bad Block Table Lee Jones
2014-12-16 22:49   ` Brian Norris
2014-12-09 14:54 ` [PATCH v4 00/11] mtd: nand: Support for new DT NAND driver Lee Jones

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=1415206793-25670-10-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).