nand-regs.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* NAND flash interface register definitions
  2. *
  3. * Copyright (C) 2008-2009 Panasonic Corporation
  4. * All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef _PROC_NAND_REGS_H_
  16. #define _PROC_NAND_REGS_H_
  17. /* command register */
  18. #define FCOMMAND_0 __SYSREG(0xd8f00000, u8) /* fcommand[24:31] */
  19. #define FCOMMAND_1 __SYSREG(0xd8f00001, u8) /* fcommand[16:23] */
  20. #define FCOMMAND_2 __SYSREG(0xd8f00002, u8) /* fcommand[8:15] */
  21. #define FCOMMAND_3 __SYSREG(0xd8f00003, u8) /* fcommand[0:7] */
  22. /* for dma 16 byte trans, use FCOMMAND2 register */
  23. #define FCOMMAND2_0 __SYSREG(0xd8f00110, u8) /* fcommand2[24:31] */
  24. #define FCOMMAND2_1 __SYSREG(0xd8f00111, u8) /* fcommand2[16:23] */
  25. #define FCOMMAND2_2 __SYSREG(0xd8f00112, u8) /* fcommand2[8:15] */
  26. #define FCOMMAND2_3 __SYSREG(0xd8f00113, u8) /* fcommand2[0:7] */
  27. #define FCOMMAND_FIEN 0x80 /* nand flash I/F enable */
  28. #define FCOMMAND_BW_8BIT 0x00 /* 8bit bus width */
  29. #define FCOMMAND_BW_16BIT 0x40 /* 16bit bus width */
  30. #define FCOMMAND_BLOCKSZ_SMALL 0x00 /* small block */
  31. #define FCOMMAND_BLOCKSZ_LARGE 0x20 /* large block */
  32. #define FCOMMAND_DMASTART 0x10 /* dma start */
  33. #define FCOMMAND_RYBY 0x08 /* ready/busy flag */
  34. #define FCOMMAND_RYBYINTMSK 0x04 /* mask ready/busy interrupt */
  35. #define FCOMMAND_XFWP 0x02 /* write protect enable */
  36. #define FCOMMAND_XFCE 0x01 /* flash device disable */
  37. #define FCOMMAND_SEQKILL 0x10 /* stop seq-read */
  38. #define FCOMMAND_ANUM 0x07 /* address cycle */
  39. #define FCOMMAND_ANUM_NONE 0x00 /* address cycle none */
  40. #define FCOMMAND_ANUM_1CYC 0x01 /* address cycle 1cycle */
  41. #define FCOMMAND_ANUM_2CYC 0x02 /* address cycle 2cycle */
  42. #define FCOMMAND_ANUM_3CYC 0x03 /* address cycle 3cycle */
  43. #define FCOMMAND_ANUM_4CYC 0x04 /* address cycle 4cycle */
  44. #define FCOMMAND_ANUM_5CYC 0x05 /* address cycle 5cycle */
  45. #define FCOMMAND_FCMD_READ0 0x00 /* read1 command */
  46. #define FCOMMAND_FCMD_SEQIN 0x80 /* page program 1st command */
  47. #define FCOMMAND_FCMD_PAGEPROG 0x10 /* page program 2nd command */
  48. #define FCOMMAND_FCMD_RESET 0xff /* reset command */
  49. #define FCOMMAND_FCMD_ERASE1 0x60 /* erase 1st command */
  50. #define FCOMMAND_FCMD_ERASE2 0xd0 /* erase 2nd command */
  51. #define FCOMMAND_FCMD_STATUS 0x70 /* read status command */
  52. #define FCOMMAND_FCMD_READID 0x90 /* read id command */
  53. #define FCOMMAND_FCMD_READOOB 0x50 /* read3 command */
  54. /* address register */
  55. #define FADD __SYSREG(0xd8f00004, u32)
  56. /* address register 2 */
  57. #define FADD2 __SYSREG(0xd8f00008, u32)
  58. /* error judgement register */
  59. #define FJUDGE __SYSREG(0xd8f0000c, u32)
  60. #define FJUDGE_NOERR 0x0 /* no error */
  61. #define FJUDGE_1BITERR 0x1 /* 1bit error in data area */
  62. #define FJUDGE_PARITYERR 0x2 /* parity error */
  63. #define FJUDGE_UNCORRECTABLE 0x3 /* uncorrectable error */
  64. #define FJUDGE_ERRJDG_MSK 0x3 /* mask of judgement result */
  65. /* 1st ECC store register */
  66. #define FECC11 __SYSREG(0xd8f00010, u32)
  67. /* 2nd ECC store register */
  68. #define FECC12 __SYSREG(0xd8f00014, u32)
  69. /* 3rd ECC store register */
  70. #define FECC21 __SYSREG(0xd8f00018, u32)
  71. /* 4th ECC store register */
  72. #define FECC22 __SYSREG(0xd8f0001c, u32)
  73. /* 5th ECC store register */
  74. #define FECC31 __SYSREG(0xd8f00020, u32)
  75. /* 6th ECC store register */
  76. #define FECC32 __SYSREG(0xd8f00024, u32)
  77. /* 7th ECC store register */
  78. #define FECC41 __SYSREG(0xd8f00028, u32)
  79. /* 8th ECC store register */
  80. #define FECC42 __SYSREG(0xd8f0002c, u32)
  81. /* data register */
  82. #define FDATA __SYSREG(0xd8f00030, u32)
  83. /* access pulse register */
  84. #define FPWS __SYSREG(0xd8f00100, u32)
  85. #define FPWS_PWS1W_2CLK 0x00000000 /* write pulse width 1clock */
  86. #define FPWS_PWS1W_3CLK 0x01000000 /* write pulse width 2clock */
  87. #define FPWS_PWS1W_4CLK 0x02000000 /* write pulse width 4clock */
  88. #define FPWS_PWS1W_5CLK 0x03000000 /* write pulse width 5clock */
  89. #define FPWS_PWS1W_6CLK 0x04000000 /* write pulse width 6clock */
  90. #define FPWS_PWS1W_7CLK 0x05000000 /* write pulse width 7clock */
  91. #define FPWS_PWS1W_8CLK 0x06000000 /* write pulse width 8clock */
  92. #define FPWS_PWS1R_3CLK 0x00010000 /* read pulse width 3clock */
  93. #define FPWS_PWS1R_4CLK 0x00020000 /* read pulse width 4clock */
  94. #define FPWS_PWS1R_5CLK 0x00030000 /* read pulse width 5clock */
  95. #define FPWS_PWS1R_6CLK 0x00040000 /* read pulse width 6clock */
  96. #define FPWS_PWS1R_7CLK 0x00050000 /* read pulse width 7clock */
  97. #define FPWS_PWS1R_8CLK 0x00060000 /* read pulse width 8clock */
  98. #define FPWS_PWS2W_2CLK 0x00000100 /* write pulse interval 2clock */
  99. #define FPWS_PWS2W_3CLK 0x00000200 /* write pulse interval 3clock */
  100. #define FPWS_PWS2W_4CLK 0x00000300 /* write pulse interval 4clock */
  101. #define FPWS_PWS2W_5CLK 0x00000400 /* write pulse interval 5clock */
  102. #define FPWS_PWS2W_6CLK 0x00000500 /* write pulse interval 6clock */
  103. #define FPWS_PWS2R_2CLK 0x00000001 /* read pulse interval 2clock */
  104. #define FPWS_PWS2R_3CLK 0x00000002 /* read pulse interval 3clock */
  105. #define FPWS_PWS2R_4CLK 0x00000003 /* read pulse interval 4clock */
  106. #define FPWS_PWS2R_5CLK 0x00000004 /* read pulse interval 5clock */
  107. #define FPWS_PWS2R_6CLK 0x00000005 /* read pulse interval 6clock */
  108. /* command register 2 */
  109. #define FCOMMAND2 __SYSREG(0xd8f00110, u32)
  110. /* transfer frequency register */
  111. #define FNUM __SYSREG(0xd8f00114, u32)
  112. #define FSDATA_ADDR 0xd8f00400
  113. /* active data register */
  114. #define FSDATA __SYSREG(FSDATA_ADDR, u32)
  115. #endif /* _PROC_NAND_REGS_H_ */