linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] MTD/GPMI bugfix : reset the BCH module when it is not MX23
@ 2012-01-04  3:18 Huang Shijie
  2012-01-10  8:49 ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Huang Shijie @ 2012-01-04  3:18 UTC (permalink / raw)
  To: linux-arm-kernel

In MX28, if we do not reset the BCH module. The BCH module may
becomes unstable when the board reboots for several thousands times.
This bug has been catched in customer's production.

The patch adds some comments(some from Wolfram Sang), and fixes it now.

Also change gpmi_reset_block() to static.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index de4db76..7523691 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -69,17 +69,19 @@ static int clear_poll_bit(void __iomem *addr, u32 mask)
  *  [1] enable the module.
  *  [2] reset the module.
  *
- * In most of the cases, it's ok. But there is a hardware bug in the BCH block.
+ * In most of the cases, it's ok.
+ * But in MX23, there is a hardware bug in the BCH block(see 2847 from errata).
  * If you try to soft reset the BCH block, it becomes unusable until
  * the next hard reset. This case occurs in the NAND boot mode. When the board
  * boots by NAND, the ROM of the chip will initialize the BCH blocks itself.
  * So If the driver tries to reset the BCH again, the BCH will not work anymore.
- * You will see a DMA timeout in this case.
+ * You will see a DMA timeout in this case. The bug has been fixed
+ * in the following chips, such as MX28.
  *
  * To avoid this bug, just add a new parameter `just_enable` for
  * the mxs_reset_block(), and rewrite it here.
  */
-int gpmi_reset_block(void __iomem *reset_addr, bool just_enable)
+static int gpmi_reset_block(void __iomem *reset_addr, bool just_enable)
 {
 	int ret;
 	int timeout = 0x400;
@@ -206,7 +208,15 @@ int bch_set_geometry(struct gpmi_nand_data *this)
 	if (ret)
 		goto err_out;
 
-	ret = gpmi_reset_block(r->bch_regs, true);
+	/*
+	* Due to Errata #2847 of the MX23, the BCH cannot be soft reset on this
+	* chip, otherwise it will lock up. So we skip resetting BCH on the MX23.
+	* On the other hand, the MX28 needs the reset, because one case has been
+	* seen where the BCH produced ECC errors constantly after 10000
+	* consecutive reboots. The latter case has not been seen on the MX23 yet,
+	* still we don't know if it could happen there as well.
+	*/
+	ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this));
 	if (ret)
 		goto err_out;
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v4] MTD/GPMI bugfix : reset the BCH module when it is not MX23
  2012-01-04  3:18 [PATCH v4] MTD/GPMI bugfix : reset the BCH module when it is not MX23 Huang Shijie
@ 2012-01-10  8:49 ` Artem Bityutskiy
  2012-01-11 10:43   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2012-01-10  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2012-01-04 at 11:18 +0800, Huang Shijie wrote:
> In MX28, if we do not reset the BCH module. The BCH module may
> becomes unstable when the board reboots for several thousands times.
> This bug has been catched in customer's production.
> 
> The patch adds some comments(some from Wolfram Sang), and fixes it now.
> 
> Also change gpmi_reset_block() to static.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> Acked-by: Marek Vasut <marek.vasut@gmail.com>

Pushed to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120110/2dba91fd/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4] MTD/GPMI bugfix : reset the BCH module when it is not MX23
  2012-01-10  8:49 ` Artem Bityutskiy
@ 2012-01-11 10:43   ` Wolfram Sang
  2012-01-11 11:25     ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2012-01-11 10:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 10, 2012 at 10:49:00AM +0200, Artem Bityutskiy wrote:
> On Wed, 2012-01-04 at 11:18 +0800, Huang Shijie wrote:
> > In MX28, if we do not reset the BCH module. The BCH module may
> > becomes unstable when the board reboots for several thousands times.
> > This bug has been catched in customer's production.
> > 
> > The patch adds some comments(some from Wolfram Sang), and fixes it now.
> > 
> > Also change gpmi_reset_block() to static.
> > 
> > Signed-off-by: Huang Shijie <b32955@freescale.com>
> > Acked-by: Marek Vasut <marek.vasut@gmail.com>
> 
> Pushed to l2-mtd-2.6.git, thanks!

I somehow missed this patch, if it's not too late, you can add my

Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120111/43116a71/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4] MTD/GPMI bugfix : reset the BCH module when it is not MX23
  2012-01-11 10:43   ` Wolfram Sang
@ 2012-01-11 11:25     ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-01-11 11:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2012-01-11 at 11:43 +0100, Wolfram Sang wrote:
> > Pushed to l2-mtd-2.6.git, thanks!
> 
> I somehow missed this patch, if it's not too late, you can add my
> 
> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>

Sorry, it is upstream already.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120111/bfbc7ad9/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-11 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04  3:18 [PATCH v4] MTD/GPMI bugfix : reset the BCH module when it is not MX23 Huang Shijie
2012-01-10  8:49 ` Artem Bityutskiy
2012-01-11 10:43   ` Wolfram Sang
2012-01-11 11:25     ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).