mtd-nand-omap2.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  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. #ifndef _MTD_NAND_OMAP2_H
  11. #define _MTD_NAND_OMAP2_H
  12. #include <linux/mtd/partitions.h>
  13. #define GPMC_BCH_NUM_REMAINDER 8
  14. enum nand_io {
  15. NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
  16. NAND_OMAP_POLLED, /* polled mode, without prefetch */
  17. NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
  18. NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
  19. };
  20. enum omap_ecc {
  21. /* 1-bit ecc: stored at end of spare area */
  22. OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
  23. OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
  24. /* 1-bit ecc: stored at beginning of spare area as romcode */
  25. OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
  26. OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
  27. OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
  28. };
  29. struct gpmc_nand_regs {
  30. void __iomem *gpmc_status;
  31. void __iomem *gpmc_nand_command;
  32. void __iomem *gpmc_nand_address;
  33. void __iomem *gpmc_nand_data;
  34. void __iomem *gpmc_prefetch_config1;
  35. void __iomem *gpmc_prefetch_config2;
  36. void __iomem *gpmc_prefetch_control;
  37. void __iomem *gpmc_prefetch_status;
  38. void __iomem *gpmc_ecc_config;
  39. void __iomem *gpmc_ecc_control;
  40. void __iomem *gpmc_ecc_size_config;
  41. void __iomem *gpmc_ecc1_result;
  42. void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
  43. void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
  44. void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
  45. void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
  46. };
  47. struct omap_nand_platform_data {
  48. int cs;
  49. struct mtd_partition *parts;
  50. int nr_parts;
  51. bool dev_ready;
  52. enum nand_io xfer_type;
  53. int devsize;
  54. enum omap_ecc ecc_opt;
  55. struct gpmc_nand_regs reg;
  56. /* for passing the partitions */
  57. struct device_node *of_node;
  58. };
  59. #endif