]> git.sur5r.net Git - u-boot/blobdiff - board/prodrive/pdnb3/nand.c
Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / board / prodrive / pdnb3 / nand.c
index 1ce3c8c618f817461fb9e3cc8344d8cd9c51df5f..e1d2c630bf3bf97b7e52e6ead3899c2140fdd613 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2006
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -96,16 +80,8 @@ static void pdnb3_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 {
        int i;
 
-       if (len % 4) {
-               for (i = 0; i < len; i++)
-                       buf[i] = readb(&(pdnb3_ndfc->data));
-       } else {
-               ulong *ptr = (ulong *)buf;
-               int count = len >> 2;
-
-               for (i = 0; i < count; i++)
-                       *ptr++ = readl(&(pdnb3_ndfc->data));
-       }
+       for (i = 0; i < len; i++)
+               buf[i] = readb(&(pdnb3_ndfc->data));
 }
 
 static int pdnb3_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
@@ -121,12 +97,10 @@ static int pdnb3_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int le
 
 static int pdnb3_nand_dev_ready(struct mtd_info *mtd)
 {
-       volatile u_char val;
-
        /*
         * Blocking read to wait for NAND to be ready
         */
-       val = readb(&(pdnb3_ndfc->wait));
+       readb(&(pdnb3_ndfc->wait));
 
        /*
         * Return always true
@@ -136,7 +110,7 @@ static int pdnb3_nand_dev_ready(struct mtd_info *mtd)
 
 int board_nand_init(struct nand_chip *nand)
 {
-       pdnb3_ndfc = (struct pdnb3_ndfc_regs *)CFG_NAND_BASE;
+       pdnb3_ndfc = (struct pdnb3_ndfc_regs *)CONFIG_SYS_NAND_BASE;
 
        nand->ecc.mode = NAND_ECC_SOFT;