]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/nand/edb7312.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-omap-h63xx.git] / drivers / mtd / nand / edb7312.c
index 1daf8231aaefc079885be293a7f598e88bb87401..86366bfba9f8866d17f87585379ef84e5b749734 100644 (file)
@@ -6,8 +6,6 @@
  *  Derived from drivers/mtd/nand/autcpu12.c
  *       Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
  *
- * $Id: edb7312.c,v 1.12 2005/11/07 11:14:30 gleixner Exp $
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -25,7 +23,7 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <asm/io.h>
-#include <asm/arch/hardware.h> /* for CLPS7111_VIRT_BASE */
+#include <mach/hardware.h>     /* for CLPS7111_VIRT_BASE */
 #include <asm/sizes.h>
 #include <asm/hardware/clps7111.h>
 
@@ -74,7 +72,7 @@ static struct mtd_partition partition_info[] = {
 /*
  *     hardware specific access to control-lines
  *
- *     NAND_NCE: bit 0 -> bit 7
+ *     NAND_NCE: bit 0 -> bit 6 (bit 7 = 1)
  *     NAND_CLE: bit 1 -> bit 4
  *     NAND_ALE: bit 2 -> bit 5
  */
@@ -83,12 +81,12 @@ static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
        struct nand_chip *chip = mtd->priv;
 
        if (ctrl & NAND_CTRL_CHANGE) {
-               unsigned char bits;
+               unsigned char bits = 0x80;
 
-               bits = (ctrl & (NAND_CLE | NAND_ALE)) << 3;
-               bits = (ctrl & NAND_NCE) << 7;
+               bits |= (ctrl & (NAND_CLE | NAND_ALE)) << 3;
+               bits |= (ctrl & NAND_NCE) ? 0x00 : 0x40;
 
-               clps_writeb((clps_readb(ep7312_pxdr)  & 0xB0) | 0x10,
+               clps_writeb((clps_readb(ep7312_pxdr)  & 0xF0) | bits,
                            ep7312_pxdr);
        }
        if (cmd != NAND_CMD_NONE)
@@ -125,7 +123,7 @@ static int __init ep7312_init(void)
                return -ENOMEM;
        }
 
-       /* map physical adress */
+       /* map physical address */
        ep7312_fio_base = ioremap(ep7312_fio_pbase, SZ_1K);
        if (!ep7312_fio_base) {
                printk("ioremap EDB7312 NAND flash failed\n");