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