/ payloads / libpayload / Kconfig
Kconfig
  1  ## SPDX-License-Identifier: GPL-2.0-only
  2  
  3  ##
  4  ##
  5  ## Copyright (C) 2008 Advanced Micro Devices, Inc.
  6  ## Copyright (C) 2008 coresystems GmbH
  7  ##
  8  ## Redistribution and use in source and binary forms, with or without
  9  ## modification, are permitted provided that the following conditions
 10  ## are met:
 11  ## 1. Redistributions of source code must retain the above copyright
 12  ##    notice, this list of conditions and the following disclaimer.
 13  ## 2. Redistributions in binary form must reproduce the above copyright
 14  ##    notice, this list of conditions and the following disclaimer in the
 15  ##    documentation and/or other materials provided with the distribution.
 16  ## 3. The name of the author may not be used to endorse or promote products
 17  ##    derived from this software without specific prior written permission.
 18  ##
 19  ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 20  ## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 21  ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 22  ## ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 23  ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 24  ## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 25  ## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 26  ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 27  ## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 28  ## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 29  ## SUCH DAMAGE.
 30  ##
 31  
 32  mainmenu "Libpayload Configuration"
 33  
 34  menu "Generic Options"
 35  
 36  config GPL
 37  	bool "GPLv2-licensed Options"
 38  	default y if CHROMEOS
 39  	default n
 40  	help
 41  	  Prompt for options that will build code licensed under the GNU General
 42  	  Public License (version 2). This will subject the whole payload to the
 43  	  terms of this license (including its provision to release all sources,
 44  	  please see the LICENSE_GPL file for details).
 45  
 46  config EXPERIMENTAL
 47  	bool "Experimental Options"
 48  	default n
 49  	help
 50  	  Prompt for experimental functionality. Attention: This is not likely
 51  	  to work without problems
 52  
 53  config DEVELOPER
 54  	bool "Developer Options"
 55  	default n
 56  	help
 57  	  Prompt for developer options. These options are only interesting for
 58  	  libpayload developers.
 59  
 60  config CHROMEOS
 61  	bool "ChromeOS Options"
 62  	default n
 63  	help
 64  	  Select configuration defaults appropriate for ChromeOS boards.
 65  
 66  choice
 67  	prompt "Compiler to use"
 68  	default COMPILER_GCC
 69  	help
 70  	  This option allows you to select the compiler.
 71  
 72  config COMPILER_GCC
 73  	bool "GCC"
 74  	help
 75  	  Use the GNU Compiler Collection (GCC).
 76  
 77  config COMPILER_LLVM_CLANG
 78  	bool "LLVM/clang"
 79  	help
 80  	  Use LLVM/clang.
 81  
 82  endchoice
 83  
 84  config LTO
 85  	bool "Use link time optimization (LTO)"
 86  	default n
 87  	help
 88  	  Compile with link time optimization. This can often decrease the
 89  	  final binary size, but may increase compilation time.
 90  
 91  config REMOTEGDB
 92  	bool "Remote GDB stub"
 93  	default n
 94  	depends on GPL
 95  	help
 96  	  Enable Remote GDB debugging support.
 97  
 98  config MEMMAP_RAM_ONLY
 99  	bool "Only consider RAM entries in memory map for further processing"
