xref: /OK3568_Linux_fs/kernel/arch/sh/mm/Kconfig (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyunmenu "Memory management options"
3*4882a593Smuzhiyun
4*4882a593Smuzhiyunconfig MMU
5*4882a593Smuzhiyun        bool "Support for memory management hardware"
6*4882a593Smuzhiyun	depends on !CPU_SH2
7*4882a593Smuzhiyun	default y
8*4882a593Smuzhiyun	help
9*4882a593Smuzhiyun	  Some SH processors (such as SH-2/SH-2A) lack an MMU. In order to
10*4882a593Smuzhiyun	  boot on these systems, this option must not be set.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun	  On other systems (such as the SH-3 and 4) where an MMU exists,
13*4882a593Smuzhiyun	  turning this off will boot the kernel on these machines with the
14*4882a593Smuzhiyun	  MMU implicitly switched off.
15*4882a593Smuzhiyun
16*4882a593Smuzhiyunconfig PAGE_OFFSET
17*4882a593Smuzhiyun	hex
18*4882a593Smuzhiyun	default "0x80000000" if MMU
19*4882a593Smuzhiyun	default "0x00000000"
20*4882a593Smuzhiyun
21*4882a593Smuzhiyunconfig FORCE_MAX_ZONEORDER
22*4882a593Smuzhiyun	int "Maximum zone order"
23*4882a593Smuzhiyun	range 9 64 if PAGE_SIZE_16KB
24*4882a593Smuzhiyun	default "9" if PAGE_SIZE_16KB
25*4882a593Smuzhiyun	range 7 64 if PAGE_SIZE_64KB
26*4882a593Smuzhiyun	default "7" if PAGE_SIZE_64KB
27*4882a593Smuzhiyun	range 11 64
28*4882a593Smuzhiyun	default "14" if !MMU
29*4882a593Smuzhiyun	default "11"
30*4882a593Smuzhiyun	help
31*4882a593Smuzhiyun	  The kernel memory allocator divides physically contiguous memory
32*4882a593Smuzhiyun	  blocks into "zones", where each zone is a power of two number of
33*4882a593Smuzhiyun	  pages.  This option selects the largest power of two that the kernel
34*4882a593Smuzhiyun	  keeps in the memory allocator.  If you need to allocate very large
35*4882a593Smuzhiyun	  blocks of physically contiguous memory, then you may need to
36*4882a593Smuzhiyun	  increase this value.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun	  This config option is actually maximum order plus one. For example,
39*4882a593Smuzhiyun	  a value of 11 means that the largest free memory block is 2^10 pages.
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun	  The page size is not necessarily 4KB. Keep this in mind when
42*4882a593Smuzhiyun	  choosing a value for this option.
43*4882a593Smuzhiyun
44*4882a593Smuzhiyunconfig MEMORY_START
45*4882a593Smuzhiyun	hex "Physical memory start address"
46*4882a593Smuzhiyun	default "0x08000000"
47*4882a593Smuzhiyun	help
48*4882a593Smuzhiyun	  Computers built with Hitachi SuperH processors always
49*4882a593Smuzhiyun	  map the ROM starting at address zero.  But the processor
50*4882a593Smuzhiyun	  does not specify the range that RAM takes.
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun	  The physical memory (RAM) start address will be automatically
53*4882a593Smuzhiyun	  set to 08000000. Other platforms, such as the Solution Engine
54*4882a593Smuzhiyun	  boards typically map RAM at 0C000000.
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun	  Tweak this only when porting to a new machine which does not
57*4882a593Smuzhiyun	  already have a defconfig. Changing it from the known correct
58*4882a593Smuzhiyun	  value on any of the known systems will only lead to disaster.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyunconfig MEMORY_SIZE
61*4882a593Smuzhiyun	hex "Physical memory size"
62*4882a593Smuzhiyun	default "0x04000000"
63*4882a593Smuzhiyun	help
64*4882a593Smuzhiyun	  This sets the default memory size assumed by your SH kernel. It can
65*4882a593Smuzhiyun	  be overridden as normal by the 'mem=' argument on the kernel command
66*4882a593Smuzhiyun	  line. If unsure, consult your board specifications or just leave it
67*4882a593Smuzhiyun	  as 0x04000000 which was the default value before this became
68*4882a593Smuzhiyun	  configurable.
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun# Physical addressing modes
71*4882a593Smuzhiyun
72*4882a593Smuzhiyunconfig 29BIT
73*4882a593Smuzhiyun	def_bool !32BIT
74*4882a593Smuzhiyun	select UNCACHED_MAPPING
75*4882a593Smuzhiyun
76*4882a593Smuzhiyunconfig 32BIT
77*4882a593Smuzhiyun	bool
78*4882a593Smuzhiyun	default !MMU
79*4882a593Smuzhiyun
80*4882a593Smuzhiyunconfig PMB
81*4882a593Smuzhiyun	bool "Support 32-bit physical addressing through PMB"
82*4882a593Smuzhiyun	depends on MMU && CPU_SH4A && !CPU_SH4AL_DSP
83*4882a593Smuzhiyun	select 32BIT
84*4882a593Smuzhiyun	select UNCACHED_MAPPING
85*4882a593Smuzhiyun	help
86*4882a593Smuzhiyun	  If you say Y here, physical addressing will be extended to
87*4882a593Smuzhiyun	  32-bits through the SH-4A PMB. If this is not set, legacy
88*4882a593Smuzhiyun	  29-bit physical addressing will be used.
89*4882a593Smuzhiyun
90*4882a593Smuzhiyunconfig X2TLB
91*4882a593Smuzhiyun	def_bool y
92*4882a593Smuzhiyun	depends on (CPU_SHX2 || CPU_SHX3) && MMU
93*4882a593Smuzhiyun
94*4882a593Smuzhiyunconfig VSYSCALL
95*4882a593Smuzhiyun	bool "Support vsyscall page"
96*4882a593Smuzhiyun	depends on MMU && (CPU_SH3 || CPU_SH4)
97*4882a593Smuzhiyun	default y
98*4882a593Smuzhiyun	help
99*4882a593Smuzhiyun	  This will enable support for the kernel mapping a vDSO page
100*4882a593Smuzhiyun	  in process space, and subsequently handing down the entry point
101*4882a593Smuzhiyun	  to the libc through the ELF auxiliary vector.
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun	  From the kernel side this is used for the signal trampoline.
104*4882a593Smuzhiyun	  For systems with an MMU that can afford to give up a page,
105*4882a593Smuzhiyun	  (the default value) say Y.
106*4882a593Smuzhiyun
107*4882a593Smuzhiyunconfig NUMA
108*4882a593Smuzhiyun	bool "Non Uniform Memory Access (NUMA) Support"
109*4882a593Smuzhiyun	depends on MMU && SYS_SUPPORTS_NUMA
110*4882a593Smuzhiyun	select ARCH_WANT_NUMA_VARIABLE_LOCALITY
111*4882a593Smuzhiyun	default n
112*4882a593Smuzhiyun	help
113*4882a593Smuzhiyun	  Some SH systems have many various memories scattered around
114*4882a593Smuzhiyun	  the address space, each with varying latencies. This enables
115*4882a593Smuzhiyun	  support for these blocks by binding them to nodes and allowing
116*4882a593Smuzhiyun	  memory policies to be used for prioritizing and controlling
117*4882a593Smuzhiyun	  allocation behaviour.
118*4882a593Smuzhiyun
119*4882a593Smuzhiyunconfig NODES_SHIFT
120*4882a593Smuzhiyun	int
121*4882a593Smuzhiyun	default "3" if CPU_SUBTYPE_SHX3
122*4882a593Smuzhiyun	default "1"
123*4882a593Smuzhiyun	depends on NEED_MULTIPLE_NODES
124*4882a593Smuzhiyun
125*4882a593Smuzhiyunconfig ARCH_FLATMEM_ENABLE
126*4882a593Smuzhiyun	def_bool y
127*4882a593Smuzhiyun	depends on !NUMA
128*4882a593Smuzhiyun
129*4882a593Smuzhiyunconfig ARCH_SPARSEMEM_ENABLE
130*4882a593Smuzhiyun	def_bool y
131*4882a593Smuzhiyun	select SPARSEMEM_STATIC
132*4882a593Smuzhiyun
133*4882a593Smuzhiyunconfig ARCH_SPARSEMEM_DEFAULT
134*4882a593Smuzhiyun	def_bool y
135*4882a593Smuzhiyun
136*4882a593Smuzhiyunconfig ARCH_SELECT_MEMORY_MODEL
137*4882a593Smuzhiyun	def_bool y
138*4882a593Smuzhiyun
139*4882a593Smuzhiyunconfig ARCH_ENABLE_MEMORY_HOTPLUG
140*4882a593Smuzhiyun	def_bool y
141*4882a593Smuzhiyun	depends on SPARSEMEM && MMU
142*4882a593Smuzhiyun
143*4882a593Smuzhiyunconfig ARCH_ENABLE_MEMORY_HOTREMOVE
144*4882a593Smuzhiyun	def_bool y
145*4882a593Smuzhiyun	depends on SPARSEMEM && MMU
146*4882a593Smuzhiyun
147*4882a593Smuzhiyunconfig ARCH_MEMORY_PROBE
148*4882a593Smuzhiyun	def_bool y
149*4882a593Smuzhiyun	depends on MEMORY_HOTPLUG
150*4882a593Smuzhiyun
151*4882a593Smuzhiyunconfig IOREMAP_FIXED
152*4882a593Smuzhiyun       def_bool y
153*4882a593Smuzhiyun       depends on X2TLB
154*4882a593Smuzhiyun
155*4882a593Smuzhiyunconfig UNCACHED_MAPPING
156*4882a593Smuzhiyun	bool
157*4882a593Smuzhiyun
158*4882a593Smuzhiyunconfig HAVE_SRAM_POOL
159*4882a593Smuzhiyun	bool
160*4882a593Smuzhiyun	select GENERIC_ALLOCATOR
161*4882a593Smuzhiyun
162*4882a593Smuzhiyunchoice
163*4882a593Smuzhiyun	prompt "Kernel page size"
164*4882a593Smuzhiyun	default PAGE_SIZE_4KB
165*4882a593Smuzhiyun
166*4882a593Smuzhiyunconfig PAGE_SIZE_4KB
167*4882a593Smuzhiyun	bool "4kB"
168*4882a593Smuzhiyun	help
169*4882a593Smuzhiyun	  This is the default page size used by all SuperH CPUs.
170*4882a593Smuzhiyun
171*4882a593Smuzhiyunconfig PAGE_SIZE_8KB
172*4882a593Smuzhiyun	bool "8kB"
173*4882a593Smuzhiyun	depends on !MMU || X2TLB
174*4882a593Smuzhiyun	help
175*4882a593Smuzhiyun	  This enables 8kB pages as supported by SH-X2 and later MMUs.
176*4882a593Smuzhiyun
177*4882a593Smuzhiyunconfig PAGE_SIZE_16KB
178*4882a593Smuzhiyun	bool "16kB"
179*4882a593Smuzhiyun	depends on !MMU
180*4882a593Smuzhiyun	help
181*4882a593Smuzhiyun	  This enables 16kB pages on MMU-less SH systems.
182*4882a593Smuzhiyun
183*4882a593Smuzhiyunconfig PAGE_SIZE_64KB
184*4882a593Smuzhiyun	bool "64kB"
185*4882a593Smuzhiyun	depends on !MMU || CPU_SH4
186*4882a593Smuzhiyun	help
187*4882a593Smuzhiyun	  This enables support for 64kB pages, possible on all SH-4
188*4882a593Smuzhiyun	  CPUs and later.
189*4882a593Smuzhiyun
190*4882a593Smuzhiyunendchoice
191*4882a593Smuzhiyun
192*4882a593Smuzhiyunchoice
193*4882a593Smuzhiyun	prompt "HugeTLB page size"
194*4882a593Smuzhiyun	depends on HUGETLB_PAGE
195*4882a593Smuzhiyun	default HUGETLB_PAGE_SIZE_1MB if PAGE_SIZE_64KB
196*4882a593Smuzhiyun	default HUGETLB_PAGE_SIZE_64K
197*4882a593Smuzhiyun
198*4882a593Smuzhiyunconfig HUGETLB_PAGE_SIZE_64K
199*4882a593Smuzhiyun	bool "64kB"
200*4882a593Smuzhiyun	depends on !PAGE_SIZE_64KB
201*4882a593Smuzhiyun
202*4882a593Smuzhiyunconfig HUGETLB_PAGE_SIZE_256K
203*4882a593Smuzhiyun	bool "256kB"
204*4882a593Smuzhiyun	depends on X2TLB
205*4882a593Smuzhiyun
206*4882a593Smuzhiyunconfig HUGETLB_PAGE_SIZE_1MB
207*4882a593Smuzhiyun	bool "1MB"
208*4882a593Smuzhiyun
209*4882a593Smuzhiyunconfig HUGETLB_PAGE_SIZE_4MB
210*4882a593Smuzhiyun	bool "4MB"
211*4882a593Smuzhiyun	depends on X2TLB
212*4882a593Smuzhiyun
213*4882a593Smuzhiyunconfig HUGETLB_PAGE_SIZE_64MB
214*4882a593Smuzhiyun	bool "64MB"
215*4882a593Smuzhiyun	depends on X2TLB
216*4882a593Smuzhiyun
217*4882a593Smuzhiyunendchoice
218*4882a593Smuzhiyun
219*4882a593Smuzhiyunconfig SCHED_MC
220*4882a593Smuzhiyun	bool "Multi-core scheduler support"
221*4882a593Smuzhiyun	depends on SMP
222*4882a593Smuzhiyun	default y
223*4882a593Smuzhiyun	help
224*4882a593Smuzhiyun	  Multi-core scheduler support improves the CPU scheduler's decision
225*4882a593Smuzhiyun	  making when dealing with multi-core CPU chips at a cost of slightly
226*4882a593Smuzhiyun	  increased overhead in some places. If unsure say N here.
227*4882a593Smuzhiyun
228*4882a593Smuzhiyunendmenu
229*4882a593Smuzhiyun
230*4882a593Smuzhiyunmenu "Cache configuration"
231*4882a593Smuzhiyun
232*4882a593Smuzhiyunconfig SH7705_CACHE_32KB
233*4882a593Smuzhiyun	bool "Enable 32KB cache size for SH7705"
234*4882a593Smuzhiyun	depends on CPU_SUBTYPE_SH7705
235*4882a593Smuzhiyun	default y
236*4882a593Smuzhiyun
237*4882a593Smuzhiyunchoice
238*4882a593Smuzhiyun	prompt "Cache mode"
239*4882a593Smuzhiyun	default CACHE_WRITEBACK if CPU_SH2A || CPU_SH3 || CPU_SH4
240*4882a593Smuzhiyun	default CACHE_WRITETHROUGH if (CPU_SH2 && !CPU_SH2A)
241*4882a593Smuzhiyun
242*4882a593Smuzhiyunconfig CACHE_WRITEBACK
243*4882a593Smuzhiyun	bool "Write-back"
244*4882a593Smuzhiyun
245*4882a593Smuzhiyunconfig CACHE_WRITETHROUGH
246*4882a593Smuzhiyun	bool "Write-through"
247*4882a593Smuzhiyun	help
248*4882a593Smuzhiyun	  Selecting this option will configure the caches in write-through
249*4882a593Smuzhiyun	  mode, as opposed to the default write-back configuration.
250*4882a593Smuzhiyun
251*4882a593Smuzhiyun	  Since there's sill some aliasing issues on SH-4, this option will
252*4882a593Smuzhiyun	  unfortunately still require the majority of flushing functions to
253*4882a593Smuzhiyun	  be implemented to deal with aliasing.
254*4882a593Smuzhiyun
255*4882a593Smuzhiyun	  If unsure, say N.
256*4882a593Smuzhiyun
257*4882a593Smuzhiyunconfig CACHE_OFF
258*4882a593Smuzhiyun	bool "Off"
259*4882a593Smuzhiyun
260*4882a593Smuzhiyunendchoice
261*4882a593Smuzhiyun
262*4882a593Smuzhiyunendmenu
263