aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-10-28Merge https://source.denx.de/u-boot/custodians/u-boot-marvellWIP/28Oct2021Tom Rini8-36/+76
- mvebu: Fix usage of BIN header arguments (Pali) - mvebu: turris_omnia: Fix MTD partitions order for Linux (Pali) - mvebu: nandpagesize support for kwbimage v1 (Pali)
2021-10-28arm: mvebu: Fix comments about kwbimage structuresPali Rohár2-2/+2
kwbimage v1 is used on more SoCs. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28arm: mvebu: Update name of kwbimage v1 field at offset 0x2-0x3Pali Rohár2-2/+2
At this offset is stored nand page size. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28tools: kwboot: Patch nandpagesize to zero also for v1 imagePali Rohár1-7/+6
kwbimage v1 has also nandpagesize field. So set it to zero for both image versions when image is not signed. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28tools: kwbimage: Add support for NAND_PAGE_SIZE command also for v1 imagesPali Rohár2-1/+4
The NAND_PAGE_SIZE command is already supported by mkimage for v0 images, but not for v1 images. A38x and A39x BootROM supports reading NAND flash page size from v1 image in the same way as Kirkwood BootROM from v0 image. It it documented in A38x and A39x Functional Specification. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28arm: mvebu: turris_omnia: Fix MTD partitions order for LinuxPali Rohár1-1/+1
Linux enumerates MTD partitions in DTB order, while the fdt_add_subnode() function puts a new subnode at the beginning. To fix this, put MTD partitions into DTB in reverse order. Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB") Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28arm: mvebu: Remove dummy BIN header arguments for SPL binaryPali Rohár1-1/+1
U-Boot SPL binary does not read BIN header arguments, so passing some dummy values 0000005b and 00000068 has no effect for U-Boot SPL code. Probably these two values comes from old Marvell DDR training code which was separated from U-Boot and used it for some configuration. Seems that two 32-bit values were specified here to ensure SPL code alignment to 128-bit boundary as it is required e.g. for A370 or AXP processors. Main kwbimage header is 64-byte long which is aligned to 128-bit boundary. Optional kwbheader is 32-bit long, number of BIN header arguments is stored in 32-bit number. So for alignment to 128-bit boundary is needed 64-bit padding which exactly these two 32-bit dummy arguments provided. Now when mkimage correctly aligns start of executable code in BIN header to 128-bit boundary, there is no requirement to put dummy argument values into kwbimage. So remove them. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28arm: mvebu: Add documentation for save_boot_params() functionPali Rohár1-0/+9
Important detail is availability of kwbimage BIN header arguments passed via r0 and r1 registers by BootROM. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28tools: kwbimage: Align BIN header executable code to 128-bit boundaryPali Rohár1-17/+34
ARM executable code inside the BIN header on some mvebu platforms (e.g. A370, AXP) must always be aligned with the 128-bit boundary. This requirement can be met by inserting dummy arguments into BIN header. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-28tools: kwboot: Align UART baudrate change code in BIN header to 128-bit boundaryPali Rohár1-5/+17
ARM executable code inside the BIN header on some mvebu platforms (e.g. A370, AXP) must always be aligned with the 128-bit boundary. This requirement can be met by inserting dummy arguments into BIN header. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-27sandbox: Remove OF_HOSTFILEWIP/27Oct2021Ilias Apalodimas31-69/+81
OF_HOSTFILE is used on sandbox configs only. Although it's pretty unique and not causing any confusions, we are better of having simpler config options for the DTB. So let's replace that with the existing OF_BOARD. U-Boot would then have only three config options for the DTB origin. - OF_SEPARATE, build separately from U-Boot - OF_BOARD, board specific way of providing the DTB - OF_EMBED embedded in the u-boot binary(should not be used in production Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-26Merge tag 'efi-2022-01-rc1-2' of ↵WIP/26Oct2021Tom Rini23-388/+715
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-01-rc1-2 doc: Remove obsolete PPC4XX references UEFI: Implement missing TCG2 measurements Code clean up # gpg: Signature made Tue 26 Oct 2021 05:56:47 PM EDT # gpg: using RSA key 6DC4F9C71F29A6FA06B76D33C481DBBC2C051AC4 # gpg: Good signature from "Heinrich Schuchardt <xypron.glpk@gmx.de>" [unknown] # gpg: aka "[jpeg image of size 1389]" [unknown] # Primary key fingerprint: 6DC4 F9C7 1F29 A6FA 06B7 6D33 C481 DBBC 2C05 1AC4
2021-10-26Merge branch '2021-10-26-add-nand-biterr-and-bugfixes'Tom Rini7-18/+144
- Add biterr sub-command to "nand" - scmi, rsa, uuid bugfixes, re-sort DFU menu in Kconfig and remove superfluous checks before free in env.
2021-10-26efi_loader: add DeployedMode and AuditMode variable measurementMasahisa Kojima1-8/+25
This commit adds the DeployedMode and AuditMode variable measurement required in TCG PC Client Platform Firmware Profile Specification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2021-10-26efi_loader: simplify tcg2_measure_secure_boot_variable()Masahisa Kojima1-42/+18
This commit simplifies tcg2_measure_secure_boot_variable() using secure_variables table. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2021-10-26efi_loader: add UEFI GPT measurementMasahisa Kojima6-3/+190
This commit adds the UEFI GPT disk partition topology measurement required in TCG PC Client Platform Firmware Profile Specification Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2021-10-26env: superfluous check before free()WIP/2021-10-26-add-nand-biterr-and-bugfixesHeinrich Schuchardt1-4/+2
Free() checks if its argument in NULL. There is no need for the caller to do the same. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-26dfu: Sort Kconfig entries alphabeticallyMarek Vasut1-7/+7
The DFU_MTD Kconfig entry is in the wrong position, move it into the correct alphabetically sorted position. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Lukasz Majewski <lukma@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-10-26lib: uuid: fix the test on RNG device presencePatrick Delaunay1-1/+1
Correct the test on RNG device presence,when ret is equal to 0, before to call dm_rng_read function. Without this patch the RNG device is not used when present (when ret == 0) or a data abort occurs in dm_rng_read when CONFIG_DM_RNG is activated but the RNG device is not present in device tree (ret != 0 and devp = NULL). Fixes: 92fdad28cfdf ("lib: uuid: use RNG device if present") CC: Matthias Brugger <mbrugger@suse.com> CC: Torsten Duwe <duwe@suse.de> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-26common: Kconfig.boot: add config SPL_FIT_RSASSA_PSSPhilippe Reynes1-0/+7
The padding pss is only supported on u-boot and tools since commit 2bbed3ff8c7f ("image: Use Kconfig to enable FIT_RSASSA_PSS on host") This commit adds the config SPL_FIT_RSASSA_PSS to support the padding pss in the SPL. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-26lib: rsa: rsa-verify: also check that padding is not NULLPhilippe Reynes1-1/+1
This commit adds a check on the padding in the function rsa_verify_key to avoid using a NULL pointer. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-26firmware: scmi: fix struct layout for scmi_clk_rate_set_inClément Léger1-2/+2
First two fields are reversed compared to what is expected by the SCMI specification. Signed-off-by: Clément Léger <clement.leger@bootlin.com> Fixes: 60388844836 ("clk: add clock driver for SCMI agents")
2021-10-26cmd: nand biterr - Add support for nand biterr commandBalamanikandan Gunasundar1-3/+124
The command shall be used to induce bit errors in the nand page manually. The code flips a bit in the specified offset without changing the ECC. This helps to see how the software handles the error. The patch is ported from https://patchwork.ozlabs.org/project/uboot/patch/\ 1325691123-19565-1-git-send-email-holger.brunck@keymile.com The implementation is inspired from 'mtd-utils/nand-utils/nandflipbits.c' Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
2021-10-26efi_loader: add SMBIOS table measurementMasahisa Kojima8-14/+261
TCG PC Client Platform Firmware Profile Specification requires to measure the SMBIOS table that contains static configuration information (e.g. Platform Manufacturer Enterprise Number assigned by IANA, platform model number, Vendor and Device IDs for each SMBIOS table). The device- and environment-dependent information such as serial number is cleared to zero or space character for the measurement. Existing smbios_string() function returns pointer to the string with const qualifier, but exisintg use case is updating version string and const qualifier must be removed. This commit removes const qualifier from smbios_string() return value and reuses to clear the strings for the measurement. This commit also fixes the following compiler warning: lib/smbios-parser.c:59:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] const struct smbios_header *header = (struct smbios_header *)entry->struct_table_address; Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2021-10-26Merge branch '2021-10-25-assorted-updates'Tom Rini7-14/+111
- Allow redundant environment on the eMMC HW boot partitions - Use LMB in "loads" - env, dfu + spi, OPTEE bugfixes
2021-10-25dfu: dfu_sf: Read the SPI flash in 16 MiB chunksMarek Vasut1-2/+12
Not all SPI flashes and controllers can do continuous transfer longer than 16 MiB, so perform the DFU read in 16 MiB chunks. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Lukasz Majewski <lukma@denx.de> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2021-10-25arm: spl: prepare for jumping to OPTEERicardo Salveti3-3/+30
Make sure to (if applicable) flush the D-cache, invalidate I-cache, and disable MMU and caches before jumping to OPTEE. This fixes the SDP->SPL->OPTEE boot flow on iMX6Q and most likely on some other ARM SoCs. Signed-off-by: Ricardo Salveti <ricardo@foundries.io> Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2021-10-25efi_loader: simplify tcg2_measure_secure_boot_variable()Heinrich Schuchardt1-16/+13
Don't duplicate GUIDs. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-10-25efi_loader: simplify efi_sigstore_parse_sigdb()Heinrich Schuchardt1-33/+5
Simplify efi_sigstore_parse_sigdb() by using existing functions. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-10-25efi_loader: function to get GUID for variable nameHeinrich Schuchardt2-0/+17
In multiple places we need the default GUID matching a variable name. The patch provides a library function. For secure boot related variables like 'PK', 'KEK', 'db' a lookup table is used. For all other variable names EFI_GLOBAL_VARIABLE is returned. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-10-25efi_loader: treat UEFI variable name as constHeinrich Schuchardt7-23/+34
UEFI variable names are typically constants and hence should be defined as const. Unfortunately some of our API functions do not define the parameters for UEFI variable names as const. This requires unnecessary conversions. Adjust parameters of several internal functions to tre UEFI variable names as const. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-10-25efi_loader: capsule: add back efi_get_public_key_data()AKASHI Takahiro1-0/+36
The commit 47a25e81d35c ("Revert "efi_capsule: Move signature from DTB to .rodata"") failed to revert the removal of efi_get_public_key_data(). Add back this function and move it under lib/efi_loader so that other platforms can utilize it. It is now declared as a weak function so that it can be replaced with a platform-specific implementation. Fixes: 47a25e81d35c ("Revert "efi_capsule: Move signature from DTB to .rodata"") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-25Revert "Revert "doc: Update CapsuleUpdate READMEs""AKASHI Takahiro1-0/+124
This reverts commit a7e4f905d206d5895dab4bd38a8316e4f2fe15fe. The description originally written by Sughosh is still valid even after the commit 47a25e81d35c ("Revert "efi_capsule: Move signature from DTB to .rodata"") was applied. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2021-10-25Revert "Revert "mkeficapsule: Remove dtb related options""AKASHI Takahiro1-222/+7
This reverts commit d428e81266a59974ade74c1ba019af39f23304ab. We have agreed with removing dtb-related stuff from mkeficapsule command even if the commit 47a25e81d35c ("Revert "efi_capsule: Move signature from DTB to .rodata"") was applied. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-10-25.mailmap: add Heinrich SchuchardtHeinrich Schuchardt1-0/+1
Add a mailmap entry for me. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-25efi_loader: add missing const qualifierMasahisa Kojima2-3/+4
This commit fixes the following compilation warning of boottime->install_configuration_table() function. lib/efi_selftest/efi_selftest_tcg2.c:475:46: warning: passing argument 1 of ‘boottime->install_configuration_table’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] ret = boottime->install_configuration_table(&smbios_guid, dmi); Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-25doc: Remove the obsolete README.mpc74xx fileThomas Huth1-22/+0
Support for the PPC74xx processors has been removed in commit d928664f41 ("powerpc: 74xx_7xx: remove 74xx_7xx cpu support") more than 6 years ago already. So the corresponding README file can now be removed, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-25doc: remove AMCC PPC405 processor referencesHeinrich Schuchardt1-22/+0
Support for PPC4XX processors has been removed. So we should not mention it in the documentation. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
2021-10-25env: mmc: Add support for redundant env in both eMMC boot partitionsMarek Vasut2-5/+47
Currently the MMC environment driver supports storing redundant environment only in one eMMC partition at different offsets. This is sub-optimal, since if this one boot partition is erased, both copies of environment are lost. Since the eMMC has two boot partitions, add support for storing one copy of environment in each of the two boot partitions. To enable this functionality, select CONFIG_SYS_REDUNDAND_ENVIRONMENT to indicate redundant environment should be used. Set CONFIG_SYS_MMC_ENV_PART to 1 to indicate environment should be stored in eMMC boot partition. Set CONFIG_ENV_OFFSET equal to CONFIG_ENV_OFFSET_REDUND, and both to the offset from start of eMMC boot partition where the environment should be located. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
2021-10-25loads: Block writes into LMB reserved areas of U-BootMarek Vasut1-0/+12
The loads srec loading may overwrite piece of U-Boot accidentally. Prevent that by using LMB to detect whether upcoming write would overwrite piece of reserved U-Boot code, and if that is the case, abort the srec loading. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-10-25env: mmc: Add missing eMMC bootpart restoration to env eraseMarek Vasut1-4/+10
If the environment is stored in eMMC hardware boot partition, the environment driver first stores the currently selected eMMC boot partition, then does the requested operation, and then restores the original boot partition settings. In case the environment operation fails, the boot partition settings are also restored. The 'env erase' implementation in the MMC environment driver lacks the path which restores the boot partition. This could lead to various failure modes, like the system boots the wrong copy of bootloader etc. Fix this by filling in the missing restoration path. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
2021-10-25Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiWIP/25Oct2021Tom Rini27-35/+305
- Add and enable watchdog driver - Prepare for SYSRESET driven AXP poweroff - Prepare for SoCs without MMC2 - Some fixes for extending SPL (SPL-DM for RISC-V) - Some preparations for proper VBUS management - Fix secure monitor move
2021-10-25mmc: sunxi: conditionally include MMC2 initialization codeIcenowy Zheng1-0/+2
Allwinner R329 has no MMC2. Only include the code of MMC2 if the base address of it is defined. Signed-off-by: Icenowy Zheng <icenowy@sipeed.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-10-25sunxi: only include alias for eMMC when mmc2 usedIcenowy Zheng1-0/+2
Some Allwinner SoCs (e.g. R329) doesn't have a MMC2 controller at all, and on boards that we do not utilize MMC2, the alias for it is just useless. Only include the alias when we specify CONFIG_MMC_SUNXI_EXTRA_SLOT to 2. Signed-off-by: Icenowy Zheng <icenowy@sipeed.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-10-25sunxi: dts: H616: Enable the watchdogSamuel Holland1-1/+0
For some reason, the watchdog was disabled in the H616 device tree. Most likely this is a copy-paste from the H6 device tree: the H6 watchdog is disabled because it is broken in some chips. However, there is no evidence of issues with the H616 watchdog. Enable the watchdog node so it can be used by the driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-10-25Merge tag 'u-boot-imx-20211022' of ↵Tom Rini52-278/+880
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20211022 ------------------- CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/9561 - i.MX8: - Toradex Verdin (switch to binman, cleanup, etc.) - Phytec phycore_imx8mm (fixes, boot from SPI-NOR) - fixes for imx8mp_evk - doc (i.MX): MX8MM with Fast boot - i.MX6: - Toradex : colibri-imx6ull with eMMC, fixes - i.MX7ULP : - preparation for OPTEE + Serial Number - generic: - imx8m_image: Support ddr3 firmware
2021-10-25sunxi: Enable watchdog timer support by defaultSamuel Holland1-0/+1
A watchdog helps recover from hangs or failure to boot an OS. It can also be used by the sysreset framework to intentionally reset the system. Now that a driver is available, let's enable this functionality on sunxi boards. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-10-25watchdog: Add a driver for the sunxi watchdogSamuel Holland3-0/+197
This driver supports the sun4i/sun6i/sun20i watchdog timers. They have a maximum timeout of 16 seconds. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-10-25clk: sunxi: Extend DM_RESET selection to SPLSamuel Holland1-0/+1
The sunxi clock driver exposes a reset controller, so it selects the reset controller framework. Ensure that dependency is also satisfied when building the driver for the SPL. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-10-25sunxi: SPL SPI: Allow larger SPLAndre Przywara1-3/+7
The more recent Allwinner SoCs BootROMs can actually load SPL images larger than 32KB. We use this on the H616 to fit the extra code needed for the PMIC into the image, and have provisions in board.c to respect that larger SPL size when booting from MMC. However the sunxi SPL SPI loader has a hardcoded load offset of 32KB, which will fail on the H616. To fix this, use the same algorithm we use for MMC: if the SPL size is smaller than 32KB, we use 32KB, otherwise we expect the U-Boot payload directly after the SPL code. This prepares for SPI booting with larger SPLs like on the H616. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>