Kconfig.cache 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #
  2. # MN10300 CPU cache options
  3. #
  4. choice
  5. prompt "CPU Caching mode"
  6. default MN10300_CACHE_WBACK
  7. help
  8. This option determines the caching mode for the kernel.
  9. Write-Back caching mode involves the all reads and writes causing
  10. the affected cacheline to be read into the cache first before being
  11. operated upon. Memory is not then updated by a write until the cache
  12. is filled and a cacheline needs to be displaced from the cache to
  13. make room. Only at that point is it written back.
  14. Write-Through caching only fetches cachelines from memory on a
  15. read. Writes always get written directly to memory. If the affected
  16. cacheline is also in cache, it will be updated too.
  17. The final option is to turn of caching entirely.
  18. config MN10300_CACHE_WBACK
  19. bool "Write-Back"
  20. help
  21. The dcache operates in delayed write-back mode. It must be manually
  22. flushed if writes are made that subsequently need to be executed or
  23. to be DMA'd by a device.
  24. config MN10300_CACHE_WTHRU
  25. bool "Write-Through"
  26. help
  27. The dcache operates in immediate write-through mode. Writes are
  28. committed to RAM immediately in addition to being stored in the
  29. cache. This means that the written data is immediately available for
  30. execution or DMA.
  31. This is not available for use with an SMP kernel if cache flushing
  32. and invalidation by automatic purge register is not selected.
  33. config MN10300_CACHE_DISABLED
  34. bool "Disabled"
  35. help
  36. The icache and dcache are disabled.
  37. endchoice
  38. config MN10300_CACHE_ENABLED
  39. def_bool y if !MN10300_CACHE_DISABLED
  40. choice
  41. prompt "CPU cache flush/invalidate method"
  42. default MN10300_CACHE_MANAGE_BY_TAG if !AM34_2
  43. default MN10300_CACHE_MANAGE_BY_REG if AM34_2
  44. depends on MN10300_CACHE_ENABLED
  45. help
  46. This determines the method by which CPU cache flushing and
  47. invalidation is performed.
  48. config MN10300_CACHE_MANAGE_BY_TAG
  49. bool "Use the cache tag registers directly"
  50. depends on !(SMP && MN10300_CACHE_WTHRU)
  51. config MN10300_CACHE_MANAGE_BY_REG
  52. bool "Flush areas by way of automatic purge registers (AM34 only)"
  53. depends on AM34_2
  54. endchoice
  55. config MN10300_CACHE_INV_BY_TAG
  56. def_bool y if MN10300_CACHE_MANAGE_BY_TAG && MN10300_CACHE_ENABLED
  57. config MN10300_CACHE_INV_BY_REG
  58. def_bool y if MN10300_CACHE_MANAGE_BY_REG && MN10300_CACHE_ENABLED
  59. config MN10300_CACHE_FLUSH_BY_TAG
  60. def_bool y if MN10300_CACHE_MANAGE_BY_TAG && MN10300_CACHE_WBACK
  61. config MN10300_CACHE_FLUSH_BY_REG
  62. def_bool y if MN10300_CACHE_MANAGE_BY_REG && MN10300_CACHE_WBACK
  63. config MN10300_HAS_CACHE_SNOOP
  64. def_bool n
  65. config MN10300_CACHE_SNOOP
  66. bool "Use CPU Cache Snooping"
  67. depends on MN10300_CACHE_ENABLED && MN10300_HAS_CACHE_SNOOP
  68. default y
  69. config MN10300_CACHE_FLUSH_ICACHE
  70. def_bool y if MN10300_CACHE_WBACK && !MN10300_CACHE_SNOOP
  71. help
  72. Set if we need the dcache flushing before the icache is invalidated.
  73. config MN10300_CACHE_INV_ICACHE
  74. def_bool y if MN10300_CACHE_WTHRU && !MN10300_CACHE_SNOOP
  75. help
  76. Set if we need the icache to be invalidated, even if the dcache is in
  77. write-through mode and doesn't need flushing.
  78. #
  79. # The kernel debugger gets its own separate cache flushing functions
  80. #
  81. config MN10300_DEBUGGER_CACHE_FLUSH_BY_TAG
  82. def_bool y if KERNEL_DEBUGGER && \
  83. MN10300_CACHE_WBACK && \
  84. !MN10300_CACHE_SNOOP && \
  85. MN10300_CACHE_MANAGE_BY_TAG
  86. help
  87. Set if the debugger needs to flush the dcache and invalidate the
  88. icache using the cache tag registers to make breakpoints work.
  89. config MN10300_DEBUGGER_CACHE_FLUSH_BY_REG
  90. def_bool y if KERNEL_DEBUGGER && \
  91. MN10300_CACHE_WBACK && \
  92. !MN10300_CACHE_SNOOP && \
  93. MN10300_CACHE_MANAGE_BY_REG
  94. help
  95. Set if the debugger needs to flush the dcache and invalidate the
  96. icache using automatic purge registers to make breakpoints work.
  97. config MN10300_DEBUGGER_CACHE_INV_BY_TAG
  98. def_bool y if KERNEL_DEBUGGER && \
  99. MN10300_CACHE_WTHRU && \
  100. !MN10300_CACHE_SNOOP && \
  101. MN10300_CACHE_MANAGE_BY_TAG
  102. help
  103. Set if the debugger needs to invalidate the icache using the cache
  104. tag registers to make breakpoints work.
  105. config MN10300_DEBUGGER_CACHE_INV_BY_REG
  106. def_bool y if KERNEL_DEBUGGER && \
  107. MN10300_CACHE_WTHRU && \
  108. !MN10300_CACHE_SNOOP && \
  109. MN10300_CACHE_MANAGE_BY_REG
  110. help
  111. Set if the debugger needs to invalidate the icache using automatic
  112. purge registers to make breakpoints work.
  113. config MN10300_DEBUGGER_CACHE_NO_FLUSH
  114. def_bool y if KERNEL_DEBUGGER && \
  115. (MN10300_CACHE_DISABLED || MN10300_CACHE_SNOOP)
  116. help
  117. Set if the debugger does not need to flush the dcache and/or
  118. invalidate the icache to make breakpoints work.