xref: /openbmc/u-boot/include/linux/mtd/fsl_upm.h (revision 4320e2fd)
1 /*
2  * FSL UPM NAND driver
3  *
4  * Copyright (C) 2007 MontaVista Software, Inc.
5  *                    Anton Vorontsov <avorontsov@ru.mvista.com>
6  *
7  * SPDX-License-Identifier:	GPL-2.0+
8  */
9 
10 #ifndef __LINUX_MTD_NAND_FSL_UPM
11 #define __LINUX_MTD_NAND_FSL_UPM
12 
13 #include <linux/mtd/rawnand.h>
14 
15 #define FSL_UPM_WAIT_RUN_PATTERN  0x1
16 #define FSL_UPM_WAIT_WRITE_BYTE   0x2
17 #define FSL_UPM_WAIT_WRITE_BUFFER 0x4
18 
19 struct fsl_upm {
20 	void __iomem *mdr;
21 	void __iomem *mxmr;
22 	void __iomem *mar;
23 	void __iomem *io_addr;
24 };
25 
26 struct fsl_upm_nand {
27 	struct fsl_upm upm;
28 
29 	int width;
30 	int upm_cmd_offset;
31 	int upm_addr_offset;
32 	int upm_mar_chip_offset;
33 	int wait_flags;
34 	int (*dev_ready)(int chip_nr);
35 	int chip_delay;
36 	int chip_offset;
37 	int chip_nr;
38 
39 	/* no need to fill */
40 	int last_ctrl;
41 };
42 
43 extern int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun);
44 
45 #endif
46