Thread (2 messages) 2 messages, 2 authors, 2017-11-29

Re: [PATCH 2/3] mtd: nand: mtk: Support different MTK NAND flash controller IP

From: Boris Brezillon <hidden>
Date: 2017-11-29 10:04:41

Possibly related (same subject, not in this thread)

Hi,

On Wed, 29 Nov 2017 17:24:45 +0800
RogerCC Lin [off-list ref] wrote:

quoted hunk
diff --git a/drivers/mtd/nand/mtk_ecc.h b/drivers/mtd/nand/mtk_ecc.h
index d245c14..764adb6 100644
--- a/drivers/mtd/nand/mtk_ecc.h
+++ b/drivers/mtd/nand/mtk_ecc.h
@@ -14,8 +14,6 @@
 
 #include <linux/types.h>
 
-#define ECC_PARITY_BITS		(14)
-
 enum mtk_ecc_mode {ECC_DMA_MODE = 0, ECC_NFI_MODE = 1};
 enum mtk_ecc_operation {ECC_ENCODE, ECC_DECODE};
 
@@ -37,6 +35,29 @@ struct mtk_ecc_config {
 	u32 len;
 };
 
+struct mtk_ecc_caps {
+	u32 err_mask;
+	const u8 *ecc_strength;
+	const u32 *ecc_regs;
+	u8 num_ecc_strength;
+	u8 ecc_mode_shift;
+	u8 parity_bits;
+	int pg_irq_sel;
+};
+
+struct mtk_ecc {
+	struct device *dev;
+	const struct mtk_ecc_caps *caps;
+	void __iomem *regs;
+	struct clk *clk;
+
+	struct completion done;
+	struct mutex lock;
+	u32 sectors;
+
+	u8 *eccdata;
+};
Can you please keep these information private and instead provide a
helper to query the parity bits info, something like:

unsigned int mtk_ecc_get_parity_bits(struct mtk_ecc *ecc);

Regards,

Boris
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help