xref: /rk3399_rockchip-uboot/include/linux/mtd/fsl_upm.h (revision 33846df28fa1f4cf96a96c18142d48d813caa892)
1cd9d2305SAnton Vorontsov /*
2cd9d2305SAnton Vorontsov  * FSL UPM NAND driver
3cd9d2305SAnton Vorontsov  *
4cd9d2305SAnton Vorontsov  * Copyright (C) 2007 MontaVista Software, Inc.
5cd9d2305SAnton Vorontsov  *                    Anton Vorontsov <avorontsov@ru.mvista.com>
6cd9d2305SAnton Vorontsov  *
7cd9d2305SAnton Vorontsov  * This program is free software; you can redistribute it and/or
8cd9d2305SAnton Vorontsov  * modify it under the terms of the GNU General Public License as
9cd9d2305SAnton Vorontsov  * published by the Free Software Foundation; either version 2 of
10cd9d2305SAnton Vorontsov  * the License, or (at your option) any later version.
11cd9d2305SAnton Vorontsov  */
12cd9d2305SAnton Vorontsov 
13cd9d2305SAnton Vorontsov #ifndef __LINUX_MTD_NAND_FSL_UPM
14cd9d2305SAnton Vorontsov #define __LINUX_MTD_NAND_FSL_UPM
15cd9d2305SAnton Vorontsov 
16cd9d2305SAnton Vorontsov #include <linux/mtd/nand.h>
17cd9d2305SAnton Vorontsov 
18*33846df2SWolfgang Grandegger #define FSL_UPM_WAIT_RUN_PATTERN  0x1
19*33846df2SWolfgang Grandegger #define FSL_UPM_WAIT_WRITE_BYTE   0x2
20*33846df2SWolfgang Grandegger #define FSL_UPM_WAIT_WRITE_BUFFER 0x4
21*33846df2SWolfgang Grandegger 
22cd9d2305SAnton Vorontsov struct fsl_upm {
23cd9d2305SAnton Vorontsov 	void __iomem *mdr;
24cd9d2305SAnton Vorontsov 	void __iomem *mxmr;
25cd9d2305SAnton Vorontsov 	void __iomem *mar;
26cd9d2305SAnton Vorontsov 	void __iomem *io_addr;
27cd9d2305SAnton Vorontsov };
28cd9d2305SAnton Vorontsov 
29cd9d2305SAnton Vorontsov struct fsl_upm_nand {
30cd9d2305SAnton Vorontsov 	struct fsl_upm upm;
31cd9d2305SAnton Vorontsov 
32cd9d2305SAnton Vorontsov 	int width;
33cd9d2305SAnton Vorontsov 	int upm_cmd_offset;
34cd9d2305SAnton Vorontsov 	int upm_addr_offset;
3506e9f7dfSWolfgang Grandegger 	int upm_mar_chip_offset;
36*33846df2SWolfgang Grandegger 	int wait_flags;
37e93c1c16SWolfgang Grandegger 	int (*dev_ready)(int chip_nr);
38cd9d2305SAnton Vorontsov 	int chip_delay;
39e93c1c16SWolfgang Grandegger 	int chip_offset;
40e93c1c16SWolfgang Grandegger 	int chip_nr;
41e1c3dbadSAnton Vorontsov 
42e1c3dbadSAnton Vorontsov 	/* no need to fill */
43e1c3dbadSAnton Vorontsov 	int last_ctrl;
44cd9d2305SAnton Vorontsov };
45cd9d2305SAnton Vorontsov 
46cd9d2305SAnton Vorontsov extern int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun);
47cd9d2305SAnton Vorontsov 
48cd9d2305SAnton Vorontsov #endif
49