blob: 619df2431e750794c1081580221e88659241554b [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/*
Russell Kinga09e64f2008-08-05 16:14:15 +01002 * Copyright (C) 2006 Micron Technology Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
Afzal Mohammedbc3668e2012-09-29 12:26:13 +05309#ifndef _MTD_NAND_OMAP2_H
10#define _MTD_NAND_OMAP2_H
11
Russell Kinga09e64f2008-08-05 16:14:15 +010012#include <linux/mtd/partitions.h>
13
Afzal Mohammed2fdf0c92012-10-04 15:49:04 +053014#define GPMC_BCH_NUM_REMAINDER 8
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 {
Roger Quadros7d5929c2014-08-25 16:15:32 -070024 /*
25 * 1-bit ECC: calculation and correction by SW
26 * ECC stored at end of spare area
27 */
28 OMAP_ECC_HAM1_CODE_SW = 0,
29
30 /*
31 * 1-bit ECC: calculation by GPMC, Error detection by Software
32 * ECC layout compatible with ROM code layout
33 */
34 OMAP_ECC_HAM1_CODE_HW,
Pekon Guptaac65caf52013-10-24 18:20:17 +053035 /* 4-bit ECC calculation by GPMC, Error detection by Software */
36 OMAP_ECC_BCH4_CODE_HW_DETECTION_SW,
37 /* 4-bit ECC calculation by GPMC, Error detection by ELM */
38 OMAP_ECC_BCH4_CODE_HW,
39 /* 8-bit ECC calculation by GPMC, Error detection by Software */
40 OMAP_ECC_BCH8_CODE_HW_DETECTION_SW,
41 /* 8-bit ECC calculation by GPMC, Error detection by ELM */
42 OMAP_ECC_BCH8_CODE_HW,
pekon gupta27c9fd62014-05-19 13:24:39 +053043 /* 16-bit ECC calculation by GPMC, Error detection by ELM */
44 OMAP_ECC_BCH16_CODE_HW,
Afzal Mohammedbc3668e2012-09-29 12:26:13 +053045};
46
47struct gpmc_nand_regs {
Afzal Mohammedbc3668e2012-09-29 12:26:13 +053048 void __iomem *gpmc_nand_command;
49 void __iomem *gpmc_nand_address;
50 void __iomem *gpmc_nand_data;
51 void __iomem *gpmc_prefetch_config1;
52 void __iomem *gpmc_prefetch_config2;
53 void __iomem *gpmc_prefetch_control;
54 void __iomem *gpmc_prefetch_status;
55 void __iomem *gpmc_ecc_config;
56 void __iomem *gpmc_ecc_control;
57 void __iomem *gpmc_ecc_size_config;
58 void __iomem *gpmc_ecc1_result;
Afzal Mohammed2fdf0c92012-10-04 15:49:04 +053059 void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
60 void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
61 void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
62 void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
pekon gupta27c9fd62014-05-19 13:24:39 +053063 void __iomem *gpmc_bch_result4[GPMC_BCH_NUM_REMAINDER];
64 void __iomem *gpmc_bch_result5[GPMC_BCH_NUM_REMAINDER];
65 void __iomem *gpmc_bch_result6[GPMC_BCH_NUM_REMAINDER];
Afzal Mohammedbc3668e2012-09-29 12:26:13 +053066};
stanley.miao562468b2010-04-20 06:33:26 +000067#endif