1# SPDX-License-Identifier: GPL-2.0
2config XTENSA
3	def_bool y
4	select ARCH_32BIT_OFF_T
5	select ARCH_HAS_CPU_CACHE_ALIASING
6	select ARCH_HAS_BINFMT_FLAT if !MMU
7	select ARCH_HAS_CURRENT_STACK_POINTER
8	select ARCH_HAS_DEBUG_VM_PGTABLE
9	select ARCH_HAS_DMA_PREP_COHERENT if MMU
10	select ARCH_HAS_GCOV_PROFILE_ALL
11	select ARCH_HAS_KCOV
12	select ARCH_HAS_SYNC_DMA_FOR_CPU if MMU
13	select ARCH_HAS_SYNC_DMA_FOR_DEVICE if MMU
14	select ARCH_HAS_DMA_SET_UNCACHED if MMU
15	select ARCH_HAS_STRNCPY_FROM_USER if !KASAN
16	select ARCH_HAS_STRNLEN_USER
17	select ARCH_NEED_CMPXCHG_1_EMU
18	select ARCH_USE_MEMTEST
19	select ARCH_USE_QUEUED_RWLOCKS
20	select ARCH_USE_QUEUED_SPINLOCKS
21	select ARCH_WANT_IPC_PARSE_VERSION
22	select BUILDTIME_TABLE_SORT
23	select GENERIC_BUILTIN_DTB
24	select CLONE_BACKWARDS
25	select COMMON_CLK
26	select DMA_NONCOHERENT_MMAP if MMU
27	select GENERIC_ATOMIC64
28	select GENERIC_IRQ_SHOW
29	select GENERIC_LIB_CMPDI2
30	select GENERIC_LIB_MULDI3
31	select GENERIC_LIB_UCMPDI2
32	select GENERIC_PCI_IOMAP
33	select GENERIC_SCHED_CLOCK
34	select GENERIC_IOREMAP if MMU
35	select HAVE_ARCH_AUDITSYSCALL
36	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
37	select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
38	select HAVE_ARCH_KCSAN
39	select HAVE_ARCH_SECCOMP_FILTER
40	select HAVE_ARCH_TRACEHOOK
41	select HAVE_ASM_MODVERSIONS
42	select HAVE_CONTEXT_TRACKING_USER
43	select HAVE_DEBUG_KMEMLEAK
44	select HAVE_DMA_CONTIGUOUS
45	select HAVE_EXIT_THREAD
46	select HAVE_FUNCTION_TRACER
47	select HAVE_GCC_PLUGINS if GCC_VERSION >= 120000
48	select HAVE_HW_BREAKPOINT if PERF_EVENTS
49	select HAVE_IRQ_TIME_ACCOUNTING
50	select HAVE_PAGE_SIZE_4KB
51	select HAVE_PCI
52	select HAVE_PERF_EVENTS
53	select HAVE_STACKPROTECTOR
54	select HAVE_SYSCALL_TRACEPOINTS
55	select HAVE_VIRT_CPU_ACCOUNTING_GEN
56	select IRQ_DOMAIN
57	select LOCK_MM_AND_FIND_VMA
58	select MODULES_USE_ELF_RELA
59	select PERF_USE_VMALLOC
60	select TRACE_IRQFLAGS_SUPPORT
61	help
62	  Xtensa processors are 32-bit RISC machines designed by Tensilica
63	  primarily for embedded systems.  These processors are both
64	  configurable and extensible.  The Linux port to the Xtensa
65	  architecture supports all processor configurations and extensions,
66	  with reasonable minimum requirements.  The Xtensa Linux project has
67	  a home page at <http://www.linux-xtensa.org/>.
68
69config GENERIC_HWEIGHT
70	def_bool y
71
72config ARCH_HAS_ILOG2_U32
73	def_bool n
74
75config ARCH_HAS_ILOG2_U64
76	def_bool n
77
78config ARCH_MTD_XIP
79	def_bool y
80
81config NO_IOPORT_MAP
82	def_bool n
83
84config HZ
85	int
86	default 100
87
88config LOCKDEP_SUPPORT
89	def_bool y
90
91config STACKTRACE_SUPPORT
92	def_bool y
93
94config MMU
95	def_bool n
96	select PFAULT
97
98config HAVE_XTENSA_GPIO32
99	def_bool n
100
101config KASAN_SHADOW_OFFSET
102	hex
103	default 0x6e400000
104
105config CPU_BIG_ENDIAN
106	def_bool $(success,test "$(shell,echo __XTENSA_EB__ | $(CC) -E -P -)" = 1)
107
108config CPU_LITTLE_ENDIAN
109	def_bool !CPU_BIG_ENDIAN
110
111config CC_HAVE_CALL0_ABI
112	def_bool $(success,test "$(shell,echo __XTENSA_CALL0_ABI__ | $(CC) -mabi=call0 -E -P - 2>/dev/null)" = 1)
113
114menu "Processor type and features"
115
116choice
117	prompt "Xtensa Processor Configuration"
118	default XTENSA_VARIANT_FSF
119
120config XTENSA_VARIANT_FSF
121	bool "fsf - default (not generic) configuration"
122	select MMU
123
124config XTENSA_VARIANT_DC232B
125	bool "dc232b - Diamond 232L Standard Core Rev.B (LE)"
126	select MMU
127	select HAVE_XTENSA_GPIO32
128	help
129	  This variant refers to Tensilica's Diamond 232L Standard core Rev.B (LE).
130
131config XTENSA_VARIANT_DC233C
132	bool "dc233c - Diamond 233L Standard Core Rev.C (LE)"
133	select MMU
134	select HAVE_XTENSA_GPIO32
135	help
136	  This variant refers to Tensilica's Diamond 233L Standard core Rev.C (LE).
137
138config XTENSA_VARIANT_CUSTOM
139	bool "Custom Xtensa processor configuration"
140	select HAVE_XTENSA_GPIO32
141	help
142	  Select this variant to use a custom Xtensa processor configuration.
143	  You will be prompted for a processor variant CORENAME.
144endchoice
145
146config XTENSA_VARIANT_CUSTOM_NAME
147	string "Xtensa Processor Custom Core Variant Name"
148	depends on XTENSA_VARIANT_CUSTOM
149	help
150	  Provide the name of a custom Xtensa processor variant.
151	  This CORENAME selects arch/xtensa/variants/CORENAME.
152	  Don't forget you have to select MMU if you have one.
153
154config XTENSA_VARIANT_NAME
155	string
156	default "dc232b"			if XTENSA_VARIANT_DC232B
157	default "dc233c"			if XTENSA_VARIANT_DC233C
158	default "fsf"				if XTENSA_VARIANT_FSF
159	default XTENSA_VARIANT_CUSTOM_NAME	if XTENSA_VARIANT_CUSTOM
160
161config XTENSA_VARIANT_MMU
162	bool "Core variant has a Full MMU (TLB, Pages, Protection, etc)"
163	depends on XTENSA_VARIANT_CUSTOM
164	default y
165	select MMU
166	help
167	  Build a Conventional Kernel with full MMU support,
168	  ie: it supports a TLB with auto-loading, page protection.
169
170config XTENSA_VARIANT_HAVE_PERF_EVENTS
171	bool "Core variant has Performance Monitor Module"
172	depends on XTENSA_VARIANT_CUSTOM
173	default n
174	help
175	  Enable if core variant has Performance Monitor Module with
176	  External Registers Interface.
177
178	  If unsure, say N.
179
180config XTENSA_FAKE_NMI
181	bool "Treat PMM IRQ as NMI"
182	depends on XTENSA_VARIANT_HAVE_PERF_EVENTS
183	default n
184	help
185	  If PMM IRQ is the only IRQ at EXCM level it is safe to
186	  treat it as NMI, which improves accuracy of profiling.
187
188	  If there are other interrupts at or above PMM IRQ priority level
189	  but not above the EXCM level, PMM IRQ still may be treated as NMI,
190	  but only if these IRQs are not used. There will be a build warning
191	  saying that this is not safe, and a bugcheck if one of these IRQs
192	  actually fire.
193
194	  If unsure, say N.
195
196config PFAULT
197	bool "Handle protection faults" if EXPERT && !MMU
198	default y
199	help
200	  Handle protection faults. MMU configurations must enable it.
201	  noMMU configurations may disable it if used memory map never
202	  generates protection faults or faults are always fatal.
203
204	  If unsure, say Y.
205
206config XTENSA_UNALIGNED_USER
207	bool "Unaligned memory access in user space"
208	help
209	  The Xtensa architecture currently does not handle unaligned
210	  memory accesses in hardware but through an exception handler.
211	  Per default, unaligned memory accesses are disabled in user space.
212
213	  Say Y here to enable unaligned memory access in user space.
214
215config XTENSA_LOAD_STORE
216	bool "Load/store exception handler for memory only readable with l32"
217	help
218	  The Xtensa architecture only allows reading memory attached to its
219	  instruction bus with l32r and l32i instructions, all other
220	  instructions raise an exception with the LoadStoreErrorCause code.
221	  This makes it hard to use some configurations, e.g. store string
222	  literals in FLASH memory attached to the instruction bus.
223
224	  Say Y here to enable exception handler that allows transparent
225	  byte and 2-byte access to memory attached to instruction bus.
226
227config HAVE_SMP
228	bool "System Supports SMP (MX)"
229	depends on XTENSA_VARIANT_CUSTOM
230	select XTENSA_MX
231	help
232	  This option is used to indicate that the system-on-a-chip (SOC)
233	  supports Multiprocessing. Multiprocessor support implemented above
234	  the CPU core definition and currently needs to be selected manually.
235
236	  Multiprocessor support is implemented with external cache and
237	  interrupt controllers.
238
239	  The MX interrupt distributer adds Interprocessor Interrupts
240	  and causes the IRQ numbers to be increased by 4 for devices
241	  like the open cores ethernet driver and the serial interface.
242
243	  You still have to select "Enable SMP" to enable SMP on this SOC.
244
245config SMP
246	bool "Enable Symmetric multi-processing support"
247	depends on HAVE_SMP
248	select GENERIC_SMP_IDLE_THREAD
249	help
250	  Enabled SMP Software; allows more than one CPU/CORE
251	  to be activated during startup.
252
253config NR_CPUS
254	depends on SMP
255	int "Maximum number of CPUs (2-32)"
256	range 2 32
257	default "4"
258
259config HOTPLUG_CPU
260	bool "Enable CPU hotplug support"
261	depends on SMP
262	help
263	  Say Y here to allow turning CPUs off and on. CPUs can be
264	  controlled through /sys/devices/system/cpu.
265
266	  Say N if you want to disable CPU hotplug.
267
268config SECONDARY_RESET_VECTOR
269	bool "Secondary cores use alternative reset vector"
270	default y
271	depends on HAVE_SMP
272	help
273	  Secondary cores may be configured to use alternative reset vector,
274	  or all cores may use primary reset vector.
275	  Say Y here to supply handler for the alternative reset location.
276
277config FAST_SYSCALL_XTENSA
278	bool "Enable fast atomic syscalls"
279	default n
280	help
281	  fast_syscall_xtensa is a syscall that can make atomic operations
282	  on UP kernel when processor has no s32c1i support.
283
284	  This syscall is deprecated. It may have issues when called with
285	  invalid arguments. It is provided only for backwards compatibility.
286	  Only enable it if your userspace software requires it.
287
288	  If unsure, say N.
289
290config FAST_SYSCALL_SPILL_REGISTERS
291	bool "Enable spill registers syscall"
292	default n
293	help
294	  fast_syscall_spill_registers is a syscall that spills all active
295	  register windows of a calling userspace task onto its stack.
296
297	  This syscall is deprecated. It may have issues when called with
298	  invalid arguments. It is provided only for backwards compatibility.
299	  Only enable it if your userspace software requires it.
300
301	  If unsure, say N.
302
303choice
304	prompt "Kernel ABI"
305	default KERNEL_ABI_DEFAULT
306	help
307	  Select ABI for the kernel code. This ABI is independent of the
308	  supported userspace ABI and any combination of the
309	  kernel/userspace ABI is possible and should work.
310
311	  In case both kernel and userspace support only call0 ABI
312	  all register windows support code will be omitted from the
313	  build.
314
315	  If unsure, choose the default ABI.
316
317config KERNEL_ABI_DEFAULT
318	bool "Default ABI"
319	help
320	  Select this option to compile kernel code with the default ABI
321	  selected for the toolchain.
322	  Normally cores with windowed registers option use windowed ABI and
323	  cores without it use call0 ABI.
324
325config KERNEL_ABI_CALL0
326	bool "Call0 ABI" if CC_HAVE_CALL0_ABI
327	help
328	  Select this option to compile kernel code with call0 ABI even with
329	  toolchain that defaults to windowed ABI.
330	  When this option is not selected the default toolchain ABI will
331	  be used for the kernel code.
332
333endchoice
334
335config USER_ABI_CALL0
336	bool
337
338choice
339	prompt "Userspace ABI"
340	default USER_ABI_DEFAULT
341	help
342	  Select supported userspace ABI.
343
344	  If unsure, choose the default ABI.
345
346config USER_ABI_DEFAULT
347	bool "Default ABI only"
348	help
349	  Assume default userspace ABI. For XEA2 cores it is windowed ABI.
350	  call0 ABI binaries may be run on such kernel, but signal delivery
351	  will not work correctly for them.
352
353config USER_ABI_CALL0_ONLY
354	bool "Call0 ABI only"
355	select USER_ABI_CALL0
356	help
357	  Select this option to support only call0 ABI in userspace.
358	  Windowed ABI binaries will crash with a segfault caused by
359	  an illegal instruction exception on the first 'entry' opcode.
360
361	  Choose this option if you're planning to run only user code
362	  built with call0 ABI.
363
364config USER_ABI_CALL0_PROBE
365	bool "Support both windowed and call0 ABI by probing"
366	select USER_ABI_CALL0
367	help
368	  Select this option to support both windowed and call0 userspace
369	  ABIs. When enabled all processes are started with PS.WOE disabled
370	  and a fast user exception handler for an illegal instruction is
371	  used to turn on PS.WOE bit on the first 'entry' opcode executed by
372	  the userspace.
373
374	  This option should be enabled for the kernel that must support
375	  both call0 and windowed ABIs in userspace at the same time.
376
377	  Note that Xtensa ISA does not guarantee that entry opcode will
378	  raise an illegal instruction exception on cores with XEA2 when
379	  PS.WOE is disabled, check whether the target core supports it.
380
381endchoice
382
383endmenu
384
385config XTENSA_CALIBRATE_CCOUNT
386	def_bool n
387	help
388	  On some platforms (XT2000, for example), the CPU clock rate can
389	  vary.  The frequency can be determined, however, by measuring
390	  against a well known, fixed frequency, such as an UART oscillator.
391
392config SERIAL_CONSOLE
393	def_bool n
394
395config PLATFORM_HAVE_XIP
396	def_bool n
397
398menu "Platform options"
399
400choice
401	prompt "Xtensa System Type"
402	default XTENSA_PLATFORM_ISS
403
404config XTENSA_PLATFORM_ISS
405	bool "ISS"
406	select XTENSA_CALIBRATE_CCOUNT
407	select SERIAL_CONSOLE
408	help
409	  ISS is an acronym for Tensilica's Instruction Set Simulator.
410
411config XTENSA_PLATFORM_XT2000
412	bool "XT2000"
413	help
414	  XT2000 is the name of Tensilica's feature-rich emulation platform.
415	  This hardware is capable of running a full Linux distribution.
416
417config XTENSA_PLATFORM_XTFPGA
418	bool "XTFPGA"
419	select ETHOC if ETHERNET
420	select PLATFORM_WANT_DEFAULT_MEM if !MMU
421	select SERIAL_CONSOLE
422	select XTENSA_CALIBRATE_CCOUNT
423	select PLATFORM_HAVE_XIP
424	help
425	  XTFPGA is the name of Tensilica board family (LX60, LX110, LX200, ML605).
426	  This hardware is capable of running a full Linux distribution.
427
428endchoice
429
430config PLATFORM_NR_IRQS
431	int
432	default 3 if XTENSA_PLATFORM_XT2000
433	default 0
434
435config XTENSA_CPU_CLOCK
436	int "CPU clock rate [MHz]"
437	depends on !XTENSA_CALIBRATE_CCOUNT
438	default 16
439
440config GENERIC_CALIBRATE_DELAY
441	bool "Auto calibration of the BogoMIPS value"
442	help
443	  The BogoMIPS value can easily be derived from the CPU frequency.
444
445config CMDLINE_BOOL
446	bool "Default bootloader kernel arguments"
447
448config CMDLINE
449	string "Initial kernel command string"
450	depends on CMDLINE_BOOL
451	default "console=ttyS0,38400 root=/dev/ram"
452	help
453	  On some architectures (EBSA110 and CATS), there is currently no way
454	  for the boot loader to pass arguments to the kernel. For these
455	  architectures, you should supply some command-line options at build
456	  time by entering them here. As a minimum, you should specify the
457	  memory size and the root device (e.g., mem=64M root=/dev/nfs).
458
459config USE_OF
460	bool "Flattened Device Tree support"
461	select OF
462	select OF_EARLY_FLATTREE
463	help
464	  Include support for flattened device tree machine descriptions.
465
466config BUILTIN_DTB_NAME
467	string "DTB to build into the kernel image"
468	depends on OF
469
470config PARSE_BOOTPARAM
471	bool "Parse bootparam block"
472	default y
473	help
474	  Parse parameters passed to the kernel from the bootloader. It may
475	  be disabled if the kernel is known to run without the bootloader.
476
477	  If unsure, say Y.
478
479choice
480	prompt "Semihosting interface"
481	default XTENSA_SIMCALL_ISS
482	depends on XTENSA_PLATFORM_ISS
483	help
484	  Choose semihosting interface that will be used for serial port,
485	  block device and networking.
486
487config XTENSA_SIMCALL_ISS
488	bool "simcall"
489	help
490	  Use simcall instruction. simcall is only available on simulators,
491	  it does nothing on hardware.
492
493config XTENSA_SIMCALL_GDBIO
494	bool "GDBIO"
495	help
496	  Use break instruction. It is available on real hardware when GDB
497	  is attached to it via JTAG.
498
499endchoice
500
501config BLK_DEV_SIMDISK
502	tristate "Host file-based simulated block device support"
503	default n
504	depends on XTENSA_PLATFORM_ISS && BLOCK
505	help
506	  Create block devices that map to files in the host file system.
507	  Device binding to host file may be changed at runtime via proc
508	  interface provided the device is not in use.
509
510config BLK_DEV_SIMDISK_COUNT
511	int "Number of host file-based simulated block devices"
512	range 1 10
513	depends on BLK_DEV_SIMDISK
514	default 2
515	help
516	  This is the default minimal number of created block devices.
517	  Kernel/module parameter 'simdisk_count' may be used to change this
518	  value at runtime. More file names (but no more than 10) may be
519	  specified as parameters, simdisk_count grows accordingly.
520
521config SIMDISK0_FILENAME
522	string "Host filename for the first simulated device"
523	depends on BLK_DEV_SIMDISK = y
524	default ""
525	help
526	  Attach a first simdisk to a host file. Conventionally, this file
527	  contains a root file system.
528
529config SIMDISK1_FILENAME
530	string "Host filename for the second simulated device"
531	depends on BLK_DEV_SIMDISK = y && BLK_DEV_SIMDISK_COUNT != 1
532	default ""
533	help
534	  Another simulated disk in a host file for a buildroot-independent
535	  storage.
536
537config XTFPGA_LCD
538	bool "Enable XTFPGA LCD driver"
539	depends on XTENSA_PLATFORM_XTFPGA
540	default n
541	help
542	  There's a 2x16 LCD on most of XTFPGA boards, kernel may output
543	  progress messages there during bootup/shutdown. It may be useful
544	  during board bringup.
545
546	  If unsure, say N.
547
548config XTFPGA_LCD_BASE_ADDR
549	hex "XTFPGA LCD base address"
550	depends on XTFPGA_LCD
551	default "0x0d0c0000"
552	help
553	  Base address of the LCD controller inside KIO region.
554	  Different boards from XTFPGA family have LCD controller at different
555	  addresses. Please consult prototyping user guide for your board for
556	  the correct address. Wrong address here may lead to hardware lockup.
557
558config XTFPGA_LCD_8BIT_ACCESS
559	bool "Use 8-bit access to XTFPGA LCD"
560	depends on XTFPGA_LCD
561	default n
562	help
563	  LCD may be connected with 4- or 8-bit interface, 8-bit access may
564	  only be used with 8-bit interface. Please consult prototyping user
565	  guide for your board for the correct interface width.
566
567comment "Kernel memory layout"
568
569config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
570	bool "Initialize Xtensa MMU inside the Linux kernel code"
571	depends on !XTENSA_VARIANT_FSF && !XTENSA_VARIANT_DC232B
572	default y if XTENSA_VARIANT_DC233C || XTENSA_VARIANT_CUSTOM
573	help
574	  Earlier version initialized the MMU in the exception vector
575	  before jumping to _startup in head.S and had an advantage that
576	  it was possible to place a software breakpoint at 'reset' and
577	  then enter your normal kernel breakpoints once the MMU was mapped
578	  to the kernel mappings (0XC0000000).
579
580	  This unfortunately won't work for U-Boot and likely also won't
581	  work for using KEXEC to have a hot kernel ready for doing a
582	  KDUMP.
583
584	  So now the MMU is initialized in head.S but it's necessary to
585	  use hardware breakpoints (gdb 'hbreak' cmd) to break at _startup.
586	  xt-gdb can't place a Software Breakpoint in the  0XD region prior
587	  to mapping the MMU and after mapping even if the area of low memory
588	  was mapped gdb wouldn't remove the breakpoint on hitting it as the
589	  PC wouldn't match. Since Hardware Breakpoints are recommended for
590	  Linux configurations it seems reasonable to just assume they exist
591	  and leave this older mechanism for unfortunate souls that choose
592	  not to follow Tensilica's recommendation.
593
594	  Selecting this will cause U-Boot to set the KERNEL Load and Entry
595	  address at 0x00003000 instead of the mapped std of 0xD0003000.
596
597	  If in doubt, say Y.
598
599config XIP_KERNEL
600	bool "Kernel Execute-In-Place from ROM"
601	depends on PLATFORM_HAVE_XIP
602	help
603	  Execute-In-Place allows the kernel to run from non-volatile storage
604	  directly addressable by the CPU, such as NOR flash. This saves RAM
605	  space since the text section of the kernel is not loaded from flash
606	  to RAM. Read-write sections, such as the data section and stack,
607	  are still copied to RAM. The XIP kernel is not compressed since
608	  it has to run directly from flash, so it will take more space to
609	  store it. The flash address used to link the kernel object files,
610	  and for storing it, is configuration dependent. Therefore, if you
611	  say Y here, you must know the proper physical address where to
612	  store the kernel image depending on your own flash memory usage.
613
614	  Also note that the make target becomes "make xipImage" rather than
615	  "make Image" or "make uImage". The final kernel binary to put in
616	  ROM memory will be arch/xtensa/boot/xipImage.
617
618	  If unsure, say N.
619
620config MEMMAP_CACHEATTR
621	hex "Cache attributes for the memory address space"
622	depends on !MMU
623	default 0x22222222
624	help
625	  These cache attributes are set up for noMMU systems. Each hex digit
626	  specifies cache attributes for the corresponding 512MB memory
627	  region: bits 0..3 -- for addresses 0x00000000..0x1fffffff,
628	  bits 4..7 -- for addresses 0x20000000..0x3fffffff, and so on.
629
630	  Cache attribute values are specific for the MMU type.
631	  For region protection MMUs:
632	    1: WT cached,
633	    2: cache bypass,
634	    4: WB cached,
635	    f: illegal.
636	  For full MMU:
637	    bit 0: executable,
638	    bit 1: writable,
639	    bits 2..3:
640	      0: cache bypass,
641	      1: WB cache,
642	      2: WT cache,
643	      3: special (c and e are illegal, f is reserved).
644	  For MPU:
645	    0: illegal,
646	    1: WB cache,
647	    2: WB, no-write-allocate cache,
648	    3: WT cache,
649	    4: cache bypass.
650
651config KSEG_PADDR
652	hex "Physical address of the KSEG mapping"
653	depends on INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX && MMU
654	default 0x00000000
655	help
656	  This is the physical address where KSEG is mapped. Please refer to
657	  the chosen KSEG layout help for the required address alignment.
658	  Unpacked kernel image (including vectors) must be located completely
659	  within KSEG.
660	  Physical memory below this address is not available to linux.
661
662	  If unsure, leave the default value here.
663
664config KERNEL_VIRTUAL_ADDRESS
665	hex "Kernel virtual address"
666	depends on MMU && XIP_KERNEL
667	default 0xd0003000
668	help
669	  This is the virtual address where the XIP kernel is mapped.
670	  XIP kernel may be mapped into KSEG or KIO region, virtual address
671	  provided here must match kernel load address provided in
672	  KERNEL_LOAD_ADDRESS.
673
674config KERNEL_LOAD_ADDRESS
675	hex "Kernel load address"
676	default 0x60003000 if !MMU
677	default 0x00003000 if MMU && INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
678	default 0xd0003000 if MMU && !INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
679	help
680	  This is the address where the kernel is loaded.
681	  It is virtual address for MMUv2 configurations and physical address
682	  for all other configurations.
683
684	  If unsure, leave the default value here.
685
686choice
687	prompt "Relocatable vectors location"
688	default XTENSA_VECTORS_IN_TEXT
689	help
690	  Choose whether relocatable vectors are merged into the kernel .text
691	  or placed separately at runtime. This option does not affect
692	  configurations without VECBASE register where vectors are always
693	  placed at their hardware-defined locations.
694
695config XTENSA_VECTORS_IN_TEXT
696	bool "Merge relocatable vectors into kernel text"
697	depends on !MTD_XIP
698	help
699	  This option puts relocatable vectors into the kernel .text section
700	  with proper alignment.
701	  This is a safe choice for most configurations.
702
703config XTENSA_VECTORS_SEPARATE
704	bool "Put relocatable vectors at fixed address"
705	help
706	  This option puts relocatable vectors at specific virtual address.
707	  Vectors are merged with the .init data in the kernel image and
708	  are copied into their designated location during kernel startup.
709	  Use it to put vectors into IRAM or out of FLASH on kernels with
710	  XIP-aware MTD support.
711
712endchoice
713
714config VECTORS_ADDR
715	hex "Kernel vectors virtual address"
716	default 0x00000000
717	depends on XTENSA_VECTORS_SEPARATE
718	help
719	  This is the virtual address of the (relocatable) vectors base.
720	  It must be within KSEG if MMU is used.
721
722config XIP_DATA_ADDR
723	hex "XIP kernel data virtual address"
724	depends on XIP_KERNEL
725	default 0x00000000
726	help
727	  This is the virtual address where XIP kernel data is copied.
728	  It must be within KSEG if MMU is used.
729
730config PLATFORM_WANT_DEFAULT_MEM
731	def_bool n
732
733config DEFAULT_MEM_START
734	hex
735	prompt "PAGE_OFFSET/PHYS_OFFSET" if !MMU && PLATFORM_WANT_DEFAULT_MEM
736	default 0x60000000 if PLATFORM_WANT_DEFAULT_MEM
737	default 0x00000000
738	help
739	  This is the base address used for both PAGE_OFFSET and PHYS_OFFSET
740	  in noMMU configurations.
741
742	  If unsure, leave the default value here.
743
744choice
745	prompt "KSEG layout"
746	depends on MMU
747	default XTENSA_KSEG_MMU_V2
748
749config XTENSA_KSEG_MMU_V2
750	bool "MMUv2: 128MB cached + 128MB uncached"
751	help
752	  MMUv2 compatible kernel memory map: TLB way 5 maps 128MB starting
753	  at KSEG_PADDR to 0xd0000000 with cache and to 0xd8000000
754	  without cache.
755	  KSEG_PADDR must be aligned to 128MB.
756
757config XTENSA_KSEG_256M
758	bool "256MB cached + 256MB uncached"
759	depends on INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
760	help
761	  TLB way 6 maps 256MB starting at KSEG_PADDR to 0xb0000000
762	  with cache and to 0xc0000000 without cache.
763	  KSEG_PADDR must be aligned to 256MB.
764
765config XTENSA_KSEG_512M
766	bool "512MB cached + 512MB uncached"
767	depends on INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
768	help
769	  TLB way 6 maps 512MB starting at KSEG_PADDR to 0xa0000000
770	  with cache and to 0xc0000000 without cache.
771	  KSEG_PADDR must be aligned to 256MB.
772
773endchoice
774
775config HIGHMEM
776	bool "High Memory Support"
777	depends on MMU
778	select KMAP_LOCAL
779	help
780	  Linux can use the full amount of RAM in the system by
781	  default. However, the default MMUv2 setup only maps the
782	  lowermost 128 MB of memory linearly to the areas starting
783	  at 0xd0000000 (cached) and 0xd8000000 (uncached).
784	  When there are more than 128 MB memory in the system not
785	  all of it can be "permanently mapped" by the kernel.
786	  The physical memory that's not permanently mapped is called
787	  "high memory".
788
789	  If you are compiling a kernel which will never run on a
790	  machine with more than 128 MB total physical RAM, answer
791	  N here.
792
793	  If unsure, say Y.
794
795config ARCH_FORCE_MAX_ORDER
796	int "Order of maximal physically contiguous allocations"
797	default "10"
798	help
799	  The kernel page allocator limits the size of maximal physically
800	  contiguous allocations. The limit is called MAX_PAGE_ORDER and it
801	  defines the maximal power of two of number of pages that can be
802	  allocated as a single contiguous block. This option allows
803	  overriding the default setting when ability to allocate very
804	  large blocks of physically contiguous memory is required.
805
806	  Don't change if unsure.
807
808endmenu
809
810menu "Power management options"
811
812config ARCH_HIBERNATION_POSSIBLE
813	def_bool y
814
815source "kernel/power/Kconfig"
816
817endmenu
818