2007-12-12 04:50:17 +07:00
|
|
|
/*
|
2008-08-05 22:14:15 +07:00
|
|
|
* arch/arm/plat-omap/include/mach/nand.h
|
2007-12-12 04:50:17 +07:00
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Micron Technology Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
2012-09-29 13:56:13 +07:00
|
|
|
#ifndef _MTD_NAND_OMAP2_H
|
|
|
|
#define _MTD_NAND_OMAP2_H
|
|
|
|
|
2007-12-12 04:50:17 +07:00
|
|
|
#include <linux/mtd/partitions.h>
|
|
|
|
|
2012-10-04 17:19:04 +07:00
|
|
|
#define GPMC_BCH_NUM_REMAINDER 8
|
|
|
|
|
2011-01-28 17:12:04 +07:00
|
|
|
enum nand_io {
|
|
|
|
NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
|
|
|
|
NAND_OMAP_POLLED, /* polled mode, without prefetch */
|
2011-01-28 17:12:06 +07:00
|
|
|
NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
|
|
|
|
NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
|
2011-01-28 17:12:04 +07:00
|
|
|
};
|
|
|
|
|
2012-09-29 13:56:13 +07:00
|
|
|
enum omap_ecc {
|
|
|
|
/* 1-bit ecc: stored at end of spare area */
|
|
|
|
OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
|
|
|
|
OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
|
|
|
|
/* 1-bit ecc: stored at beginning of spare area as romcode */
|
|
|
|
OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
|
|
|
|
OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
|
|
|
|
OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct gpmc_nand_regs {
|
|
|
|
void __iomem *gpmc_status;
|
|
|
|
void __iomem *gpmc_nand_command;
|
|
|
|
void __iomem *gpmc_nand_address;
|
|
|
|
void __iomem *gpmc_nand_data;
|
|
|
|
void __iomem *gpmc_prefetch_config1;
|
|
|
|
void __iomem *gpmc_prefetch_config2;
|
|
|
|
void __iomem *gpmc_prefetch_control;
|
|
|
|
void __iomem *gpmc_prefetch_status;
|
|
|
|
void __iomem *gpmc_ecc_config;
|
|
|
|
void __iomem *gpmc_ecc_control;
|
|
|
|
void __iomem *gpmc_ecc_size_config;
|
|
|
|
void __iomem *gpmc_ecc1_result;
|
2012-10-04 17:19:04 +07:00
|
|
|
void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
|
|
|
|
void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
|
|
|
|
void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
|
|
|
|
void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
|
2012-09-29 13:56:13 +07:00
|
|
|
};
|
|
|
|
|
2007-12-12 04:50:17 +07:00
|
|
|
struct omap_nand_platform_data {
|
|
|
|
int cs;
|
|
|
|
struct mtd_partition *parts;
|
|
|
|
int nr_parts;
|
2011-06-04 02:56:33 +07:00
|
|
|
bool dev_ready;
|
2011-01-28 17:12:04 +07:00
|
|
|
enum nand_io xfer_type;
|
2010-02-16 01:03:33 +07:00
|
|
|
int devsize;
|
2011-01-28 17:12:08 +07:00
|
|
|
enum omap_ecc ecc_opt;
|
2012-08-31 02:53:22 +07:00
|
|
|
struct gpmc_nand_regs reg;
|
2010-02-16 01:03:33 +07:00
|
|
|
|
2012-12-14 17:36:41 +07:00
|
|
|
/* for passing the partitions */
|
|
|
|
struct device_node *of_node;
|
|
|
|
};
|
2010-04-20 13:33:26 +07:00
|
|
|
#endif
|