aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-15image: Add an option to do a full check of the FITSimon Glass
Some strange modifications of the FIT can introduce security risks. Add an option to check it thoroughly, using libfdt's fdt_check_full() function. Enable this by default if signature verification is enabled. CVE-2021-27097 Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Bruce Monroe <bruce.monroe@intel.com> Reported-by: Arie Haenel <arie.haenel@intel.com> Reported-by: Julien Lenoir <julien.lenoir@intel.com>
2021-02-15image: Adjust the workings of fit_check_format()Simon Glass
At present this function does not accept a size for the FIT. This means that it must be read from the FIT itself, introducing potential security risk. Update the function to include a size parameter, which can be invalid, in which case fit_check_format() calculates it. For now no callers pass the size, but this can be updated later. Also adjust the return value to an error code so that all the different types of problems can be distinguished by the user. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Bruce Monroe <bruce.monroe@intel.com> Reported-by: Arie Haenel <arie.haenel@intel.com> Reported-by: Julien Lenoir <julien.lenoir@intel.com>
2021-02-15test: Add tests for the 'evil' vboot attacksSimon Glass
Add tests to check that these two attacks are mitigated by recent patches. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Bruce Monroe <bruce.monroe@intel.com> Reported-by: Arie Haenel <arie.haenel@intel.com> Reported-by: Julien Lenoir <julien.lenoir@intel.com>
2021-02-15test: Add vboot_evil implementationSimon Glass
Add a library which performs two different attacks on a FIT. Signed-off-by: Julien Lenoir <julien.lenoir@intel.com> Signed-off-by: Bruce Monroe <bruce.monroe@intel.com> Signed-off-by: Arie Haenel <arie.haenel@intel.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2021-02-15fit: Don't allow verification of images with @ nodesSimon Glass
When searching for a node called 'fred', any unit address appended to the name is ignored by libfdt, meaning that 'fred' can match 'fred@1'. This means that we cannot be sure that the node originally intended is the one that is used. Disallow use of nodes with unit addresses. Update the forge test also, since it uses @ addresses. CVE-2021-27138 Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Bruce Monroe <bruce.monroe@intel.com> Reported-by: Arie Haenel <arie.haenel@intel.com> Reported-by: Julien Lenoir <julien.lenoir@intel.com>
2021-02-15fdt_region: Check for a single root node of the correct nameSimon Glass
At present fdt_find_regions() assumes that the FIT is a valid devicetree. If the FIT has two root nodes this is currently not detected in this function, nor does libfdt's fdt_check_full() notice. Also it is possible for the root node to have a name even though it should not. Add checks for these and return -FDT_ERR_BADSTRUCTURE if a problem is detected. CVE-2021-27097 Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Bruce Monroe <bruce.monroe@intel.com> Reported-by: Arie Haenel <arie.haenel@intel.com> Reported-by: Julien Lenoir <julien.lenoir@intel.com>
2021-02-15configs: Resync with savedefconfigTom Rini
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-15Merge branch '2021-02-02-drop-asm_global_data-when-unused'Tom Rini
- Merge the patch to take <asm/global_data.h> out of <common.h>
2021-02-15Merge branch '2021-02-14-remove-some-boards'Tom Rini
- Remove some boards that are behind on conversions and have had their removal acked or suggested by the relevant maintainers.
2021-02-15sh: Remove sh7763rdp boardTom Rini
This board has not been converted to CONFIG_DM by the deadline of v2020.01 and is missing other conversions which depend on this as well. Remove it. Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-15sh: Remove sh7757lcr boardTom Rini
This board has not been converted to CONFIG_DM by the deadline of v2020.01 and is missing other conversions which depend on this as well. Remove it. As this is the last SH4A board, remove that support as well. Cc: Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-15sh: Remove sh7753evb boardTom Rini
This board has not been converted to CONFIG_DM by the deadline of v2020.01 and is missing other conversions which depend on this as well. Remove it. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-15sh: Remove sh7752evb boardTom Rini
This board has not been converted to CONFIG_DM by the deadline of v2020.01 and is missing other conversions which depend on this as well. Remove it. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-15sh: Remove r7780mp boardTom Rini
This board has not been converted to CONFIG_DM by the deadline of v2020.01 and is missing other conversions which depend on this as well. Remove it. Patch-cc: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Patch-cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-15sh: Remove MigoR boardTom Rini
This board has not been converted to CONFIG_DM by the deadline of v2020.01 and is missing other conversions which depend on this as well. Remove it. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-15ppc: Remove MPC8641HPCN boardTom Rini
This board relies on using CONFIG_LIBATA but does not enable CONFIG_AHCI. The deadline for this conversion was the v2019.07 release. The use of CONFIG_AHCI requires CONFIG_DM. The deadline for this conversion was v2020.01. Remove this board. Cc: Priyanka Jain <priyanka.jain@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-02-15ppc: Remove MPC8610HPCD boardTom Rini
This board relies on using CONFIG_LIBATA but does not enable CONFIG_AHCI. The deadline for this conversion was the v2019.07 release. The use of CONFIG_AHCI requires CONFIG_DM. The deadline for this conversion was v2020.01. Remove this board. Cc: Priyanka Jain <priyanka.jain@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-02-15ppc: Remove MPC8572DS boardTom Rini
This board relies on using CONFIG_LIBATA but does not enable CONFIG_AHCI. The deadline for this conversion was the v2019.07 release. The use of CONFIG_AHCI requires CONFIG_DM. The deadline for this conversion was v2020.01. Remove this board. Cc: Priyanka Jain <priyanka.jain@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-02-15ppc: Remove MPC8544DS boardTom Rini
This board relies on using CONFIG_LIBATA but does not enable CONFIG_AHCI. The deadline for this conversion was the v2019.07 release. The use of CONFIG_AHCI requires CONFIG_DM. The deadline for this conversion was v2020.01. Remove this board. Cc: Priyanka Jain <priyanka.jain@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-02-15arm: Remove db-88f6281-bp boardTom Rini
This board has not been converted to CONFIG_DM_MMC by the deadline of v2019.04, which is almost two years ago. In addition there are other DM migrations it is also missing. Remove it. Cc: Chris Packham <judge.packham@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Chris Packham <judge.packham@gmail.com>
2021-02-15arm: Remove ls2080a_simu boardTom Rini
This board has not been converted to CONFIG_DM_MMC by the deadline of v2019.04, which is almost two years ago. In addition there are other DM migrations it is also missing. Remove it. Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-02-15arm: Remove mx35pdk boardTom Rini
This board has not been converted to CONFIG_DM_MMC by the deadline of v2019.04, which is almost two years ago. In addition there are other DM migrations it is also missing. Remove it. Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Stefano Babic <sbabic@denx.de>
2021-02-15arm: Remove apx4devkit boardTom Rini
This board has not been converted to CONFIG_DM_MMC by the deadline of v2019.04, which is almost two years ago. In addition there are other DM migrations it is also missing. Remove it. Cc: Lauri Hintsala <lauri.hintsala@bluegiga.com> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Lauri Hintsala <lauri.hintsala@silabs.com<mailto:lauri.hintsala@silabs.com>> Signed-off-by: Tom Rini <trini@konsulko.com<mailto:trini@konsulko.com>>
2021-02-15Revert "fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()"Tom Rini
On Rockchip platforms we need this area of code in TPL, but there is no TPL_SEPARATE_BSS symbol. This reverts commit 0a2aaab0b678fd1778ff2fc59d0770fc82995532. Reported-by: Markus Reichl <m.reichl@fivetechno.de> Reported-by: Jesper Schmitz Mouridsen <jesper@schmitz.computer> Reported-by: Peter Robinson <pbrobinson@gmail.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-14Merge tag 'efi-2021-04-rc2-2' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2021-04-rc2-2 Bug fixes: * fix stack smashing in UEFI capsule updates * correct loading of UEFI binaries where Virtual size is not a multiple of FileAlignment * simplify detection of capsule files. * buildman: use threading.is_alive() instead of removed method IsAlive()
2021-02-14buildman: 'Thread' object has no attribute 'isAlive'Heinrich Schuchardt
The isAlive() method was deprecated in Python 3.8 and has been removed in Python 3.9. See https://bugs.python.org/issue37804. Use is_alive() instead. Since Python 2.6 is_alive() has been a synonym for isAlive(). So there should be no problems for users using elder Python 3 versions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-02-14efi_loader: fix get_last_capsule()Heinrich Schuchardt
fix get_last_capsule() leads to writes beyond the stack allocated buffer. This was indicated when enabling the stack protector. utf16_utf8_strcpy() only stops copying when reaching '\0'. The current invocation always writes beyond the end of value[]. The output length of utf16_utf8_strcpy() may be longer than the number of UTF-16 tokens. E.g has "CapsuleКиев" has 11 UTF-16 tokens but 15 UTF-8 tokens. Hence, using utf16_utf8_strcpy() without checking the input may lead to further writes beyond value[]. The current invocation of strict_strtoul() reads beyond the end of value[]. A non-hexadecimal value after "Capsule" (e.g. "CapsuleZZZZ") must result in an error. We cat catch this by checking the return value of strict_strtoul(). A value that is too short after "Capsule" (e.g. "Capsule0") must result in an error. We must check the string length of value[]. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-02-14efi_loader: '.' and '..' are directoriesHeinrich Schuchardt
'.' and '..' are directories. So when looking for capsule files it is sufficient to check that the attribute EFI_FILE_DIRECTORY is not set. We don't have to check for these special names. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-02-14efi_loader: don't load beyond VirtualSizeAsherah Connor
PE section table entries' SizeOfRawData must be a multiple of FileAlignment, and thus may be rounded up and larger than their VirtualSize. We should not load beyond the VirtualSize, which is "the total size of the section when loaded into memory" -- we may clobber real data at the target in some other section, since we load sections in reverse order and sections are usually laid out sequentially. Signed-off-by: Asherah Connor <ashe@kivikakk.ee> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-02-12Merge tag 'u-boot-atmel-fixes-2021.04-a' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-atmel First set of u-boot-atmel fixes for 2021.04 cycle: This small PR includes just two fixes but very important: one revert in the clk subsystem which fixes the boot on many old boards (sama5d2_xplained, sama5d4_xplained), which currently crash at boot; and one small fix related to debug serial on sama7g5ek board.
2021-02-11clk: at91: compat: partially revert "dm: Remove uses of device_bind_offset()"Eugen Hristev
Revert changes in at91 compat.c that cause u-boot to fail booting on sama5d4_xplained and sama5d2_xplained Log below: <debug_uart> No serial driver found Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Could not initialize timer (err -19) Fixes: a2703ce10c ("dm: Remove uses of device_bind_offset()") Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-02-11ARM: dts: at91: sama7g5ek: enable pull-up for serial debug lineEugen Hristev
If the serial tx/rx are floating, it can happen that bogus characters are detected on the line at boot time. This leads to U-boot accidentally thinking someone pressed a key to stop autoboot, thus stopping booting process. This can happen if the serial cable is not connected. There are hardware pull-ups on the board connected to serial cable VBUS. To solve this when the cable is not plugged, enable internal pull-ups as well for the tx/rx lines. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2021-02-10Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usbTom Rini
- MediaTek updates - xhci fixes - dwc2 stm32 compatible update
2021-02-10usb: dwc2: change compatible st,stm32mp1-hsotg to st,stm32mp15-hsotgPatrick Delaunay
The Linux kernel v5.7-rc1 introduced the compatible "st,stm32mp15-hsotg". See Linux kernel commit d49850110434 ("dt-bindings: usb: dwc2: add support for STM32MP15 SoCs USB OTG HS and FS") This patch updates the supported compatible in DWC2 driver, removes the add-on done in U-Boot dtsi and keeps the compatible defined in SOC dtsi arch/arm/dts/stm32mp151.dtsi: usbotg_hs: usb-otg@49000000 { compatible = "st,stm32mp15-hsotg", "snps,dwc2"; reg = <0x49000000 0x10000>; ... }; Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-02-10usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx()Stefan Roese
Testing with v2021.01 on MIPS Octeon has shown, that the latest patch for the "short packet event trb handling" did introduce a bug on platforms with virtual address != physical address. This patch fixes this issue by using the correct address types in the compare (both physical in this case). Signed-off-by: Stefan Roese <sr@denx.de> Cc: Aaron Williams <awilliams@marvell.com> Cc: Chandrakala Chavva <cchavva@marvell.com> Cc: Ran Wang <ran.wang_1@nxp.com> Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Cc: Marek Vasut <marex@denx.de> Cc: Bin Meng <bmeng.cn@gmail.com>
2021-02-10usb: xhci-pci: Check for errors from dm_pci_map_bar()Pali Rohár
Function dm_pci_map_bar() may fail and returns NULL. Check this to prevent dereferencing a NULL pointer. In xhci-pci this may happen when board does not enable CONFIG_PCI_PNP and PCI_BASE_ADDRESS_0 contains unconfigured zero address. Signed-off-by: Pali Rohár <pali@kernel.org>
2021-02-10dt-bindings: usb: mtk-xhci: add optional properies to disable portsChunfeng Yun
Add optional properies to disable usb2 or usb3 ports, they are used when provided ports are not used on some special platforms. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
2021-02-10usb: xhci-mtk: support option to disable portsChunfeng Yun
Add support to disable specific ports, it's useful for some scenarios: 1. usb3 PHY is shared whith PCIe or SATA, the corresponding usb3 port can be disabled; 2. some usb2 or usb3 ports are not used on special platforms, they should be disabled to save power. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
2021-02-10Merge tag 'u-boot-amlogic-20210210' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic - Add configuration helpers for MIPI D-PHY - generic-phy: add configure op - Add Amlogic AXG MIPI D-PHY driver & MIPI PCIe Analog PHY driver - odroid: add runtime detection of the N2/N2+/C4/HC4 variants
2021-02-10board: amlogic: odroid: add runtime detection of the N2/N2+/C4/HC4 variantsMarek Szyprowski
Use the ADC channel 1 to check the hardware revision of the board and detect the N2 vs. N2+ and the C4 vs. HC4 variants. Each of them use different dtb file, so adjust fdtfile environment variable to the detected variant. The ADC min/max values for each variant are taken from the vendor code, adjusted to the 12-bit ADC driver operation mode (vendor code use 10-bit mode). Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-02-10phy: Add Amlogic AXG MIPI PCIe Analog PHY driverNeil Armstrong
The Amlogic AXG MIPI + PCIe Analog PHY provides function for both PCIe and MIPI DSI at the same time, and provides the Analog part of MIPI DSI transmission and Analog part of the PCIe lines. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-02-10phy: Add Amlogic AXG MIPI D-PHY driverNeil Armstrong
The Amlogic AXG SoCs embeds a MIPI D-PHY used to communicate with DSI panels. This D-PHY depends on a separate analog PHY. Signed-off-by:Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-02-10generic-phy: add configure opNeil Armstrong
Add the PHY configure op callback to the generic PHY uclass to permit configuring the PHY. It's useful for MIPI DSI PHYs to setup the link timings. Signed-off-by:Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-02-10phy: dphy: Add configuration helpersNeil Armstrong
The MIPI D-PHY spec defines default values and boundaries for most of the parameters it defines. Introduce helpers to help drivers get meaningful values based on their current parameters, and validate the boundaries of these parameters if needed. These helpers and header are taken from Linux commit 9123e3a74ec7 ("Linux 5.9-rc1"). Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-02-09Merge tag 'u-boot-stm32-20210209' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-stm - Enable the fastboot oem commands in stm32mp15 defconfig - Fixes pinctrol for stmfx and stm32 - Add support of I2C6_K in stm32mp15 clock driver - Alignment with Linux kernel device tree v5.11-rc2 for ST boards
2021-02-09arm: dts: stm32mp15: alignment with v5.11-rc2Patrick Delaunay
Device tree alignment with Linux kernel v5.11-rc2 - fix DCMI DMA features on stm32mp15 family - Add alternate pinmux for FMC EBI bus - Harmonize EHCI/OHCI DT nodes name on stm32mp15 - update sdmmc IP version for STM32MP15 - Add LP timer irqs on stm32mp151 - Add LP timer wakeup-source on stm32mp151 - enable HASH by default on stm32mp15 - enable CRC1 by default on stm32mp15 - enable CRYP by default on stm32mp15 - set bus-type in DCMI endpoint for stm32mp157c-ev1 board - reorder spi4 within stm32mp15-pinctrl - add STUSB1600 Type-C using I2C4 on stm32mp15xx-dkx - fix mdma1 clients channel priority level on stm32mp151 - fix dmamux reg property on stm32mp151 - adjust USB OTG gadget fifo sizes in stm32mp151 - update stm32mp151 for remote proc synchronization support - support child mfd cells for the stm32mp1 TAMP syscon Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-02-09ARM: dts: stm32: Fix cosmetic typo: use 'kHz' as kilohertz abbreviationFabrice GIRARDOT
The kilohertz unit abbreviation should read 'kHz'. Note to STM32 team: modified files were generated, it may be worth to fix STM32CubeMX tool. Signed-off-by: Fabrice GIRARDOT <fabrice.girardot@flowbird.group> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-02-09clk: stm32mp1: add support of I2C6_KPatrick Delaunay
Add support of missing I2C6_K with bit 3 of RCC_MC_APB5ENSETR = I2C6EN: I2C6 peripheral clocks enable. This patch allows customer to use I2C6 in SPL or in U-Boot as other I2C instance, already support in clk driver. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2021-02-09pinctrl: stm32: bind only the enabled GPIO subnodePatrick Delaunay
Bind only the enabled GPIO subnode, to avoid to probe the node "gpio-controller" present in SOC dtsi (disabled by default) but not enabled in the included pincontrol dtsi file. For example, in stm32mp15xxac-pinctrl.dtsi 2 gpio bank are absent: gpioj: gpio@5000b000 gpiok: gpio@5000c000 Then these GPIO are absent in output of command "dm tree" and "gpio status -a" Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2021-02-09pinctrl: stm32: correct management pin display of OTYPEPatrick Delaunay
OTYPE can be used for output or for alternate function to select PP = push-pull or OP = open-drain mode, according reference manual (Table 81. Port bit configuration table). This patch removes this indication for input pins and adds it for AF and output pins for pinmux command output. Fixes: b305dbc08b08 ("pinctrl: stm32: display bias information for all pins") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>