summaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)Author
2025-09-30net: mdio: mux-meson-gxl: set reversed bit when using internal phyNeil Armstrong
This bit is necessary to receive packets from the internal PHY. Without this bit set, no activity occurs on the interface. Normally u-boot sets this bit, but if u-boot is compiled without net support, the interface will be up but without any activity. The vendor SDK sets this bit along with the PHY_ID bits. Ported from the Linux change at [1] from Da Xu merged in commit [2]. [1] https://lore.kernel.org/all/[email protected]/ [2] b23285e93bef ("net: mdio: mux-meson-gxl: set reversed bit when using internal phy") Suggested-by: Da Xue <[email protected]> Link: https://lore.kernel.org/r/20250502-u-boot-topic-mdio-mux-gxl-bit28-v1-1-399f6c3db154@linaro.org Signed-off-by: Neil Armstrong <[email protected]>
2025-09-23Merge tag 'v2025.10-rc5' into nextTom Rini
Prepare v2025.10-rc5
2025-09-18Merge patch series "Add support for MediaTek MT7987/MT7988 built-in 2.5Gb ↵Tom Rini
ethernet PHY (v4)" Weijie Gao <[email protected]> says: This patch adds PHY driver for MediaTek MT7987/MT7988 built-in 2.5Gb ethernet PHY. [trini: Change 'tristate' Kconfig to 'bool'] Link: https://lore.kernel.org/r/[email protected]
2025-09-18net: phy: Add MediaTek built-in 2.5Gb ethernet PHY driverWeijie Gao
The MediaTek MT7987/MT7988 SoCs features a built-in 2.5Gb PHY connected to GMAC1. The PHY supports 10/100/1000/2500 Mbps full-duplex only. The PHY requires one or two firmware files. Firmware for MT7988 has already been added to upstream: mediatek/mt7988/i2p5ge-phy-pmb.bin. MT7987 has two firmware files which will be add to upstream later: i2p5ge-phy-pmb.bin and i2p5ge-phy-DSPBitTb.bin. Environment variable can be set for firmware data loading: mt7987_i2p5ge_load_pmb_firmware for i2p5ge-phy-pmb.bin mt7987_i2p5ge_load_dspbit_firmware for i2p5ge-phy-DSPBitTb.bin mt7988_i2p5ge_load_pmb_firmware for i2p5ge-phy-pmb.bin This driver allows dedicated weak functions to be overridden by board to provide the firmware data: mt7987_i2p5ge_get_fw() for MT7987 mt7988_i2p5ge_get_fw() for MT7988 To enable the PHY, add the following not to device tree: &eth1 { status = "okay"; phy-mode = "xgmii"; phy-handle = <&phy15>; phy15: ethernet-phy@15 { compatible = "ethernet-phy-ieee802.3-c45"; reg = <15>; phy-mode = "xgmii"; }; }; Signed-off-by: Sky Huang <[email protected]> Signed-off-by: Weijie Gao <[email protected]>
2025-09-18net: mediatek: associate PHY device with dts node specified by phy-handleWeijie Gao
Associate PHY device with its device node specified by phy-handle property. This makes it possible for PHY drivers to read dedicated information to configure the PHY device. Signed-off-by: Weijie Gao <[email protected]>
2025-09-16Merge patch series "Fix ADI driver header dependencies"Tom Rini
Greg Malysa <[email protected]> says: Between 2025.07 and 2025.10 many header dependency chains were improved, but this exposed implicit header usage in several of our drivers. This wasn't discovered before or included in the original fixes because our drivers are not yet used by any mainline-supported boards, so build tests did not find them. This series addresses the two build failures I've encountered while rebasing our work onto 2025.10 and continuing to prepare the next submission of our board files. Link: https://lore.kernel.org/r/[email protected]
2025-09-16net: dwc_eth_qos_adi: Add missing headerGreg Malysa
Following header dependency cleanups, an implicit dependence on env.h was exposed in dwc_eth_qos_adi. However because this driver is not (yet) enabled in any defconfigs, build tests did not identify the missing header. This adds the missing #include so that the driver builds correctly when enabled. Signed-off-by: Greg Malysa <[email protected]>
2025-09-16net: dwc_eth_qos: Fix support for stm32mp2 platformMarek Vasut
The layout of SYSCFG_ETHnCR on STM32MP25xx is slightly different yet again. Add missing swizzling to program the correct register with the correct content. Fixes: 20afca89ed53 ("net: dwc_eth_qos: add support of stm32mp2 platform") Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Christophe ROULLIER<[email protected]>
2025-09-08Merge tag 'v2025.10-rc4' into nextTom Rini
Prepare v2025.10-rc4
2025-09-08MAINTAINERS: Add entry for DesignWare XGMAC driverBoon Khai Ng
Add a MAINTAINERS entry for the DesignWare XGMAC network driver to ensure future patches are properly routed for review and support. Signed-off-by: Boon Khai Ng <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2025-08-27net: fsl-mc: Incorrect variable used in error pathAndrew Goodbody
In mc_fixup_dpc_mac_addr noff is assigned the return value from fdt_add_subnode so that is the variable that should be passed to fdt_strerror and returned when negative. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-27net: fsl-mc: NULL check dflt_dpni before dereferenceAndrew Goodbody
In dpni_exit there is a NULL check for dflt_dpni after it is dereferenced a number of times. Instead move the NULL check to early in the function. Also assign NULL to dflt_dpni after free in both dpni_init and dpni_exit. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-27net: fsl-mc: NULL check dflt_dpbp before dereferenceAndrew Goodbody
In dpbp_exit there is a NULL check for dflt_dpbp after it is dereferenced a number of times. Instead move the NULL check to early in the function. Also assign NULL to dflt_dpbp after free in both dpbp_init and dpbp_exit. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-27net: fsl-mc: NULL check dflt_dpio before dereferenceAndrew Goodbody
In dpio_exit there is a NULL check for dflt_dpio but it happens after dpio_dflt has been dereferenced a number of times already. Instead move the NULL check to first thing in the function. Also assign NULL to dflt_dpio after free in both dpio_init and dpio_exit. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-27net: fsl_enetc: Fix copy/paste errorAndrew Goodbody
In netc_blk_ctrl_probe the test for failure of the function clk_prepare_enable should not return PTR_ERR(ipg_clk) as it does not check IS_ERR(ipg_clk) instead it should return err as that is what is holding the error code in this case. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-27net: fm: Correct test for timeoutAndrew Goodbody
In memac_wait_until_free and memac_wait_until_done the use of post-decrement on the test in the while loop for a timeout means that timeout will be equal to -1 on exit in that case. Adjust the test for this expected value. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-27net: fm: NULL check dev before dereferenceAndrew Goodbody
In fm_eth_bind there is a dereference of dev before it is NULL checked. Add a NULL check before the first dereference and remove a later NULL check that is now redundant. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-27net: fm: Correct test for timeoutAndrew Goodbody
In bmi_rx_port_disable and bmi_tx_port_disable the use of post-decrement on the test in the while loop for a timeout means that timeout will be equal to -1 on exit in that case. Adjust the test for this expected value. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-08-25Merge tag 'v2025.10-rc3' into nextTom Rini
Prepare v2025.10-rc3
2025-08-25net: axi_emac: Fix timeout testAndrew Goodbody
The timeout test in axi_dma_init is not correct due to the post-decrement used on the timeout variable which will mean timeout is not 0 if the timeout occurs. Make the timeout variable an int instead of a u32 and then test for timeout being -1. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-08-20Merge patch series "Add support for Ethernet boot"Tom Rini
Chintan Vankar <[email protected]> says: This series adds bind method for CPSW to avoid explicit probing, removes explicit probing of CPSW, adds support for Ethernet boot on SK-AM68, SK-AM62P-LP, J722S, SK-AM69. Link: https://lore.kernel.org/r/[email protected]
2025-08-20net: ti: Kconfig: Enable SPL_SYSCON config for CPSWChintan Vankar
TI's Ethernet switch needs system controllers enabled in R5SPL stage while booting via Ethernet. Enable SPL_SYSCON config for CONFIG_TI_AM65_CPSW_NUSS. Reviewed-by: Alexander Sverdlin <[email protected]> Signed-off-by: Chintan Vankar <[email protected]>
2025-08-20net: ti: am65-cpsw-nuss: Define bind method for CPSW driverChintan Vankar
CPSW driver is defined as UCLASS_MISC driver which needs to be probed explicitly. Define bind method for CPSW driver to scan and bind ethernet-ports with UCLASS_ETH driver which will eventually probe CPSW driver and avoid probing CPSW driver explicitly. Signed-off-by: Chintan Vankar <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Signed-off-by: Jim Liu <[email protected]>
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 <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2025-08-15net: ti: icssg: Remove impossible testAndrew Goodbody
port_id is an unsigned variable so cannot be negative. Remove the test checking for port_id being less than 0. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15net: ti: am65-cpsw-nuss: Initialise retAndrew Goodbody
In am65_cpsw_phy_init it is not certain that ret will be assigned to before it reaches the 'return ret' statement. Initialise ret to ensure that ret is valid. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15net: phy: cortina: Ensure memory allocated is freedAndrew Goodbody
In cs4340_upload_firmware a buffer is allocated with malloc but this is never freed. The pointer to this buffer, addr, is not even kept unchanged. But in some cases addr is not a buffer allocated by malloc. Introduce the use of another pointer to keep track of the buffer and to know if it needs to be freed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-14net: e1000: Free temporary buffer on exitAndrew Goodbody
In do_e1000_spi_checksum a temporary buffer is allocated but never freed. Add code to free on exit. Also refactor the code to make the exit code common. This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-08Merge tag 'u-boot-socfpga-next-20250808' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-socfpga This pull request introduces initial U-Boot support for Agilex7 M-series, along with several enhancements and cleanups across existing Agilex platforms. Key changes include new board support, DDR driver additions, updated device trees, and broader SoCFPGA SPL improvements. Highlights: - Agilex7 M-series bring-up: - Basic DT support and board initialization for Agilex7 M-series SoC and SoCDK. - New sdram_agilex7m DDR driver with UIBSSM mailbox support and HBM support. - Clock driver support for Agilex7 M-series. - New defconfig: socfpga_agilex7m_defconfig. - Agilex and Agilex5 enhancements: - Improved SPL support: ASYNC interrupt enabling, system manager init refactor, and cold scratch register usage. - Updated firewall probing and watchdog support in SPL. - Cleaned up DDR code, added secure region support for ATF, and improved warm reset handling. - Device Tree and config updates: - Migration to upstream Linux DT layout for Agilex platforms. - Consolidated socfpga_agilex_defconfig and removed deprecated configs. - Platform-specific environment variables for Distro Boot added. - Driver fixes and cleanups: - dwc_eth_xgmac and clk-agilex cleanup and improvements. - Several coverity and style fixes. Contributions in this PR are from Alif Zakuan Yuslaimi, Tingting Meng, and Andrew Goodbody. This patch set has been tested on Agilex 5 devkit, Agilex devkit and Agilex7m devkit. Passing all pipeline tests at SoCFPGA U-boot custodian https://source.denx.de/u-boot/custodians/u-boot-socfpga/-/pipelines/27318
2025-08-08net: dwc_eth_xgmac_socfpga: Remove always true testAndrew Goodbody
In dwxgmac_of_get_mac_mode there is a test for mac_mode which will return if false. After this point mac_mode is guaranteed to be true so there is no need to test for this. Remove that test. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Tien Fong Chee <[email protected]>
2025-08-08net: dwc_eth_xgmac: Use unwind goto on errorAndrew Goodbody
In xgmac_probe there is a direct return after the point where unwind gotos start to be used to undo actions performed by earlier code. Use the appropriate unwind goto instead. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Tien Fong Chee <[email protected]>
2025-08-07net: fec_mxc: Set error code on error exitAndrew Goodbody
In fecmxc_probe if a timeout is detected when resetting the chip no error code is set before taking the error exit. This could lead to a silent failure. Instead set an error code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-06net: rswitch: Fix error detectionAndrew Goodbody
In rswitch_probe the error detection after the call to devm_clk_get is very wrong. It checks the value of ret which is uninitialised at that point. Instead it should be using the macros for including errors into pointers. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2025-08-01net: phy: Support overriding Auto Negotiation timeout with env variableSiddharth Vadapalli
The Auto Negotiation procedure between two Ethernet PHYs consists of determining the best commonly supported parameters among Speed, Duplex Mode and Flow Control. The time taken for this procedure is not only dependent on the local PHY used, but also on the link-partner PHY. While a timeout can be specified in the form of a "CONFIG" on the basis of the local PHY present on the device, since the timeout also depends on the link-partner PHY, it might be necessary to modify the timeout. To avoid rebuilding the bootloader for a given device, just because it may be connected to various link-partner PHYs, each with a different timeout, introduce an environment variable named "phy_aneg_timeout" and override "CONFIG_PHY_ANEG_TIMEOUT" with "phy_aneg_timeout". Signed-off-by: Siddharth Vadapalli <[email protected]> Acked-by: Jerome Forissier <[email protected]> [jf: add missing #include <env.h>] Signed-off-by: Jerome Forissier <[email protected]>