nand_config.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /****************************************************************************
  2. * include/nuttx/mtd/nand_config.h
  3. *
  4. * Copyright (C) 2013 Gregory Nutt. All rights reserved.
  5. * Author: Gregory Nutt <gnutt@nuttx.org>
  6. *
  7. * This logic was based largely on Atmel sample code with modifications for
  8. * better integration with NuttX. The Atmel sample code has a BSD
  9. * compatible license that requires this copyright notice:
  10. *
  11. * Copyright (c) 2012, Atmel Corporation
  12. *
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions
  15. * are met:
  16. *
  17. * 1. Redistributions of source code must retain the above copyright
  18. * notice, this list of conditions and the following disclaimer.
  19. * 2. Redistributions in binary form must reproduce the above copyright
  20. * notice, this list of conditions and the following disclaimer in
  21. * the documentation and/or other materials provided with the
  22. * distribution.
  23. * 3. Neither the names NuttX nor Atmel nor the names of its contributors
  24. * may be used to endorse or promote products derived from this software
  25. * without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  30. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  31. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  32. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  33. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  34. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  35. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  37. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. ****************************************************************************/
  41. #ifndef __INCLUDE_NUTTX_MTD_NAND_CONFIG_H
  42. #define __INCLUDE_NUTTX_MTD_NAND_CONFIG_H
  43. /****************************************************************************
  44. * Included Files
  45. ****************************************************************************/
  46. #include <nuttx/config.h>
  47. /****************************************************************************
  48. * Pre-processor Definitions
  49. ****************************************************************************/
  50. /* Configuration ************************************************************
  51. /* Maximum number of blocks in a device */
  52. #ifndef CONFIG_MTD_NAND_MAXNUMBLOCKS
  53. # define CONFIG_MTD_NAND_MAXNUMBLOCKS 1024
  54. #endif
  55. /* Maximum number of pages in one block */
  56. #ifndef CONFIG_MTD_NAND_MAXNUMPAGESPERBLOCK
  57. # define CONFIG_MTD_NAND_MAXNUMPAGESPERBLOCK 256
  58. #endif
  59. /* Maximum size of the data area of one page, in bytes. */
  60. #ifndef CONFIG_MTD_NAND_MAXPAGEDATASIZE
  61. # define CONFIG_MTD_NAND_MAXPAGEDATASIZE 4096
  62. #endif
  63. /* Maximum size of the spare area of one page, in bytes. */
  64. #ifndef CONFIG_MTD_NAND_MAXPAGESPARESIZE
  65. # define CONFIG_MTD_NAND_MAXPAGESPARESIZE 256
  66. #endif
  67. /* Maximum number of ecc bytes stored in the spare for one single page. */
  68. #ifndef CONFIG_MTD_NAND_MAXSPAREECCBYTES
  69. # define CONFIG_MTD_NAND_MAXSPAREECCBYTES 48
  70. #endif
  71. /* Maximum number of extra free bytes inside the spare area of a page. */
  72. #ifndef CONFIG_MTD_NAND_MAXSPAREEXTRABYTES
  73. # define CONFIG_MTD_NAND_MAXSPAREEXTRABYTES 206
  74. #endif
  75. /****************************************************************************
  76. * Public Types
  77. ****************************************************************************/
  78. /****************************************************************************
  79. * Public Data
  80. ****************************************************************************/
  81. #ifndef __ASSEMBLY__
  82. #ifdef __cplusplus
  83. #define EXTERN extern "C"
  84. extern "C"
  85. {
  86. #else
  87. #define EXTERN extern
  88. #endif
  89. /****************************************************************************
  90. * Public Function Prototypes
  91. ****************************************************************************/
  92. #undef EXTERN
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif /* __ASSEMBLY__ */
  97. #endif /* __INCLUDE_NUTTX_MTD_NAND_CONFIG_H */