summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-01-14 15:19:29 +0800
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-02-04 09:27:33 +0200
commitf722689346afc1a0ed3fec8372c1762b6edc0c72 (patch)
tree8e60b06ec86ece3f9567295e7f08772df449c752 /drivers/mtd
parent54cccc70946c7fc15eb9a930935ccba1f7e4599e (diff)
downloadblackbird-obmc-linux-f722689346afc1a0ed3fec8372c1762b6edc0c72.tar.gz
blackbird-obmc-linux-f722689346afc1a0ed3fec8372c1762b6edc0c72.zip
mtd: gpmi: dump the BCH registers
Dump the BCH registers in gpmi_dump_info(). Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/gpmi-nand/bch-regs.h2
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-lib.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/bch-regs.h b/drivers/mtd/nand/gpmi-nand/bch-regs.h
index a0924515c396..d67bca5174bc 100644
--- a/drivers/mtd/nand/gpmi-nand/bch-regs.h
+++ b/drivers/mtd/nand/gpmi-nand/bch-regs.h
@@ -103,4 +103,6 @@
? (((v) >> 2) & MX6Q_BM_BCH_FLASH0LAYOUT1_DATAN_SIZE) \
: ((v) & BM_BCH_FLASH0LAYOUT1_DATAN_SIZE) \
)
+
+#define HW_BCH_VERSION 0x00000160
#endif
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index d84699c7968e..01cc570e98aa 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -208,6 +208,11 @@ void gpmi_dump_info(struct gpmi_nand_data *this)
}
/* start to print out the BCH info */
+ pr_err("Show BCH registers :\n");
+ for (i = 0; i <= HW_BCH_VERSION / 0x10 + 1; i++) {
+ reg = readl(r->bch_regs + i * 0x10);
+ pr_err("offset 0x%.3x : 0x%.8x\n", i * 0x10, reg);
+ }
pr_err("BCH Geometry :\n");
pr_err("GF length : %u\n", geo->gf_len);
pr_err("ECC Strength : %u\n", geo->ecc_strength);
OpenPOWER on IntegriCloud