[PATCH 01/10] i.MX Nand: Set correct datawidth/pagesize in CCM module

Eric Bénard eric at eukrea.com
Fri Dec 4 10:00:36 EST 2009


Dear Sascha,

Sascha Hauer a écrit :
> +void imx_nand_set_layout(int writesize, int datawidth)
> +{
> +	unsigned int fmcr;
> +
> +	fmcr = readl(FMCR);
> +
are you sure this works ?
FMCR is (*((volatile u32 *)(x))) (0x10027814) and thus this leads to a 
date abort.

here is the fix (at least on my imx27 board) :

Signed-off-by: Eric Benard <eric at eukrea.com>

diff --git a/arch/arm/mach-imx/nand.c b/arch/arm/mach-imx/nand.c
index 5b5f78b..01b8058 100644
--- a/arch/arm/mach-imx/nand.c
+++ b/arch/arm/mach-imx/nand.c
@@ -68,7 +68,7 @@ void imx_nand_set_layout(int writesize, int datawidth)
  {
         unsigned int fmcr;

-       fmcr = readl(FMCR);
+       fmcr = FMCR;

         switch (writesize) {
         case 512:
@@ -92,7 +92,7 @@ void imx_nand_set_layout(int writesize, int datawidth)
                 break;
         }

-       writel(fmcr, FMCR);
+       FMCR = fmcr;
  }

  #else


Eric




More information about the u-boot-v2 mailing list