2 * (C) Copyright 2006 Detlev Zundel, dzu@denx.de
3 * (C) Copyright 2006 DENX Software Engineering
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
31 #if defined(CONFIG_IDS852_REV1)
33 * hardware specific access to control-lines
35 static void nc650_hwcontrol(struct mtd_info *mtd, int cmd)
37 struct nand_chip *this = mtd->priv;
58 #elif defined(CONFIG_IDS852_REV2)
60 * hardware specific access to control-lines
62 static void nc650_hwcontrol(struct mtd_info *mtd, int cmd)
64 struct nand_chip *this = mtd->priv;
68 *(((volatile __u8 *) this->IO_ADDR_W) + 0xa) = 0;
71 *(((volatile __u8 *) this->IO_ADDR_W) + 0x8) = 0;
74 *(((volatile __u8 *) this->IO_ADDR_W) + 0x9) = 0;
77 *(((volatile __u8 *) this->IO_ADDR_W) + 0x8) = 0;
80 *(((volatile __u8 *) this->IO_ADDR_W) + 0x8) = 0;
83 *(((volatile __u8 *) this->IO_ADDR_W) + 0xc) = 0;
88 #error Unknown IDS852 module revision
92 * Board-specific NAND initialization. The following members of the
93 * argument are board-specific (per include/linux/mtd/nand.h):
94 * - IO_ADDR_R?: address to read the 8 I/O lines of the flash device
95 * - IO_ADDR_W?: address to write the 8 I/O lines of the flash device
96 * - hwcontrol: hardwarespecific function for accesing control-lines
97 * - dev_ready: hardwarespecific function for accesing device ready/busy line
98 * - enable_hwecc?: function to enable (reset) hardware ecc generator. Must
99 * only be provided if a hardware ECC is available
100 * - eccmode: mode of ecc, see defines
101 * - chip_delay: chip dependent delay for transfering data from array to
103 * - options: various chip options. They can partly be set to inform
104 * nand_scan about special functionality. See the defines for further
106 * Members with a "?" were not set in the merged testing-NAND branch,
107 * so they are not set here either.
109 int board_nand_init(struct nand_chip *nand)
112 nand->hwcontrol = nc650_hwcontrol;
113 nand->eccmode = NAND_ECC_SOFT;
114 nand->chip_delay = 12;
115 /* nand->options = NAND_SAMSUNG_LP_OPTIONS;*/
118 #endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */