mtd-nand-omap2.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 calculation by GPMC, Error detection by Software */
  22. OMAP_ECC_HAM1_CODE_HW = 0,
  23. /* 4-bit ECC calculation by GPMC, Error detection by Software */
  24. OMAP_ECC_BCH4_CODE_HW_DETECTION_SW,
  25. /* 4-bit ECC calculation by GPMC, Error detection by ELM */
  26. OMAP_ECC_BCH4_CODE_HW,
  27. /* 8-bit ECC calculation by GPMC, Error detection by Software */
  28. OMAP_ECC_BCH8_CODE_HW_DETECTION_SW,
  29. /* 8-bit ECC calculation by GPMC, Error detection by ELM */
  30. OMAP_ECC_BCH8_CODE_HW,
  31. };
  32. struct gpmc_nand_regs {
  33. void __iomem *gpmc_status;
  34. void __iomem *gpmc_nand_command;
  35. void __iomem *gpmc_nand_address;
  36. void __iomem *gpmc_nand_data;
  37. void __iomem *gpmc_prefetch_config1;
  38. void __iomem *gpmc_prefetch_config2;
  39. void __iomem *gpmc_prefetch_control;
  40. void __iomem *gpmc_prefetch_status;
  41. void __iomem *gpmc_ecc_config;
  42. void __iomem *gpmc_ecc_control;
  43. void __iomem *gpmc_ecc_size_config;
  44. void __iomem *gpmc_ecc1_result;
  45. void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
  46. void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
  47. void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
  48. void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
  49. };
  50. struct omap_nand_platform_data {
  51. int cs;
  52. struct mtd_partition *parts;
  53. int nr_parts;
  54. bool dev_ready;
  55. enum nand_io xfer_type;
  56. int devsize;
  57. enum omap_ecc ecc_opt;
  58. struct gpmc_nand_regs reg;
  59. /* for passing the partitions */
  60. struct device_node *of_node;
  61. struct device_node *elm_of_node;
  62. };
  63. #endif