]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Xilinx: ARM: nand: Move the zynq nand driver to drivers/mtd/nand
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 6 Jun 2012 00:10:22 +0000 (19:10 -0500)
committerJohn Linn <john.linn@xilinx.com>
Wed, 6 Jun 2012 18:02:25 +0000 (11:02 -0700)
This drivers should be accesible to other boards based on Zynq

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
arch/arm/include/asm/arch-zynq/nand.h [new file with mode: 0644]
board/xilinx/zynq_common/Makefile
board/xilinx/zynq_common/board.c
drivers/mtd/nand/Makefile
drivers/mtd/nand/zynq_nand.c [moved from board/xilinx/zynq_common/xilinx_nandps.c with 99% similarity]
drivers/mtd/nand/zynq_nand.h [moved from board/xilinx/zynq_common/xilinx_nand_smc.h with 100% similarity]
include/configs/zynq_ep107.h
include/configs/zynq_zc770.h

diff --git a/arch/arm/include/asm/arch-zynq/nand.h b/arch/arm/include/asm/arch-zynq/nand.h
new file mode 100644 (file)
index 0000000..33a7d20
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 Joe Hershberger <joe.hershberger@ni.com>
+ *
+ * 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
+ */
+
+#include <nand.h>
+
+extern int zynq_nand_init(struct nand_chip *nand_chip);
index d884920b05df66a09b5a18b3e96da48de2d16df2..975d1cc307d372b64caac478f9f6cff1ab1f5737 100644 (file)
@@ -35,7 +35,6 @@ COBJS-$(CONFIG_CMD_NET) += xemacps_g.o xemacps_control.o \
                xemacps_sinit.o xemacps_bdring.o \
                xemacps.o xgmac.o
 COBJS-$(CONFIG_CMD_SPI) += xilinx_qspi.o xilinx_qspips.o
-COBJS-$(CONFIG_CMD_NAND) += xilinx_nandps.o
 
 COBJS  := $(sort $(COBJS-y))
 
index c7d688b6882d4edc14c77ca6b505b524acd5e6c5..6a029fd11c185fbd9f18968dcb84f287809dd59e 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <common.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/nand.h>
 #include <asm/arch/xparameters.h>
 #include <netdev.h>
 #include <zynqpl.h>
@@ -681,6 +682,13 @@ int board_mmc_init(bd_t *bd)
 }
 #endif
 
+#ifdef CONFIG_CMD_NAND
+int board_nand_init(struct nand_chip *nand_chip)
+{
+       return zynq_nand_init(nand_chip);
+}
+#endif
+
 int dram_init(void)
 {
        gd->ram_size = PHYS_SDRAM_1_SIZE;
index 8b598f6bfef8769964fa149fb2526a48d394f613..a17e75b96ddec7c9ab6cefaf7fe02d32505c6564 100644 (file)
@@ -50,6 +50,7 @@ COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
+COBJS-$(CONFIG_NAND_ZYNQ) += zynq_nand.o
 endif
 
 COBJS  := $(COBJS-y)
similarity index 99%
rename from board/xilinx/zynq_common/xilinx_nandps.c
rename to drivers/mtd/nand/zynq_nand.c
index 7bdf756bada50021388f0f80f059e94deb7b85cf..48842564b9e21dcdca3e5e060f8abadf8937b120 100644 (file)
 #include <common.h>
 #include <malloc.h>
 
+#include <asm/arch/nand.h>
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand_ecc.h>
-#include "xilinx_nand_smc.h"
+#include "zynq_nand.h"
 
 /********** stubs - Make Linux code compile in this environment **************/
 #define EIO              5
@@ -985,7 +986,7 @@ static int xnandps_device_ready(struct mtd_info *mtd)
 #ifdef LINUX_ONLY_NOT_UBOOT
 static int __init xnandps_probe(struct platform_device *pdev)
 #else
-int board_nand_init(struct nand_chip *nand_chip)
+int zynq_nand_init(struct nand_chip *nand_chip)
 #endif
 {
        struct xnandps_info *xnand;
index 11c568396374d2ce7c4415cc06b6fa330ffe23e2..4cb64da8412b59beba9f66ce2762b0310bcac3af 100644 (file)
@@ -95,6 +95,7 @@
 /*
  * NAND Flash settings
  */
+#define CONFIG_NAND_ZYNQ
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_NAND_LOCK_UNLOCK
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
index 602dccccf657a55ea8e4f5414c267447b8621d8e..56f5b876c3fcae94885170ea7fa99a56b931f93f 100644 (file)
  * NAND Flash settings
  */
 #if defined(CONFIG_ZC770_XM011)
+#define CONFIG_NAND_ZYNQ
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_NAND_LOCK_UNLOCK
 #define CONFIG_SYS_MAX_NAND_DEVICE 1