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