2 * Genericish driver for memory mapped NAND devices
4 * Copyright (c) 2006-2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
8 /* Your board must implement the following macros:
9 * NAND_PLAT_WRITE_CMD(chip, cmd)
10 * NAND_PLAT_WRITE_ADR(chip, cmd)
13 * It may also implement the following:
14 * NAND_PLAT_DEV_READY(chip)
22 static void plat_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
24 struct nand_chip *this = mtd->priv;
26 if (cmd == NAND_CMD_NONE)
30 NAND_PLAT_WRITE_CMD(this, cmd);
32 NAND_PLAT_WRITE_ADR(this, cmd);
35 #ifdef NAND_PLAT_DEV_READY
36 static int plat_dev_ready(struct mtd_info *mtd)
38 return NAND_PLAT_DEV_READY((struct nand_chip *)mtd->priv);
41 # define plat_dev_ready NULL
44 int board_nand_init(struct nand_chip *nand)
48 nand->cmd_ctrl = plat_cmd_ctrl;
49 nand->dev_ready = plat_dev_ready;
50 nand->ecc.mode = NAND_ECC_SOFT;