100  	default n
101  
102  endmenu
103  
104  menu "Architecture Options"
105  
106  choice
107          prompt "Target Architecture"
108          default ARCH_X86_32
109  
110  config ARCH_ARM
111          bool "ARM"
112          help
113            Support the ARM architecture
114  
115  config ARCH_X86_32
116          bool "x86_32"
117          help
118            Support the x86_32 architecture
119  
120  config ARCH_X86_64
121          bool "x86_64"
122          help
123            Support the x86_64 architecture
124  
125  config ARCH_ARM64
126          bool "ARM64"
127          help
128            Support the ARM64 architecture
129  
130  config ARCH_MOCK
131          bool "Mock architecture (for unit tests)"
132          help
133            This enables the mock architecture (for unit tests) that is intended
134            to be used for testing purposes, to either test payloads or libpayload itself.
135            It provides necessary headers, but requires mocking (providing implementation
136            for) arch-specific functions.
137  
138  endchoice
139  
140  config ARCH_X86
141  	bool
142  	default y if ARCH_X86_32 || ARCH_X86_64
143  	help
144  	  Support the x86 architecture
145  
146  config MULTIBOOT
147  	bool "Multiboot header support"
148  	depends on ARCH_X86
149  	default y if !CHROMEOS
150  
151  config HEAP_SIZE
152  	int "Heap size"
153  	default 131072
154  	help
155  	  This is the heap size (malloc'able size) available
156  	  to the payload.
157  
158  	  If unsure, set to 131072 (128K)
159  
160  config STACK_SIZE
161  	int "Stack size"
162  	default 16384
163  	help
164  	  This is the stack size available to the payload.
165  
166  	  If unsure, set to 16384 (16K)
167  
168  config BASE_ADDRESS
169  	hex "Base address"
170  	default 0x04000000 if ARCH_ARM
171  	default 0x80100000 if ARCH_ARM64
172  	default 0x00100000 if ARCH_X86
173  	default 0x00000000 if ARCH_MOCK
174  	help
175  	  This is the base address for the payload.
176  
177  	  If unsure, set to 0x00100000 on x86,
178  	  0x04000000 on ARM or 0x80100000 on ARM64.
179  
180  endmenu
181  
182  menu "Standard Libraries"
183  
184  config LIBC
185  	bool "Enable C library support"
186  	default y
187  
188  config CURSES
189  	bool "Build a curses library"
190  	default y if !CHROMEOS
191  
192  choice
193  	prompt "Curses implementation"
194  	default PDCURSES
195  	depends on CURSES
196  
197  config TINYCURSES
198  	bool "TinyCurses"
199  	help
200  	  TinyCurses was the first curses implementation for libpayload.
201  	  It features low memory consumption, static allocation of larger
202  	  data structures (so few or no memory allocation calls) and a
203  	  reduced feature set.
204  
205  config PDCURSES
206  	bool "PDCurses"
207  	help
208  	  libpayload's PDCurses port provides a full features curses
209  	  implementation, including libpanel, libmenu and libform (which
210  	  are taken from ncurses).
211  	  It requires more system resources, in particularily heap memory.
212  
213  endchoice
214  
215  source "libcbfs/Kconfig"
216  
217  config LZMA
218  	bool "LZMA decoder"
219  	default y
220  	help
221  	  LZMA decoder implementation, usable eg. by CBFS,
222  	  but also externally.
223  
224  config LZ4
225  	bool "LZ4 decoder"
226  	default y
227  	help
228  	  Decoder implementation for the LZ4 compression algorithm.
229  	  Adds standalone functions (CBFS support coming soon).
230  
231  source "vboot/Kconfig"
232  
233  endmenu
234  
235  menu "Console Options"
236  
237  config SKIP_CONSOLE_INIT
238  	bool "Skip initializing the consoles at startup"
239  	default y if CHROMEOS
240  	default n
241  	help
242  	  Normally, libpayload will initialize console input/output on startup
243  	  before the payload itself gets control. This option disables that
244  	  behavior and leaves console initialization up to the payload.
245  
246  config CBMEM_CONSOLE
247  	bool "Send output to the in memory CBMEM console"
248  	default y
249  
250  config SERIAL_CONSOLE
251  	bool "See output on the serial port console"
252  	default y
253  
254  config 8250_SERIAL_CONSOLE
255  	bool "8250-compatible serial port driver (including IO and MMIO)"
256  	depends on SERIAL_CONSOLE
257  	default y if ARCH_X86
258  
259  config S5P_SERIAL_CONSOLE
260  	bool "Exynos SOC, S5P compatible serial port driver"
261  	depends on SERIAL_CONSOLE
262  	default n
263  
264  config IPQ806X_SERIAL_CONSOLE
265  	bool "IPQ806x SOC compatible serial port driver"
266  	depends on SERIAL_CONSOLE
267  	default n
268  
269  config IPQ40XX_SERIAL_CONSOLE
270  	bool "IPQ40xx SOC compatible serial port driver"
271  	depends on SERIAL_CONSOLE
272  	default n
273  
274  config QCS405_SERIAL_CONSOLE
275  	bool "QCS405 SOC compatible serial port driver"
276  	depends on SERIAL_CONSOLE
277  	default n
278  
279  config QUALCOMM_QUPV3_SERIAL_CONSOLE
280  	bool "Qualcomm QUPV3 serial port driver"
281  	depends on SERIAL_CONSOLE
282  	default n
283  
284  config PL011_SERIAL_CONSOLE
285  	bool "PL011 compatible serial port driver"
286  	depends on 8250_SERIAL_CONSOLE
287  	default n
288  
289  config SERIAL_IOBASE
290  	## This default is currently not used on non-x86 systems.
291  	hex "Default I/O base for the serial port (default 0x3f8)"
292  	depends on SERIAL_CONSOLE && ARCH_X86
293  	default 0x3f8
294  
295  config SERIAL_SET_SPEED
296  	bool "Override the serial console baud rate"
297  	default n
298  	depends on SERIAL_CONSOLE
299  
300  config SERIAL_BAUD_RATE
301  	int "Serial console baud rate (default 115200)"
302  	depends on SERIAL_SET_SPEED
303  	default 115200
304  
305  config SERIAL_ACS_FALLBACK
306  	bool "Use plain ASCII characters for ACS"
307  	default n
308  	depends on SERIAL_CONSOLE
309  	help
310  	  The alternate character set (ACS) is used for drawing lines and
311  	  displaying a couple of other special graphics characters.  The
312  	  ACS characters generally look good on screen, but can be difficult
313  	  to cut and paste from a terminal window to a text editor.
314  
315  	  Say 'y' here if you want to always use plain ASCII characters to
316  	  approximate the appearance of ACS characters on the serial port
317  	  console.
318  
319  config VIDEO_CONSOLE
320  	bool "See output on a video console"
321  	default y
322  
323  config VGA_VIDEO_CONSOLE
324  	bool "VGA video console driver"
325  	depends on ARCH_X86 && VIDEO_CONSOLE
326  	default y if !CHROMEOS
327  
328  config GEODELX_VIDEO_CONSOLE
329  	bool "Geode LX video console driver"
330  	depends on ARCH_X86 && VIDEO_CONSOLE
331  	default n
332  
333  config COREBOOT_VIDEO_CONSOLE
334  	bool "coreboot video console driver"
335  	depends on VIDEO_CONSOLE && !GEODELX_VIDEO_CONSOLE
336  	default y if CHROMEOS
337  	default n
338  	help
339  	  Say Y here if coreboot switched to a graphics mode and
340  	  your payload wants to use it.
341  
342  config COREBOOT_VIDEO_CENTERED
343  	bool "Center a classic 80x25 console on bigger screens"
344  	depends on COREBOOT_VIDEO_CONSOLE
345  	help
346  	  Say 'y' here if your payload is hardcoded to a 80x25 console. Otherwise
347  	  its output would look squeezed into the upper-left corner of the screen.
348  
349  config FONT_SCALE_FACTOR
350  	int "Scale factor for the included font"
351  	depends on GEODELX_VIDEO_CONSOLE || COREBOOT_VIDEO_CONSOLE
352  	default 0
353  	help
354  	  By default (value of 0), the scale factor is automatically
355  	  calculated to ensure at least 130 columns (when possible).
356  
357  config CBGFX_FAST_RESAMPLE
358  	bool "CBGFX: use faster (less pretty) image scaling"
359  	default n
360  	help
361  	  When payloads use the CBGFX library to draw .BMPs on the screen,
362  	  they will be resampled with an anti-aliasing filter to scale to the
363  	  requested output size. The default implementation should normally be
364  	  fast enough, but if desired this option can make it about 50-100%
365  	  faster at the cost of quality. (It changes the 'a' parameter in the
366  	  Lanczos resampling algorithm from 3 to 2.)
367  
368  	  Only affects .BMPs that aren't already provided at the right size.
369  
370  config PC_I8042
371  	bool "A common PC i8042 driver"
372  	default y if PC_KEYBOARD || PC_MOUSE
373  	default n
374  	help
375  	  To be used by PC_KEYBOARD and PC_MOUSE.
376  
377  config PC_MOUSE
378  	bool "Allow input from a PC mouse"
379  	default n if CHROMEOS
380  	default y if ARCH_X86 # uses IO
381  	default n
382  	help
383  	  PS/2 mouse driver on top of PC_I8042.
384  
385  config PC_KEYBOARD
386  	bool "Allow input from a PC keyboard"
387  	default y if ARCH_X86 # uses IO
388  	default n
389  
390  config PC_KEYBOARD_LAYOUT_US
391  	bool "English (US) keyboard layout"
392  	depends on PC_KEYBOARD
393  	default y
394  
395  config PC_KEYBOARD_LAYOUT_DE
396  	bool "German keyboard layout"
397  	depends on PC_KEYBOARD
398  	default n
399  
400  config PC_KEYBOARD_TRANSLATION
401  	bool "Enable or Disable translation in PC keyboard set 2 on exit"
402  	depends on PC_KEYBOARD
403  	default y
404  
405  endmenu
406  
407  menu "Drivers"
408  
409  config PCI
410  	bool "Support for PCI devices"
411  	default y if ARCH_X86
412  	default n
413  
414  config PCI_IO_OPS
415  	bool "Support for PCI devices with port IO"
416  	depends on PCI && IO_ADDRESS_SPACE
417  	default y if ARCH_X86
418  	default n
419  
420  config PCIE_MEDIATEK
421  	bool "Support for PCIe devices on MediaTek platforms"
422  	depends on PCI && !PCI_IO_OPS
423  	default n
424  
425  config PCIE_QCOM
426  	bool "Support for PCIe devices on Qualcomm platforms"
427  	depends on PCI && !PCI_IO_OPS
428  	default n
429  
430  config NVRAM
431  	bool "Support for reading/writing NVRAM bytes"
432  	depends on ARCH_X86 # for now
433  	default y
434  
435  config MOUSE_CURSOR
436  	bool "Support for mouse cursor handling"
437  	default y if PC_MOUSE
438  	default n
439  	help
440  	  Provides a common interface for various mouse cursor drivers.
441  	  * Supports up to 32 buttons.
442  	  * Supports 3 axis mice.
443  	  * Applies simple cursor acceleration.
444  	  * Allows to set cursor acceleration and cursor speed.
445  
446  config RTC_PORT_EXTENDED_VIA
447  	bool "Extended RTC ports are 0x74/0x75"
448  	default n
449  	help
450  	  For recent chipsets with 256 NVRAM bytes, you have to access the
451  	  upper 128 bytes (128-255) using two different I/O ports,
452  	  usually 0x72/0x73.
453  
454  	  On some chipsets this can be a different set of ports, though.
455  	  The VIA VT8237R for example only recognizes the ports 0x74/0x75
456  	  for accessing the high 128 NVRAM bytes (as seems to be the case for
457  	  multiple VIA chipsets).
458  
459  	  If you want to read or write CMOS bytes on computers with one of
460  	  these chipsets, say 'y' here.
461  
462  config SPEAKER
463  	bool "Support for PC speaker"
464  	depends on ARCH_X86
465  	default y if !CHROMEOS
466  
467  source "drivers/timer/Kconfig"
468  source "drivers/storage/Kconfig"
469  source "drivers/usb/Kconfig"
470  
471  endmenu
472  
473  menu "Debugging"
474  	depends on DEVELOPER
475  
476  config DEBUG_MALLOC
477  	bool "Debug memory allocator"
478  	default n
479  	help
480  	  Select this option if you want to debug the memory allocator. This
481  	  option logs all uses of the following functions:
482  
483  	    void free(void *ptr);
484  	    void *malloc(size_t size);
485  	    void *calloc(size_t nmemb, size_t size);
486  	    void *realloc(void *ptr, size_t size);
487  	    void *memalign(size_t align, size_t size);
488  
489  	  Say N here unless you are debugging memory allocator problems.
490  
491  endmenu
492  
493  config BIG_ENDIAN
494  	default n
495  	bool
496  
497  config LITTLE_ENDIAN
498  	default n
499  	bool
500  
501  config IO_ADDRESS_SPACE
502  	default n
503  	bool
504  	help
505  	  This option is turned on if the target system has a separate
506  	  IO address space. This is typically only the case on x86.
507  
508  source "arch/arm/Kconfig"
509  source "arch/arm64/Kconfig"
510  source "arch/x86/Kconfig"
511  source "arch/mock/Kconfig"