aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-08-05Merge tag 'tpm-030822' of https://source.denx.de/u-boot/custodians/u-boot-tpmWIP/05Aug2022Tom Rini13-82/+213
EFI_RNG_PROTOCOL with a TPM
2022-08-04configs: Resync with savedefconfigWIP/04Aug2022Tom Rini3-23/+12
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Merge branch '2022-08-04-Kconfig-migrations'Tom Rini412-1433/+758
- Further migrations to Kconfig and associated dead code removal.
2022-08-04Convert CONFIG_SYS_FSL_DDR_INTLV_256B to KconfigTom Rini26-8/+29
This converts the following to Kconfig: CONFIG_SYS_FSL_DDR_INTLV_256B Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_FSL_CORES_PER_CLUSTER to KconfigTom Rini3-7/+8
This converts the following to Kconfig: CONFIG_SYS_FSL_CORES_PER_CLUSTER As part of this, correct the dependencies on SYS_FSL_THREADS_PER_CORE. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_FSL_MEMAC et al to KconfigTom Rini44-23/+77
This converts the following to Kconfig: CONFIG_FSL_MEMAC CONFIG_SYS_MEMAC_LITTLE_ENDIAN Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_FSL_CCSR_GUR_BE et al to KconfigTom Rini8-45/+43
This converts the following to Kconfig: CONFIG_SYS_FSL_CCSR_GUR_BE CONFIG_SYS_FSL_CCSR_SCFG_BE CONFIG_SYS_FSL_ESDHC_BE CONFIG_SYS_FSL_IFC_BE CONFIG_SYS_FSL_PEX_LUT_BE CONFIG_SYS_FSL_CCSR_GUR_LE CONFIG_SYS_FSL_CCSR_SCFG_LE CONFIG_SYS_FSL_ESDHC_LE CONFIG_SYS_FSL_IFC_LE CONFIG_SYS_FSL_PEX_LUT_LE Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_FSL_CORENET to KconfigTom Rini43-51/+17
This converts the following to Kconfig: CONFIG_FSL_CORENET Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04configs: Remove a number of unreferenced CONFIG options.Tom Rini28-130/+6
There are a large number of options under CONFIG_SYS (but some of these are elsewhere, spotted while cleaning CONFIG_SYS) that are never referenced, or only used slightly later in the config file. Remove or restructure these. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_FMAN_V3 to KconfigTom Rini3-7/+8
This converts the following to Kconfig: CONFIG_SYS_FMAN_V3 Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_FLASH_QUIET_TEST to KconfigTom Rini157-31/+138
This converts the following to Kconfig: CONFIG_SYS_FLASH_QUIET_TEST Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_MAX_FLASH_SECT to KconfigTom Rini283-155/+203
This converts the following to Kconfig: CONFIG_SYS_MAX_FLASH_SECT Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Audit <flash.h> inclusionTom Rini36-45/+24
A large number of files include <flash.h> as it used to be how various SPI flash related functions were found, or for other reasons entirely. In order to migrate some further CONFIG symbols to Kconfig we need to not include flash.h in cases where we don't have a NOR flash of some sort enabled. Furthermore, in cases where we are in common code and it doesn't make sense to try and further refactor the code itself in to new files we need to guard this inclusion. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_FLASH_CFI_LEGACY to KconfigTom Rini2-1/+4
This converts the following to Kconfig: CONFIG_FLASH_CFI_LEGACY Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04flash: Remove pic32_flash.cTom Rini4-470/+1
As the only pic32 platform does not enable flash, this is dead code. Remove it. Cc: Purna Chandra Mandal <purna.mandal@microchip.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_FLASH_ERASE_TOUT et al to KconfigTom Rini41-102/+22
This converts the following to Kconfig: CONFIG_SYS_FLASH_ERASE_TOUT CONFIG_SYS_FLASH_LOCK_TOUT CONFIG_SYS_FLASH_UNLOCK_TOUT CONFIG_SYS_FLASH_WRITE_TOUT In practice, for two m68k platforms we move to hard-coding with a comment the timeout values, rather than try and make convoluted Kconfig logic. We add options for the write and erase options to the pic32 flash driver, as this driver does make use of them. Everywhere else these are unreferenced values. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_FLASH_CHECKSUM to KconfigTom Rini10-7/+9
This converts the following to Kconfig: CONFIG_SYS_FLASH_CHECKSUM Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04P1010RDB: Drop support for not-CONFIG_SYS_DDR_RAW_TIMINGTom Rini2-175/+0
All platforms today define CONFIG_SYS_DDR_RAW_TIMING, so drop the code for this option being unset. Cc: Qiang Zhao <qiang.zhao@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04malta: Switch to using CONFIG_SYS_SDRAM_SIZETom Rini3-4/+4
This is the only platform defining and using CONFIG_SYS_MEM_SIZE, switch to using CONFIG_SYS_SDRAM_SIZE for consistency. Cc: Paul Burton <paul.burton@mips.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04powerpc: Move CONFIG_SYS_DDR_SIZE to CONFIG_SYS_SDRAM_SIZETom Rini7-11/+10
We have a number of CONFIG_SYS_xxx_SIZE options to describe the amount main memory available. Rework CONFIG_SYS_DDR_SIZE, which described a size in number of MiB to use CONFIG_SYS_SDRAM_SIZE which is most often used as a number of bytes. Use shifts of this option when required. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Convert CONFIG_SYS_FLASH_EMPTY_INFO to KconfigTom Rini188-40/+154
This converts the following to Kconfig: CONFIG_SYS_FLASH_EMPTY_INFO Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04net: Remove CONFIG_SYS_DIRECT_FLASH_TFTPTom Rini3-54/+13
No platforms enable the functionality to tftp directly to NOR flash, and this is discouraged by the documentation. Remove this code. Further, this highlights an oddity of the code. Un-indent the start of this function. Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04sh: Remove unused code in arch/sh/lib/bootm.cTom Rini1-15/+0
There are no callers of the hexdump function that is guarded by CONFIG_SYS_DEBUG, so remove the section. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-08-04Merge branch '2022-08-04-assorted-fixed'Tom Rini21-44/+521
- Assorted TI, aspeed, xen updates - Assorted return / error checking fixes in commands - SPL MMC bugfix to get the correct device in some cases - SPL related depends fixes - Remove deprecated LCD command - Some tool fixes
2022-08-04tools: mkimage: fix build with LibreSSLMichal Vasilek1-0/+6
RSA_get0_* functions are not available in LibreSSL Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-04tools: kwboot: use pkg-config to get -ltinfoHeiko Thiery1-1/+3
Instead of hardcoding -ltinfo as the flags needed to build kwboot, use pkg-config when available. We gracefully fallback on the previous behavior of hardcoding -ltinfo if pkg-config is not available or fails with an error. Reviewed-by: Pali Rohár <pali@kernel.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2022-08-04tools: mkeficapsule: use pkg-config to get -luuid and -lgnutlsHeiko Thiery1-1/+4
Instead of hardcoding -luuid -lgnutls as the flags needed to build mkeficapsule, use pkg-config when available. We gracefully fallback on the previous behavior of hardcoding -luuid -lgnutls if pkg-config is not available or fails with an error. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2022-08-04arm: mach-k3: security: Remove certificate if detected on GP deviceAndrew Davis1-1/+29
If the device is a GP and we detect a signing certificate then remove it. It would fail to authenticate otherwise as the device is GP and has no secure authentication services in SYSFW. This shouldn't happen often as trying to boot signed images on GP devices doesn't make much sense, but if we run into a signed image we should at least try to ignore the certificate and boot the image anyway. This could help with users of GP devices who only have HS images available. If this does happen, print a nice big warning. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-08-04arm: mach-k3: security: Bypass image signing at runtime for GP devicesAndrew Davis3-4/+4
We can skip the image authentication check at runtime if the device is GP. This reduces the delta between GP and HS U-Boot builds. End goal is to re-unify the two build types into one build that can run on all device types. Signed-off-by: Andrew Davis <afd@ti.com>
2022-08-04arm: mach-k3: security: Allow signing bypass if type is HS-FSAndrew Davis1-1/+21
On HS-FS devices signing boot images is optional. To ease use we check if we are HS-FS and if no certificate is attached to the image we skip the authentication step with a warning that this will fail when the device is set to security enforcing. Signed-off-by: Andrew Davis <afd@ti.com>
2022-08-04arm: mach-k3: Add support for device type detectionAndrew Davis3-1/+70
K3 SoCs are available in a number of device types such as GP, HS-FS, EMU, etc. Like OMAP SoCs we can detect this at runtime and should print this out as part of the SoC information line. We add this as part of the common.c file as it will be used to also modify our security state early in the device boot. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-08-04cmd: remove deprecated LCD supportHeinrich Schuchardt1-14/+6
No board uses lcd_clear() anymore. So we can remove support for it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-04vpl: fix reference in comment to non-existing SPL_SERIAL_SUPPORTQuentin Schulz1-1/+1
Since commit 2a7360666871 ("serial: Rename SERIAL_SUPPORT to SERIAL") SPL_SERIAL_SUPPORT is named SPL_SERIAL. So let's update the comment to point to the correct Kconfig option in the comment of VPL_SERIAL. Fixes: 747093dd408 ("vpl: Add Kconfig options for VPL") Cc: Quentin Schulz <foss+uboot@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-04imx: imx8mp_rsb3720a1: fix incorrect ifdef check on SPL_MMCQuentin Schulz1-2/+2
Since commit 103c5f180694 ("mmc: Rename MMC_SUPPORT to MMC"), SPL_MMC_SUPPORT is named SPL_MMC, so let's fix the ifdef. Fixes: fbc6b1414342 ("imx: imx8mp_rsb3720a1: convert to DM_SERIAL") Cc: Quentin Schulz <foss+uboot@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2022-08-04mx7ulp_com: fix incorrect select for SPL optionsQuentin Schulz1-3/+3
SPL_GPIO_SUPPORT is named SPL_GPIO since commit 83061dbd1c89 ("Rename GPIO_SUPPORT to GPIO"), SPL_MMC_SUPPORT is named SPL_MMC since commit 103c5f180694 ("mmc: Rename MMC_SUPPORT to MMC"), SPL_SERIAL_SUPPORT is named SPL_SERIAL since commit 2a7360666871 ("serial: Rename SERIAL_SUPPORT to SERIAL") so let's select the correct Kconfig options. Fixes: 8b71576f3842 ("mx7ulp_com: add support for SPL") Cc: Quentin Schulz <foss+uboot@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2022-08-04gpio: fix incorrect depends on for SPL_GPIO_HOGQuentin Schulz1-1/+1
Since commit 83061dbd1c89 ("Rename GPIO_SUPPORT to GPIO"), SPL_GPIO_SUPPORT has been renamed to SPL_GPIO, meaning that SPL_GPIO_HOG can never be enabled. Let's fix this by using the proper name for the Kconfig option. Fixes: 1d99e673c752 ("gpio: Enable hogging support in SPL") Cc: Quentin Schulz <foss+uboot@0leil.net> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-04ARM: dts: npcm7xx: add npcm750 full function nodeJim Liu4-11/+343
add npcm750 BMC full function node Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-08-04cmd: undefined return value of do_extension_apply()Heinrich Schuchardt1-0/+1
If 'extension apply all' is executed and no extension is found, the return value of do_extension_apply() is undefined. Return CMD_RET_FAILURE in this case. Fixes: 2f84e9cf06d3 ("cmd: add support for a new "extension" command") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
2022-08-04spl: mmc: Use correct MMC device when loading imageHarald Seiler1-2/+15
When attempting to load images from multiple MMC devices in sequence, spl_mmc_load() chooses the wrong device from the second attempt onwards. The reason is that MMC initialization is only done on its first call and spl_mmc_load() will then continue using this same device for all future calls. Fix this by checking the devnum of the "cached" device struct against the one which is requested. If they match, use the cached one but if they do not match, initialize the new device. This fixes specifying multiple MMC devices in the SPL's boot order to fall back when U-Boot Proper is corrupted or missing on the first attempted MMC device. Fixes: e1eb6ada4e38 ("spl: Make image loader infrastructure more universal") Signed-off-by: Harald Seiler <hws@denx.de>
2022-08-04drivers: xen: events: fix build issues with disabled Xen HVCDmytro Firsov1-0/+5
Some setups do not use Xen hypervisor console for logging, e.g. they use emulated PL011 hardware or shared peripherals (real UART). In such cases Xen HVC will be disabled on a build time and will cause issues in current driver implementation. This commit fixes build issues in Xen event channel driver, caused by absense of console event channel, that is not available when console config is disabled. Now console related code will be removed when Xen HVC is turned off. Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com> Reviewed-by: Anastasiia Lukianenko <vicooodin@gmail.com> Reviewed-by: Anastasiia Lukianenko <vicooodin@gmail.com<mailto:vicooodin@gmail.com>> Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com<mailto:dmytro_firsov@epam.com>>
2022-08-04cmd: fix do_adc_single()Vyacheslav Bocharov1-2/+7
The source code contains an error: - argv[2] contains <channel> arg, variable for env_set is in argv[3] - number of args is 4 Revert 54d24d72601321f4470c4edf31c6b29adae424a7 cmd: simplify do_adc_single() Fixes 9de612ae4ded53f742f5f99929c06d0839471ced cmd: adc: Add support for storing ADC result in env variable Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-04pwm: aspeed: Select SYSCON to get parent detail.Billy Tsai1-0/+1
To work correctly, this driver depends on SYSCON to get the base address from the parent dts node. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Reviewed-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2022-08-02test: rng: Add a UT testcase for the rng commandSughosh Ganu2-0/+30
The 'rng' command dumps a number of random bytes on the console. Add a set of tests for the 'rng' command. The test function performs basic sanity testing of the command. Since a unit test is being added for the command, enable it by default in the sandbox platforms. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-02doc: rng: Add documentation for the rng commandSughosh Ganu2-0/+27
Add a usage document for the 'rng' u-boot command. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-02cmd: rng: Use a statically allocated array for random bytesSughosh Ganu1-10/+7
Use a statically allocated buffer on stack instead of using malloc for reading the random bytes. Using a local array is faster than allocating heap memory on every initiation of the command. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-02cmd: rng: Add support for selecting RNG deviceSughosh Ganu1-8/+23
The 'rng' u-boot command is used for printing a select number of random bytes on the console. Currently, the RNG device from which the random bytes are read is fixed. However, a platform can have multiple RNG devices, one example being qemu, which has a virtio RNG device and the RNG pseudo device through the TPM chip. Extend the 'rng' command so that the user can provide the RNG device number from which the random bytes are to be read. This will be the device index under the RNG uclass. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-02tpm: Add the RNG child deviceSughosh Ganu1-6/+34
The TPM device comes with the random number generator(RNG) functionality which is built into the TPM device. Add logic to add the RNG child device in the TPM uclass post probe callback. The RNG device can then be used to pass a set of random bytes to the linux kernel, need for address space randomisation through the EFI_RNG_PROTOCOL interface. No compatible string is provided because this is not available in the binding defined by Linux. If multiple rand devices are in the system, then some method of selecting them (other than device tree) will need to be used, or a binding will need to be added. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-02tpm: rng: Add driver model interface for TPM RNG deviceSughosh Ganu5-3/+37
The TPM device has a builtin random number generator(RNG) functionality. Expose the RNG functions of the TPM device to the driver model so that they can be used by the EFI_RNG_PROTOCOL if the protocol is installed. Also change the function arguments and return type of the random number functions to comply with the driver model api. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-02efi_loader: initialize the RNG protocol after the TCC2Ilias Apalodimas1-7/+7
Due to U-Boot's lazy binding the RNG presented by the TCG is not available until the EFI_TCG2 protocol has been initialized. Since the TPM has a built-in RNG device we can use for the OS randomization, move the RNG protocol installation after the TCG. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-02tpm: Export the TPM-version functionsSimon Glass2-51/+51
These functions should really be available outside the TPM code, so that other callers can find out which version the TPM is. Rename them to have a tpm_ prefix() and add them to the header file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>