mtd-davinci.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * mach-davinci/nand.h
  4. *
  5. * Copyright © 2006 Texas Instruments.
  6. *
  7. * Ported to 2.6.23 Copyright © 2008 by
  8. * Sander Huijsen <[email protected]>
  9. * Troy Kisky <[email protected]>
  10. * Dirk Behme <[email protected]>
  11. *
  12. * --------------------------------------------------------------------------
  13. */
  14. #ifndef __ARCH_ARM_DAVINCI_NAND_H
  15. #define __ARCH_ARM_DAVINCI_NAND_H
  16. #include <linux/mtd/rawnand.h>
  17. #define NANDFCR_OFFSET 0x60
  18. #define NANDFSR_OFFSET 0x64
  19. #define NANDF1ECC_OFFSET 0x70
  20. /* 4-bit ECC syndrome registers */
  21. #define NAND_4BIT_ECC_LOAD_OFFSET 0xbc
  22. #define NAND_4BIT_ECC1_OFFSET 0xc0
  23. #define NAND_4BIT_ECC2_OFFSET 0xc4
  24. #define NAND_4BIT_ECC3_OFFSET 0xc8
  25. #define NAND_4BIT_ECC4_OFFSET 0xcc
  26. #define NAND_ERR_ADD1_OFFSET 0xd0
  27. #define NAND_ERR_ADD2_OFFSET 0xd4
  28. #define NAND_ERR_ERRVAL1_OFFSET 0xd8
  29. #define NAND_ERR_ERRVAL2_OFFSET 0xdc
  30. /* NOTE: boards don't need to use these address bits
  31. * for ALE/CLE unless they support booting from NAND.
  32. * They're used unless platform data overrides them.
  33. */
  34. #define MASK_ALE 0x08
  35. #define MASK_CLE 0x10
  36. struct davinci_nand_pdata { /* platform_data */
  37. uint32_t mask_ale;
  38. uint32_t mask_cle;
  39. /*
  40. * 0-indexed chip-select number of the asynchronous
  41. * interface to which the NAND device has been connected.
  42. *
  43. * So, if you have NAND connected to CS3 of DA850, you
  44. * will pass '1' here. Since the asynchronous interface
  45. * on DA850 starts from CS2.
  46. */
  47. uint32_t core_chipsel;
  48. /* for packages using two chipselects */
  49. uint32_t mask_chipsel;
  50. /* board's default static partition info */
  51. struct mtd_partition *parts;
  52. unsigned nr_parts;
  53. /* none == NAND_ECC_ENGINE_TYPE_NONE (strongly *not* advised!!)
  54. * soft == NAND_ECC_ENGINE_TYPE_SOFT
  55. * else == NAND_ECC_ENGINE_TYPE_ON_HOST, according to ecc_bits
  56. *
  57. * All DaVinci-family chips support 1-bit hardware ECC.
  58. * Newer ones also support 4-bit ECC, but are awkward
  59. * using it with large page chips.
  60. */
  61. enum nand_ecc_engine_type engine_type;
  62. enum nand_ecc_placement ecc_placement;
  63. u8 ecc_bits;
  64. /* e.g. NAND_BUSWIDTH_16 */
  65. unsigned options;
  66. /* e.g. NAND_BBT_USE_FLASH */
  67. unsigned bbt_options;
  68. /* Main and mirror bbt descriptor overrides */
  69. struct nand_bbt_descr *bbt_td;
  70. struct nand_bbt_descr *bbt_md;
  71. /* Access timings */
  72. struct davinci_aemif_timing *timing;
  73. };
  74. #endif /* __ARCH_ARM_DAVINCI_NAND_H */