blob: 0a949bca0de37c539e7a181d0c2f3d6850ffb135 [file] [log] [blame]
Anton Vorontsovcd9d2302008-01-14 23:09:32 +03001/*
2 * FSL UPM NAND driver
3 *
4 * Copyright (C) 2007 MontaVista Software, Inc.
5 * Anton Vorontsov <avorontsov@ru.mvista.com>
6 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Anton Vorontsovcd9d2302008-01-14 23:09:32 +03008 */
9
10#ifndef __LINUX_MTD_NAND_FSL_UPM
11#define __LINUX_MTD_NAND_FSL_UPM
12
13#include <linux/mtd/nand.h>
14
Wolfgang Grandegger33846df2009-02-11 18:38:23 +010015#define FSL_UPM_WAIT_RUN_PATTERN 0x1
16#define FSL_UPM_WAIT_WRITE_BYTE 0x2
17#define FSL_UPM_WAIT_WRITE_BUFFER 0x4
18
Anton Vorontsovcd9d2302008-01-14 23:09:32 +030019struct fsl_upm {
Anton Vorontsovcd9d2302008-01-14 23:09:32 +030020 void __iomem *mdr;
21 void __iomem *mxmr;
22 void __iomem *mar;
23 void __iomem *io_addr;
24};
25
26struct fsl_upm_nand {
27 struct fsl_upm upm;
28
29 int width;
30 int upm_cmd_offset;
31 int upm_addr_offset;
Wolfgang Grandegger06e9f7d2009-02-11 18:38:22 +010032 int upm_mar_chip_offset;
Wolfgang Grandegger33846df2009-02-11 18:38:23 +010033 int wait_flags;
Wolfgang Grandeggere93c1c12009-02-11 18:38:21 +010034 int (*dev_ready)(int chip_nr);
Anton Vorontsovcd9d2302008-01-14 23:09:32 +030035 int chip_delay;
Wolfgang Grandeggere93c1c12009-02-11 18:38:21 +010036 int chip_offset;
37 int chip_nr;
Anton Vorontsove1c3dba2008-06-12 11:10:21 -050038
39 /* no need to fill */
40 int last_ctrl;
Anton Vorontsovcd9d2302008-01-14 23:09:32 +030041};
42
43extern int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun);
44
45#endif