aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-14ARM: dts: imx6qdl-sr-som: add support for alternate phy addressesJosua Mayer
The Cubox has an unstable phy address - which can appear at either address 0 (intended) or 4 (unintended). SoM revision 1.9 has replaced the ar8035 phy with an adin1300, which will always appear at address 1. Change the reg property of the phy node to the magic value 0xffffffff, which indicates to the generic phy driver that all addresses should be probed. That allows the same node (which is pinned by phy-handle) to match either the AR8035 PHY at both possible addresses, as well as the new one at address 1. Also add the new adi,phy-output-clock property for enabling the 125MHz clock used by the fec ethernet controller, as submitted to Linux [1]. Linux solves this problem differently: For the ar8035 phy it will probe both phy nodes in device-tree in order, and use the one that succeeds. For the new adin1300 it expects U-Boot to patch the status field in the DTB before booting While at it also sync the reset-delay with the upstream Linux dtb. [1] https://patchwork.kernel.org/project/netdevbpf/patch/20220428082848.12191-4-josua@solid-run.com/ Signed-off-by: Josua Mayer <josua@solid-run.com>
2022-06-14phy: adin: add support for clock outputJosua Mayer
The ADIN1300 supports generating certain clocks on its GP_CLK pin, as well as providing the reference clock on CLK25_REF. Add support for selecting the clock via device-tree properties. This patch is based on the Linux implementation for this feature, which has been added to netdev/net-next.git [1]. [2] https://patchwork.kernel.org/project/netdevbpf/cover/20220517085143.3749-1-josua@solid-run.com/ Signed-off-by: Josua Mayer <josua@solid-run.com>
2022-06-14phy: adin: fix broken support for adi, phy-mode-overrideNate Drude
Currently, the adin driver fails to compile. The original patch introducing the adin driver used the function phy_get_interface_by_name to support the adi,phy-mode-override property. Unfortunately, a few days before the adin patch was accepted, another patch removed support for phy_get_interface_by_name: https://github.com/u-boot/u-boot/commit/123ca114e07ecf28aa2538748d733e2b22d8b8b5 This patch refactors adin_get_phy_mode_override, implementing the logic in the new function, ofnode_read_phy_mode, from the patch above. Signed-off-by: Nate Drude <nate.d@variscite.com> Tested-by: Josua Mayer <josua@solid-run.com> Signed-off-by: Josua Mayer <josua@solid-run.com>
2022-06-14imx8mn_evk: Add Ethernet support to the LPDDR4 variantFabio Estevam
The imx8mn-ddr4-evk board has Ethernet support already, but the lpddr4 board does not. Add Ethernet support for the LPDDR4 variant too. Signed-off-by: Fabio Estevam <festevam@denx.de>
2022-06-14board: apalis-imx8: add new 8gb product variantPhilippe Schenker
Add the new Apalis iMX8 product variant 0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT the only difference to the product 0037 Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT is the 8gb of RAM. Toradex strategy to choose the correct RAM timing in SCFW is by fuses in the user area telling which RAM timing to load. This commit makes use of this information to set the correct size of the RAM and therefore distinguish between the new 0067 and 0037 product Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2022-06-14toradex: tdx-cfg-block: add new 8gb apalis-imx8Philippe Schenker
0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT This module is identical to its 4GB counterpart 0037: Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT except for the RAM size. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2022-06-14imx8mn_evk: Add the missing spl.bin entryFabio Estevam
The generated flash.bin does not boot the imx8mn evk LPDDR4 variant as it misses the spl.bin description in binman. Add its entry to fix the boot on the imx8mn evk LPDDR4 variant. Signed-off-by: Fabio Estevam <festevam@denx.de> Tested-by: Arti Zirk <art@zirk.me> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-06-14dtoc: Update test_src_scan.py for new tegra compatiblesTom Rini
This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-14Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-tegraTom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-13board: apalis_t30/tk1/colibri_t20/t30: integrate mac address via dtMarcel Ziswiler
Use device tree to set MAC address of the Ethernet chip. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2022-06-13arm: tegra: Update some DT compatiblesPeter Robinson
Some of the DT compatibles have changed upstream so add new DT compatibles to ensure things continue to keep working if the device trees are updated. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2022-06-13pci: tegra: Update error prints with new linesPeter Robinson
Add new lines to make errorr messages easier to read. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2022-06-13ARM: tegra: XUSB padctl: Add new lines for errorsPeter Robinson
Add new lines for error messages to make them easier to read. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2022-06-13Merge tag 'efi-2022-07-rc5' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-07-rc5 UEFI: * Ignore OsIndications if CONFIG_EFI_IGNORE_OSINDICATIONS=y * Correct UEFI default binary name * Let efidebug create boot options without file path * Support booting with a boot option with shortened device only device path
2022-06-12efi_loader: create boot options without file pathHeinrich Schuchardt
Allow the efidebug command to create boot options without file path, e.g. efidebug boot add -b 0001 'short dev only' host 0:1 '' efidebug boot add -B 0002 'long dev only' host 0:1 '' Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-06-12efi_loader: allow booting from short dev only DPHeinrich Schuchardt
Allow booting from a short form device-path without file path, e.g. /HD(1,GPT,5ef79931-a1aa-4c70-9d67-611e8f69eafd,0x800,0x1000) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-06-12efi_loader: correctly identify binary nameHeinrich Schuchardt
Only on the sandbox the default EFI binary name (e.g. BOOTX64.EFI) must match the host architecture. In all other cases we must use the target architecture. Use #elif where appropriate. Reported-by: Vagrant Cascadian <vagrant@reproducible-builds.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-12EFI: FMP: Use a common GetImageInfo function for FIT and raw imagesSughosh Ganu
The GetImageInfo function definitions for the FIT images and raw images are the same. Use a common function for the both the Firmware Management Protocol(FMP) instances for raw and FIT images. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-12EFI: Do not consider OsIndications variable if ↵Sughosh Ganu
CONFIG_EFI_IGNORE_OSINDICATIONS is enabled The EFI_IGNORE_OSINDICATIONS config symbol was introduced as a mechanism to have capsule updates work even on platforms where the SetVariable runtime service was not supported. The current logic requires the OsIndications variable to have been set to a 64 bit value even when the EFI_IGNORE_OSINDICATIONS config is enabled. Return an error code on not being able to read the variable only when EFI_IGNORE_OSINDICATIONS is not enabled. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-08Merge https://source.denx.de/u-boot/custodians/u-boot-usbTom Rini
- MediaTek XHCI bugfix, add USB251xB/xBi driver
2022-06-07misc: Port USB251xB/xBi Hi-Speed Hub Controller Driver from LinuxMarek Vasut
This patch adds a driver for configuration of the Microchip USB251xB/xBi USB 2.0 hub controller series with USB 2.0 upstream connectivity, SMBus configuration interface and two to four USB 2.0 downstream ports. This is ported from Linux as of Linux kernel commit 5c2b9c61ae5d8 ("usb: usb251xb: add boost-up property support") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Simon Glass <sjg@chromium.org>
2022-06-07Merge https://source.denx.de/u-boot/custodians/u-boot-watchdogTom Rini
- Fix SPL build with watchdog disabled in asm files (Pali)
2022-06-07Merge tag 'xilinx-for-v2022.07-rc4-v2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2022.07-rc4-v2 - Fix revision name (remove spaces)
2022-06-07usb: xhci-mtk: disable all ports when disable host controllerChunfeng Yun
This is used to avoid the ports status of IPPC being brought in kernel stage, it may cause ports error especially when the xhci controller is a component of dual-role controller. Reported-by: Yun-Chien Yu <yun-chien.yu@mediatek.com> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
2022-06-07watchdog: Fix SPL build with watchdog disabled in asm filesPali Rohár
Allow to compile assembler files in SPL build which calls WATCHDOG_RESET function when watchdog is disabled in SPL and enabled in U-Boot proper. This issue was fixed in past by commit 7fbd42f5afc4 ("watchdog: Handle SPL build with watchdog disabled") for C source files, but not for assembler source files. Currently the only assembler source file which calls WATCHDOG_RESET is arch/powerpc/lib/ticks.S, so this patch affects and fixes powerpc SPL builds. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-06-06Prepare v2022.07-rc4Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06configs: fsl: add missing SYS_FMAN_FW_ADDR definesCamelia Groza
Two defconfigs were missed when transitioning the SYS_FMAN_FW_ADDR symbol to Kconfig. CONFIG_SYS_FMAN_FW_ADDR is currently initialized to 0 by default on these builds, which prevents the firmware from loading. Add the correct symbols to these defconfigs. Fixes: a97a071d10d2b ("configs: fsl: migrate FMAN/QE specific defines to Kconfig") Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2022-06-06doc: update mail author for st-dt.rstPatrick Delaunay
Update author email address with the one dedicated to upstream activities. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-06-06xilinx: fru: Replace spaces with \0 in detected revisionMichal Simek
Also fix board revision field where spaces are used instead of \0. The same change was done for board name by commit 530560b6f8eb ("xilinx: fru: Replace spaces with \0 in detected name"). Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/e069e5134e57899e859786ad8ba48721df6df752.1653911444.git.michal.simek@amd.com
2022-06-04Merge tag 'efi-2022-07-rc4-4' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-07-rc4-4 UEFI: * Fix the implementation of the firmware management protocol * Fix the unit tests for signed update capsules
2022-06-04efi: test/py: authenticate fit capsulesVincent Stehlé
Add support for the authentication of UEFI capsules containing FIT images. The authentication code is moved out of the function handling raw images into a new function efi_firmware_capsule_authenticate(). The special case for the FMP header coming from edk2 tools is preserved. There is no functional change for capsules containing raw images. The python test for signed capsules with raw images is renamed with no functional change and a new test is added for signed capsules containing FIT images. This can be tested with sandbox64_defconfig or sandbox_flattree_defconfig, plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y. Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-06-04test/py: efi_capsule: repair image authentication testVincent Stehlé
Repair the python tests for authenticated EFI capsules, which can be run with sandbox_defconfig plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y. - Account for the reset changes done by commit 3e6f81000672 ("efi_loader: test/py: Reset system after capsule update on disk"). - Fix the capsule GUID typo introduced by commit 2e9c3c6965ba ("test: capsule: Modify the capsule tests to use GUID values for sandbox"). Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-06-04EFI: Update the documentation to reflect the correct value of OsIndicationsSughosh Ganu
The OsIndications is a 64 bit variable, and the current code expects the value of the variable to be 64 bit. Update the documentation to reflect this fact. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-04EFI: Populate descriptor_count value only when image_info_size is not zeroSughosh Ganu
The GetImageInfo function of the Firmware Mangement Protocol(FMP) gets called initially to query the size of the image descriptor array that would have to be allocated. During this call, the rest of the function arguments, specifically pointers might be passed as NULL. Do not populate the descriptor_count value before it is known that the call to GetImageInfo has been made with the allocated buffer for the image descriptors. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-04doc: environment: Fix typoChris Packham
"valu" should be "value". Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-03Merge branch '2022-06-03-assorted-fixes'Tom Rini
- armv8 TCR write bugfix, ubifs bugfix, imx8mq clk bugfixes, two network fixes, Add U-Boot version to chosen node, update TI AM64x board maintainers
2022-06-03board: ti: am64x: Update MAINTAINERSDave Gerlach
Move maintainership of TI AM64x boards to Vignesh. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2022-06-03squashfs: Fix compilation on big endian systemsPali Rohár
Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2022-06-03imx: imx8mq: select CONFIG_CMD_CLKPeng Fan
select CONFIG_CMD_CLK to enable dump clk in uboot shell Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-06-03imx: imx8mq: default select CLK_IMX8MQPeng Fan
Since the power domain driver default select CONFIG_CLK, so we will meet lots failures without CLK_IMX8MQ, so default select it. Fixes: commit 4eb82c2e56a7c ("imx: power-domain: Get rid of SMCCC dependency") Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-06-03fdt: Add U-Boot version to chosen nodeFrancesco Dolcini
Add a new device tree property "u-boot,version" in the chosen node to pass the U-Boot version to the operating system. This can be useful to implement a firmware upgrade procedure from the operating system. Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-06-03net: Check for the minimum IP fragmented datagram sizeFabio Estevam
Nicolas Bidron and Nicolas Guigo reported the two bugs below: " ----------BUG 1---------- In compiled versions of U-Boot that define CONFIG_IP_DEFRAG, a value of `ip->ip_len` (IP packet header's Total Length) higher than `IP_HDR_SIZE` and strictly lower than `IP_HDR_SIZE+8` will lead to a value for `len` comprised between `0` and `7`. This will ultimately result in a truncated division by `8` resulting value of `0` forcing the hole metadata and fragment to point to the same location. The subsequent memcopy will overwrite the hole metadata with the fragment data. Through a second fragment, this can be exploited to write to an arbitrary offset controlled by that overwritten hole metadata value. This bug is only exploitable locally as it requires crafting two packets the first of which would most likely be dropped through routing due to its unexpectedly low Total Length. However, this bug can potentially be exploited to root linux based embedded devices locally. ```C static struct ip_udp_hdr *__net_defragment(struct ip_udp_hdr *ip, int *lenp) { static uchar pkt_buff[IP_PKTSIZE] __aligned(PKTALIGN); static u16 first_hole, total_len; struct hole *payload, *thisfrag, *h, *newh; struct ip_udp_hdr *localip = (struct ip_udp_hdr *)pkt_buff; uchar *indata = (uchar *)ip; int offset8, start, len, done = 0; u16 ip_off = ntohs(ip->ip_off); /* payload starts after IP header, this fragment is in there */ payload = (struct hole *)(pkt_buff + IP_HDR_SIZE); offset8 = (ip_off & IP_OFFS); thisfrag = payload + offset8; start = offset8 * 8; len = ntohs(ip->ip_len) - IP_HDR_SIZE; ``` The last line of the previous excerpt from `u-boot/net/net.c` shows how the attacker can control the value of `len` to be strictly lower than `8` by issuing a packet with `ip_len` between `21` and `27` (`IP_HDR_SIZE` has a value of `20`). Also note that `offset8` here is `0` which leads to `thisfrag = payload`. ```C } else if (h >= thisfrag) { /* overlaps with initial part of the hole: move this hole */ newh = thisfrag + (len / 8); *newh = *h; h = newh; if (h->next_hole) payload[h->next_hole].prev_hole = (h - payload); if (h->prev_hole) payload[h->prev_hole].next_hole = (h - payload); else first_hole = (h - payload); } else { ``` Lower down the same function, execution reaches the above code path. Here, `len / 8` evaluates to `0` leading to `newh = thisfrag`. Also note that `first_hole` here is `0` since `h` and `payload` point to the same location. ```C /* finally copy this fragment and possibly return whole packet */ memcpy((uchar *)thisfrag, indata + IP_HDR_SIZE, len); ``` Finally, in the above excerpt the `memcpy` overwrites the hole metadata since `thisfrag` and `h` both point to the same location. The hole metadata is effectively overwritten with arbitrary data from the fragmented IP packet data. If `len` was crafted to be `6`, `last_byte`, `next_hole`, and `prev_hole` of the `first_hole` can be controlled by the attacker. Finally the arbitrary offset write occurs through a second fragment that only needs to be crafted to write data in the hole pointed to by the previously controlled hole metadata (`next_hole`) from the first packet. ### Recommendation Handle cases where `len` is strictly lower than 8 by preventing the overwrite of the hole metadata during the memcpy of the fragment. This could be achieved by either: * Moving the location where the hole metadata is stored when `len` is lower than `8`. * Or outright rejecting fragmented IP datagram with a Total Length (`ip_len`) lower than 28 bytes which is the minimum valid fragmented IP datagram size (as defined as the minimum fragment of 8 octets in the IP Specification Document: [RFC791](https://datatracker.ietf.org/doc/html/rfc791) page 25). ----------BUG 2---------- In compiled versions of U-Boot that define CONFIG_IP_DEFRAG, a value of `ip->ip_len` (IP packet header's Total Length) lower than `IP_HDR_SIZE` will lead to a negative value for `len` which will ultimately result in a buffer overflow during the subsequent `memcpy` that uses `len` as it's `count` parameter. This bug is only exploitable on local ethernet as it requires crafting an invalid packet to include an unexpected `ip_len` value in the IP UDP header that's lower than the minimum accepted Total Length of a packet (21 as defined in the IP Specification Document: [RFC791](https://datatracker.ietf.org/doc/html/rfc791)). Such packet would in all likelihood be dropped while being routed to its final destination through most routing equipment and as such requires the attacker to be in a local position in order to be exploited. ```C static struct ip_udp_hdr *__net_defragment(struct ip_udp_hdr *ip, int *lenp) { static uchar pkt_buff[IP_PKTSIZE] __aligned(PKTALIGN); static u16 first_hole, total_len; struct hole *payload, *thisfrag, *h, *newh; struct ip_udp_hdr *localip = (struct ip_udp_hdr *)pkt_buff; uchar *indata = (uchar *)ip; int offset8, start, len, done = 0; u16 ip_off = ntohs(ip->ip_off); /* payload starts after IP header, this fragment is in there */ payload = (struct hole *)(pkt_buff + IP_HDR_SIZE); offset8 = (ip_off & IP_OFFS); thisfrag = payload + offset8; start = offset8 * 8; len = ntohs(ip->ip_len) - IP_HDR_SIZE; ``` The last line of the previous excerpt from `u-boot/net/net.c` shows where the underflow to a negative `len` value occurs if `ip_len` is set to a value strictly lower than 20 (`IP_HDR_SIZE` being 20). Also note that in the above excerpt the `pkt_buff` buffer has a size of `CONFIG_NET_MAXDEFRAG` which defaults to 16 KB but can range from 1KB to 64 KB depending on configurations. ```C /* finally copy this fragment and possibly return whole packet */ memcpy((uchar *)thisfrag, indata + IP_HDR_SIZE, len); ``` In the above excerpt the `memcpy` overflows the destination by attempting to make a copy of nearly 4 gigabytes in a buffer that's designed to hold `CONFIG_NET_MAXDEFRAG` bytes at most which leads to a DoS. ### Recommendation Stop processing of the packet if `ip_len` is lower than 21 (as defined by the minimum length of a data carrying datagram in the IP Specification Document: [RFC791](https://datatracker.ietf.org/doc/html/rfc791) page 34)." Add a check for ip_len lesser than 28 and stop processing the packet in this case. Such a check covers the two reported bugs. Reported-by: Nicolas Bidron <nicolas.bidron@nccgroup.com> Signed-off-by: Fabio Estevam <festevam@denx.de>
2022-06-03armv8: Fix TCR 64-bit writesAndre Przywara
The AArch64 TCR_ELx register is a 64-bit register, and many newer architecture features use bits in the upper half. So far U-Boot was igorant of those bits, trying to leave them alone. However, in an effort to set bit 31 to 1, it failed doing so, because the compiler sign-extended "1 << 31", so that all bits[63:31] got set. Older ARMv8.0 cores don't define anything dangerous up there, but newer architecture revisions do, and setting all those bits will end badly: ================= $ qemu-system-aarch64 -cpu max .... U-Boot 2022.07-rc1 (May 09 2022 - 15:21:00 +0100) DRAM: 1.5 GiB ================= (hangs here) Defining TCR_ELx_RSVD to "1U << 31" avoids the sign-extension, so all upper bits stay at a safe 0 value. This means no more surprises when U-Boot runs on a more capable CPU core. Reported-by: Balaji Anandapadmanaban <Balaji.Anandapadmanaban@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Tested-by: Peter Collingbourne <pcc@google.com> Reviewed-by: Peter Collingbourne <pcc@google.com>
2022-06-03net: enetc: unregister mdiobusMichael Walle
If the device fails to probe - for example, when there is no ethaddr set - then the private data is automatically freed but the mdiobus remains registered. Fixes: 1e354cb39314 ("drivers: net: fsl_enetc: register internal MDIO bus") Signed-off-by: Michael Walle <michael@walle.cc>
2022-06-03ubifs: Fix lockup/crash when reading filesPali Rohár
Commit b1a14f8a1c2e ("UBIFS: Change ubifsload to not read beyond the requested size") added optimization to do not read more bytes than it is really needed. But this commit introduced incorrect handling of the hole at the end of file. This logic cause U-Boot to crash or lockup when trying to read from the ubifs filesystem. When read_block() call returns -ENOENT error (not an error, but the hole) then dn-> structure is not filled and contain garbage. So using of dn->size for memcpy() argument cause that U-Boot tries to copy unspecified amount of bytes from possible unmapped memory. Which randomly cause lockup of P2020 CPU. Fix this issue by copying UBIFS_BLOCK_SIZE bytes from read buffer when dn->size is not available. UBIFS_BLOCK_SIZE is the size of the buffer itself and read_block() fills buffer by zeros when it returns -ENOENT. This patch fixes ubifsload on P2020. Fixes: b1a14f8a1c2e ("UBIFS: Change ubifsload to not read beyond the requested size") Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-05-31Merge tag 'efi-2022-07-rc4-3' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-07-rc4-3 UEFI: * fix a problem in loading an image from a short-path * fix building the bootmenu command for CONFIG_EFI_LOADER=n * correct the bootefi command syntax * add firmware management protocol to the documentation Others: * bootmenu: fix bootmenu title handling Tested-by: Pali Rohár <pali@kernel.org> [n900, for bootmenu working as before]
2022-05-31bootmenu: use utf-8 for menu titleMasahisa Kojima
The commit a3d0aa87acbe ("bootmenu: update bootmenu_entry structure") changes the bootmenu title type from char to u16(UTF16 string) to support EFI based system. If EFI_LOADER is not enabled, printf("%ls") is not supported, so bootmenu does not appear correctly. This commit changes the type of menu title from u16(UTF16) to utf-8 string and EFI strings is conveted into utf-8. Fixes: a3d0aa87acbe ("bootmenu: update bootmenu_entry structure") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Tested-by: Pali Rohar <pali@kernel.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-28doc/efi: add firmware management protocol to the documentationVincent Stehlé
The firmware management protocol can be used to manage device firmware. U-Boot can be configured to provide an implementation. Document the related functions in the API section. Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-28efi: fix documentation warningsVincent Stehlé
This fixes the following warnings: ./lib/efi_loader/efi_firmware.c:283: warning: Function parameter or member 'package_version' not described in 'efi_firmware_fit_get_image_info' ./lib/efi_loader/efi_firmware.c:283: warning: Function parameter or member 'package_version_name' not described in 'efi_firmware_fit_get_image_info' ./lib/efi_loader/efi_firmware.c:369: warning: bad line: firmware image ./lib/efi_loader/efi_firmware.c:395: warning: Function parameter or member 'package_version' not described in 'efi_firmware_raw_get_image_info' ./lib/efi_loader/efi_firmware.c:395: warning: Function parameter or member 'package_version_name' not described in 'efi_firmware_raw_get_image_info' Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-28lib/charset: fix compile warningsMasahisa Kojima
This commit fixes the following compile warnings for the documentation. ./include/charset.h:276: warning: Function parameter or member 'size' not described in 'u16_strlcat' ./include/charset.h:276: warning: Excess function parameter 'count' description in 'u16_strlcat' Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>