# SPDX-License-Identifier: GPL-2.0 config SW64 bool default y select AUDIT_ARCH select HAVE_IDE select HAVE_OPROFILE select HAVE_PCSPKR_PLATFORM select HAVE_PERF_EVENTS select HAVE_GENERIC_GUP select GENERIC_CLOCKEVENTS select GENERIC_IRQ_PROBE select GENERIC_IRQ_LEGACY select GENERIC_IRQ_SHOW select ARCH_WANT_IPC_PARSE_VERSION select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_MIGHT_HAVE_PC_SERIO select ARCH_NO_PREEMPT select ARCH_USE_CMPXCHG_LOCKREF select GENERIC_SMP_IDLE_THREAD select HAVE_MOD_ARCH_SPECIFIC select MODULES_USE_ELF_RELA select ARCH_SUPPORTS_NUMA_BALANCING select HAVE_ARCH_TRANSPARENT_HUGEPAGE select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_SECCOMP_FILTER select OLD_SIGACTION select OLD_SIGSUSPEND select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select HAVE_ARCH_KGDB select ARCH_HAS_PHYS_TO_DMA select SWIOTLB select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP select NO_BOOTMEM select ARCH_USE_QUEUED_RWLOCKS select ARCH_USE_QUEUED_SPINLOCKS select COMMON_CLK select HANDLE_DOMAIN_IRQ select ARCH_INLINE_READ_LOCK select ARCH_INLINE_READ_LOCK_BH select ARCH_INLINE_READ_LOCK_IRQ select ARCH_INLINE_READ_LOCK_IRQSAVE select ARCH_INLINE_READ_UNLOCK select ARCH_INLINE_READ_UNLOCK_BH select ARCH_INLINE_READ_UNLOCK_IRQ select ARCH_INLINE_READ_UNLOCK_IRQRESTORE select ARCH_INLINE_WRITE_LOCK select ARCH_INLINE_WRITE_LOCK_BH select ARCH_INLINE_WRITE_LOCK_IRQ select ARCH_INLINE_WRITE_LOCK_IRQSAVE select ARCH_INLINE_WRITE_UNLOCK select ARCH_INLINE_WRITE_UNLOCK_BH select ARCH_INLINE_WRITE_UNLOCK_IRQ select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE select ARCH_INLINE_SPIN_TRYLOCK select ARCH_INLINE_SPIN_TRYLOCK_BH select ARCH_INLINE_SPIN_LOCK select ARCH_INLINE_SPIN_LOCK_BH select ARCH_INLINE_SPIN_LOCK_IRQ select ARCH_INLINE_SPIN_LOCK_IRQSAVE select ARCH_INLINE_SPIN_UNLOCK select ARCH_INLINE_SPIN_UNLOCK_BH select ARCH_INLINE_SPIN_UNLOCK_IRQ select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE select ARCH_SUPPORTS_ATOMIC_RMW select ARCH_HAS_SG_CHAIN select IRQ_FORCED_THREADING select GENERIC_IRQ_MIGRATION if SMP select HAVE_FUNCTION_TRACER select HAVE_DYNAMIC_FTRACE select HAVE_FTRACE_MCOUNT_RECORD select HAVE_C_RECORDMCOUNT select HAVE_FUNCTION_GRAPH_TRACER select HAVE_KPROBES select HAVE_KRETPROBES select HAVE_SYSCALL_TRACEPOINTS select ARCH_SUPPORTS_UPROBES select OF_EARLY_FLATTREE if OF select HAVE_EBPF_JIT select SPARSEMEM_EXTREME if SPARSEMEM select HAVE_ARCH_JUMP_LABEL select ARCH_WANT_FRAME_POINTERS select HAVE_ASM_MODVERSIONS select ARCH_HAS_ELF_RANDOMIZE select HAVE_PERF_USER_STACK_DUMP select HAVE_PERF_REGS select ARCH_SUPPORTS_ACPI select ACPI select ACPI_REDUCED_HARDWARE_ONLY select GENERIC_TIME_VSYSCALL select SET_FS select PCI_MSI_ARCH_FALLBACKS select DMA_OPS if PCI select HAVE_REGS_AND_STACK_ACCESS_API select ARCH_HAS_PTE_SPECIAL select HARDIRQS_SW_RESEND config LOCKDEP_SUPPORT def_bool y config 64BIT def_bool y config MMU bool default y config PGTABLE_LEVELS int default 4 config SYS_SUPPORTS_HUGETLBFS def_bool y config RWSEM_GENERIC_SPINLOCK bool config RWSEM_XCHGADD_ALGORITHM bool default y config ARCH_ENABLE_MEMORY_HOTPLUG bool default y config ARCH_ENABLE_MEMORY_HOTREMOVE bool default y config ARCH_HAS_ILOG2_U32 bool default n config ARCH_HAS_ILOG2_U64 bool default n config GENERIC_GPIO bool config ZONE_DMA32 bool default y config NEED_DMA_MAP_STATE def_bool y config NEED_SG_DMA_LENGTH def_bool y config ARCH_WANT_HUGE_PMD_SHARE def_bool y config GENERIC_ISA_DMA bool default y config NONCACHE_PAGE bool depends on SW64 default y config AUDIT_ARCH bool config SYS_HAS_EARLY_PRINTK bool menu "System setup" menu "Machine Configuration" choice prompt "Subarchitecture Configuration" config SUBARCH_C3B bool "C3B" endchoice choice prompt "Chipset Family" config SW64_CHIP3 bool "Chip3" depends on SUBARCH_C3B endchoice choice prompt "Runtime System" depends on SW64_CHIP3 default SW64_ASIC config SW64_FPGA bool "FPGA" help Support for chip3 FPGA. config SW64_SIM bool "Hardware Simulator" help Support for chip3 hardware simulator. config SW64_ASIC bool "ASIC" help Support for chip3 asic. endchoice config SW64_CHIP3_ASIC_DEBUG bool "Debug Support for Chip3 Asic" depends on SW64_ASIC help Used for debug config CPUFREQ_DEBUGFS bool "CPU Frequency debugfs interface for Chip3 Asic" depends on SW64_CHIP3 && DEBUG_FS help Turns on the DebugFS interface for CPU Frequency. If you don't know what to do here, say N. choice prompt "Platform Type" config PLATFORM_XUELANG bool "Xuelang" depends on SW64_CHIP3 select SPARSE_IRQ select SYS_HAS_EARLY_PRINTK help Sunway chip3 board chipset endchoice endmenu config LOCK_MEMB bool "Insert mem barrier before lock instruction" default y menu "CPU Frequency scaling" config CPU_FREQ bool "CPU Frequency scaling" select SRCU help CPU Frequency scaling allows you to change the clock speed of CPUs on the fly. This is a nice method to save power, because the lower the CPU clock speed, the less power the CPU consumes. Note that this driver doesn't automatically change the CPU clock speed, you need to either enable a dynamic cpufreq governor (see below) after boot, or use a userspace tool. For details, take a look at . If in doubt, say N. if CPU_FREQ config SW64_CPUFREQ bool "sw64 CPU Frequency interface for Chip3 Asic" depends on SW64_CHIP3 default y help Turns on the interface for SW64_CPU Frequency. config SW64_CPUAUTOPLUG bool "sw64 CPU Autoplug interface" depends on SW64_CPUFREQ default y help Turns on the interface for SW64_CPU CPUAUTOPLUG. config CPU_FREQ_GOV_ATTR_SET bool config CPU_FREQ_GOV_COMMON select CPU_FREQ_GOV_ATTR_SET select IRQ_WORK bool config CPU_FREQ_BOOST_SW bool depends on THERMAL config CPU_FREQ_STAT bool "CPU frequency transition statistics" help Export CPU frequency statistics information through sysfs. If in doubt, say N. choice prompt "Default CPUFreq governor" default CPU_FREQ_DEFAULT_GOV_USERSPACE if ARM_SA1100_CPUFREQ || ARM_SA1110_CPUFREQ default CPU_FREQ_DEFAULT_GOV_PERFORMANCE help This option sets which CPUFreq governor shall be loaded at startup. If in doubt, select 'performance'. config CPU_FREQ_DEFAULT_GOV_PERFORMANCE bool "performance" select CPU_FREQ_GOV_PERFORMANCE help Use the CPUFreq governor 'performance' as default. This sets the frequency statically to the highest frequency supported by the CPU. config CPU_FREQ_DEFAULT_GOV_POWERSAVE bool "powersave" select CPU_FREQ_GOV_POWERSAVE help Use the CPUFreq governor 'powersave' as default. This sets the frequency statically to the lowest frequency supported by the CPU. config CPU_FREQ_DEFAULT_GOV_USERSPACE bool "userspace" select CPU_FREQ_GOV_USERSPACE help Use the CPUFreq governor 'userspace' as default. This allows you to set the CPU frequency manually or when a userspace program shall be able to set the CPU dynamically without having to enable the userspace governor manually. config CPU_FREQ_DEFAULT_GOV_ONDEMAND bool "ondemand" select CPU_FREQ_GOV_ONDEMAND select CPU_FREQ_GOV_PERFORMANCE help Use the CPUFreq governor 'ondemand' as default. This allows you to get a full dynamic frequency capable system by simply loading your cpufreq low-level hardware driver. Be aware that not all cpufreq drivers support the ondemand governor. If unsure have a look at the help section of the driver. Fallback governor will be the performance governor. config CPU_FREQ_DEFAULT_GOV_CONSERVATIVE bool "conservative" select CPU_FREQ_GOV_CONSERVATIVE select CPU_FREQ_GOV_PERFORMANCE help Use the CPUFreq governor 'conservative' as default. This allows you to get a full dynamic frequency capable system by simply loading your cpufreq low-level hardware driver. Be aware that not all cpufreq drivers support the conservative governor. If unsure have a look at the help section of the driver. Fallback governor will be the performance governor. config CPU_FREQ_DEFAULT_GOV_SCHEDUTIL bool "schedutil" depends on SMP select CPU_FREQ_GOV_SCHEDUTIL select CPU_FREQ_GOV_PERFORMANCE help Use the 'schedutil' CPUFreq governor by default. If unsure, have a look at the help section of that governor. The fallback governor will be 'performance'. endchoice config CPU_FREQ_GOV_PERFORMANCE tristate "'performance' governor" help This cpufreq governor sets the frequency statically to the highest available CPU frequency. To compile this driver as a module, choose M here: the module will be called cpufreq_performance. If in doubt, say Y. config CPU_FREQ_GOV_POWERSAVE tristate "'powersave' governor" help This cpufreq governor sets the frequency statically to the lowest available CPU frequency. To compile this driver as a module, choose M here: the module will be called cpufreq_powersave. If in doubt, say Y. config CPU_FREQ_GOV_USERSPACE tristate "'userspace' governor for userspace frequency scaling" help Enable this cpufreq governor when you either want to set the CPU frequency manually or when a userspace program shall be able to set the CPU dynamically, like on LART . To compile this driver as a module, choose M here: the module will be called cpufreq_userspace. For details, take a look at . If in doubt, say Y. config CPU_FREQ_GOV_ONDEMAND tristate "'ondemand' cpufreq policy governor" select CPU_FREQ_GOV_COMMON help 'ondemand' - This driver adds a dynamic cpufreq policy governor. The governor does a periodic polling and changes frequency based on the CPU utilization. The support for this governor depends on CPU capability to do fast frequency switching (i.e, very low latency frequency transitions). To compile this driver as a module, choose M here: the module will be called cpufreq_ondemand. For details, take a look at linux/Documentation/cpu-freq. If in doubt, say N. config CPU_FREQ_GOV_CONSERVATIVE tristate "'conservative' cpufreq governor" depends on CPU_FREQ select CPU_FREQ_GOV_COMMON help 'conservative' - this driver is rather similar to the 'ondemand' governor both in its source code and its purpose, the difference is its optimisation for better suitability in a battery powered environment. The frequency is gracefully increased and decreased rather than jumping to 100% when speed is required. If you have a desktop machine then you should really be considering the 'ondemand' governor instead, however if you are using a laptop, PDA or even an AMD64 based computer (due to the unacceptable step-by-step latency issues between the minimum and maximum frequency transitions in the CPU) you will probably want to use this governor. To compile this driver as a module, choose M here: the module will be called cpufreq_conservative. For details, take a look at linux/Documentation/cpu-freq. If in doubt, say N. config CPU_FREQ_GOV_SCHEDUTIL bool "'schedutil' cpufreq policy governor" depends on CPU_FREQ && SMP select CPU_FREQ_GOV_ATTR_SET select IRQ_WORK help This governor makes decisions based on the utilization data provided by the scheduler. It sets the CPU frequency to be proportional to the utilization/capacity ratio coming from the scheduler. If the utilization is frequency-invariant, the new frequency is also proportional to the maximum available frequency. If that is not the case, it is proportional to the current frequency of the CPU. The frequency tipping point is at utilization/capacity equal to 80% in both cases. If in doubt, say N. comment "CPU frequency scaling drivers" config CPUFREQ_DT tristate "Generic DT based cpufreq driver" depends on HAVE_CLK && OF # if CPU_THERMAL is on and THERMAL=m, CPUFREQ_DT cannot be =y: depends on !CPU_THERMAL || THERMAL select CPUFREQ_DT_PLATDEV select PM_OPP help This adds a generic DT based cpufreq driver for frequency management. It supports both uniprocessor (UP) and symmetric multiprocessor (SMP) systems. If in doubt, say N. config CPUFREQ_DT_PLATDEV bool help This adds a generic DT based cpufreq platdev driver for frequency management. This creates a 'cpufreq-dt' platform device, on the supported platforms. If in doubt, say N. endif endmenu # clear all implied options (don't want default values for those): # Most of these machines have ISA slots; not exactly sure which don't, # and this doesn't activate hordes of code, so do it always. config ISA bool default y help Find out whether you have ISA slots on your motherboard. ISA is the name of a bus system, i.e. the way the CPU talks to the other stuff inside your box. Other bus systems are PCI, EISA, MicroChannel (MCA) or VESA. ISA is an older system, now being displaced by PCI; newer boards don't support it. If you have ISA, say Y, otherwise N. config ISA_DMA_API bool default y config PCI bool "PCI Support" depends on SW64 select GENERIC_PCI_IOMAP default y help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or VESA. If you have PCI, say Y, otherwise N. config PCI_DOMAINS def_bool PCI config PCI_SYSCALL def_bool PCI config IOMMU_HELPER def_bool PCI config PHYSICAL_START hex "Physical address where the kernel starts" default "0x900000" help This gives the physical address where the kernel starts, and it is 0x10000 before _text. If you plan to use kernel for capturing the crash dump change this value to start of the reserved region (the "X" value as specified in the "crashkernel=YM@XM" command line boot parameter passed to the panic-ed kernel). config KEXEC bool "Kexec system call (EXPERIMENTAL)" select KEXEC_CORE help kexec is a system call that implements the ability to shutdown your current kernel, and to start another kernel. It is like a reboot but it is independent of the system firmware. And like a reboot you can start any kernel with it, not just Linux. The name comes from the similarity to the exec system call. It is an ongoing process to be certain the hardware in a machine is properly shutdown, so do not be surprised if this code does not initially work for you. As of this writing the exact hardware interface is strongly in flux, so no good recommendation can be made. config CRASH_DUMP bool "Kernel crash dumps (EXPERIMENTAL)" help Generate crash dump after being started by kexec. This should be normally only set in special crash dump kernels which are loaded in the main kernel with kexec-tools into a specially reserved region and then later executed after a crash by kdump/kexec. The crash dump kernel must be compiled to a memory address not used by the main kernel or firmware using PHYSICAL_START. config SECCOMP def_bool y prompt "Enable seccomp to safely compute untrusted bytecode" help This kernel feature is useful for number crunching applications that may need to compute untrusted bytecode during their execution. By using pipes or other transports made available to the process as file descriptors supporting the read/write syscalls, it's possible to isolate those applications in their own address space using seccomp. Once seccomp is enabled via prctl(PR_SET_SECCOMP), it cannot be disabled and the task is only allowed to execute a few safe syscalls defined by each seccomp mode. If unsure, say Y. Only embedded should say N here. config GENERIC_HWEIGHT bool default y config LOCK_FIXUP bool "fix up the lock" depends on SW64 help Add an instruction("memb\n") to ensure the correctness of the lock. config SMP bool "Symmetric multi-processing support" depends on SW64 select USE_GENERIC_SMP_HELPERS help This enables support for systems with more than one CPU. If you have a system with only one CPU, like most personal computers, say N. If you have a system with more than one CPU, say Y. If you say N here, the kernel will run on single and multiprocessor machines, but will use only one CPU of a multiprocessor machine. If you say Y here, the kernel will run on many, but not all, singleprocessor machines. On a singleprocessor machine, the kernel will run faster if you say N here. See also the SMP-HOWTO available at . If you don't know what to do here, say N. config ARCH_PROC_KCORE_TEXT def_bool y config HAVE_DEC_LOCK bool "Use arch-specified dec_and_lock" depends on SMP && !NUMA default y config TRACE_IRQFLAGS_SUPPORT def_bool y config ARCH_SUPPORTS_UPROBES def_bool y config NR_CPUS int "Maximum number of CPUs (2-256)" range 2 256 depends on SMP default "64" if SW64_CHIP3 help SW6 support can handle a maximum of 256 CPUs. config HOTPLUG_CPU bool "Support for hot-pluggable CPUs" depends on SMP help Say Y here to allow turning CPUs off and on. CPUs can be controlled through /sys/devices/system/cpu. ( Note: power management support will enable this option automatically on SMP systems. ) Say N if you want to disable CPU hotplug. config ARCH_SPARSEMEM_ENABLE bool "Sparse Memory Support" depends on SMP select SPARSEMEM_VMEMMAP_ENABLE config ARCH_DISCONTIGMEM_ENABLE bool "Discontiguous Memory Support" depends on SMP help Say Y to support efficient handling of discontiguous physical memory, for architectures which are either NUMA (Non-Uniform Memory Access) or have huge holes in the physical address space for other reasons. See for more. config NUMA bool "NUMA Support" depends on SMP && !FLATMEM help Say Y to compile the kernel to support NUMA (Non-Uniform Memory Access). This option is for configuring high-end multiprocessor server machines. If in doubt, say N. config USE_PERCPU_NUMA_NODE_ID def_bool y depends on NUMA config NODES_SHIFT int default "7" depends on NEED_MULTIPLE_NODES config RELOCATABLE bool "Relocatable kernel" help This builds a kernel image that retains relocation information so it can be loaded someplace besides the default 1MB. The relocations make the kernel binary about 15% larger, but are discarded at runtime config RELOCATION_TABLE_SIZE hex "Relocation table size" depends on RELOCATABLE range 0x0 0x01000000 default "0x80000" help A table of relocation data will be appended to the kernel binary and parsed at boot to fix up the relocated kernel. This option allows the amount of space reserved for the table to be adjusted, although the default of 1Mb should be ok in most cases. The build will fail and a valid size suggested if this is too small. If unsure, leave at the default value. config RANDOMIZE_BASE bool "Randomize the address of the kernel image" depends on RELOCATABLE help Randomizes the physical and virtual address at which the kernel image is loaded, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals. Entropy is generated using any coprocessor 0 registers available. The kernel will be offset by up to RANDOMIZE_BASE_MAX_OFFSET. If unsure, say N. config RANDOMIZE_BASE_MAX_OFFSET hex "Maximum kASLR offset" if EXPERT depends on RANDOMIZE_BASE range 0x0 0x20000000 default "0x10000000" help When kASLR is active, this provides the maximum offset that will be applied to the kernel image. It should be set according to the amount of physical RAM available in the target system minus PHYSICAL_START and must be a power of 2. This is limited by the size of KTEXT space, 512Mb. The default is 256MB. config HZ int "HZ of the short timer" default 500 source "drivers/pci/Kconfig" source "drivers/eisa/Kconfig" source "drivers/pcmcia/Kconfig" source "fs/Kconfig.binfmt" source "arch/sw_64/lib/Kconfig" endmenu menu "Boot options" config SW64_IRQ_CHIP bool config USE_OF bool "Flattened Device Tree support" select GENERIC_IRQ_CHIP select IRQ_DOMAIN select SW64_IRQ_CHIP select OF help Include support for flattened device tree machine descriptions. config SW64_BUILTIN_DTB bool "Embed DTB in kernel image" depends on OF default n help Embeds a device tree binary in the kernel image. config SW64_BUILTIN_DTB_NAME string "Built in DTB" depends on SW64_BUILTIN_DTB help Set the name of the DTB to embed, leave blank to pick one automatically based on kernel configuration. config EFI bool "UEFI runtime support" select UCS2_STRING select EFI_RUNTIME_WRAPPERS default y help This option provides support for runtime services provided by UEFI firmware (such as non-volatile variables, realtime clock, and platform reset). A UEFI stub is also provided to allow the kernel to be booted as an EFI application. This is only useful on systems that have UEFI firmware. config DMI bool "Enable support for SMBIOS (DMI) tables" depends on EFI default y help This enables SMBIOS/DMI feature for systems. This option is only useful on systems that have UEFI firmware. However, even with this option, the resultant kernel should continue to boot on existing non-UEFI platforms. NOTE: This does *NOT* enable or encourage the use of DMI quirks, i.e., the practice of identifying the platform via DMI to decide whether certain workarounds for buggy hardware and/or firmware need to be enabled. This would require the DMI subsystem to be enabled much earlier than we do on ARM, which is non-trivial. config CMDLINE_BOOL bool "Built-in kernel command line" help Allow for specifying boot arguments to the kernel at build time. On some systems (e.g. embedded ones), it is necessary or convenient to provide some or all of the kernel boot arguments with the kernel itself (that is, to not rely on the boot loader to provide them.) To compile command line arguments into the kernel, set this option to 'Y', then fill in the boot arguments in CONFIG_CMDLINE. Systems with fully functional boot loaders (i.e. non-embedded) should leave this option set to 'N'. config CMDLINE string "Built-in kernel command string" depends on CMDLINE_BOOL default "" help Enter arguments here that should be compiled into the kernel image and used at boot time. If the boot loader provides a command line at boot time, it is appended to this string to form the full kernel command line, when the system boots. However, you can use the CONFIG_CMDLINE_OVERRIDE option to change this behavior. In most cases, the command line (whether built-in or provided by the boot loader) should specify the device for the root file system. config CMDLINE_OVERRIDE bool "Built-in command line overrides boot loader arguments" depends on CMDLINE_BOOL help Set this option to 'Y' to have the kernel ignore the boot loader command line, and use ONLY the built-in command line. This is used to work around broken boot loaders. This should be set to 'N' under normal conditions. config FORCE_MAX_ZONEORDER int default "16" if (HUGETLB_PAGE) default "11" help The kernel memory allocator divides physically contiguous memory blocks into "zones", where each zone is a power of two number of pages. This option selects the largest power of two that the kernel keeps in the memory allocator. If you need to allocate very large blocks of physically contiguous memory, then you may need to increase this value. This config option is actually maximum order plus one. For example, a value of 11 means that the largest free memory block is 2^10 pages. We make sure that we can allocate upto a HugePage size for each configuration. Hence we have : MAX_ORDER = (PMD_SHIFT - PAGE_SHIFT) + 1 => PAGE_SHIFT - 2 endmenu source "drivers/firmware/Kconfig" menu "Power management options" source "kernel/power/Kconfig" source "drivers/acpi/Kconfig" config ARCH_SUSPEND_POSSIBLE depends on SW64 def_bool y config ARCH_HIBERNATION_POSSIBLE depends on SW64 def_bool y config SW64_SUSPEND_DEEPSLEEP_NONBOOT_CORE depends on SUSPEND bool "SW64 non bootcore suspend into deep sleep mode" default n config SW64_SUSPEND_DEEPSLEEP_BOOTCORE depends on SUSPEND bool "SW64 bootcore suspend into deep sleep mode" default n source "drivers/cpuidle/Kconfig" source "drivers/idle/Kconfig" endmenu # DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig # but we also need it if VGA_HOSE is set config DUMMY_CONSOLE bool depends on VGA_HOSE default y source "arch/sw_64/kvm/Kconfig"