[PATCH 09/10] MTD/GPMI : add a new field `gpmi_version`

From: Huang Shijie
Date: Thu Jan 19 2012 - 01:15:40 EST


add this field to store the GPMI verison.

Signed-off-by: Huang Shijie <b32955@xxxxxxxxxxxxx>
---
drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 3 +++
drivers/mtd/nand/gpmi-nand/gpmi-nand.h | 4 ++++
drivers/mtd/nand/gpmi-nand/gpmi-regs.h | 2 ++
3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index 7f68042..5b73ae5 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -133,6 +133,9 @@ int gpmi_init(struct gpmi_nand_data *this)
if (ret)
goto err_out;

+ /* Read out the GPMI version */
+ this->gpmi_version = readl(r->gpmi_regs + HW_GPMI_VERSION);
+
/* Choose NAND mode. */
writel(BM_GPMI_CTRL1_GPMI_MODE, r->gpmi_regs + HW_GPMI_CTRL1_CLR);

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
index 1c7fdbb..5c277e3 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
@@ -132,6 +132,10 @@ struct gpmi_nand_data {
/* Flash Hardware */
struct nand_timing timing;

+ /* GPMI hardware version */
+#define GPMI_VERSION_0501 (0x05010000)
+ u32 gpmi_version;
+
/* BCH */
struct bch_geometry bch_geometry;
struct completion bch_done;
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-regs.h b/drivers/mtd/nand/gpmi-nand/gpmi-regs.h
index 8343124..f005b24 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-regs.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-regs.h
@@ -169,4 +169,6 @@
#define HW_GPMI_DEBUG 0x000000c0
#define MX23_BP_GPMI_DEBUG_READY0 28
#define MX23_BM_GPMI_DEBUG_READY0 (1 << MX23_BP_GPMI_DEBUG_READY0)
+
+#define HW_GPMI_VERSION 0x000000d0
#endif
--
1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/