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 * 71a459660SWolfgang Denk * SPDX-License-Identifier: GPL-2.0+ 8cd9d2305SAnton Vorontsov */ 9cd9d2305SAnton Vorontsov 10cd9d2305SAnton Vorontsov #ifndef __LINUX_MTD_NAND_FSL_UPM 11cd9d2305SAnton Vorontsov #define __LINUX_MTD_NAND_FSL_UPM 12cd9d2305SAnton Vorontsov 13*331c2375SMasahiro Yamada #include <linux/mtd/rawnand.h> 14cd9d2305SAnton Vorontsov 1533846df2SWolfgang Grandegger #define FSL_UPM_WAIT_RUN_PATTERN 0x1 1633846df2SWolfgang Grandegger #define FSL_UPM_WAIT_WRITE_BYTE 0x2 1733846df2SWolfgang Grandegger #define FSL_UPM_WAIT_WRITE_BUFFER 0x4 1833846df2SWolfgang Grandegger 19cd9d2305SAnton Vorontsov struct fsl_upm { 20cd9d2305SAnton Vorontsov void __iomem *mdr; 21cd9d2305SAnton Vorontsov void __iomem *mxmr; 22cd9d2305SAnton Vorontsov void __iomem *mar; 23cd9d2305SAnton Vorontsov void __iomem *io_addr; 24cd9d2305SAnton Vorontsov }; 25cd9d2305SAnton Vorontsov 26cd9d2305SAnton Vorontsov struct fsl_upm_nand { 27cd9d2305SAnton Vorontsov struct fsl_upm upm; 28cd9d2305SAnton Vorontsov 29cd9d2305SAnton Vorontsov int width; 30cd9d2305SAnton Vorontsov int upm_cmd_offset; 31cd9d2305SAnton Vorontsov int upm_addr_offset; 3206e9f7dfSWolfgang Grandegger int upm_mar_chip_offset; 3333846df2SWolfgang Grandegger int wait_flags; 34e93c1c16SWolfgang Grandegger int (*dev_ready)(int chip_nr); 35cd9d2305SAnton Vorontsov int chip_delay; 36e93c1c16SWolfgang Grandegger int chip_offset; 37e93c1c16SWolfgang Grandegger int chip_nr; 38e1c3dbadSAnton Vorontsov 39e1c3dbadSAnton Vorontsov /* no need to fill */ 40e1c3dbadSAnton Vorontsov int last_ctrl; 41cd9d2305SAnton Vorontsov }; 42cd9d2305SAnton Vorontsov 43cd9d2305SAnton Vorontsov extern int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun); 44cd9d2305SAnton Vorontsov 45cd9d2305SAnton Vorontsov #endif 46