regs-nand.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* arch/arm/mach-s3c2410/include/mach/regs-nand.h
  2. *
  3. * Copyright (c) 2004-2005 Simtec Electronics <linux@simtec.co.uk>
  4. * http://www.simtec.co.uk/products/SWLINUX/
  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. * S3C2410 NAND register definitions
  11. */
  12. #ifndef __ASM_ARM_REGS_NAND
  13. #define __ASM_ARM_REGS_NAND
  14. #define S3C2410_NFREG(x) (x)
  15. #define S3C2410_NFCONF S3C2410_NFREG(0x00)
  16. #define S3C2410_NFCMD S3C2410_NFREG(0x04)
  17. #define S3C2410_NFADDR S3C2410_NFREG(0x08)
  18. #define S3C2410_NFDATA S3C2410_NFREG(0x0C)
  19. #define S3C2410_NFSTAT S3C2410_NFREG(0x10)
  20. #define S3C2410_NFECC S3C2410_NFREG(0x14)
  21. #define S3C2440_NFCONT S3C2410_NFREG(0x04)
  22. #define S3C2440_NFCMD S3C2410_NFREG(0x08)
  23. #define S3C2440_NFADDR S3C2410_NFREG(0x0C)
  24. #define S3C2440_NFDATA S3C2410_NFREG(0x10)
  25. #define S3C2440_NFECCD0 S3C2410_NFREG(0x14)
  26. #define S3C2440_NFECCD1 S3C2410_NFREG(0x18)
  27. #define S3C2440_NFECCD S3C2410_NFREG(0x1C)
  28. #define S3C2440_NFSTAT S3C2410_NFREG(0x20)
  29. #define S3C2440_NFESTAT0 S3C2410_NFREG(0x24)
  30. #define S3C2440_NFESTAT1 S3C2410_NFREG(0x28)
  31. #define S3C2440_NFMECC0 S3C2410_NFREG(0x2C)
  32. #define S3C2440_NFMECC1 S3C2410_NFREG(0x30)
  33. #define S3C2440_NFSECC S3C2410_NFREG(0x34)
  34. #define S3C2440_NFSBLK S3C2410_NFREG(0x38)
  35. #define S3C2440_NFEBLK S3C2410_NFREG(0x3C)
  36. #define S3C2412_NFSBLK S3C2410_NFREG(0x20)
  37. #define S3C2412_NFEBLK S3C2410_NFREG(0x24)
  38. #define S3C2412_NFSTAT S3C2410_NFREG(0x28)
  39. #define S3C2412_NFMECC_ERR0 S3C2410_NFREG(0x2C)
  40. #define S3C2412_NFMECC_ERR1 S3C2410_NFREG(0x30)
  41. #define S3C2412_NFMECC0 S3C2410_NFREG(0x34)
  42. #define S3C2412_NFMECC1 S3C2410_NFREG(0x38)
  43. #define S3C2412_NFSECC S3C2410_NFREG(0x3C)
  44. #define S3C2410_NFCONF_EN (1<<15)
  45. #define S3C2410_NFCONF_512BYTE (1<<14)
  46. #define S3C2410_NFCONF_4STEP (1<<13)
  47. #define S3C2410_NFCONF_INITECC (1<<12)
  48. #define S3C2410_NFCONF_nFCE (1<<11)
  49. #define S3C2410_NFCONF_TACLS(x) ((x)<<8)
  50. #define S3C2410_NFCONF_TWRPH0(x) ((x)<<4)
  51. #define S3C2410_NFCONF_TWRPH1(x) ((x)<<0)
  52. #define S3C2410_NFSTAT_BUSY (1<<0)
  53. #define S3C2440_NFCONF_BUSWIDTH_8 (0<<0)
  54. #define S3C2440_NFCONF_BUSWIDTH_16 (1<<0)
  55. #define S3C2440_NFCONF_ADVFLASH (1<<3)
  56. #define S3C2440_NFCONF_TACLS(x) ((x)<<12)
  57. #define S3C2440_NFCONF_TWRPH0(x) ((x)<<8)
  58. #define S3C2440_NFCONF_TWRPH1(x) ((x)<<4)
  59. #define S3C2440_NFCONT_LOCKTIGHT (1<<13)
  60. #define S3C2440_NFCONT_SOFTLOCK (1<<12)
  61. #define S3C2440_NFCONT_ILLEGALACC_EN (1<<10)
  62. #define S3C2440_NFCONT_RNBINT_EN (1<<9)
  63. #define S3C2440_NFCONT_RN_FALLING (1<<8)
  64. #define S3C2440_NFCONT_SPARE_ECCLOCK (1<<6)
  65. #define S3C2440_NFCONT_MAIN_ECCLOCK (1<<5)
  66. #define S3C2440_NFCONT_INITECC (1<<4)
  67. #define S3C2440_NFCONT_nFCE (1<<1)
  68. #define S3C2440_NFCONT_ENABLE (1<<0)
  69. #define S3C2440_NFSTAT_READY (1<<0)
  70. #define S3C2440_NFSTAT_nCE (1<<1)
  71. #define S3C2440_NFSTAT_RnB_CHANGE (1<<2)
  72. #define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3)
  73. #define S3C2412_NFCONF_NANDBOOT (1<<31)
  74. #define S3C2412_NFCONF_ECCCLKCON (1<<30)
  75. #define S3C2412_NFCONF_ECC_MLC (1<<24)
  76. #define S3C2412_NFCONF_TACLS_MASK (7<<12) /* 1 extra bit of Tacls */
  77. #define S3C2412_NFCONT_ECC4_DIRWR (1<<18)
  78. #define S3C2412_NFCONT_LOCKTIGHT (1<<17)
  79. #define S3C2412_NFCONT_SOFTLOCK (1<<16)
  80. #define S3C2412_NFCONT_ECC4_ENCINT (1<<13)
  81. #define S3C2412_NFCONT_ECC4_DECINT (1<<12)
  82. #define S3C2412_NFCONT_MAIN_ECC_LOCK (1<<7)
  83. #define S3C2412_NFCONT_INIT_MAIN_ECC (1<<5)
  84. #define S3C2412_NFCONT_nFCE1 (1<<2)
  85. #define S3C2412_NFCONT_nFCE0 (1<<1)
  86. #define S3C2412_NFSTAT_ECC_ENCDONE (1<<7)
  87. #define S3C2412_NFSTAT_ECC_DECDONE (1<<6)
  88. #define S3C2412_NFSTAT_ILLEGAL_ACCESS (1<<5)
  89. #define S3C2412_NFSTAT_RnB_CHANGE (1<<4)
  90. #define S3C2412_NFSTAT_nFCE1 (1<<3)
  91. #define S3C2412_NFSTAT_nFCE0 (1<<2)
  92. #define S3C2412_NFSTAT_Res1 (1<<1)
  93. #define S3C2412_NFSTAT_READY (1<<0)
  94. #define S3C2412_NFECCERR_SERRDATA(x) (((x) >> 21) & 0xf)
  95. #define S3C2412_NFECCERR_SERRBIT(x) (((x) >> 18) & 0x7)
  96. #define S3C2412_NFECCERR_MERRDATA(x) (((x) >> 7) & 0x3ff)
  97. #define S3C2412_NFECCERR_MERRBIT(x) (((x) >> 4) & 0x7)
  98. #define S3C2412_NFECCERR_SPARE_ERR(x) (((x) >> 2) & 0x3)
  99. #define S3C2412_NFECCERR_MAIN_ERR(x) (((x) >> 2) & 0x3)
  100. #define S3C2412_NFECCERR_NONE (0)
  101. #define S3C2412_NFECCERR_1BIT (1)
  102. #define S3C2412_NFECCERR_MULTIBIT (2)
  103. #define S3C2412_NFECCERR_ECCAREA (3)
  104. #endif /* __ASM_ARM_REGS_NAND */