mtd-nand-omap2.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2006 Micron Technology Inc.
  4. */
  5. #ifndef _MTD_NAND_OMAP2_H
  6. #define _MTD_NAND_OMAP2_H
  7. #include <linux/mtd/partitions.h>
  8. #include <linux/mod_devicetable.h>
  9. #define GPMC_BCH_NUM_REMAINDER 8
  10. enum nand_io {
  11. NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
  12. NAND_OMAP_POLLED, /* polled mode, without prefetch */
  13. NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
  14. NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
  15. };
  16. enum omap_ecc {
  17. /*
  18. * 1-bit ECC: calculation and correction by SW
  19. * ECC stored at end of spare area
  20. */
  21. OMAP_ECC_HAM1_CODE_SW = 0,
  22. /*
  23. * 1-bit ECC: calculation by GPMC, Error detection by Software
  24. * ECC layout compatible with ROM code layout
  25. */
  26. OMAP_ECC_HAM1_CODE_HW,
  27. /* 4-bit ECC calculation by GPMC, Error detection by Software */
  28. OMAP_ECC_BCH4_CODE_HW_DETECTION_SW,
  29. /* 4-bit ECC calculation by GPMC, Error detection by ELM */
  30. OMAP_ECC_BCH4_CODE_HW,
  31. /* 8-bit ECC calculation by GPMC, Error detection by Software */
  32. OMAP_ECC_BCH8_CODE_HW_DETECTION_SW,
  33. /* 8-bit ECC calculation by GPMC, Error detection by ELM */
  34. OMAP_ECC_BCH8_CODE_HW,
  35. /* 16-bit ECC calculation by GPMC, Error detection by ELM */
  36. OMAP_ECC_BCH16_CODE_HW,
  37. };
  38. struct gpmc_nand_regs {
  39. void __iomem *gpmc_nand_command;
  40. void __iomem *gpmc_nand_address;
  41. void __iomem *gpmc_nand_data;
  42. void __iomem *gpmc_prefetch_config1;
  43. void __iomem *gpmc_prefetch_config2;
  44. void __iomem *gpmc_prefetch_control;
  45. void __iomem *gpmc_prefetch_status;
  46. void __iomem *gpmc_ecc_config;
  47. void __iomem *gpmc_ecc_control;
  48. void __iomem *gpmc_ecc_size_config;
  49. void __iomem *gpmc_ecc1_result;
  50. void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
  51. void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
  52. void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
  53. void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
  54. void __iomem *gpmc_bch_result4[GPMC_BCH_NUM_REMAINDER];
  55. void __iomem *gpmc_bch_result5[GPMC_BCH_NUM_REMAINDER];
  56. void __iomem *gpmc_bch_result6[GPMC_BCH_NUM_REMAINDER];
  57. };
  58. static const struct of_device_id omap_nand_ids[] = {
  59. { .compatible = "ti,omap2-nand", },
  60. { .compatible = "ti,am64-nand", },
  61. {},
  62. };
  63. #endif /* _MTD_NAND_OMAP2_H */