162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_cimenu "Memory management options"
362306a36Sopenharmony_ci
462306a36Sopenharmony_ciconfig MMU
562306a36Sopenharmony_ci        bool "Support for memory management hardware"
662306a36Sopenharmony_ci	depends on !CPU_SH2
762306a36Sopenharmony_ci	default y
862306a36Sopenharmony_ci	help
962306a36Sopenharmony_ci	  Some SH processors (such as SH-2/SH-2A) lack an MMU. In order to
1062306a36Sopenharmony_ci	  boot on these systems, this option must not be set.
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci	  On other systems (such as the SH-3 and 4) where an MMU exists,
1362306a36Sopenharmony_ci	  turning this off will boot the kernel on these machines with the
1462306a36Sopenharmony_ci	  MMU implicitly switched off.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciconfig PAGE_OFFSET
1762306a36Sopenharmony_ci	hex
1862306a36Sopenharmony_ci	default "0x80000000" if MMU
1962306a36Sopenharmony_ci	default "0x00000000"
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciconfig ARCH_FORCE_MAX_ORDER
2262306a36Sopenharmony_ci	int "Order of maximal physically contiguous allocations"
2362306a36Sopenharmony_ci	default "8" if PAGE_SIZE_16KB
2462306a36Sopenharmony_ci	default "6" if PAGE_SIZE_64KB
2562306a36Sopenharmony_ci	default "13" if !MMU
2662306a36Sopenharmony_ci	default "10"
2762306a36Sopenharmony_ci	help
2862306a36Sopenharmony_ci	  The kernel page allocator limits the size of maximal physically
2962306a36Sopenharmony_ci	  contiguous allocations. The limit is called MAX_ORDER and it
3062306a36Sopenharmony_ci	  defines the maximal power of two of number of pages that can be
3162306a36Sopenharmony_ci	  allocated as a single contiguous block. This option allows
3262306a36Sopenharmony_ci	  overriding the default setting when ability to allocate very
3362306a36Sopenharmony_ci	  large blocks of physically contiguous memory is required.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci	  The page size is not necessarily 4KB. Keep this in mind when
3662306a36Sopenharmony_ci	  choosing a value for this option.
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci	  Don't change if unsure.
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciconfig MEMORY_START
4162306a36Sopenharmony_ci	hex "Physical memory start address"
4262306a36Sopenharmony_ci	default "0x08000000"
4362306a36Sopenharmony_ci	help
4462306a36Sopenharmony_ci	  Computers built with Hitachi SuperH processors always
4562306a36Sopenharmony_ci	  map the ROM starting at address zero.  But the processor
4662306a36Sopenharmony_ci	  does not specify the range that RAM takes.
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci	  The physical memory (RAM) start address will be automatically
4962306a36Sopenharmony_ci	  set to 08000000. Other platforms, such as the Solution Engine
5062306a36Sopenharmony_ci	  boards typically map RAM at 0C000000.
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci	  Tweak this only when porting to a new machine which does not
5362306a36Sopenharmony_ci	  already have a defconfig. Changing it from the known correct
5462306a36Sopenharmony_ci	  value on any of the known systems will only lead to disaster.
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ciconfig MEMORY_SIZE
5762306a36Sopenharmony_ci	hex "Physical memory size"
5862306a36Sopenharmony_ci	default "0x04000000"
5962306a36Sopenharmony_ci	help
6062306a36Sopenharmony_ci	  This sets the default memory size assumed by your SH kernel. It can
6162306a36Sopenharmony_ci	  be overridden as normal by the 'mem=' argument on the kernel command
6262306a36Sopenharmony_ci	  line. If unsure, consult your board specifications or just leave it
6362306a36Sopenharmony_ci	  as 0x04000000 which was the default value before this became
6462306a36Sopenharmony_ci	  configurable.
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci# Physical addressing modes
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ciconfig 29BIT
6962306a36Sopenharmony_ci	def_bool !32BIT
7062306a36Sopenharmony_ci	select UNCACHED_MAPPING
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ciconfig 32BIT
7362306a36Sopenharmony_ci	bool
7462306a36Sopenharmony_ci	default !MMU
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ciconfig PMB
7762306a36Sopenharmony_ci	bool "Support 32-bit physical addressing through PMB"
7862306a36Sopenharmony_ci	depends on MMU && CPU_SH4A && !CPU_SH4AL_DSP
7962306a36Sopenharmony_ci	select 32BIT
8062306a36Sopenharmony_ci	select UNCACHED_MAPPING
8162306a36Sopenharmony_ci	help
8262306a36Sopenharmony_ci	  If you say Y here, physical addressing will be extended to
8362306a36Sopenharmony_ci	  32-bits through the SH-4A PMB. If this is not set, legacy
8462306a36Sopenharmony_ci	  29-bit physical addressing will be used.
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ciconfig X2TLB
8762306a36Sopenharmony_ci	def_bool y
8862306a36Sopenharmony_ci	depends on (CPU_SHX2 || CPU_SHX3) && MMU
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ciconfig VSYSCALL
9162306a36Sopenharmony_ci	bool "Support vsyscall page"
9262306a36Sopenharmony_ci	depends on MMU && (CPU_SH3 || CPU_SH4)
9362306a36Sopenharmony_ci	default y
9462306a36Sopenharmony_ci	help
9562306a36Sopenharmony_ci	  This will enable support for the kernel mapping a vDSO page
9662306a36Sopenharmony_ci	  in process space, and subsequently handing down the entry point
9762306a36Sopenharmony_ci	  to the libc through the ELF auxiliary vector.
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci	  From the kernel side this is used for the signal trampoline.
10062306a36Sopenharmony_ci	  For systems with an MMU that can afford to give up a page,
10162306a36Sopenharmony_ci	  (the default value) say Y.
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ciconfig NUMA
10462306a36Sopenharmony_ci	bool "Non-Uniform Memory Access (NUMA) Support"
10562306a36Sopenharmony_ci	depends on MMU && SYS_SUPPORTS_NUMA
10662306a36Sopenharmony_ci	select ARCH_WANT_NUMA_VARIABLE_LOCALITY
10762306a36Sopenharmony_ci	default n
10862306a36Sopenharmony_ci	help
10962306a36Sopenharmony_ci	  Some SH systems have many various memories scattered around
11062306a36Sopenharmony_ci	  the address space, each with varying latencies. This enables
11162306a36Sopenharmony_ci	  support for these blocks by binding them to nodes and allowing
11262306a36Sopenharmony_ci	  memory policies to be used for prioritizing and controlling
11362306a36Sopenharmony_ci	  allocation behaviour.
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ciconfig NODES_SHIFT
11662306a36Sopenharmony_ci	int
11762306a36Sopenharmony_ci	default "3" if CPU_SUBTYPE_SHX3
11862306a36Sopenharmony_ci	default "1"
11962306a36Sopenharmony_ci	depends on NUMA
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ciconfig ARCH_FLATMEM_ENABLE
12262306a36Sopenharmony_ci	def_bool y
12362306a36Sopenharmony_ci	depends on !NUMA
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ciconfig ARCH_SPARSEMEM_ENABLE
12662306a36Sopenharmony_ci	def_bool y
12762306a36Sopenharmony_ci	select SPARSEMEM_STATIC
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ciconfig ARCH_SPARSEMEM_DEFAULT
13062306a36Sopenharmony_ci	def_bool y
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ciconfig ARCH_SELECT_MEMORY_MODEL
13362306a36Sopenharmony_ci	def_bool y
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ciconfig ARCH_MEMORY_PROBE
13662306a36Sopenharmony_ci	def_bool y
13762306a36Sopenharmony_ci	depends on MEMORY_HOTPLUG
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ciconfig IOREMAP_FIXED
14062306a36Sopenharmony_ci       def_bool y
14162306a36Sopenharmony_ci       depends on X2TLB
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ciconfig UNCACHED_MAPPING
14462306a36Sopenharmony_ci	bool
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ciconfig HAVE_SRAM_POOL
14762306a36Sopenharmony_ci	bool
14862306a36Sopenharmony_ci	select GENERIC_ALLOCATOR
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_cichoice
15162306a36Sopenharmony_ci	prompt "Kernel page size"
15262306a36Sopenharmony_ci	default PAGE_SIZE_4KB
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ciconfig PAGE_SIZE_4KB
15562306a36Sopenharmony_ci	bool "4kB"
15662306a36Sopenharmony_ci	help
15762306a36Sopenharmony_ci	  This is the default page size used by all SuperH CPUs.
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ciconfig PAGE_SIZE_8KB
16062306a36Sopenharmony_ci	bool "8kB"
16162306a36Sopenharmony_ci	depends on !MMU || X2TLB
16262306a36Sopenharmony_ci	help
16362306a36Sopenharmony_ci	  This enables 8kB pages as supported by SH-X2 and later MMUs.
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ciconfig PAGE_SIZE_16KB
16662306a36Sopenharmony_ci	bool "16kB"
16762306a36Sopenharmony_ci	depends on !MMU
16862306a36Sopenharmony_ci	help
16962306a36Sopenharmony_ci	  This enables 16kB pages on MMU-less SH systems.
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ciconfig PAGE_SIZE_64KB
17262306a36Sopenharmony_ci	bool "64kB"
17362306a36Sopenharmony_ci	depends on !MMU || CPU_SH4
17462306a36Sopenharmony_ci	help
17562306a36Sopenharmony_ci	  This enables support for 64kB pages, possible on all SH-4
17662306a36Sopenharmony_ci	  CPUs and later.
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ciendchoice
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_cichoice
18162306a36Sopenharmony_ci	prompt "HugeTLB page size"
18262306a36Sopenharmony_ci	depends on HUGETLB_PAGE
18362306a36Sopenharmony_ci	default HUGETLB_PAGE_SIZE_1MB if PAGE_SIZE_64KB
18462306a36Sopenharmony_ci	default HUGETLB_PAGE_SIZE_64K
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ciconfig HUGETLB_PAGE_SIZE_64K
18762306a36Sopenharmony_ci	bool "64kB"
18862306a36Sopenharmony_ci	depends on !PAGE_SIZE_64KB
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ciconfig HUGETLB_PAGE_SIZE_256K
19162306a36Sopenharmony_ci	bool "256kB"
19262306a36Sopenharmony_ci	depends on X2TLB
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ciconfig HUGETLB_PAGE_SIZE_1MB
19562306a36Sopenharmony_ci	bool "1MB"
19662306a36Sopenharmony_ci
19762306a36Sopenharmony_ciconfig HUGETLB_PAGE_SIZE_4MB
19862306a36Sopenharmony_ci	bool "4MB"
19962306a36Sopenharmony_ci	depends on X2TLB
20062306a36Sopenharmony_ci
20162306a36Sopenharmony_ciconfig HUGETLB_PAGE_SIZE_64MB
20262306a36Sopenharmony_ci	bool "64MB"
20362306a36Sopenharmony_ci	depends on X2TLB
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ciendchoice
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ciconfig SCHED_MC
20862306a36Sopenharmony_ci	bool "Multi-core scheduler support"
20962306a36Sopenharmony_ci	depends on SMP
21062306a36Sopenharmony_ci	default y
21162306a36Sopenharmony_ci	help
21262306a36Sopenharmony_ci	  Multi-core scheduler support improves the CPU scheduler's decision
21362306a36Sopenharmony_ci	  making when dealing with multi-core CPU chips at a cost of slightly
21462306a36Sopenharmony_ci	  increased overhead in some places. If unsure say N here.
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ciendmenu
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_cimenu "Cache configuration"
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ciconfig SH7705_CACHE_32KB
22162306a36Sopenharmony_ci	bool "Enable 32KB cache size for SH7705"
22262306a36Sopenharmony_ci	depends on CPU_SUBTYPE_SH7705
22362306a36Sopenharmony_ci	default y
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_cichoice
22662306a36Sopenharmony_ci	prompt "Cache mode"
22762306a36Sopenharmony_ci	default CACHE_WRITEBACK if CPU_SH2A || CPU_SH3 || CPU_SH4
22862306a36Sopenharmony_ci	default CACHE_WRITETHROUGH if (CPU_SH2 && !CPU_SH2A)
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ciconfig CACHE_WRITEBACK
23162306a36Sopenharmony_ci	bool "Write-back"
23262306a36Sopenharmony_ci
23362306a36Sopenharmony_ciconfig CACHE_WRITETHROUGH
23462306a36Sopenharmony_ci	bool "Write-through"
23562306a36Sopenharmony_ci	help
23662306a36Sopenharmony_ci	  Selecting this option will configure the caches in write-through
23762306a36Sopenharmony_ci	  mode, as opposed to the default write-back configuration.
23862306a36Sopenharmony_ci
23962306a36Sopenharmony_ci	  Since there's sill some aliasing issues on SH-4, this option will
24062306a36Sopenharmony_ci	  unfortunately still require the majority of flushing functions to
24162306a36Sopenharmony_ci	  be implemented to deal with aliasing.
24262306a36Sopenharmony_ci
24362306a36Sopenharmony_ci	  If unsure, say N.
24462306a36Sopenharmony_ci
24562306a36Sopenharmony_ciconfig CACHE_OFF
24662306a36Sopenharmony_ci	bool "Off"
24762306a36Sopenharmony_ci
24862306a36Sopenharmony_ciendchoice
24962306a36Sopenharmony_ci
25062306a36Sopenharmony_ciendmenu
251