Anton Vorontsov | cd9d230 | 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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Anton Vorontsov | cd9d230 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __LINUX_MTD_NAND_FSL_UPM |
| 11 | #define __LINUX_MTD_NAND_FSL_UPM |
| 12 | |
| 13 | #include <linux/mtd/nand.h> |
| 14 | |
Wolfgang Grandegger | 33846df | 2009-02-11 18:38:23 +0100 | [diff] [blame] | 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 | |
Anton Vorontsov | cd9d230 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 19 | struct fsl_upm { |
Anton Vorontsov | cd9d230 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 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; |
Wolfgang Grandegger | 06e9f7d | 2009-02-11 18:38:22 +0100 | [diff] [blame] | 32 | int upm_mar_chip_offset; |
Wolfgang Grandegger | 33846df | 2009-02-11 18:38:23 +0100 | [diff] [blame] | 33 | int wait_flags; |
Wolfgang Grandegger | e93c1c1 | 2009-02-11 18:38:21 +0100 | [diff] [blame] | 34 | int (*dev_ready)(int chip_nr); |
Anton Vorontsov | cd9d230 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 35 | int chip_delay; |
Wolfgang Grandegger | e93c1c1 | 2009-02-11 18:38:21 +0100 | [diff] [blame] | 36 | int chip_offset; |
| 37 | int chip_nr; |
Anton Vorontsov | e1c3dba | 2008-06-12 11:10:21 -0500 | [diff] [blame] | 38 | |
| 39 | /* no need to fill */ |
| 40 | int last_ctrl; |
Anton Vorontsov | cd9d230 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | extern int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun); |
| 44 | |
| 45 | #endif |