summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-08-23arm: imx: imx9: soc: Fix env location when booting from USBJoão Paulo Gonçalves
On i.MX9 platforms, when booting from USB, the U-Boot environment is always assumed to be in RAM. However, this causes the boot to hang when `CONFIG_ENV_IS_NOWHERE` is not enabled. The boot also hangs even if the environment is present in another storage media (for example, eMMC). Fix the issue by correctly handling the U-Boot environment's location when booting from USB. Also for i.MX95, set the environment location based on the ENV config and not solely based on the boot device type. Suggested-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
2025-08-21Merge patch series "bootstd: rauc: Fix segfault when scanning device with ↵Tom Rini
unsupported layout" Martin Schwan <m.schwan@phytec.de> says: This series fixes a segfault, that would occur at the end of scanning a device, which does not contain the required partition layout scheme for a RAUC system. With this series, a "bootflow scan" should now correctly scan the specified devices with boot method "rauc" without crashing on invalid partition schemes. Link: https://lore.kernel.org/r/20250813-wip-bootmeth-rauc-priv-free-v1-0-1ef928169469@phytec.de
2025-08-21bootstd: rauc: Free private data when bootingMartin Schwan
The private data struct can be freed when loading the boot script, as we don't need the slot information anymore at this point. Signed-off-by: Martin Schwan <m.schwan@phytec.de> Tested-by: Wadim Egorov <w.egorov@phytec.de>
2025-08-21bootstd: rauc: Move freeing private struct to its own functionMartin Schwan
Move freeing a distro_rauc_priv struct to a new, separate function for better reuse. Signed-off-by: Martin Schwan <m.schwan@phytec.de> Tested-by: Wadim Egorov <w.egorov@phytec.de>
2025-08-21bootstd: rauc: Don't null bootflow->bootmeth_privMartin Schwan
Don't null bootflow->bootmeth_priv, as the private struct is freed later on by the bootflow. Signed-off-by: Martin Schwan <m.schwan@phytec.de> Tested-by: Wadim Egorov <w.egorov@phytec.de>
2025-08-21bootstd: rauc: Fix segfault when cleaning up slotsMartin Schwan
Fix a segfault when cleaning up the slots from the private struct. This fault was generated by accessing a member of a null pointer. Signed-off-by: Martin Schwan <m.schwan@phytec.de> Tested-by: Wadim Egorov <w.egorov@phytec.de>
2025-08-21Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-shTom Rini
- DRAM controller driver off-by-one error fix.
2025-08-20ram: renesas: dbsc5: Fix off by 1 errorsAndrew Goodbody
In dbsc5_read_vref_training the arrays dvw_min_byte0_table and dvw_min_byte1_table have 128 elements per channel. The variable vref_stop_index is limited to be a maximum of 128. This means that the index used to access the arrays must use a test of '< vref_stop_index' rather than '<= vref_stop_index' in order to prevent out of bounds accesses to the arrays. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Tested-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-18Merge tag 'net-20250818' of https://source.denx.de/u-boot/custodians/u-boot-netTom Rini
Pull request net-20250818. This is mostly code cleanup and fixes, mainly for issues reported by the Smatch tool, plus two small features for NET_LWIP as well as support for the BCM54612E phy. net-common: - Fix a bunch of issues reported by Smatch - Introduce CONFIG_DNS - Add support for BCM54612E phy net-legacy: - Add missing SPDX-License-Identifier for files originating from LiMon net-lwip: - ping: initialize net_try_count to 1 - sntp: remove redundant sys_check_timeouts() - tftp: resend initial request - Add Kconfig option to show ICMP unreachable errors
2025-08-18phy: cadence: torrent: Set an error code for returnAndrew Goodbody
In cdns_torrent_phy_probe the test for too many lanes configured does not set an error code before taking the error path. This could lead to a silent failure if the calling code does not detect the error. Add the code to return -EINVAL in this case. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18phy: cadence: sierra: Remove variable that is not assigned toAndrew Goodbody
In cdns_sierra_pll_bind_of_clocks the variable 'i' is declared but never assigned to before its value is used in a dev_err. Replace clk_names[i] by the name passed to device_bind(), i.e., "pll_mux_clk". With that, the clk_names[] array is unused and can therefore be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> [jf: update description] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-08-18net: ks8851_mll: Remove unreachable codeAndrew Goodbody
In ks8851_mll_detect_chip the if..else code detects the case of (val & 0xfff0) != CIDER_ID and returns if found. So testing for this again will always fail and the code is unreachable. Just remove the test and code block. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: lwip: ping: set net_try_count to 1Jerome Forissier
The legacy network stack sets net_try_count to 1 at the beginning of the net_loop() function. This is required for net_start_again() to work properly. Therefore, set the variable accordingly in the do_ping() function when NET_LWIP=y. This fixes an issue where a ping to an unreachable destination would run twice on the same network device. For example with qemu_arm64_lwip_defconfig: => dhcp DHCP client bound to address 10.0.2.15 (3 ms) => ping 10.0.0.1 Using virtio-net#32 device ping failed; host 10.0.0.1 is not alive Using virtio-net#32 device ping failed; host 10.0.0.1 is not alive => QEMU: Terminated Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-08-18net: cortina_ni: Fix typo accessing wrong phyAndrew Goodbody
In ca_phy_probe when checking for an external phy it uses a field from the internal phy due to what is assumed to be a copy/paste typo. Make the obvious fix to use the field from the external phy. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18lwip: sntp: remove redundant sys_check_timeouts()Jerome Forissier
Now that sys_check_timeouts() is called in net_lwip_rx(), there is no need to call it from the SNTP receive loop. Remove the redundant call. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-08-18lwip: tftp: resend initial requestJerome Forissier
The TFTP implementation does not resend the initial request if there is no response from the server. Since TFTP is based on UDP, there should be a mechanism to deal with unreliable transmissions at this point, similar to what we have for data packets. Therefore, introduce request retransmission. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> CC: Venkatesh Abbarapu <venkatesh.abbarapu@amd.com> CC: Michal Simek <michal.simek@amd.com> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-08-18net: introduce CONFIG_DNSJerome Forissier
Introduce the DNS Kconfig symbol so that various network commands may use host names without the dns command (CMD_DNS) being selected. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> CC: E Shattow <e@freeshell.de>
2025-08-18net: octeontx2: NULL check before dereferenceAndrew Goodbody
In rvu_af_init if the code fails to allocate memory for nix_af it will take the error path with nix_af == NULL which will dereference nix_af. Add the appropriate NULL check. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: octeontx2: Restore default value for errAndrew Goodbody
In nix_lf_setup there is a default value assigned to err in case an error is detected. However this default value will be overwritten in the for loop so that later code does not return an error code from the function. Add a new assignment to restore err to the default error code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: mvpp2: Use field just assigned in error testAndrew Goodbody
In mvpp2_probe the code attempts to get a value for "gop-port-id" and assigns it to port->gop_id but it then tests port->id for being equal to -1. That is an impossible test as port->id is a field of type u8 so cannot be negative. Change the test to port->gop_id. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: mvpp2: Cannot test unsigned variable to be negativeAndrew Goodbody
In phy_info_parse all uses of the variable phyaddr are as an int so declaring as u32 is not useful and prevents the test for an error return from fdtdec_get_int ever detecting an error. Change phyaddr to be an int. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: mvpp2: Return -ENOMEM for failed allocAndrew Goodbody
Instead of returning -1 on a failed alloc, return -ENOMEM. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: mvpp2: Fix impossible testAndrew Goodbody
You cannot test an unsigned char to be >= 256. Instead make the variables start and end to be ints. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: mv88e6xxx: Fix logical operator instead of bitwiseAndrew Goodbody
In mv88e6xxx_port_enable when attempting to mask out the previous settings of two bits a logical operator was used instead of a bitwise operator. Fix this. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: mediatek: Use correct variable for returnAndrew Goodbody
In mtk_eth_of_to_plat, the last error check has the value in 'priv->phy_addr' but returns ret. Correct to return 'priv->phy_addr' instead. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: ldpaa_eth: Fix buffer overflow in memsetAndrew Goodbody
In ldpaa_eth_open a memset is used to initialise a struct to 0 but the size passed is that of a different struct. Correct to pass the sizeof the struct that is being initialised. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: add missing SPDX-License-Identifier for files originating from LiMonMax Merchel
The header of LiMon imported files reference a License file which does not exist in U-Boot. Some files were forgotten when adding the SPDX-License-Identifier. The LiMon files were originally licensed under GPLv2 as can be seen in commit [2ea91039]. Based on this commit, add the correct SPDX license identifier. While at it drop the reference to the non-existing License file from all LiMon files and update the SPDX-License-Identifier to SPDX version 3. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>
2025-08-18net: lwip: add Kconfig option to show ICMP unreachable errorsJerome Forissier
Add Kconfig symbol LWIP_ICMP_SHOW_UNREACH which, when enabled, prints a message to the console upon reception of ICMP unreachable messages. For example: $ make qemu_arm64_lwip_defconfig $ qemu-system-aarch64 -M virt -cpu max -nographic -bios u-boot.bin [...] => dhcp DHCP client bound to address 10.0.2.15 (0 ms) => tftp 192.168.0.100:69:Image Using virtio-net#32 device TFTP from server 192.168.0.100; our IP address is 10.0.2.15 Filename 'Image'. Load address: 0x40200000 Loading: ICMP destination unreachable (host unreachable) from 192.168.0.16 Timeout! => tftp 192.168.0.16:69:Image Using virtio-net#32 device TFTP from server 192.168.0.16; our IP address is 10.0.2.15 Filename 'Image'. Load address: 0x40200000 Loading: ICMP destination unreachable (port unreachable) from 192.168.0.16 Timeout! => Submitted upstream as https://github.com/lwip-tcpip/lwip/pull/73. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-08-18lwip: icmp: allow reporting ICMP destination unreachableJerome Forissier
Allow reporting ICMP destination unreachable messages via a user-defined callback. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-08-18net: phy: broadcom: add support for BCM54612EJim Liu
It's Broadcom PHY simply described as single-port RGMII 10/100/1000BASE-T PHY. Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2025-08-18net: designware: Fix get_timer value overflowJim Liu
get_timer returns a ulong value representing system time in ms. On a 64-bit system, this ulong value is 64 bits long. However, the driver stores it in a 32-bit unsigned integer, which overflows after 49 days up time, causing the driver to get an incorrect time. Replace the unsigned int variable with a ulong type to properly store the value returned by get_timer. Signed-off-by: Stanley Chu <yschu@nuvoton.com> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2025-08-18phy: marvell: Cannot test unsigned field to be negativeAndrew Goodbody
In comphy_cp110_init_serdes_map in comphy_cp110.c there are two fields in cfg, comphy_lanes_count and comphy_mux_bitcount, which are fetched from the FDT blob with fdtdec_get_int which returns an int. These two fields are then tested for being negative. However the fields are declared as unsigned so those tests must always fail. Change the declaration of those fields to be int instead of u32 and the code will work as expected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
2025-08-18phy: marvell: Fix off by 1 limit checksAndrew Goodbody
The limit checks in get_speed_string and get_type_string are off by 1 as they do not account for the maximum index into an array that can be used is 1 less than the number of elements in that array. Adjust the limit checks to allow for this. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
2025-08-18net: phy: vitesse: Fix incorrect test for timeoutAndrew Goodbody
In vsc8514_config there is a while loop for detecting a config failure using a timeout counter with a post-decrement. In the case of a timeout this will result in the loop exiting with timeout == -1 so use that as the test below the loop to detect that the timeout occurred. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-08-18net: octeontx: Free allocated memory on errorAndrew Goodbody
In octeontx_smi_probe if an error is detected then memory that was allocated is not freed. Small refactor of the code to use a common return and free memory. Also return -ENOMEM for an allocation failure. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: octeontx: Remove unneeded testAndrew Goodbody
In nicvf_cq_handler there is a test for !cqe_count which will return if true so it is guaranteed that cqe_count will true after that point. This makes the later test for cqe_count redundant so it can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-18net: octeontx: Remove unneeded codeAndrew Goodbody
In nicvf_rcv_pkt_handler there is no need to initialise err as it is assigned to immediately after. Also the test for !pkt will return if true meaning that pkt is guaranteed to be true after that code block and so no need to test for it and the redundant test can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-17Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-shTom Rini
Fixes for newer revision of Retronix R-Car V4H Sparrow Hawk and fixes for boards which enable POSITION_INDEPENDENT and also set non-zero CONFIG_TEXT_BASE.
2025-08-17configs: Remove redundant CONFIG_TEXT_BASE assignments for Renesas defconfigsLad Prabhakar
The Renesas board defconfigs explicitly set CONFIG_TEXT_BASE=0x50000000, however U-Boot's POSITION_INDEPENDENT=y build default already places text at 0x0. These hardcoded overrides are therefore unnecessary and will be pruned automatically in upcoming resyncs. Remove the CONFIG_TEXT_BASE lines from the following defconfigs: - hihope_rzg2_defconfig - r8a77970_eagle_defconfig - r8a77970_v3msk_defconfig - r8a77990_ebisu_defconfig - r8a77995_draak_defconfig - r8a779a0_falcon_defconfig - renesas_rzg2l_smarc_defconfig - rz2_beacon_defconfig - silinux_ek874_defconfig Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-17arm64: dts: renesas: r8a779g3: Describe generic SPI NOR support on Retronix ↵Marek Vasut
R-Car V4H Sparrow Hawk board Retronix R-Car V4H Sparrow Hawk EVTA1 is populated with Spansion S25FS512S, EVTB1 is populated with Winbond W77Q51NW. Describe the SPI NOR using generic "jedec,spi-nor" compatible, because both flashes can be auto-detected based on their built-in IDs. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-17arm64: dts: renesas: r8a779g3: Set VDDQ18_25_AVB voltage on Retronix R-Car ↵Marek Vasut
V4H Sparrow Hawk EVTB1 The Retronix R-Car V4H Sparrow Hawk EVTB1 uses 1V8 IO voltage supply for VDDQ18_25_AVB power rail. Update the AVB0 pinmux to reflect the change in IO voltage. Since the VDDQ18_25_AVB power rail is shared, all four AVB0, AVB1, AVB2, TSN0 PFC/GPIO POC[7..4] registers have to be configured the same way. Correct the voltage for EVTA1 boards accordingly by patching the U-Boot control DT in SPL. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-17arm64: dts: renesas: r8a779g3: Invert microSD voltage selector on Retronix ↵Marek Vasut
R-Car V4H Sparrow Hawk EVTB1 Invert the polarity of microSD voltage selector on Retronix R-Car V4H Sparrow Hawk board. The voltage selector was not populated on prototype EVTA1 boards, and is implemented slightly different on EVTB1 boards. As the EVTA1 boards are from a limited run and generally not available, update the DT to make it compatible with EVTB1 microSD voltage selector. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-17arm64: renesas: r8a779g3: Enable xHCI USB on Retronix R-Car V4H Sparrow Hawk ↵Marek Vasut
board Enable support for PCIe based xHCI USB 3.0 driver and USB mass storage support on Retronix R-Car V4H Sparrow Hawk board . Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-17arm64: renesas: r8a779g3: Disable dual-rank DRAM on Retronix R-Car V4H ES2 ↵Marek Vasut
Sparrow Hawk The R-Car V4H SoC before rev.3.0 can not support dual-rank LPDDR5 DRAM. This affects 16 GiB dual-rank DRAM configuration of Retronix R-Car V4H Sparrow Hawk board. Fall back to 8 GiB single-rank DRAM configuration on such systems instead. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-17arm64: renesas: r8a779g3: Disable MicroSD UHS modes on Retronix R-Car V4H ↵Marek Vasut
Sparrow Hawk EVTA1 The Retronix R-Car V4H Sparrow Hawk old revision EVTA1 does not have MicroSD voltage switch populated on the board, therefore the board supports only 3V3 and non-UHS MicroSD cards. While the EVTB1 board is populated with Winbond W77Q51NW SPI NOR, the EVTA1 board is populated with Spansion S25FS512S SPI NOR, those those SPI NOR IDs to discern the two board revisions and apply the MicroSD related DT changes. The MicroSD related DT changes modify the regulator node, which is now a regulator-fixed and supplies only 3V3, and remove sd-uhs-sdr50 and sd-uhs-sdr104 properties from the MicroSD slot controller node. The MicroSD related DT changes cannot be applied as DTO, because the base DT contains nodes which have to be removed in case of EVTA1, but have to be present in case of EVTB1 and newer revisions of the board. Because the EVTA1 is an old revision of the board that is not generally available, it is better to special case it and keep the base DT compatible with EVTB1 and newer revisions of the board which are actually available. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-17pci: pcie-rcar-gen4: Fix PHY initializationMarek Vasut
R-Car V4H Reference Manual R19UH0186EJ0130 Rev.1.30 Apr. 21, 2025 page 4581 Figure 104.3b Initial Setting of PCIEC(example) middle of the figure indicates that fourth write into register 0x148 [2:0] is 0x3 or GENMASK(1, 0). The current code writes GENMASK(11, 0) which is a typo. Fix the typo. Fixes: be3dd0dc2fd9 ("pci: pcie-rcar-gen4: Add Renesas R-Car Gen4 DW PCIe controller driver") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-08-14bootstd: rauc: Change global method to check any partitionMartin Schwan
The bootmeth rauc should scan all partitions, in particular whole devices, and not be a global method. There may exist multiple RAUC systems on different devices and they should all be detected. This also fixes a bug, where both a global bootflow and one using an actual, complete device would be detected at the same time, when scanning for valid bootflows. Signed-off-by: Martin Schwan <m.schwan@phytec.de> Tested-by: Wadim Egorov <w.egorov@phytec.de>
2025-08-14env: Correct Kconfig type for ENV_MMC_SW_PARTITIONTom Rini
As part of renaming environment related Kconfig options, ENV_MMC_SW_PARTITION was inadvertently changed from a string to a bool. Correct this. Fixes: ffc4914703a2 ("env: Rename ENV_MMC_PARTITION to ENV_MMC_SW_PARTITION") Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-08-14Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscvTom Rini
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/27379 - Board: mbv: Prepare MBV for CI - Board: MPFS Icicle Kit cleanup - Board: Add Andes Voyager board support - RISCV: Update SYS_BOOTM_LEN to commonly used value - starfive: fix return code of `mac write_eeprom` - arch/riscv/lib: update memmove and memcpy for big-endian
2025-08-14arch/riscv/lib: update memmove and memcpy for big-endianBen Dooks
Change the shift patterns for the unaligned memory move and copy code to deal with big-endian by definign macros to change the shfit left and right to go the opposite way. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>