mtd: gpmi: dump the BCH registers
authorHuang Shijie <b32955@freescale.com>
Mon, 14 Jan 2013 07:19:29 +0000 (15:19 +0800)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 4 Feb 2013 07:27:33 +0000 (09:27 +0200)
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>
drivers/mtd/nand/gpmi-nand/bch-regs.h
drivers/mtd/nand/gpmi-nand/gpmi-lib.c

index a0924515c39644fcc9430938ded2795a2f356a4c..d67bca5174bcb003db7878839540ef1b71cb8c5c 100644 (file)
                ? (((v) >> 2) & MX6Q_BM_BCH_FLASH0LAYOUT1_DATAN_SIZE)   \
                : ((v) & BM_BCH_FLASH0LAYOUT1_DATAN_SIZE)               \
        )
+
+#define HW_BCH_VERSION                         0x00000160
 #endif
index d84699c7968e4e854d394c94f07ec4b8fdd4fcf6..01cc570e98aa8470502fa47b49308b6485a723be 100644 (file)
@@ -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);