Kconfig 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. menu "SPINOR Devices"
  2. config DRIVERS_SPINOR
  3. bool "enable spinor driver"
  4. default y
  5. config HAL_TEST_SPINOR
  6. bool "enable spinor hal APIs test command"
  7. depends on DRIVERS_SPINOR
  8. default n
  9. config DRIVERS_SPINOR_FREQ
  10. int "spinor frequency (MHz)"
  11. depends on DRIVERS_SPINOR
  12. range 10 100
  13. default 50
  14. help
  15. The frequency for spi master.
  16. config DRIVERS_SPINOR_4K_SECTORS
  17. bool "Use small 4096 B erase sectors"
  18. depends on DRIVERS_SPINOR
  19. default y
  20. help
  21. This only tells the upper layer that the block size is 4K and the upper
  22. layer can do 4K erase. In fact, the driver still supports 32K or 64K
  23. erase and it may try to do 64K or 32K erase as far as possible if you
  24. enable cache since it does really improve performance. Erasing should be
  25. mush faster when using 64K block instead of 16 * 4K.
  26. Why we should need this option? Even most filesystems save a file in
  27. unit block, which is equal to nor block size generally. The larger block
  28. is, the much space waste for a small file. Take an example, to save a 1K
  29. size file, the filesystem allocate a block for it and waste 3K size
  30. for 4K block size, even 63K size for 64K block size.
  31. To balance waste-space and performance, we really support to eanble
  32. 4K block and nor cache to get more operations together.
  33. If unsure, please says Y.
  34. config DRIVERS_SPINOR_CACHE
  35. bool "Enable spinor cache layer"
  36. depends on DRIVERS_SPINOR
  37. default n
  38. help
  39. To improve write performance by merging 4K page erase operation to
  40. 32K/64K erase operation. This cache layer holds a 64K buffer. It just
  41. will cache sequential erase/write operation. There are three ways to
  42. flush cache.
  43. 1. block buffer is fullly.
  44. 2. operate over a block.
  45. Once operate over a 64K block, this layer will write-back directly
  46. avoiding lose data.
  47. 3. upper layer call hal_spinor_sync()
  48. This cache layer with the littlefs turns out no loss of data, but the
  49. others need more tested. The upper layer (fs) should takes care of the
  50. following issues.
  51. 1. after writing meta data, upper must call hal_spinor_sync() to flush
  52. cache. Also, you can flush cache for fatal data too. In a word,
  53. sync() is called only immediately after data that affects filesystem
  54. consistency is written. The littlefs is checked ok.
  55. 2. contecting to sync()/fsync() for user in case of user codes writing
  56. fatal file.
  57. If unsure, please says N.
  58. config DRIVERS_SPINOR_WRITE_LOCK
  59. bool "Use nor dynamic write limit if support"
  60. depends on DRIVERS_SPINOR
  61. default y
  62. help
  63. Some nor flash support write protection. This feature is much usefull
  64. for power lose case to avoid data corruption. Most of them support zone
  65. protection, which cost much for status register and to protect
  66. a continuous space from head or tail. That's NOT what we need. What this
  67. option used, is individual block protection. Before we do write/erase
  68. operation, we unlock (unprotect) the individual block we want and still
  69. protect other blocks. As you see, the unit to lock/unlock is a block.
  70. Beside, it just rewrite a volatile memory, not status register, which
  71. has less time and wear costs.
  72. In a word, It spends very little time to protect data if power lose.
  73. If unsure, please says Y.
  74. endmenu