blob: e1965fe581d1204cdb7eca19edd780b5b66c4811 [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/*
2 * arch/arm/plat-omap/include/mach/nand.h
3 *
4 * Copyright (C) 2006 Micron Technology Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
Afzal Mohammedbc3668e2012-09-29 12:26:13 +053011#ifndef _MTD_NAND_OMAP2_H
12#define _MTD_NAND_OMAP2_H
13
Russell Kinga09e64f2008-08-05 16:14:15 +010014#include <linux/mtd/partitions.h>
15
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053016enum nand_io {
17 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
18 NAND_OMAP_POLLED, /* polled mode, without prefetch */
Sukumar Ghorai4e070372011-01-28 15:42:06 +053019 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
20 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053021};
22
Afzal Mohammedbc3668e2012-09-29 12:26:13 +053023enum omap_ecc {
24 /* 1-bit ecc: stored at end of spare area */
25 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
26 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
27 /* 1-bit ecc: stored at beginning of spare area as romcode */
28 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
29 OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
30 OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
31};
32
33struct gpmc_nand_regs {
34 void __iomem *gpmc_status;
35 void __iomem *gpmc_nand_command;
36 void __iomem *gpmc_nand_address;
37 void __iomem *gpmc_nand_data;
38 void __iomem *gpmc_prefetch_config1;
39 void __iomem *gpmc_prefetch_config2;
40 void __iomem *gpmc_prefetch_control;
41 void __iomem *gpmc_prefetch_status;
42 void __iomem *gpmc_ecc_config;
43 void __iomem *gpmc_ecc_control;
44 void __iomem *gpmc_ecc_size_config;
45 void __iomem *gpmc_ecc1_result;
46 void __iomem *gpmc_bch_result0;
47};
48
Russell Kinga09e64f2008-08-05 16:14:15 +010049struct omap_nand_platform_data {
Russell Kinga09e64f2008-08-05 16:14:15 +010050 int cs;
Russell Kinga09e64f2008-08-05 16:14:15 +010051 struct mtd_partition *parts;
52 int nr_parts;
Grazvydas Ignotas7a559c72011-06-03 19:56:33 +000053 bool dev_ready;
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053054 enum nand_io xfer_type;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080055 int devsize;
Sukumar Ghoraif3d73f32011-01-28 15:42:08 +053056 enum omap_ecc ecc_opt;
Afzal Mohammedd126d012012-08-30 12:53:22 -070057 struct gpmc_nand_regs reg;
Russell Kinga09e64f2008-08-05 16:14:15 +010058};
Vimal Singh2f70a1e2010-02-15 10:03:33 -080059
stanley.miao562468b2010-04-20 06:33:26 +000060#endif