[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1326953767-24155-10-git-send-email-b32955@freescale.com>
Date: Thu, 19 Jan 2012 14:16:06 +0800
From: Huang Shijie <b32955@...escale.com>
To: <vinod.koul@...el.com>
CC: <shawn.guo@...aro.org>, <artem.bityutskiy@...el.com>,
<shijie8@...il.com>, <linux-arm-kernel@...ts.infradead.org>,
<linux-mtd@...ts.infradead.org>, <linux-mmc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <w.sang@...gutronix.de>,
<LW@...O-electronics.de>, <alsa-devel@...a-project.org>,
<b29396@...escale.com>, Huang Shijie <b32955@...escale.com>
Subject: [PATCH 09/10] MTD/GPMI : add a new field `gpmi_version`
add this field to store the GPMI verison.
Signed-off-by: Huang Shijie <b32955@...escale.com>
---
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists