Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Anton Vorontsov | 6ab97e9 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 2 | /* |
| 3 | * FSL UPM NAND driver |
| 4 | * |
| 5 | * Copyright (C) 2007 MontaVista Software, Inc. |
| 6 | * Anton Vorontsov <avorontsov@ru.mvista.com> |
Anton Vorontsov | 6ab97e9 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __LINUX_MTD_NAND_FSL_UPM |
| 10 | #define __LINUX_MTD_NAND_FSL_UPM |
| 11 | |
Masahiro Yamada | 2b7a873 | 2017-11-30 13:45:24 +0900 | [diff] [blame] | 12 | #include <linux/mtd/rawnand.h> |
Anton Vorontsov | 6ab97e9 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 13 | |
Wolfgang Grandegger | 64de8db | 2009-02-11 18:38:23 +0100 | [diff] [blame] | 14 | #define FSL_UPM_WAIT_RUN_PATTERN 0x1 |
| 15 | #define FSL_UPM_WAIT_WRITE_BYTE 0x2 |
| 16 | #define FSL_UPM_WAIT_WRITE_BUFFER 0x4 |
| 17 | |
Anton Vorontsov | 6ab97e9 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 18 | struct fsl_upm { |
Anton Vorontsov | 6ab97e9 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 19 | void __iomem *mdr; |
| 20 | void __iomem *mxmr; |
| 21 | void __iomem *mar; |
| 22 | void __iomem *io_addr; |
| 23 | }; |
| 24 | |
| 25 | struct fsl_upm_nand { |
| 26 | struct fsl_upm upm; |
| 27 | |
| 28 | int width; |
| 29 | int upm_cmd_offset; |
| 30 | int upm_addr_offset; |
Wolfgang Grandegger | ac20533 | 2009-02-11 18:38:22 +0100 | [diff] [blame] | 31 | int upm_mar_chip_offset; |
Wolfgang Grandegger | 64de8db | 2009-02-11 18:38:23 +0100 | [diff] [blame] | 32 | int wait_flags; |
Wolfgang Grandegger | f154044 | 2009-02-11 18:38:21 +0100 | [diff] [blame] | 33 | int (*dev_ready)(int chip_nr); |
Anton Vorontsov | 6ab97e9 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 34 | int chip_delay; |
Wolfgang Grandegger | f154044 | 2009-02-11 18:38:21 +0100 | [diff] [blame] | 35 | int chip_offset; |
| 36 | int chip_nr; |
Anton Vorontsov | 6716603 | 2008-06-12 11:10:21 -0500 | [diff] [blame] | 37 | |
| 38 | /* no need to fill */ |
| 39 | int last_ctrl; |
Anton Vorontsov | 6ab97e9 | 2008-01-14 23:09:32 +0300 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | extern int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun); |
| 43 | |
| 44 | #endif |