From: dedekind1@gmail.com (Artem Bityutskiy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Add 'config IMX_NFC_V1_BISWAP' to swap the Bad block Indicator, and use for imx27pdk nand support.
Date: Wed, 06 Jul 2011 10:06:20 +0300 [thread overview]
Message-ID: <1309935985.3149.81.camel@sauron> (raw)
In-Reply-To: <1309872828-13942-1-git-send-email-J.Lambrecht@televic.com>
Hi,
On Tue, 2011-07-05 at 15:33 +0200, J?rgen Lambrecht wrote:
> - Swap the BI-byte on position 0x7D0 with a data byte at 0x835. To fix a bug
> in Freescale imx NFC v1 SoC's for 2K page NAND flashes: imx27 and imx31.
> Warning: The same solution needs to be applied to the boot loader and the
> flash programmer.
> - Enable NAND support for the imx27pdk (3ds), and use BISWAP.
Sounds like 2 independent changes in one patch - please, split on 2
patches.
> +config MACH_MXC_NAND_USE_BBT
> + bool "Make the MXC NAND driver use the in flash Bad Block Table"
> + depends on MACH_MX27_3DS
> + depends on MTD_NAND_MXC
> + help
> + Enable this if you want that the MXC NAND driver uses the in flash
> + Bad Block Table to know what blocks are bad instead of scanning the
> + entire flash looking for bad block markers.
Sorry, but we have tons of NAND drivers, and if each driver will have a
config option for "BBT or scanning", our configuration menu will blow
up :-)
Really, it does not make sense to make this a config option - the BBT
should be detected automatically, and if it is present and correct -
scanning should not be done, otherwise, we should fall back to scanning.
And this should be a feature of the NAND base support. Please, look at
this and change the NAND base support if needed.
> +config IMX_NFC_V1_BISWAP
> + bool "Make the MXC 2kB-page NAND driver swap the Bad Block Indicator"
> + depends on MACH_MX27_3DS
> + depends on MTD_NAND_MXC
> + help
> + Enable this if you want that the MXC NAND driver swaps the Bad Block
> + Indicator (BBI) byte. The IMX NFC v1 (present in IMX27 and IMX31)
> + contains a bug for 2kB-page flashes: the 2kB page is read out in
> + 4x512B chunks, so also the spare area is read out in 4
> + chunks. Therefore the data area and the spare area becomes
> + mixed. This causes a problem for the factory programmed BBI: it
> + appears in the data area instead of the spare area, and is
> + overwritten. This patch swaps that byte to the "real" spare
> + area. WARNING: then also the bootloader and the flash programmer must
> + be patched!!
Sorry, but again, things like this should be automatically detected -
check the versions and some other magic ids and decide dynamically
whether to swap or not. If it is impossible, then this information
should be taken from the device tree (which does not exist yet, but
people are working on this).
In any case, the rule of thumb is to think twice before adding a kenel
config option - we have too many of them already.
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2011-07-06 7:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 13:33 [PATCH] Add 'config IMX_NFC_V1_BISWAP' to swap the Bad block Indicator, and use for imx27pdk nand support Jürgen Lambrecht
2011-07-05 15:52 ` Baruch Siach
2011-07-06 7:06 ` Artem Bityutskiy [this message]
2011-07-06 8:09 ` Sascha Hauer
2011-07-06 9:06 ` Lambrecht Jürgen
2011-07-06 9:30 ` Lambrecht Jürgen
2011-07-06 11:48 ` Lothar Waßmann
2011-07-06 11:56 ` Artem Bityutskiy
2011-07-06 12:39 ` Lambrecht Jürgen
2011-07-06 13:53 ` Lothar Waßmann
2011-07-06 16:29 ` Sascha Hauer
2011-07-06 16:48 ` Lothar Waßmann
2011-07-06 12:05 ` Sascha Hauer
2011-07-06 12:25 ` Lothar Waßmann
2012-08-08 16:11 ` Gaëtan Carlier
2011-07-06 9:06 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309935985.3149.81.camel@sauron \
--to=dedekind1@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).