]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/quad100hd/nand.c
3 * Gary Jennejohn, DENX Software Engineering GmbH, garyj@denx.de
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,
26 #if defined(CONFIG_CMD_NAND)
31 * hardware specific access to control-lines
33 static void quad100hd_hwcontrol(struct mtd_info
*mtd
, int cmd
)
37 gpio_write_bit(CFG_NAND_CLE
, 1);
40 gpio_write_bit(CFG_NAND_CLE
, 0);
44 gpio_write_bit(CFG_NAND_ALE
, 1);
47 gpio_write_bit(CFG_NAND_ALE
, 0);
51 gpio_write_bit(CFG_NAND_CE
, 0);
54 gpio_write_bit(CFG_NAND_CE
, 1);
59 static int quad100hd_nand_ready(struct mtd_info
*mtd
)
61 return gpio_read_in_bit(CFG_NAND_RDY
);
65 * Main initialization routine
67 int board_nand_init(struct nand_chip
*nand
)
69 /* Set address of hardware control function */
70 nand
->hwcontrol
= quad100hd_hwcontrol
;
71 nand
->dev_ready
= quad100hd_nand_ready
;
72 nand
->eccmode
= NAND_ECC_SOFT
;
73 /* 15 us command delay time */
74 nand
->chip_delay
= 20;
79 #endif /* CONFIG_CMD_NAND */