[PATCH 1/1] mxc_nand : allow swapping the Bad block Indicator for NFC v1.

Juergen Beisert jbe at pengutronix.de
Thu Sep 6 09:03:09 EDT 2012

Gaëtan Carlier 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.
> This is a modified version of patch sent by Jürgen Lambrecht :
> [PATCH] Add 'config IMX_NFC_V1_BISWAP' to swap the Bad block Indicator,
> and use for imx27pdk nand support.
>  v3: - use accessor function for I/O memory accesses as suggested by Artem
>        Bityutskiy
>      - rename function name as suggested by Artem Bityutskiy
>  v2: - Use a flag in a mxc_nand_platform structure instead of adding option
>        in Kconfig
>  v1: - Original patch "Add 'config IMX_NFC_V1_BISWAP'" by Jürgen Lambrecht
> Signed-off-by: Gaëtan Carlier <gcembed at gmail.com>

One additional note: If a user intend to boot from NAND (aka "external boot") 
there is one drawback with this patch: the very first page of the NAND will 
be read in hardware to load the bootstrap code. But the hardware doesn't know 
anything about swapping bytes!
So, when writing the very first page of the NAND the swap *must* be omitted 
(which also means the factory bad block marker of the first block in the NAND 
has to be interpreted differently).


Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-5121-206917-5128 |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

More information about the linux-arm-kernel mailing list