summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2025-07-24sandbox: eth-raw: Prevent possible buffer overflowAndrew Goodbody
Instead of strcpy which is unbounded use strlcpy to ensure that the receiving buffer cannot be overflowed. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-24uclass: Cleanup uclass_find_next_deviceAndrew Goodbody
uclass_find_next_device always returns 0, so instead make it a void and update calling sites. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-24Merge tag 'xilinx-for-v2025.10-rc1-v2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze AMD/Xilinx/FPGA changes for v2025.10-rc1 v2 zynqmp: - Generate fit-dtb.blob all the time - Simplify power-domain driver bind zynqmp_mini: - Remove PSCI_RESET fpga: - Improve user feedback in case of FPGA bitstream load failure misc: - Fix kernel-doc in gpio zynq and axi_mrmac spi: - Revert fix in STIG mode [trini: Remove CONFIG_FPGA_VERSALPL=y from sandbox due to sandbox+clang+asan test problem] Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-24firmware: zynqmp: Simplify power-domain driver bindMichal Simek
CONFIG_IS_ENABLED macro is covering CONFIG_POWER_DOMAIN or CONFIG_SPL_POWER_DOMAIN Kconfig symbols based on build target which simplify logic around binding power domain driver. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c75627e92eeaffedf0f7e682edd4f6f39f0b5706.1752826352.git.michal.simek@amd.com
2025-07-24Revert "spi: cadence_qspi: Fix odd byte write issue in STIG mode"Prasanth Babu Mantena
The buffer that is being used to write into the flash needs to be handled properly with padding of 0xFF. The place that this is done can be at a more generic place like spi-nor core. This reverts commit cd9123507003e07b13e61d72e14e493bb338e827. Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20250716070407.2082524-1-p-mantena@ti.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24net: xilinx: Fix kernel-doc for axi_mrmac function parametersVenkatesh Yadav Abbarapu
The kernel-doc comment for the axi_mrmac_recv function was missing the colon (':') after the '@packetp' parameter tag. The kernel-doc comment for the axi_mrmac_free_pkt function was missing the colon (':') after the 'length' parameter tag. This caused a Sparse warnings regarding the 'packetp' and 'length' parameters not being described. Fix the formatting to align with kernel-doc standards and resolve the warning. drivers/net/xilinx_axi_mrmac.c:357: warning: Function parameter or member 'packetp' not described in 'axi_mrmac_recv' drivers/net/xilinx_axi_mrmac.c:411: warning: Function parameter or member 'length' not described in 'axi_mrmac_free_pkt' Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20250717044855.1359443-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24gpio: zynq: Fix the documentation warning in zynq_gpio_get_bank_pinVenkatesh Yadav Abbarapu
The 'dev' parameter in the zynq_gpio_get_bank_pin function was not described in its kernel-doc comment block, leading to a Sparse warning. drivers/gpio/zynq_gpio.c:194: warning: Function parameter or member 'dev' not described in 'zynq_gpio_get_bank_pin' Add a description for the 'dev' parameter to satisfy the documentation requirements and improve code clarity for this function. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20250717044632.1353588-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24drivers: fpga: fix function declaration without a prototypePieter Van Trappen
As reported by clang 20.1, fix multiple of the following: drivers/fpga/ivm_core.c:593:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 593 | long int ispVMDataSize() | ^ | void Also fix the following warning from checkpatch.pl: WARNING: Prefer 'long' over 'long int' as the int is unnecessary Signed-off-by: Pieter Van Trappen <pieter.van.trappen@cern.ch> Link: https://lore.kernel.org/r/20250708152455.1214487-6-vtpieter@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24drivers: fpga: cleanup printf usagePieter Van Trappen
Remove `fpga_no_sup` to get rid of Werror=unused-function when all FPGA configurations are enabled. Swap all printf calls to log_* as this is now preferred and includes the calling __func__. Signed-off-by: Pieter Van Trappen <pieter.van.trappen@cern.ch> Link: https://lore.kernel.org/r/20250708152455.1214487-5-vtpieter@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24drivers: fpga: correct compiler errors and warningsPieter Van Trappen
Errors reported by GCC 14.2 when enabling FPGA commands and drivers. Also many style fixes as reported by checkpatch.pl on the diffs. Most changes in stratixII.c which has been reorganized as well to avoid the top function prototypes. No functional changes. Signed-off-by: Pieter Van Trappen <pieter.van.trappen@cern.ch> Link: https://lore.kernel.org/r/20250708152455.1214487-4-vtpieter@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24drivers: fpga: add Kconfig dependencyPieter Van Trappen
FPGA_SOCFPGA requires ARCH_SOCFPGA cause socfpga.c contains arch/arm/mach-socfpga/* include macros. Signed-off-by: Pieter Van Trappen <pieter.van.trappen@cern.ch> Link: https://lore.kernel.org/r/20250708152455.1214487-3-vtpieter@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24cmd: fpga: improve user feedback in case of bitstream load failurePieter Van Trappen
In cmd/fpga.c, change some `debug` calls to `log_err` for important user feedback and use CMD_RET_FAILURE in favor of CMD_RET_USAGE due to its long output which hides the actual, useful return message. Change the remaining `debug` calls to `log_debug`. Remove all 'fpga:' and __func__ strings as log_* has this covered. For `do_fpga_loads`, move up the `do_fpga_check_params` call for more consistent command output; use a constant instead of multiple '5' use. In drivers/fpga/zynq*.c, change 'up to' to 'above' which corrects this confusing/wrong statement. Signed-off-by: Pieter Van Trappen <pieter.van.trappen@cern.ch> Link: https://lore.kernel.org/r/20250708152455.1214487-2-vtpieter@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-24Fix emmc error state after mmc write timeoutIulian Banaga
This is a fix for the sporadic mmc write failure: mmc write failed 0 blocks written: ERROR After this happens the emmc will remain in an error state where subsequent read/writes fail with a timeout. The mmc driver sends CMD25 - WRITE_MULTIPLE_BLOCK which can sporadically timeout. When this happens, the mmc driver aborts the transfer and returns the above error messages. But the emmc still remains in data transfer mode, since the timeout was decided by uboot, not by the emmc. Fix this by sending the STOP_TRANSMISSION command (CMD12) and waiting for the emmc to be in ready state again (CMD13). Transferring data blocks after a CMD25 can take anywhere between 5 and +15s on Samsung EMMCs and the current timeout is not enough. Increase the timeout by 2x to accommodate the long transfer times observed. Signed-off-by: Iulian Banaga <iulianeugen.banaga@mobileye.com> Acked-by: Jimmy Durand Wesolowski <jimmy.wesolowski@mobileye.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-07-24mmc: exynos_dw_mmc: add exynos5420 compatiblesJaehoon Chung
The exynos5420 DTSes in linux kernel uses the compatibles samsung,exynos5420-dw-mshc{,-smu} instead of just samsung,exynos-dwmmc. Match the additional compatibles in the driver to make it possible to use it with DTSes from Linux kernel. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> [ grimler: rebase after clksel reg abstraction and re-write commit message ] Signed-off-by: Henrik Grimler <henrik@grimler.se> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Anand Moon <linux.amoon@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-07-24mmc: s5p_sdhci: add samsung,exynos4210-sdhci compatibleHenrik Grimler
the Exynos4210 devices in u-boot uses samsung,exynos4412-sdhci as sdhci compatible in their DTSes, while the upstream DTSes uses samsung,exynos4210-sdhci. Add samsung,exynos4210-sdhci compatible string for s5p_sdhci driver as well so that it can be used with upstream DTSes. Signed-off-by: Henrik Grimler <henrik@grimler.se> Reviewed-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-07-24mmc: s5p_sdhci: remove duplicated card detect codeHenrik Grimler
The common sdhci infrastructure is already parsing the cd-gpios property, since commit 451931ea7002 ("mmc: sdhci: Read cd-gpio from devicetree"). The s5p code is therefore duplicated, and also broken since it assumes that the GPIO value is inverted, while the sdhci code correctly follows the ACTIVE_LOW/ACTIVE_HIGH flag specified in the device tree. This fix was originally authored by Simon Shields: https://github.com/fourkbomb/u-boot/commit/2eac9dea7903 The change has been tested on exynos4210-i9100, a device similar to exynos4210-trats. Signed-off-by: Henrik Grimler <henrik@grimler.se> Reviewed-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-07-23block: Remove blk_find_first/nextGreg Malysa
In [0], Andrew noted a code quality issue in the implementation of blk_find_first and blk_find_next. This led to the observation that the logic of these functions was also likely incorrect, and based on a quick check it seemed the functions were unused outside of test code, which did not exercise the potential failure case, so we felt they should be removed. In [1], a test patch which illustrates the failure in sandbox is provided for reference. Because a more thorough check agrees that these functions are unused, they are currently incorrect, and fixed/removable flags on block devices prior to probe are unreliable, just remove these functions instead of fixing them. All potential users should have used blk_first_device_err instead anyway. CI results at [2]. [0] https://patchwork.ozlabs.org/project/uboot/patch/20250714-blk-uclass-v1-1-d21428c5f762@linaro.org/ [1] https://gist.github.com/gmalysa/b05e73a5c14bc18c5741a0e0e06a2992 [2] https://gitlab.com/gmalysa/lnxdsp-u-boot/-/pipelines/1931210857 Signed-off-by: Greg Malysa <malysagreg@gmail.com> Reviewed-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-23sysreset: psci: Fix SPL dependencyMichal Simek
SYSRESET_PSCI should select SPL_ARM_PSCI_FW only when SPL_SYSRESET is enabled/required. This change saves 1.6kB on Xilinx ZynqMP Kria platform. Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-07-22fastboot: Fix off by 1 errorAndrew Goodbody
strlen only reports length of string not including terminating 0 byte but this has to be included in length of receiving buffer on copy so adjust length check to be correct. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-07-22drivers: fastboot: Add support for SPI flash memoryAriel D'Alessandro
Fastboot currently supports MMC and NAND flash devices. Similarly, extend the support to SPI flash memories. Note that in this initial implementation, partitions on the device are not supported yet, but raw partitions can be set in U-Boot environment. To define a raw partition descriptor, add an environment variable similar to the MMC case: ``` fastboot_raw_partition_<raw partition name>=<offset> <size> ``` for example: ``` fastboot_raw_partition_boot=0x0 0x1000000 ``` Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-07-19Merge tag 'i2c-for-2025.10-take2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-i2c i2c updates for v2025.10 - i2c Kconfig updates from Tom - add some driver dependencies - added missing include delay.h in iproc_i2c.c - i2c: muxes: Add PCA9541 i2c arbitrator driver from Padmarao Begari - pca954x: add pca9545 support from Frank Wunderlich - cmd: i2c: fix build when CFG_SYS_I2C_NOPROBES defined with DM_I2C From Holger Brunck
2025-07-18misc: Remove DS4510 driverTom Rini
As no platforms use this driver anymore and it's not been converted from to DM_I2C for use, remove it. Fixes: ed7fe2bee12a ("ppc: Remove xpedite boards") Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-18drivers: misc: Remove pca9551_led driverTom Rini
This driver has not been converted to DM_I2C and the last platform that used it was removed as well. Remove the driver. Fixes: 4bbcec08ebec ("arm: Remove mx6dlarm2 board") Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-18input: Tighten dependency requirements for TEGRA_KEYBOARDTom Rini
This driver requires headers which only exist on Tegra. Express that requirement in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-18misc: Tighten requirements on IHS_FPGA driverTom Rini
This driver requires that the gdsys legacy driver option also be enabled in order to build. Express that requirement in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-17Merge tag 'u-boot-imx-master-20250717' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/27088 - Add support for the i.MX95 B0 version. - Enable standard boot for phycore-imx8mp. - Kconfig fixes for i.MX MMC and FSL_SEC_MON. - Support 4Gb single die variant of the i.MX8MM Venice board.
2025-07-17Merge 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/27087 - Board: mpfs_icicle: Fix board_fit_config_name_match and disable DEBUG_UART - Board: Add SD card support to the Beagle-V-Fire - Board: Add support for TH1520-integrated GMACs
2025-07-17mmc: Remove unused kona_sdhci driverTom Rini
As no platforms use this driver anymore, remove it. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-07-17mmc: Tighten some mmc driver dependenciesTom Rini
A large number of mmc drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-07-17mmc: Take cleanup path to free memory on error exitAndrew Goodbody
Instead of returning -EINVAL directly which will not call the cleanup path to free memory, fix the code to set the error and then goto the cleanup code. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-07-17nxp: Move FSL_SEC_MON related options to arch/Kconfig.nxpTom Rini
The options related to FSL_SEC_MON are part of the chain of trust related options and should be under that menu, so move it there. Furthermore we don't need to prompt for the driver itself but do need to allow for configuration of the monitor endianess. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-17arm: imx: Remove unused mxcmmc driverTom Rini
As no platforms use this driver anymore, remove it. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-17drivers: net: Add T-Head DWMAC glue layerYao Zi
The Designware IP integrated in TH1520 SoC requires extra clock configuration to operate correctly. The Linux kernel's T-Head DWMAC glue driver is ported and adapted to U-Boot's API. Signed-off-by: Yao Zi <ziyao@disroot.org> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-17clk: thead: th1520-ap: Correctly handle flags for dividersYao Zi
Unlike the gate clocks which make no use of flags, most dividers in TH1520 SoC are one-based, thus are applied with CLK_DIVIDER_ONE_BASED flag. We couldn't simply ignore the flag, which causes wrong results when calculating the clock rates. Add a member to ccu_div_internal for defining the flags, and pass it to divider_recalc_rate(). With this fix, frequency of all the clocks match the Linux kernel's calculation. Fixes: e6bfa6fc94f ("clk: thead: Port clock controller driver of TH1520 SoC") Signed-off-by: Yao Zi <ziyao@disroot.org> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-17spi: coreqspi: add xfer function for PolarFire SoCEoin Dickson
Add xfer function to PolarFire SoC coreqspi driver. The read and write operations are limited to one byte at a time instead of four as CMD18 (multiple block read) reads garbage when four byte ops are enabled. Signed-off-by: Eoin Dickson <eoin.dickson@microchip.com> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-17gpio: add PolarFire SoC GPIO and Core GPIO driverEoin Dickson
This driver adds GPIO support for PolarFire SoC family, this is required to add sd card support on the Beagle-V-Fire as it uses GPIO chip selects Signed-off-by: Eoin Dickson <eoin.dickson@microchip.com> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-16dfu: Fix dfu_config_interfaces() for single interface DFU syntaxSam Protsenko
As stated in DFU documentation [1], the device interface part might be missing in dfu_alt_info: dfu_alt_info The DFU setting for the USB download gadget with a semicolon separated string of information on each alternate: dfu_alt_info="<alt1>;<alt2>;....;<altN>" When several devices are used, the format is: - <interface> <dev>'='alternate list (';' separated) So in first case dfu_alt_info might look like something like this: dfu_alt_info="mmc 0=rawemmc raw 0 0x747c000 mmcpart 1;" And in second case (when the interface is missing): dfu_alt_info="rawemmc raw 0 0x747c000 mmcpart 1;" When the interface is not specified the 'dfu' command crashes when called using 'dfu 0' or 'dfu list' syntax: => dfu list "Synchronous Abort" handler, esr 0x96000006, far 0x0 That's happening due to incorrect string handling in dfu_config_interfaces(). In case when the interface is not specified in dfu_alt_info it triggers this corner case: d = strsep(&s, "="); // now d contains s, and s is NULL if (!d) break; a = strsep(&s, "&"); // s is already NULL, so a is NULL too if (!a) // corner case a = s; // a is NULL now which causes NULL pointer dereference later in this call, due to 'a' being NULL: part = skip_spaces(part); That's because as per strsep() behavior, when delimiter ("&") is not found, the token (a) becomes the entire string (s), and string (s) becomes NULL. To fix that issue assign "a = d" instead of "a = s", because at that point variable d actually contains previous s, which should be used in this case. [1] doc/usage/dfu.rst Fixes: commit febabe3ed4f4 ("dfu: allow to manage DFU on several devices") Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Link: https://lore.kernel.org/r/20250709042342.13544-1-semen.protsenko@linaro.org Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-07-16i2c: Kconfig: Tighten some i2c driver dependenciesTom Rini
A few i2c drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-16i2c: Add missing <linux/delay.h> to iproc_i2c.cTom Rini
This driver makes delay function calls while relying on an indirection inclusion of <linux/delay.h>. Add the missing include directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-07-15Merge patch series "drivers/net/airoha_eth: fixes"Tom Rini
Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> says: Several fixes for the airoha ethernet driver. Link: https://lore.kernel.org/r/20250709092810.4032971-1-mikhail.kshevetskiy@iopsys.eu
2025-07-15drivers/net/airoha_eth: enable hw padding of short tx packetsMikhail Kshevetskiy
Transmission of short packets does not work good for XFI (GDM2) and HSGMII (GDM3) interfaces. The issue can be solved with: - padding of short packets to 60 bytes - setting of PAD_EN bit in the corresponding REG_GDM_FWD_CFG(n) register. The issue should present for the lan switch (GDM1) as well, but it does does not appear due to unknown reason. This patch set PAD_EN bit for the used GDM. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2025-07-15drivers/net/airoha_eth: fix stalling in package receivingMikhail Kshevetskiy
ARCH_DMA_MINALIGN is 64 for ARMv7a/ARMv8a architectures, but RX/TX descriptors are 32 bytes long. So they may not be aligned on an ARCH_DMA_MINALIGN boundary. In case of RX path, this may cause the following problem 1) Assume that a packet has arrived and the EVEN rx descriptor has been updated with the incoming data. The driver will invalidate and check the corresponding rx descriptor. 2) Now suppose the next descriptor (ODD) has not yet completed. Please note that all even descriptors starts on 64-byte boundary, and the odd ones are NOT aligned on 64-byte boundary. Inspecting even descriptor, we will read the entire CPU cache line (64 bytes). So we read and sore in CPU cache also the next (odd) descriptor. 3) Now suppose the next packet (for the odd rx descriptor) arrived while the first packet was being processed. So we have new data in memory but old data in cache. 4) After packet processing (in arht_eth_free_pkt() function) we will cleanup the descriptor and put it back to rx queue. This will call flush_dcache_range() function for the even descriptor, so the odd one will be flushed as well (it is in the same cache line). So the old data will be written to the next rx descriptor. 5) We get a freeze. The next descriptor is empty (so the driver is waiting for packets), but the hardware will continue to receive packets on other available descriptors. This will continue until the last available rx descriptor is full. Then the hardware will also freeze. The problem will be solved if the previous descriptor will be put back to the queue instead of the current one. If the current descriptor is even (starts on a 64-byte boundary), then putting the previous descriptor to the rx queue will affect the previous cache line. To be 100% ok, we must make sure that the previous and the one before the previous descriptor cannot be used for receiving at this moment. If the current descriptor is odd, then the previous descriptor is on the same cache line. Both (current and previous) descriptors are not currently in use, so issue will not arrise. WARNING: The following restrictions on PKTBUFSRX must be held: * PKTBUFSRX is even, * PKTBUFSRX >= 4. The bug appears on 32-bit airoha platform, but should be present on 64-bit as well. The code was tested both on 32-bit and 64-bit airoha boards. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2025-07-15drivers/net/airoha_eth: fix packet transmission errorsMikhail Kshevetskiy
The dma_map_single() function calls one of the functions * invalidate_dcache_range(), * flush_dcache_range(). Both of them expect that 'vaddr' is aligned to the ARCH_DMA_MINALIGN boundary. Unfortunately, RX/TX descriptors are 32-byte long. Thus they might not be aligned to the ARCH_DMA_MINALIGN boundary. Data flushing (or invalidating) might do nothing in this case. The same applies to dma_unmap_single() function. In the TX path case the issue might prevent package transmission (filled TX descriptor was not flushed). To fix an issue a special wrappers for * dma_map_single(), * dma_unmap_single() functions were created. The patch fix flushing/invalidatiog for the RX path as well. The bug appears on 32-bit airoha platform, but should be present on 64-bit as well. The code was tested both on 32-bit and 64-bit airoha boards. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2025-07-15drivers/net/airoha_eth: add missing terminator for compatible devices listMikhail Kshevetskiy
Compatible device list must have a terminator. If terminator is missed the u-boot driver subsystem will access random data placed after the list in the memory. The issue can be observed with the "dm compat" command. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2025-07-15net: mediatek: correct the AN8855 TPID value in port isolation settingsWeijie Gao
The TPID value should be 0x9100 instead of 0x8100 according to the datasheet. Fixes: cedafee9ff3 (net: mediatek: add support for Airoha AN8855 ethernet switch) Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2025-07-14ofnode: NULL check bootscr_flash_size before dereferenceAndrew Goodbody
Move the NULL check of bootscr_flash_size to before the first time it is dereferenced to avoid any possible segment violations. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-07-14pci: Assign a default value on reads on errorAndrew Goodbody
Many callers of PCI read functions do not check the return value for error before using the variable that should contain the value read were there not to be an error. However in the error case this variable is never assigned to and so will contain uninitialised data. To provide some certainty as to behaviour in the error case assign a default value of all bits set. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-14scsi: Make static functions consistent using lbaint_tAndrew Goodbody
The static helper functions are inconsistent in their use of their third parameter which is used to pass a block count. Keep consistency by always using lbaint_t here. This will fix an issue where two left shifts were overflowing the variable type in use. This issue found by Smatch Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-07-14cros_ec: sandbox: Use correct value for number of slotsAndrew Goodbody
In the definition of struct ec_state the number of slots that are created is VSTORE_SLOT_COUNT (==4) but the value of req->slot is checked against EC_VSTORE_SLOT_MAX (==32) so this can lead to memory access beyond that allocated. Instead change the size check to use VSTORE_SLOT_COUNT to ensure it matches what has actually been allocated. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-07-14gpio: add SPL to Kconfig option descriptionPhilip Molloy
DM_GPIO_LOOKUP_LABEL and SPL_DM_GPIO_LOOKUP_LABEL had the same description and therefore appeared to be duplicates in Kconfig frontends Signed-off-by: Philip Molloy <philip.molloy@analog.com>