summaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)Author
2024-04-19Merge tag 'u-boot-stm32-20240419' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-stm MP1: _ Add OHCI HCD support for STM32MP15xx DHSOM _ Report OTP-CLOSED instead of rev.? on closed STM32MP15xx _ Initialize TAMP_SMCR BKP..PROT fields on STM32MP15xx _ Jump to ep on successful resume in PSCI suspend code _ Add FASTBOOT support for STM32MP13 _ Fix/Rework key and leds management for STM32MP13/15 _ net: dwc_eth_qos: Clean up STM32 glue code and add STM32MP13xx support MP2: _ Add stm32-fmc-ebi support _ Add: sdmmc2 support and fix AARCH64 compilation
2024-04-19net: dwc_eth_qos: Add support for st, ext-phyclk propertyMarek Vasut
The "st,ext-phyclk" property is a unification of "st,eth-clk-sel" and "st,eth-ref-clk-sel" properties. All three properties define ETH CK clock direction, however: - "st,eth-clk-sel" selects clock direction for GMII/RGMII mode - "st,eth-ref-clk-sel" selects clock direction for RMII mode - "st,ext-phyclk" selects clock direction for all RMII/GMII/RGMII modes The "st,ext-phyclk" is the preferrable property to use. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Christophe ROULLIER <christophe.roullier@foss.st.com>
2024-04-19net: dwc_eth_qos: Add support of STM32MP13xx platformChristophe Roullier
Add compatible "st,stm32mp13-dwmac" to manage STM32MP13 boards. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Christophe Roullier <christophe.roullier@st.com> Signed-off-by: Marek Vasut <marex@denx.de> # Rebase, reshuffle, squash code Reviewed-by: Christophe ROULLIER <christophe.roullier@foss.st.com>
2024-04-19net: dwc_eth_qos: Add DT parsing for STM32MP13xx platformChristophe Roullier
Manage 2 ethernet instances, select which instance to configure with mask If mask is not present in DT, it is stm32mp15 platform. Signed-off-by: Christophe Roullier <christophe.roullier@st.com> Signed-off-by: Marek Vasut <marex@denx.de> # Rework the code Reviewed-by: Christophe ROULLIER <christophe.roullier@foss.st.com>
2024-04-19net: dwc_eth_qos: Constify st, eth-* values parsed out of DTMarek Vasut
Use const bool for the values parsed out of DT. Drop the duplicate assignment of false into those bool variables, assign them directly with the content parsed out of DT. Abbreviate the variable name too. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-04-19net: dwc_eth_qos: Use consistent logging printsMarek Vasut
Use dev_*() only to print all the logs from this glue code, instead of mixing dev_*(), log_*(), pr_*() all in one code. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-04-19net: dwc_eth_qos: Move log_debug statements on top of case blockMarek Vasut
Move the log_debug() calls on top of the bit manipulation code. No functional change. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-04-19net: dwc_eth_qos: Use FIELD_PREP for ETH_SEL bitfieldMarek Vasut
Use FIELD_PREP to configure content of ETH_SEL bitfield in SYSCFG_PMCSETR register. No functional change. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-04-19net: dwc_eth_qos: Scrub ifdefferyMarek Vasut
Replace ifdef CONFIG_CLK with if (CONFIG_IS_ENABLED(CLK)) to improve code build coverage. Some of the functions printed debug("%s: OK\n", __func__); on exit with and without CLK enabled, some did not, make it consistent and print nothing if CLK is disabled. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Christophe ROULLIER <christophe.roullier@foss.st.com>
2024-04-19net: dwc_eth_qos: Fold board_interface_eth_init into STM32 glue codeMarek Vasut
Move board_interface_eth_init() into eqos_probe_syscfg_stm32() in STM32 driver glue code. The eqos_probe_syscfg_stm32() parses STM32 specific DT properties of this MAC and configures SYSCFG registers accordingly, there is nothing board specific happening in this function, move it into generic driver code instead. Drop the now unused duplicates from board files. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de>
2024-04-19net: dwc_eth_qos: Rename eqos_stm32_config to eqos_stm32mp15_configMarek Vasut
The current glue code is specific to STM32MP15xx, the upcoming STM32MP13xx will introduce another entry specific to the STM32MP13xx. Rename the current entry to eqos_stm32mp15_config in preparation for STM32MP13xx addition. No functional change. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Christophe ROULLIER <christophe.roullier@foss.st.com>
2024-04-19net: dwc_eth_qos: Split STM32 glue into separate fileMarek Vasut
Move STM32 glue code into separate file to contain the STM32 specific code outside of the DWMAC core code. No functional change. Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Christophe ROULLIER<christophe.roullier@foss.st.com>
2024-04-12net: designware: Pass all multicast frames in designware driverJim Liu
Allowing multicast packets is required for IPv6 neighbor discovery protocol. Signed-off-by: Parvathi Bhogaraju <pbhogaraju@microsoft.com> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-04-12net: designware: Invalidate RX buffer cache before freeing the DMA descriptorJim Liu
In IPv6 context, the ICMP and UDP checksum byte in the RX packet is initially set to 0, recaclculated, and then re-inserted. This process can result in a dirty cache line. To prevent issues, it is essential to invalidate cache for the RX buffer before freeing the descriptor for next DMA transfer. This ensure that the dirty cache line doesn't inadvertently written back due to cache eviction, there by corrupting the RX buffer Signed-off-by: Parvathi Bhogaraju <pbhogaraju@microsoft.com> Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-04-12net: dwc_eth_qos: Fix compilation warning in eqos_free_pkt()Patrice Chotard
Fix compilation warning: ../arch/arm/include/asm/io.h: In function 'eqos_free_pkt': ../arch/arm/include/asm/io.h:103:32: warning: 'rx_desc' may be used uninitialized [-Wmaybe-uninitialized] 103 | #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) | ^~~ ../drivers/net/dwc_eth_qos.c:1220:27: note: 'rx_desc' was declared here 1220 | struct eqos_desc *rx_desc; | ^~~~~~~ Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
2024-04-12Merge patch series "Introduce ICSSG Ethernet driver"Tom Rini
MD Danish Anwar <danishanwar@ti.com> says: Introduce ICSSG PRUETH support in uboot. The ICSSG driver is used in TI AM654 SR2.0. The ICSSG PRU Sub-system runs on EMAC firmware. This series Introduces support for ICSSG driver in uboot. This series has been tested on AM65x SR2.0, and the ICSSG interface is able to ping / dhcp and boot kernel using tftp in uboot. To use ICSSG2 ethernet, the ICSSG firmware needs to be loaded to PRU RPROC cores and RPROC cores need to be booted with the firmware. This step is done inside driver similar to kernel. The remoteproc driver uses request_fw_into_buf() API from fs-loader driver to load and start rproc with the required firmwares. This series only introduces driver files. The device tree and config changes to enable ICSSG driver will be introduced later.
2024-04-12net: ti: icssg: Add support sending FDB command to update rx_flow_idMD Danish Anwar
ICSSG firmware supports FDB commands. Add support to send FDB commands from driver. Once rx_flow_id is obtained from dma, let firmware know that we are using this rx_flow_id by sending a FDB command. Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
2024-04-12net: ti: icssg: Add ICSSG ethernet driverMD Danish Anwar
This is the PRUSS Ethernet driver for TI AM654 SR2.0 and later SoCs with the ICSSG PRU Sub-system running EMAC firmware. ICSSG Subsystem supports two slices per instance. This driver caters to both slices / ports of the icssg subsystem. Since it is not possible for Ethernet driver to register more than one port for a given instance, this patch introduces top level PRUETH as UCLASS_MISC and binds UCLASS_ETH to individual ports in order to support bringing up more than one Ethernet interface in U-Boot. Since top level driver is UCLASS_MISC, board files would need to instantiate the driver explicitly. Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
2024-04-12net: ti: icssg: Add icssg queues APIs and macrosMD Danish Anwar
Add icssg_queue.c file. This file introduces macros and APIs related to ICSSG queues. These will be used by ICSSG Ethernet driver. Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
2024-04-12net: ti: icssg: Add Firmware config and classification APIs.MD Danish Anwar
Add icssg_config.h / .c and icssg_classifier.c files. These are firmware configuration and classification related files. Add MII helper APIs and MACROs. These APIs and MACROs will be later used by ICSSG Ethernet driver. Also introduce icssg_prueth.h which has definition of prueth related structures. Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
2024-04-12net: ti: icssg: Add Firmware Interface for ICSSG Ethernet driver.MD Danish Anwar
Add firmware interface related headers and macros for ICSSG Ethernet driver. These macros will be later used by the ICSSG ethernet driver. Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
2024-04-11net: ti: am65-cpsw: Fix buffer overflowMichael Walle
The device name is a concatenation of the device node name of the cpsw device and of the device node name of the port. In my case that is ethernet@8000000 port@1 First the buffer is really too small, but more importantly, there is no boundary check. Use snprintf() and increase the buffer size. Fixes: 38922b1f4acc ("net: ti: am65-cpsw: Add support for multi port independent MAC mode") Signed-off-by: Michael Walle <mwalle@kernel.org>
2024-04-10net: dw_eth_qos: Add missing \n in error messages.Heinrich Schuchardt
Missing line-feeds in error messages lead to output like: phy_startup() failed: -110FAILED: -110=> Output like the following is much easier to read: phy_startup() failed: -110 FAILED: -110 => Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-30net: fec_mxc: Avoid enable regulator failureYe Li
Change to regulator_set_enable_if_allowed to avoid enable failure, in case same phy supply shared by multiple FEC controllers. Signed-off-by: Ye Li <ye.li@nxp.com>
2024-03-26net: phy: Factor out PHY GPIO reset codeMarek Vasut
Pull the PHY GPIO reset code into separate function, since this is and will be reused multiple times. Set up default reset assert and deassert timing to generous 20ms and 1ms for maximum compatibility in case those DT properties are missing. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-03-26e1000: add support for i225-ITMarjolaine Amate
This patch adds support for i225-IT in e1000 driver. Add e1000_phy_igc. Signed-off-by: Marjolaine Amate <marjolaine.amate@odyssee-systemes.fr>
2024-03-26net: phy: ncsi: reslove the unaligned access issueJacky Chou
From the ethernet header is not on aligned, because the length of the ethernet header is 14 bytes. Therefore, unaligned access must be done here. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
2024-03-26net: phy: ncsi: Correct the endian of the checksumJacky Chou
There is no need to perform the endian twice here. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
2024-03-26net: hifemac: make some functions staticYang Xiwen
They are not required to be global, make them static. Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
2024-03-26net: hifemac: implement `net stats` needed opsYang Xiwen
3 operations needed by `net stats` are implemented. New `net stats` output some useful info. Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
2024-03-26net: hifemac: register MDIO bus device for subnodeYang Xiwen
register internal MDIO bus device if it is a subnode. Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
2024-03-26net: hifemac: fix log reportingYang Xiwen
shrink the first argument of log_msg_ret(), add dev_xxx() functions for error reporting. Fixes: 9d8f78a2a79f7 ("net: add hifemac Ethernet driver for HiSilicon platform") Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
2024-03-26net: hifemac_mdio: use log_msg_ret() correctly, report error by dev_err()Yang Xiwen
The initial commit used log_msg_ret() wrongly. Fix that by moving error report to a separate dev_err() call and shrink the first argument of log_msg_ret() to no more than 4 chars. Fixes: 6b5c8d98e204 ("net: add hifemac_mdio MDIO bus driver for HiSilicon platform") Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
2024-03-26net: phy: the NC-SI phy device do not require mdio busJacky Chou
As with fixed-link phy device, the NC-SI phy devive does not require an mdio bus. So, a condition is added to check the NC-SI phy id to avoid accessing the bus pointer that is NULL. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
2024-03-26net: phy: Fix signed shift overflowEugeniu Rosca
Booting R-Car Gen3 arm64 U-Boot with CONFIG_UBSAN=y resulted in: ===================================================================== UBSAN: Undefined behaviour in drivers/net/phy/phy.c:728:19 left shift of 1 by 31 places cannot be represented in type 'int' ===================================================================== Fix it by appending the UL suffix to the numeric literal. While at it, convert the type of "addr" variable from signed to unsigned, to protect against shifting the numeric literal by a negative value (which would lead to yet another undefined behavior). Fixes: 1adb406b0141 ("phy: add phy_find_by_mask/phy_connect_dev") Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> * Using U-suffix for integer is sufficient. * ffs() of non-zero value cannot be 0. But addr being unsigned is * preferable. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-26net: phy: broadcom: Configure LEDs on BCM54210EMarek Vasut
Configure LEDs on BCM54210E so they would blink on activity and indicate link speed. Without this the LEDs are always on if cable is plugged in. Signed-off-by: Marek Vasut <marex@denx.de>
2024-03-26net: phy: ncsi: fixed not nullify the pointers after freeJacky Chou
The issue occurs the UAF (use-after-free) to cause double free when do the realloc function for the pointers during the reinitialization NC-SI process, and it will cause the memory management occurs error. So, nullify these pointers after free. Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
2024-03-13rockchip: include asm/io.h directly in asm/arch-rockchip/hardware.hQuentin Schulz
The different macros use writel which is defined in asm/io.h, so let's include the header so users of hardware.h do not need to include asm/io.h as well. While at it, remove asm/io.h includes wherever asm/arch-rockchip/hardware.h is included already. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-03-11Merge tag 'v2024.04-rc4' into nextTom Rini
Prepare v2024.04-rc4
2024-03-09net: phy: Use PHY MDIO address from DT if availableMarek Vasut
In case the PHY is fully described in DT, use PHY MDIO address from DT directly instead of always using auto-detection. This also fixes the behavior of 'mdio list' in such DT setup, which now prints the PHY connected to the MAC correctly. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2024-03-07net: am65-cpsw: cpsw_mdio: Switch to proper DM_MDIO frameworkRoger Quadros
Add a new Kconfig symbol MDIO_TI_CPSW for the CPSW MDIO driver and build it with proper DM support if enabled. If MDIO_TI_CPSW is not enabled then we continue to behave like before. Clean up MDIO custom handling in am65-cpsw and use dm_eth_phy_connect() to get the PHY. Signed-off-by: Roger Quadros <rogerq@kernel.org> Tested-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
2024-03-05net: mv88e6xxx: fix missing SMI address initializationMarek Mojík
The mv88e6xxx driver does not currently initialize the smi_addr field, but instead keeps the default zero value. This leads to driver being unusable on devices where the switch is not on address zero of the mdio bus. Fix this problem by reading the SMI address from device tree. Signed-off-by: Marek Mojík <marek.mojik@nic.cz> Reviewed-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-03-02ARM: renesas: Rename RMOBILE_CPU_TYPE_* to RENESAS_CPU_TYPE_*Marek Vasut
Rename RMOBILE_CPU_TYPE_* to RENESAS_CPU_TYPE_* because all the chips are made by Renesas, while only a subset of them is from the R-Mobile line. Use the following command to perform the rename: " $ git grep -l '\<RMOBILE_CPU_TYPE_[A-Z0-9]\+\>' | \ xargs -I {} sed -i 's@\<RMOBILE\(_CPU_TYPE_[A-Z0-9]\+\)\>@RENESAS\1@g' {} " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2024-03-02ARM: renesas: Rename rmobile_get_cpu_type() to renesas_get_cpu_type()Marek Vasut
Rename rmobile_get_cpu_type() to renesas_get_cpu_type() because all the chips are made by Renesas, while only a subset of them is from the R-Mobile line. Use the following command to perform the rename: " $ git grep -l '\<rmobile_get_cpu_type\>' | \ xargs -I {} sed -i 's@\<rmobile_get_cpu_type\>@renesas_get_cpu_type@g' {} " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2024-03-02net: macb: Add support for fixed linkBELOUARGA Mohamed
The actual driver does not work when there is no linked PHY. These changes add support for fixed-link feature in the device tree. Signed-off-by: BELOUARGA Mohamed <m.belouarga@technologyandstrategy.com>
2024-03-01net: mediatek: add support for XGMII interfaceWeijie Gao
This patch add XGMII support for connecting 2.5G PHY. Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-03-01net: mediatek: add support for adjusting MDIO clockWeijie Gao
User can assign a specific MDC speed to the eth node as follow: &eth { ... phy-mode = "usxgmii"; phy-handle = <&phy8>; mdio { clock-frequency = <10500000>; }; phy8: eth-phy@8 { compatible = "ethernet-phy-id31c3.1c12"; ... }; Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2024-02-12net: designware: Support high memory nodesNils Le Roux
Some platforms (such as the Lichee Pi 4A) have their dwmac device addressable only in high memory space. Storing the node's base address on 32 bits is not possible in such case. Use platform's physical address type to store the base address. Signed-off-by: Nils Le Roux <gilbsgilbert@gmail.com> Cc: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2024-02-08net: phy: nxp-c45-tja11xx: add tja1120 supportRadu Pirea (NXP OSS)
Add TJA1120 driver structure and report 1G speed. Signed-off-by: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>
2024-02-08net: phy: nxp-c45-tja11xx: rename nxp_c45_tja11xx structureRadu Pirea (NXP OSS)
Rename nxp_c45_tja11xx structure to nxp_c45_tja1103. The driver will support more PHYs and nxp_c45_tja11xx is too generic. Signed-off-by: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>