summaryrefslogtreecommitdiff
path: root/common/Kconfig
AgeCommit message (Collapse)AuthorFilesLines
2022-09-29event: Fix a typo in the EVENT helpSimon Glass1-1/+1
Fix the help message. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-24console: Implement flush() functionPali Rohár1-0/+6
On certain places it is required to flush output print buffers to ensure that text strings were sent to console or serial devices. For example when printing message that U-Boot is going to boot kernel or when U-Boot is going to change baudrate of terminal device. Therefore introduce a new flush() and fflush() functions into console code. These functions will call .flush callback of associated stdio_dev device. As this function may increase U-Boot side, allow to compile U-Boot without this function. For this purpose there is a new config CONSOLE_FLUSH_SUPPORT which is enabled by default and can be disabled. It is a good idea to have this option enabled for all boards which have enough space for it. When option is disabled when U-Boot defines just empty static inline function fflush() to avoid ifdefs in other code. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-19Merge branch 'master' into nextTom Rini1-0/+14
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-09-13cyclic: Add basic support for cyclic function execution infrastrutureStefan Roese1-0/+20
Add the basic infrastructure to periodically execute code, e.g. all 100ms. Examples for such functions might be LED blinking etc. The functions that are hooked into this cyclic list should be small timewise as otherwise the execution of the other code that relies on a high frequent polling (e.g. UART rx char ready check) might be delayed too much. This patch also adds the Kconfig option CONFIG_CYCLIC_MAX_CPU_TIME_US, which configures the max allowed time for such a cyclic function. If it's execution time exceeds this time, this cyclic function will get removed from the cyclic list. How is this cyclic functionality executed? The following patch integrates the main function responsible for calling all registered cyclic functions cyclic_run() into the common WATCHDOG_RESET macro. This guarantees that cyclic_run() is executed very often, which is necessary for the cyclic functions to get scheduled and executed at their configured periods. This cyclic infrastructure will be used by a board specific function on the NIC23 MIPS Octeon board, which needs to check periodically, if a PCIe FLR has occurred. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-12fdt_support: add optional board_rng_seed() hookRasmus Villemoes1-0/+14
A recurring theme on LKML is the boot process deadlocking due to some process blocking waiting for random numbers, while the kernel's Cryptographic Random Number Generator (crng) is not initalized yet, but that very blocking means no activity happens that would generate the entropy necessary to finalize seeding the crng. This is not a problem on boards that have a good hwrng (when the kernel is configured to trust it), whether in the CPU or in a TPM or elsewhere. However, that's far from all boards out there. Moreover, there are consumers in the kernel that try to obtain random numbers very early, before the kernel has had any chance to initialize any hwrng or other peripherals. Allow a board to provide a board_rng_seed() function, which is responsible for providing a value to be put into the rng-seed property under the /chosen node. The board code is responsible for how to actually obtain those bytes. - One possibility is for the board to load a seed "file" from somewhere (it need not be a file in a filesystem of course), and then ensure that that the same seed file does not get used on subsequent boots. * One way to do that is to delete the file, or otherwise mark it as invalid, then rely on userspace to create a new one, and living with the possibility of not finding a seed file during some boots. * Another is to use the scheme used by systemd-boot and create a new seed file immediately, but in a way that the seed passed to the kernel and the new (i.e. next) seed cannot be deduced from each other, see the explanation at https://lore.kernel.org/lkml/20190929090512.GB13049@gardel-login/ and the current code at https://github.com/systemd/systemd/blob/main/src/boot/efi/random-seed.c - The board may have an hwrng from which some bytes can be read; while the kernel can also do that, doing it in U-Boot and providing a seed ensures that even very early users in the kernel get good random numbers. - If the board has a sensor of some sort (temperature, humidity, GPS, RTC, whatever), mixing in a reading of that doesn't hurt. - etc. etc. These can of course be combined. The rng-seed property is mixed into the pool used by the linux kernel's CRNG very early during boot. Whether it then actually contributes towards the kernel considering the CRNG initialized depends on whether the kernel has been configured with CONFIG_RANDOM_TRUST_BOOTLOADER (nowadays overridable via the random.trust_bootloader command line option). But that's for the BSP developer to ultimately decide. So, if the board needs to have all that logic, why not also just have it do the actual population of /chosen/rng-seed in ft_board_setup(), which is not that many extra lines of code? I considered that, but decided handling this logically belongs in fdt_chosen(). Also, apart from saving the board code from the few lines of boilerplate, doing it in ft_board_setup() is too late for at least some use cases. For example, I want to allow the board logic to decide ok, let's pass back this buffer and use that as seed, but also let's set random.trust_bootloader=n so no entropy is credited. This requires the rng-seed handling to happen before bootargs handling. For example, during the very first boot, the board might not have a proper seed file, but the board could still return (a hash of) some CPU serial# or whatnot, so that at least no two boards ever get the same seed - the kernel always mixes in the value passed in rng-seed, but if it is not "trusted", the kernel would still go through the same motions as it would if no rng-seed was passed before considering its CRNG initialized. I.e., by returning that unique-to-this-board value and setting random.trust_bootloader=n, the board would be no worse off than if board_rng_seed() returned nothing at all. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2022-09-02Convert CONFIG_SYS_I2C_EEPROM_CCID et al to KconfigTom Rini1-0/+21
This converts the following to Kconfig: CONFIG_SYS_I2C_EEPROM_CCID CONFIG_SYS_I2C_EEPROM_NXID CONFIG_SYS_EEPROM_BUS_NUM Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-07spl: Ensure all SPL symbols in Kconfig have some SPL dependencyTom Rini1-1/+2
Tighten up symbol dependencies in a number of places. Ensure that a SPL specific option has at least a direct dependency on SPL. In places where it's clear that we depend on something more specific, use that dependency instead. This means in a very small number of places we can drop redundant dependencies. Reported-by: Pali Rohár <pali@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-29vpl: Ensure all VPL symbols in Kconfig have some VPL dependencyTom Rini1-10/+2
Tighten up symbol dependencies in a number of places. Ensure that a VPL specific option has at least a direct dependency on VPL. In places where it's clear that we depend on something more specific, use that dependency instead. Reported-by: Pali Rohár <pali@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-29tpl: Ensure all TPL symbols in Kconfig have some TPL dependencyTom Rini1-1/+2
Tighten up symbol dependencies in a number of places. Ensure that a TPL specific option has at least a direct dependency on TPL. In places where it's clear that we depend on something more specific, use that dependency instead. Reported-by: Pali Rohár <pali@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06Convert CONFIG_SYS_BOOTPARAMS_LEN to KconfigTom Rini1-0/+12
This converts the following to Kconfig: CONFIG_SYS_BOOTPARAMS_LEN Signed-off-by: Tom Rini <trini@konsulko.com>
2022-05-02vpl: Add Kconfig options for VPLSimon Glass1-0/+67
Add VPL versions of commonly used Kconfig options. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-05-02bloblist: Correct Kconfig dependenciesSimon Glass1-2/+2
This feature is not available in SPL unless common/ and lib/ are built. Update the Kconfig to avoid build errors. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-01Convert CONFIG_CLOCKS to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_CLOCKS Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-25Convert CONFIG_RESET_PHY_R to KconfigTom Rini1-0/+6
This converts the following to Kconfig: CONFIG_RESET_PHY_R Cc: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-10event: Convert misc_init_f() to use eventsSimon Glass1-6/+0
This hook can be implmented using events, for the three boards that actually use it. Add the event type and event handlers. Drop CONFIG_MISC_INIT_F since we can just use CONFIG_EVENT to control this. Since sandbox always enables CONFIG_EVENT, we can drop the defconfig lines there too. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-10event: Add basic support for eventsSimon Glass1-0/+31
Add a way to create and dispatch events without needing to allocate memory. Also add a way to 'spy' on events, thus allowing 'hooks' to be created. Use a linker list for static events, which we can use to replace functions like arch_cpu_init_f(). Allow an EVENT_DEBUG option which makes it easier to see what is going on at runtime, but uses more code space. Dynamic events allow the creation of a spy at runtime. This is not always necessary, but can be enabled with EVENT_DYNAMIC if needed. A 'test' event is the only option for now. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-04Convert CONFIG_BOARD_POSTCLK_INIT to KconfigTom Rini1-0/+6
This converts the following to Kconfig: CONFIG_BOARD_POSTCLK_INIT Signed-off-by: Tom Rini <trini@konsulko.com>
2022-01-13bloblist: Refactor Kconfig to support alloc or fixedSimon Glass1-9/+82
At present we do support allocating the bloblist but the Kconfig is a bit strange, since we still have to specify an address in that case. Partly this is because it is a pain to have CONFIG options that disappears when its dependency is enabled. It means that we must have #ifdefs in the code, either in the C code or header file. Make use of IF_ENABLED_INT() and its friend to solve that problem, so we can separate out the location of bloblist into a choice. Put the address and size into variables so we can log the result. Add the options for SPL as well, so we can use CONFIG_IS_ENABLED(). Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-13bloblist: Use 'phase' consistently for bloblistsSimon Glass1-3/+3
We typically refer to the different U-Boot builds that a board runs through as phases. This avoids confusion with the word 'stage' which is used with bootstage, for example. Fix up some bloblist Kconfig help which uses the wrong term. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-28Finish converting CONFIG_SYS_FSL_CLK to KconfigTom Rini1-0/+9
This converts the following to Kconfig: CONFIG_SYS_FSL_CLK We move the exiting option to common/Kconfig near the other options to control the contents of board_init_f() and note that this is a legacy option. We further restrict this to where the call is going to be non-empty, for the SoCs that had only been using this for some MMC-related clocks. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-12-05bloblist: Support allocating the bloblistSimon Glass1-2/+13
Typically the bloblist is positioned at a fixed address in memory until relocation. This is convenient when it is set up in SPL or before relocation. But for EFI we want to set it up only when U-Boot proper is running. Add a way to allocate it using malloc() and update the documentation to cover this aspect of bloblist. Note there are no tests of this feature at present, nor any direct testing of bloblist_init(). This can be added, e.g. by making this option controllable at runtime. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-30Convert CONFIG_LCD_DT_SIMPLEFB to KconfigPatrick Delaunay1-0/+9
This converts the following to Kconfig: CONFIG_LCD_DT_SIMPLEFB This patch also renames this config to CONFIG_FDT_SIMPLEFB as the code in common/lcd_simplefb.c support CONFIG_LCD and CONFIG_VIDEO. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Matthias Brugger <mbrugger@suse.com>
2021-11-29common: Allow a smaller console-recording pre-relocSimon Glass1-0/+10
Before relocation there is generally not as much available memory and not that much console output. At present the console-output buffer is the same side before and after relocation. Add a separate Kconfig option to remove this limitation. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-12Create a new boot/ directorySimon Glass1-2/+0
Quite a lot of the code in common/relates to booting and images. Before adding more it seems like a good time to move the code into its own directory. Most files with 'boot' or 'image' in them are moved, except: - autoboot.c which relates to U-Boot automatically running a script - bootstage.c which relates to U-Boot timing Drop the removal of boot* files from the output directory, since this interfers with the symlinks created by tools and there does not appear to be any such file from my brief testing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com>
2021-10-09common: Kconfig: use 'vidconsole' name instead of old 'video'Anatolij Gustschin1-2/+2
After DM_VIDEO conversion the 'vidconsole' is the correct name for the frame buffer console. 'video' will not work, so update the description of the config option. Signed-off-by: Anatolij Gustschin <agust@denx.de>
2021-09-16Merge tag 'v2021.10-rc4' into nextTom Rini1-1/+0
Prepare v2021.10-rc4 Signed-off-by: Tom Rini <trini@konsulko.com> # gpg: Signature made Tue 14 Sep 2021 06:58:32 PM EDT # gpg: using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C # gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate] # Conflicts: # board/Arcturus/ucp1020/spl.c # cmd/mvebu/Kconfig # common/Kconfig.boot # common/image-fit.c # configs/UCP1020_defconfig # configs/sifive_unmatched_defconfig # drivers/pci/Kconfig # include/configs/UCP1020.h # include/configs/sifive-unmatched.h # lib/Makefile # scripts/config_whitelist.txt
2021-09-14pci: Drop DM_PCISimon Glass1-1/+0
This option has not effect now. Drop it, using PCI instead where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-01Kconfig: Remove all default n/no optionsMichal Simek1-5/+0
default n/no doesn't need to be specified. It is default option anyway. Signed-off-by: Michal Simek <michal.simek@xilinx.com> [trini: Rework FSP_USE_UPD portion] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-08-30Convert CONFIG_ID_EEPROM to KconfigTom Rini1-0/+6
This converts the following to Kconfig: CONFIG_ID_EEPROM Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-21log: Allow padding of the function nameSimon Glass1-0/+8
At present when function names are logged, the output is a little hard to read since every function is a different length. Add a way to pad the names so that the log messages line up vertically. This doesn't work if the function name is very long, but it makes a big difference in most cases. Use 20 characters as a default since this covers the vast majority of functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21sandbox: Adjust the bloblist default addressSimon Glass1-1/+1
Move this down to provide more space for the bloblist. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-20Add support for stack-protectorJoel Peshkin1-0/+17
Add support for stack protector for UBOOT, SPL, and TPL as well as new pytest for stackprotector Signed-off-by: Joel Peshkin <joel.peshkin@broadcom.com> Adjust UEFI build flags. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-06Convert CONFIG_MISC_INIT_F to KconfigSimon Glass1-0/+6
This converts the following to Kconfig: CONFIG_MISC_INIT_F Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-03-13common: SCP03 control (enable and provision of keys)Jorge Ramirez-Ortiz1-0/+8
This Trusted Application allows enabling SCP03 as well as provisioning the keys on TEE controlled secure element (ie, NXP SE050). All the information flowing on buses (ie I2C) between the processor and the secure element must be encrypted. Secure elements are pre-provisioned with a set of keys known to the user so that the secure channel protocol (encryption) can be enforced on the first boot. This situation is however unsafe since the keys are publically available. For example, in the case of the NXP SE050, these keys would be available in the OP-TEE source tree [2] and of course in the documentation corresponding to the part. To address that, users are required to rotate/provision those keys (ie, generate new keys and write them in the secure element's persistent memory). For information on SCP03, check the Global Platform HomePage and google for that term [1] [1] globalplatform.org [2] https://github.com/OP-TEE/optee_os/ check: core/drivers/crypto/se050/adaptors/utils/scp_config.c Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-01-29avb: AVB_VERIFY depends on MMCHeinrich Schuchardt1-0/+1
AVB Verified Boot uses functions related to MMC. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
2021-01-28bloblist: Support relocating to a larger spaceSimon Glass1-0/+10
Typically in TPL/SPL the bloblist is quite small. But U-Boot proper may want to add a lot more to it, such as ACPI tables. Add a way to expand the bloblist by relocating it in U-Boot proper, along with the other relocation activities. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-15common: Kconfig: Introduce CONFIG_CONSOLE_RECORD_INIT_FOvidiu Panait1-0/+8
Currently, the following #ifdef construct is used to check whether to run console_record_init() during pre-relocation init: defined(CONFIG_CONSOLE_RECORD) && CONFIG_VAL(SYS_MALLOC_F_LEN) Introduce CONFIG_CONSOLE_RECORD_INIT_F Kconfig option to get rid of the complex ifdef check. Also, use IS_ENABLED() instead of #ifdef. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30common: update: add a generic interface for FIT imageAKASHI Takahiro1-0/+15
The main purpose of this patch is to separate a generic interface for updating firmware using DFU drivers from "auto-update" via tftp. This function will also be used in implementing UEFI capsule update in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-09Kconfig: Move BOARD_TYPES under init optionsSimon Glass1-8/+8
This actually relates to something displayed on start-up, so move it into that menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move BOUNCE_BUFFER under driver optionsSimon Glass1-11/+0
This option does not belong at the top level. Move it under generic driver options. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move VERSION_VARIABLE under environmentSimon Glass1-10/+0
This relates to the environment so should not be at the top level. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: MISC_INIT_R and BOARD_LATE_INIT -> start-up hooksSimon Glass1-17/+17
These are start-up hooks so put them under that menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move startup hooks under init optionsSimon Glass1-31/+31
These hooks relate to U-Boot init so move them under that menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Create a new 'init options' menuSimon Glass1-0/+4
There are quite a few options at the top level relating to U-Boot init. Move them into their own menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move DEFAULT_FDT_FILE under boot optionsSimon Glass1-5/+0
This relates to booting since it is the default devicetree provided to Linux. Move it under the 'boot options' menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move SUPPORT_RAW_INITRD under boot optionsSimon Glass1-8/+0
This relates to booting, so move it under the 'boot images' menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move misc boot options under 'boot options'Simon Glass1-53/+0
There are a number of miscellaneous boot images at the top level of the kconfig menu. Move these into the 'boot options' menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move CONFIG_BOOTDELAY under autoboot optionsSimon Glass1-16/+0
This option relates to autoboot, so move it there. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move boot media under boot optionsSimon Glass1-63/+0
This relates to booting, so move it under the boot menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move boot timing under boot optionsSimon Glass1-291/+0
This relates to booting, so move it under the boot menu. Signed-off-by: Simon Glass <sjg@chromium.org>